mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
fix(uxassist): respect blueprint text and icon bounds
Account for the native background's trimmed border, keep checkbox captions independently sized, and place Auto-fill after the measured title while reserving the native icon. Limit changes to owned controls. Assisted-by: Cindy (https://cindy.app)
This commit is contained in:
1 parent
51af1430bc
commit
19d19ce38d
4 files changed
+108
-40
No files matched your search
@@ -7,6 +7,7 @@ This document records the native layout evidence for the UXAssist description-he
|
||||
Inspected on 2026-11-01 after discovering Steam through `HKCU`'s Steam path and `steamapps/libraryfolders.vdf`:
|
||||
|
||||
- Original assembly: `D:/Steam/steamapps/common/Dyson Sphere Program/DSPGAME_Data/Managed/Assembly-CSharp.dll`, SHA-256 `EF314425DADE51F529F184F07BE136CD3C2660A6A81515603C7226FBE7AB1D8C`.
|
||||
- Original `UnityEngine.UI.dll`, SHA-256 `C5ACC25EBD597B586D323AF506FB88E760322550940F1A3B0EA4FC8143FCB26C`.
|
||||
- Native UI assets: `DSPGAME_Data/level0`, SHA-256 `04655A46BBEB113113688BCDC0E0EA8EC5F128B348E32194FC9743ADB48C8E91`.
|
||||
- The installed version history ends at `0.10.35.29151`; the Steam manifest reports build ID `25955035`. Assembly file version `0.0.0.0` alone does not identify this game build.
|
||||
|
||||
@@ -22,7 +23,7 @@ The relevant original methods can be reproduced by decompiling the following typ
|
||||
| `UIBlueprintInspector.OnCustomFieldEndEdit(string str)` and `CollectExternalFields(int excludeTargetId = -1)` | Collect, escape, and validate pending custom-field edits through the native path. |
|
||||
| `UIBlueprintInspector.OnCopyClick()`, `OnSaveChangesClick()`, and `OnSaveClick()` | Serialize or save the current blueprint with the game's native workflow. |
|
||||
|
||||
The native `descGroupTrans` in all three inspectors contains a description label at the top and an input beginning 22 pixels below it. The compact UXAssist entry occupies the right side of this existing title row. Options open next to the actual entry and follow it after layout and scrolling; only owned popup transforms are positioned. Native labels, inputs, groups, scroll content, and the separate settings panel retain their native layout.
|
||||
The native `descGroupTrans` in all three inspectors contains a description label at the top and an input beginning 22 pixels below it. The compact UXAssist entry follows the native title's measured text width plus 8 pixels and reserves 8 pixels before the actual icon button's left edge, including when the icon is inactive. It hides if there is insufficient room. Options open next to the actual entry and follow it after layout and scrolling; only owned transforms are positioned. Native labels, inputs, groups, scroll content, and the separate settings panel retain their native layout.
|
||||
|
||||
`UIBlueprintInspector.Refresh(forModify: true)` does not reload `descTextInput`. Successful generation must assign both the blueprint description and its input before using the native modification refresh. Pending custom fields must first pass through the native field collection and escaping rules. Native copy and save handlers serialize the current blueprint, so they remain the actions used to share or persist a generated description.
|
||||
|
||||
@@ -30,9 +31,9 @@ Decompiled methods and extracted rectangle data are development artifacts under
|
||||
|
||||
## Anchored options and native conventions
|
||||
|
||||
The original DLL and `level0` hashes and installed version above were rechecked on 2026-11-04. The supplied screenshot shows why a fixed position at the inspector's top loses its connection to the entry after several custom fields. The options now use the entry's world corners, transformed into the popup parent's coordinates, and actual root-canvas bounds. Placement prefers below the entry with a 6-pixel gap and aligned right edges, flips above when needed, and clamps against an 8-pixel canvas inset. A panel too large for that area is closed. `Canvas.willRenderCanvases` reconciles placement after native layout only while open. An inactive or fully clipped entry closes its popup.
|
||||
The original DLL and `level0` hashes and installed version above were rechecked on 2026-11-05. The options use the entry's world corners, transformed into the popup parent's coordinates, and actual root-canvas bounds. Placement prefers below the entry with a 6-pixel gap and aligned right edges, flips above when needed, and clamps against an 8-pixel canvas inset. A panel too large for that area is closed. `Canvas.willRenderCanvases` reconciles placement after native layout only while open. An inactive or fully clipped entry closes its popup.
|
||||
|
||||
The panel has an `Auto-fill description` title and native X, then a 20-pixel proliferation row and a 28-pixel production-basis row with help. A single 30-pixel `Generate` action sits at the lower right. Localized preferred widths determine panel and selector width. The closed-list panel is 154 pixels high; two 24-pixel dropdown rows, 4 pixels of padding, and a 2-pixel gap add 54 pixels when expanded. The background grows to 208 pixels and the footer moves below the list.
|
||||
The panel has an `Auto-fill description` title and native X, proliferation, production basis with help, and one footer `Generate` action. Content insets include the actual sliced sprite's transparent trim before adding the desired visible gaps. Preferred glyph sizes determine label, row, item, and button heights; the 20-pixel checkbox keeps an independently sized label with an 8-pixel gap. Panel and footer height follow the measured rows and expanded list.
|
||||
|
||||
The X comes from `inserterWindow/panel-bg/btn-box/close-wnd-btn`: a 40-by-30 native button with a centered 16-by-16 icon and a transparent 30-by-19 raycast child. Its original serialized `Button.onClick` targets the original inserter window's `_Close`. The owned clone replaces the entire `Button.ButtonClickedEvent` before adding its popup callback; removing runtime listeners alone would leave that persistent callback active.
|
||||
|
||||
@@ -47,15 +48,17 @@ The source production-basis combo also carries source-specific behavior. Its roo
|
||||
| Native blueprint settings, color-palette input rows, and inspector footer | Supply 20-pixel checkbox, 28-pixel input-row, and 30-pixel primary-action conventions. |
|
||||
| Native inserter close-button subtree and combo row event routing | Supply the actual X artwork/hit area and the select-then-close event order. |
|
||||
|
||||
The persistent task evidence bundle `2026-11-04-UXAssist-BlueprintDescriptionLayout/anchored-options/` retains the current reported screenshot, `native-recommendations.md`, `native-inserter-close-button.json`, `native-combo-row-routing.json`, focused original decompilations, asset captures, and extraction scripts. `layout-preview.png` is a marked schematic using the exported native X artwork; its fonts and background are representative. Calculated geometry, a test harness, and this preview must be distinguished from screenshots of a running game. These checks do not execute Unity event dispatch, measure native font rendering, or establish third-party mod compatibility.
|
||||
The evidence bundle `2026-11-04-UXAssist-BlueprintDescriptionLayout/anchored-options/` retains the native close-button and event-routing captures. The current `2026-11-05-UXAssist-BlueprintTextLayout/` bundle contains the actual reported screenshots, `native-text-layout-evidence.md`, focused font/locale/header captures, original UI and text-generator decompilations, and sprite analysis. The sliced background has approximately 13-pixel horizontal and 11-pixel vertical trim before pixels-per-unit conversion. The original checkbox's 26-pixel label was shortened to 20 while retaining `Truncate`; native font metrics and generator rules explain the discarded first line. Native header captures also confirm the description input's icon occupies the rightmost 20 pixels of its title row. These are original-asset and managed-rule findings, not an executed Unity rendering test. Investigation reports and the headless-test feasibility assessment remain outside the repository.
|
||||
|
||||
## Recorded placement checks
|
||||
## Recorded checks
|
||||
|
||||
The temporary placement harness extracts the actual private `TryGetPopupPosition` method body from `BlueprintDescriptionPatch.cs` and compiles it with data-only `Rect` and `Vector2` substitutes. It does not mirror the placement algorithm in a second implementation. Sources and results are preserved under `anchored-options/actual-placement-check/` and `actual-placement-check.json`.
|
||||
|
||||
The harness passed 8 exact placement cases, 3 oversized-panel rejection cases, and 1,920 native-parent fixtures, totaling 20,191 assertions. Fixtures cover the 392- and 394-pixel native inspector frames, translated and scaled parent coordinates, scales 0.75/1/1.25/1.5, scrolling, below/above placement, canvas edges, and 154/208-pixel panel heights. Widths of 320/360/440/520 pixels are supplied test inputs, rather than measured English or Chinese font widths. The expanded-list checks also verify the 16-pixel gap before the moved footer. This is analytical geometry validation; it does not run Unity layout or input events.
|
||||
The placement harness passed 8 exact cases, 3 oversized-panel rejection cases, and 1,920 native-parent fixtures, totaling 20,191 assertions. Fixtures cover the 392- and 394-pixel native inspector frames, translated and scaled parent coordinates, scales 0.75/1/1.25/1.5, scrolling, below/above placement, canvas edges, and supplied panel sizes. Widths of 320/360/440/520 pixels are test inputs, rather than measured English or Chinese font widths. The footer checks verify a 16-pixel gap after the list. These checks validate placement for supplied bounds, not current text sizing or Unity rendering.
|
||||
|
||||
Final development checks on 2026-11-04:
|
||||
On 2026-11-05, `native-text-regression-results.json` recorded 48 passing analytical cases using the original embedded fonts, sprite data, and native header bounds. They reproduced the old transparent-margin overflow, 20-pixel checkbox truncation, and native icon overlap, then checked the updated geometry. Embedded glyph outlines and metrics do not reproduce Unity's runtime preferred-size calculation, rasterization, or interaction. The Release build also passed with 0 warnings and 0 errors, and all 569 `ProductionCheck` cases passed again.
|
||||
|
||||
Development checks recorded on 2026-11-04:
|
||||
|
||||
| Check | Result |
|
||||
| --- | --- |
|
||||
@@ -80,7 +83,7 @@ The production-basis cases check an undersupplied chain, recipe-ratio conversion
|
||||
|
||||
No in-game, Unity event-loop, or third-party mod integration test has been performed for this change. Repeat these checks at the target profile's resolutions and UI scales, with each installed blueprint UI mod. The header entry avoids native layout writes but another mod may use the same extension space.
|
||||
|
||||
1. Open each inspector in English and Simplified Chinese with different custom-field counts. Click its header entry. Confirm the popup opens beside that actual entry, with a title, native X, compact options, and a single footer action. At screen edges, confirm it flips or shifts into available canvas space.
|
||||
1. Open each inspector in English and Simplified Chinese with different custom-field counts. Focus the description input so its native icon button appears; the Auto-fill entry must remain after the title and before that icon. Open the options and confirm the proliferation label, button captions, and dropdown text are visible inside the background's visible fill, with a title, native X, and one footer action. At screen edges, confirm it flips or shifts into available canvas space.
|
||||
2. Scroll while the popup is open. Confirm it follows the entry after native layout and closes when the entry is fully clipped. Expand native foundation, fill-only, and reform settings; all native fields must retain their positions and sizes, and scrolling must reach every field.
|
||||
3. Open the production-basis list. Confirm both readable, left-aligned rows fit within the expanded background above the footer. Select each item and confirm it closes the list without generating text. Reopen the popup and change language; selector dimensions and footer spacing must remain valid.
|
||||
4. Close the popup with its X; the inspector and an open inserter window must remain open. Reopen and click outside with the left, right, and middle mouse buttons: the popup should close, and the clicked native control or world target should retain its normal behavior. Press Esc with the list expanded: only the list should close. Press Esc again: the popup should close while the inspector stays open. With a native message box present, its Escape handler must retain priority.
|
||||
|
||||
Reference in new issue
Block a user