mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
fix(uxassist): use standard blueprint option controls
Match the native description title baseline, add clearance from the popup corner, and use the rectangular settings selector. Let its list overlay the footer without resizing the popup, and reduce checkbox spacing. Reset cloned resolution rows and external events locally. Assisted-by: Cindy (https://cindy.app)
This commit is contained in:
1 parent
19d19ce38d
commit
58d08cbcd7
5 files changed
+81
-71
No files matched your search
@@ -4,7 +4,7 @@
|
||||
## Changlog
|
||||
|
||||
* 1.6.4
|
||||
* `Blueprint descriptions`: Keep `Auto-fill` beside the description title while reserving space for the native icon button. Generation options follow the entry while scrolling and adjust at screen edges; text stays inside the visible panel, the proliferation label remains visible, and rows and buttons fit the localized text. The panel uses a native X, one footer `Generate` action, and an expanding dropdown area. Close with the X, an outside click, or Esc; Esc first closes an expanded list. Preserve the native inspector layout.
|
||||
* `Blueprint descriptions`: Align `Auto-fill` with the description title while reserving space for the native icon button. Generation options follow the entry while scrolling and adjust at screen edges, with extra title padding, compact checkbox spacing, and text sized for the current language. Use a standard rectangular dropdown that overlays the footer without resizing the panel or moving its single `Generate` action. Close with the native X, an outside click, or Esc; Esc first closes an expanded list. Preserve the native inspector layout.
|
||||
* `Hide battle-related techs in Peace mode`: Fix an array index error when opening the tech tree after switching from a Peace-mode save to a Combat-mode save in the same game process, including when disabling the option after loading another Peace-mode save.
|
||||
* 1.6.3
|
||||
* `Quick build Mining Machines`:
|
||||
@@ -448,7 +448,7 @@
|
||||
## 更新日志
|
||||
|
||||
* 1.6.4
|
||||
* `蓝图说明`:「自动填写」入口紧接说明标题,并为原生图标按钮保留空间。生成选项滚动时跟随入口,在屏幕边缘调整位置;文字保留在面板可见背景内,增产标签保持可见,行高和按钮尺寸适应本地化文字。面板使用原生叉号、底部单个「生成说明」按钮和可随下拉列表展开的区域。可通过叉号、点击外部或 Esc 关闭;下拉列表展开时,Esc 先收起列表。保留原生检查面板布局。
|
||||
* `蓝图说明`:「自动填写」入口与说明标题的文字基线对齐,并为原生图标按钮保留空间。生成选项滚动时跟随入口,在屏幕边缘调整位置;标题保留边距,复选框间距紧凑,文字尺寸适应当前语言。使用原生直边下拉框,展开时覆盖底部操作区域,面板尺寸和单个「生成说明」按钮的位置保持不变。可通过原生叉号、点击外部或 Esc 关闭;下拉列表展开时,Esc 先收起列表。保留原生检查面板布局。
|
||||
* `在和平模式下隐藏战斗相关科技`:修复在同一次游戏运行中从和平模式存档切换到战斗模式存档后打开科技树时的数组越界,以及再次加载和平模式存档后关闭选项时的同类问题。
|
||||
* 1.6.3
|
||||
* `快速铺设采矿机`:
|
||||
|
||||
@@ -109,7 +109,7 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
private sealed class InspectorControls
|
||||
{
|
||||
private const float Left = 12f;
|
||||
private const float ControlsGap = 10f;
|
||||
private const float ControlsGap = 6f;
|
||||
|
||||
private readonly UIBlueprintInspector _inspector;
|
||||
private RectTransform _panel;
|
||||
@@ -126,7 +126,7 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
private readonly RectTransform _descriptionIcon;
|
||||
private bool _optionsOpen;
|
||||
private MyCheckBox _checkbox;
|
||||
private MyCornerComboBox _basisCombo;
|
||||
private UIComboBox _basisCombo;
|
||||
private Text _basisLabel;
|
||||
private UIButton _basisHelp;
|
||||
private BlueprintData _currentBlueprint;
|
||||
@@ -148,13 +148,13 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
_entry.tips = inspector.tipButton2.tips;
|
||||
_entry.tips.topLevel = true;
|
||||
_entryText.resizeTextForBestFit = false;
|
||||
_entryText.alignment = TextAnchor.MiddleCenter;
|
||||
Util.NormalizeRectWithMargin(_entryText, 1, 8, 1, 8);
|
||||
Util.NormalizeRectWithMargin(_entryText, 0, 8, 0, 8);
|
||||
|
||||
// Reuse the native background, including its blur material, only while options are open.
|
||||
var source = UIRoot.instance.uiGame.inserterWindow.transform.Find("panel-bg").GetComponent<Image>();
|
||||
_panel = UnityEngine.Object.Instantiate(source, inspector.rectTrans).rectTransform;
|
||||
_panel.gameObject.name = "uxassist-blueprint-description-options";
|
||||
_panel.gameObject.SetActive(false);
|
||||
for (var i = _panel.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
var child = _panel.GetChild(i).gameObject;
|
||||
@@ -188,29 +188,50 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
_checkbox.gameObject.name = "blueprint-proliferation";
|
||||
_checkbox.OnChecked += OnProliferationChecked;
|
||||
_basisLabel = LayoutHelper.AddText(Left, 68, _panel, I18NKeys.BlueprintProductionBasis, 14);
|
||||
_basisCombo = MyCornerComboBox.CreateComboBox(0, 68, _panel).WithFontSize(14);
|
||||
// The star-panel localizer would replace the stretched width on every enable or language change.
|
||||
var localizer = _basisCombo.GetComponent<Localizer>();
|
||||
if (localizer)
|
||||
_basisCombo = UnityEngine.Object.Instantiate(UIRoot.instance.optionWindow.resolutionComp, _panel);
|
||||
_basisCombo.gameObject.name = "blueprint-production-basis";
|
||||
_basisCombo.gameObject.SetActive(true);
|
||||
foreach (var button in _basisCombo.GetComponentsInChildren<UIButton>(true)) Util.ResetButton(button);
|
||||
var combo = _basisCombo;
|
||||
// Runtime resolution rows are cloned as children, but their private tracking list is not serialized.
|
||||
for (var i = combo.m_DropDownContent.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
localizer.enabled = false;
|
||||
UnityEngine.Object.Destroy(localizer);
|
||||
var button = combo.m_DropDownContent.GetChild(i).GetComponent<Button>();
|
||||
if (!button || button == combo.m_ListItemRes) continue;
|
||||
button.gameObject.SetActive(false);
|
||||
UnityEngine.Object.Destroy(button.gameObject);
|
||||
}
|
||||
var combo = _basisCombo.GetComponent<UIComboBox>();
|
||||
combo.ItemButtons.Clear();
|
||||
combo.Items.Clear();
|
||||
combo.onSubmit = new UIComboBox.SubmitEvent();
|
||||
combo.onItemIndexChange = new UIComboBox.ChangeEvent();
|
||||
combo.CanInput = false;
|
||||
combo.autoWidth = false;
|
||||
combo.parentSibling = false;
|
||||
combo.itemIndex = -1;
|
||||
combo.isDroppedDown = false;
|
||||
combo.m_DropDownContent.anchoredPosition = Vector2.zero;
|
||||
combo.m_DropDownList.gameObject.SetActive(false);
|
||||
combo.m_EmptyItemRes.gameObject.SetActive(false);
|
||||
combo.m_SelectionBG.gameObject.SetActive(false);
|
||||
combo.m_Scrollbar.gameObject.SetActive(false);
|
||||
Util.NormalizeRectWithMargin(_basisCombo.transform.Find("Main Button"), 0, 0, 0, 0);
|
||||
combo.m_Text.alignment = TextAnchor.MiddleLeft;
|
||||
combo.m_Text.fontSize = 14;
|
||||
combo.m_Text.resizeTextForBestFit = false;
|
||||
Util.NormalizeRectWithMargin(combo.m_Text, 2, 8, 2, 24);
|
||||
combo.m_Text.horizontalOverflow = HorizontalWrapMode.Overflow;
|
||||
combo.m_Text.verticalOverflow = VerticalWrapMode.Overflow;
|
||||
Util.NormalizeRectWithMargin(combo.m_Text, 2, 8, 2, 30);
|
||||
var itemText = combo.m_ListItemRes.GetComponentInChildren<Text>();
|
||||
itemText.alignment = TextAnchor.MiddleLeft;
|
||||
itemText.fontSize = 14;
|
||||
itemText.resizeTextForBestFit = false;
|
||||
itemText.horizontalOverflow = HorizontalWrapMode.Overflow;
|
||||
itemText.verticalOverflow = VerticalWrapMode.Overflow;
|
||||
Util.NormalizeRectWithMargin(itemText, 2, 8, 2, 8);
|
||||
_basisHelp = LayoutHelper.AddTipsButton(Left, 68, _panel,
|
||||
I18NKeys.BlueprintProductionBasis.Translate(), I18NKeys.BlueprintProductionBasisTip.Translate(), "");
|
||||
UpdateLabels();
|
||||
_panel.gameObject.SetActive(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -223,7 +244,7 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
{
|
||||
_currentBlueprint = null;
|
||||
_manualProliferation = false;
|
||||
_basisCombo.SetIndex(0);
|
||||
_basisCombo.itemIndex = 0;
|
||||
if (_inspector.blueprint != null) SyncDefault();
|
||||
else _checkbox.Checked = false;
|
||||
CloseOptions();
|
||||
@@ -261,7 +282,7 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
{
|
||||
PositionEntry();
|
||||
if (!_optionsOpen) return;
|
||||
var combo = _basisCombo.GetComponent<UIComboBox>();
|
||||
var combo = _basisCombo;
|
||||
if (VFInput.escape)
|
||||
{
|
||||
if (combo.isDroppedDown)
|
||||
@@ -327,16 +348,6 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
CloseOptions();
|
||||
return;
|
||||
}
|
||||
var combo = _basisCombo.GetComponent<UIComboBox>();
|
||||
var extra = combo.isDroppedDown ? combo.DropDownCount * combo.ItemHeight + 2 * combo.ItemPadding + 2 : 0;
|
||||
var comboRect = (RectTransform)_basisCombo.transform;
|
||||
var footerTop = -comboRect.anchoredPosition.y + comboRect.rect.height + 16 + extra;
|
||||
var image = _panel.GetComponent<Image>();
|
||||
var padding = UnityEngine.Sprites.DataUtility.GetPadding(image.sprite) / image.pixelsPerUnit;
|
||||
var right = Mathf.Ceil(padding.z) + Left;
|
||||
var bottom = Mathf.Ceil(padding.y) + Left;
|
||||
_panel.sizeDelta = new Vector2(_panel.sizeDelta.x, footerTop + ((RectTransform)_button.transform).rect.height + bottom);
|
||||
Util.NormalizeRectWithTopRight(_button, right, footerTop, _panel);
|
||||
if (!TryGetPopupPosition(anchor, screen, _panel.sizeDelta, out var position))
|
||||
{
|
||||
CloseOptions();
|
||||
@@ -364,6 +375,11 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
|
||||
public void UpdateLabels()
|
||||
{
|
||||
_entryText.font = _descriptionLabel.font;
|
||||
_entryText.fontSize = _descriptionLabel.fontSize;
|
||||
_entryText.fontStyle = _descriptionLabel.fontStyle;
|
||||
_entryText.lineSpacing = _descriptionLabel.lineSpacing;
|
||||
_entryText.alignment = _descriptionLabel.alignment;
|
||||
_entryText.text = I18NKeys.BlueprintDescriptionOptions.Translate();
|
||||
((RectTransform)_entry.transform).sizeDelta =
|
||||
new Vector2(Util.GetPreferredWidth(_entryText) + 20, 22);
|
||||
@@ -374,9 +390,10 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
_buttonText.text = I18NKeys.BlueprintGenerateDescription.Translate();
|
||||
_checkbox.SetLabelText(I18NKeys.BlueprintProliferation.Translate());
|
||||
_basisLabel.text = I18NKeys.BlueprintProductionBasis.Translate();
|
||||
var combo = _basisCombo.GetComponent<UIComboBox>();
|
||||
var combo = _basisCombo;
|
||||
var index = Math.Max(0, combo.itemIndex);
|
||||
_basisCombo.SetItems(I18NKeys.BlueprintFinalProducts, I18NKeys.BlueprintBottleneckIntermediate);
|
||||
combo.Items = [I18NKeys.BlueprintFinalProducts.Translate(), I18NKeys.BlueprintBottleneckIntermediate.Translate()];
|
||||
combo.DropDownCount = combo.Items.Count;
|
||||
_basisHelp.tips.tipTitle = I18NKeys.BlueprintProductionBasis.Translate();
|
||||
_basisHelp.tips.tipText = I18NKeys.BlueprintProductionBasisTip.Translate();
|
||||
_basisHelp.UpdateTip();
|
||||
@@ -385,9 +402,10 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
var padding = UnityEngine.Sprites.DataUtility.GetPadding(image.sprite) / image.pixelsPerUnit;
|
||||
var left = Mathf.Ceil(padding.x) + Left;
|
||||
var right = Mathf.Ceil(padding.z) + Left;
|
||||
var top = Mathf.Ceil(padding.w) + 10;
|
||||
var top = Mathf.Ceil(padding.w) + 18;
|
||||
var titleHeight = Math.Max(30, Mathf.Ceil(_title.preferredHeight) + 4);
|
||||
Util.NormalizeRectWithTopLeft(_title, left, top, _panel);
|
||||
var titleLeft = left + 12;
|
||||
Util.NormalizeRectWithTopLeft(_title, titleLeft, top, _panel);
|
||||
Util.NormalizeRectWithTopRight(_closeButton, right, top, _panel);
|
||||
var rowTop = top + titleHeight + 8;
|
||||
var labelHeight = Math.Max(26, Mathf.Ceil(_checkbox.labelText.preferredHeight) + 4);
|
||||
@@ -395,21 +413,21 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
var checkLabel = _checkbox.labelText.rectTransform;
|
||||
checkLabel.anchorMin = checkLabel.anchorMax = new Vector2(0, 0.5f);
|
||||
checkLabel.pivot = new Vector2(0, 0.5f);
|
||||
checkLabel.anchoredPosition = new Vector2(28, 0);
|
||||
checkLabel.anchoredPosition = new Vector2(24, 0);
|
||||
checkLabel.sizeDelta = new Vector2(Util.GetPreferredWidth(_checkbox.labelText) + 4, labelHeight);
|
||||
rowTop += labelHeight + 8;
|
||||
var labelWidth = Util.GetPreferredWidth(_basisLabel);
|
||||
var itemText = combo.m_ListItemRes.GetComponentInChildren<Text>();
|
||||
var comboWidth = 180f;
|
||||
var textHeight = 0f;
|
||||
foreach (var key in new[] { I18NKeys.BlueprintFinalProducts, I18NKeys.BlueprintBottleneckIntermediate })
|
||||
foreach (var item in combo.Items)
|
||||
{
|
||||
combo.m_Text.text = key.Translate();
|
||||
itemText.text = key.Translate();
|
||||
comboWidth = Math.Max(comboWidth, Util.GetPreferredWidth(combo.m_Text) + 40);
|
||||
combo.m_Text.text = item;
|
||||
itemText.text = item;
|
||||
comboWidth = Math.Max(comboWidth, Util.GetPreferredWidth(combo.m_Text) + 42);
|
||||
textHeight = Math.Max(textHeight, Math.Max(combo.m_Text.preferredHeight, itemText.preferredHeight));
|
||||
}
|
||||
_basisCombo.SetIndex(index);
|
||||
combo.itemIndex = index;
|
||||
combo.ItemHeight = (int)Math.Max(24, Mathf.Ceil(textHeight) + 4);
|
||||
var rowHeight = Math.Max(28, Math.Max(Mathf.Ceil(_basisLabel.preferredHeight), Mathf.Ceil(textHeight)) + 4);
|
||||
Util.NormalizeRectWithTopLeft(_basisLabel, left, rowTop, _panel);
|
||||
@@ -419,14 +437,18 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
rowTop + (rowHeight - helpRect.rect.height) / 2, _panel);
|
||||
var comboLeft = left + labelWidth + ControlsGap + helpRect.rect.width + ControlsGap;
|
||||
Util.NormalizeRectWithTopLeft(_basisCombo, comboLeft, rowTop, _panel);
|
||||
_basisCombo.SetSize(comboWidth, rowHeight);
|
||||
var comboRect = (RectTransform)_basisCombo.transform;
|
||||
comboRect.sizeDelta = new Vector2(comboWidth, rowHeight);
|
||||
var width = Math.Max(90f, Util.GetPreferredWidth(_buttonText) + 20);
|
||||
((RectTransform)_button.transform).sizeDelta = new Vector2(width,
|
||||
Math.Max(30, Mathf.Ceil(_buttonText.preferredHeight) + 8));
|
||||
var popupWidth = Math.Max(320, Math.Max(comboLeft + comboWidth + right,
|
||||
Util.GetPreferredWidth(_title) + left + right + 50));
|
||||
_panel.sizeDelta = new Vector2(popupWidth, _panel.sizeDelta.y);
|
||||
_title.rectTransform.sizeDelta = new Vector2(popupWidth - left - right - 50, titleHeight);
|
||||
Util.GetPreferredWidth(_title) + titleLeft + right + 50));
|
||||
var footerTop = rowTop + rowHeight + 16;
|
||||
var bottom = Mathf.Ceil(padding.y) + Left;
|
||||
_panel.sizeDelta = new Vector2(popupWidth, footerTop + ((RectTransform)_button.transform).rect.height + bottom);
|
||||
Util.NormalizeRectWithTopRight(_button, right, footerTop, _panel);
|
||||
_title.rectTransform.sizeDelta = new Vector2(popupWidth - titleLeft - right - 50, titleHeight);
|
||||
PositionEntry();
|
||||
PositionOptions();
|
||||
}
|
||||
@@ -515,7 +537,7 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
}
|
||||
|
||||
var request = capture.CreateRequest(_checkbox.Checked);
|
||||
request.ProductionBasis = (BlueprintProductionBasis)_basisCombo.GetComponent<UIComboBox>().itemIndex;
|
||||
request.ProductionBasis = (BlueprintProductionBasis)_basisCombo.itemIndex;
|
||||
var report = new FactoryBlackBoxAnalyzer(catalog).Analyze(request);
|
||||
if (report.Diagnostics.Any(diagnostic => diagnostic.Code == ProductionDiagnosticCode.BlueprintBasisUnavailable))
|
||||
{
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@
|
||||
* Fix a bug that warning popup on `Veins Utilization` upgraded to level 8000+
|
||||
* Sort blueprint structures before saving, to reduce generated blueprint data size a little
|
||||
* Add an `Auto-fill` entry to the description header in the blueprint browser, copy, and paste inspectors. Click it to open options beside the entry without moving or resizing native fields; the popup follows the entry while scrolling and adjusts its position at screen edges
|
||||
* The popup has an `Auto-fill description` title, a native X close button, proliferation and production-basis options, and one `Generate` button at the bottom. Opening the dropdown expands the background and moves the action below its rows. Close with the X, an outside click, or Esc; when the dropdown is open, Esc closes it first. Successful generation closes the popup.
|
||||
* The popup has an `Auto-fill description` title, a native X close button, proliferation and production-basis options, and one `Generate` button at the bottom. The dropdown overlays the footer without resizing the popup or moving the action. Close with the X, an outside click, or Esc; when the dropdown is open, Esc closes it first. Successful generation closes the popup.
|
||||
* `Production basis` defaults to `Final-product output` each time the inspector opens, retaining rated final outputs and showing intermediate shortages and excess. Choose `Lowest intermediate throughput` to scale the final-product mix together to the bottleneck, using recipe ratios and shared intermediate demand. Complete, balanceable chains then have no internal shortages; unused intermediate capacity appears as excess. External inputs and final outputs use the same basis.
|
||||
* `Proliferation` defaults to on when the blueprint contains a Spray Coater; it can be changed manually. Power demand still estimates all selected buildings at full load in either production basis.
|
||||
* Replaces the main description with material flows per minute and writes power demand to a `Power` custom field, preserving other custom fields. If the bottleneck basis cannot be determined, the existing description is kept; check missing building settings and chain outputs, or select `Final-product output`. Save the blueprint manually to keep generated changes.
|
||||
@@ -227,7 +227,7 @@
|
||||
* 修复了`矿物利用`升级到8000级以上时弹出警告的bug
|
||||
* 保存蓝图前对建筑进行排序,以减少生成的蓝图数据大小
|
||||
* 在蓝图浏览、复制和粘贴检查面板的说明标题行增加「自动填写」入口,点击后在入口旁打开生成选项,不移动或缩放原生字段;滚动时弹出面板跟随入口,并在屏幕边缘调整位置
|
||||
* 面板包含「自动填写说明」标题、原生叉号关闭按钮、增产和产量基准选项,以及底部单个「生成说明」按钮。展开下拉列表时,背景增高,操作按钮移至列表下方。可通过叉号、点击外部或 Esc 关闭;下拉列表展开时,Esc 先收起列表。生成成功后关闭面板。
|
||||
* 面板包含「自动填写说明」标题、原生叉号关闭按钮、增产和产量基准选项,以及底部单个「生成说明」按钮。展开下拉列表时,列表覆盖在底部操作区域前方,面板尺寸和按钮位置保持不变。可通过叉号、点击外部或 Esc 关闭;下拉列表展开时,Esc 先收起列表。生成成功后关闭面板。
|
||||
* 每次打开检查面板时,「产量基准」默认为「最终产物产量」,保留最终产物的额定产量,并显示中间产物的缺口和余量。选择「最低产量中间产物」后,按配方比例和共享中间物料的需求换算瓶颈,等比例缩放各最终产物。数据完整且可平衡的生产链没有内部缺口,未使用的中间产能列为「多余」;外部输入和最终输出采用同一基准。
|
||||
* 蓝图含喷涂机时默认勾选「增产」,也可手动修改。两种产量基准均按所选全部建筑满载估算耗电。
|
||||
* 用每分钟的物料流量替换原说明,将耗电写入「耗电」自定义字段,保留其他自定义字段。无法确定瓶颈基准时保留原说明;可检查缺失的建筑参数和生产链输出,或改选「最终产物产量」。填写后需手动保存蓝图。
|
||||
|
||||
@@ -4,14 +4,14 @@ This document records the native layout evidence for the UXAssist description-he
|
||||
|
||||
## Native evidence
|
||||
|
||||
Inspected on 2026-11-01 after discovering Steam through `HKCU`'s Steam path and `steamapps/libraryfolders.vdf`:
|
||||
Original installed DSP sources, rechecked on 2026-11-05 after discovery through the Steam registry 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.
|
||||
|
||||
The original `UIBlueprintInspector.Refresh` sizes the description and native groups, places groups 2 through 4, and updates the scroll content height. It does not restore group 1's position. The previous UXAssist layout shifted group 1 and repeatedly offset the later groups and content height, making both the native refresh and other layout patches share ownership of those transforms.
|
||||
Native `UIBlueprintInspector.Refresh` owns description and group sizes, later group positions, and scroll content height. UXAssist positions only its own entry and popup.
|
||||
|
||||
The relevant original methods can be reproduced by decompiling the following types from the original assembly:
|
||||
|
||||
@@ -23,21 +23,21 @@ 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 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.
|
||||
The native description input starts 22 pixels below its title. The entry copies the title's font, size, style, line spacing, and alignment, with zero top text inset, while its hit rectangle stays 22 pixels high. It follows the title's measured text width plus 8 pixels and reserves 8 pixels before the actual native icon, including when the icon is inactive. It hides if it cannot fit. The title's 30-pixel Text rectangle must not become the button's hit rectangle, which would extend into the input below. Native labels, inputs, groups, scroll content, and settings retain their 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.
|
||||
|
||||
Decompiled methods and extracted rectangle data are development artifacts under `UXAssist/obj/native-inspector/`. Reinspect the installed original assembly and assets after a game update; the publicized compile-time references omit method bodies.
|
||||
Reinspect the installed original assemblies and assets after a game update; the publicized compile-time references omit method bodies.
|
||||
|
||||
## Anchored options and native conventions
|
||||
|
||||
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 popup uses the entry's world corners, transformed into its 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 while open. An inactive or fully clipped entry closes its popup.
|
||||
|
||||
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 panel has a title and native X, proliferation, production basis with help, and one footer `Generate` action. Content insets include the sliced sprite's approximately 13-pixel horizontal and 11-pixel vertical trim before pixels-per-unit conversion. The title has extra left and top clearance from the visible border. The 20-pixel checkbox has an independently sized label with a 4-pixel gap and vertical overflow allowed; label height remains at least 26 pixels or preferred glyph height plus padding. The panel and footer are sized from the form alone. Opening the dropdown overlays the footer without resizing the popup or moving the action.
|
||||
|
||||
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.
|
||||
|
||||
The source production-basis combo also carries source-specific behavior. Its root `Localizer` uses `wParamKey = "恒星信息面板组合框宽度"`, `sizeApplyTrans = null`, and `def_w = 0`. `OnEnable()` and `OnLanguageChange()` call `Refresh()`, which writes the root's width. Native locale parameters are 200 in `Locale/1033/parameters.txt` and 90 in `Locale/2052/parameters.txt`, both at line 28. The owned clone disables and removes this component before assigning dimensions, and disables `autoWidth` before setting items and index. Its main button fills the owned root, with selected and row-template text aligned left. Correct native horizontal anchors are retained. Native combo row `PointerDown` first selects the item, then closes the list; no extra submit-close callback is added.
|
||||
The production-basis selector directly clones the standard rectangular `optionWindow.resolutionComp`. Cloned runtime resolution rows are removed and submit/change events are replaced before the two production choices are assigned, so changing the owned selection cannot change native resolution settings. The main caption uses 8-pixel left and 30-pixel right insets; row text uses 8-pixel horizontal insets. Native row selection closes the list, with no extra submit-close handler. The shared combo helper is unchanged.
|
||||
|
||||
| Original source | Behavior used by the popup |
|
||||
| --- | --- |
|
||||
@@ -45,27 +45,15 @@ The source production-basis combo also carries source-specific behavior. Its roo
|
||||
| `UIGame._OnUpdate()` | Updates blueprint inspectors before later native picker and function-window Escape handlers. The owned inspector postfix consumes Escape after closing an expanded dropdown or its popup. |
|
||||
| `UIItemPicker._OnUpdate()` | Tests left, right, and middle clicks outside a screen rectangle using the overlay canvas camera. The owned test also accepts the entry and an open dropdown. |
|
||||
| `UIPopupMenu.SetState()` | Constrains popup placement to game UI bounds and brings it to the front. |
|
||||
| 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 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.
|
||||
Original font, sprite, header, standard-resolution-control, and close-button captures and focused decompilations are retained in the external task evidence under `2026-11-05-UXAssist-BlueprintTextLayout/`, including `standard-controls/`. Native generator rules support keeping glyph height independent of checkbox size; native header captures identify the icon's actual 20-pixel slot. Source analysis and embedded-font calculations do not execute Unity's runtime preferred-size calculation, rasterization, or interaction. Investigation reports remain outside the repository.
|
||||
|
||||
## 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 placement harness extracts the actual private `TryGetPopupPosition` method and compiles it with data-only `Rect` and `Vector2` substitutes. It checks supplied bounds, including parent transforms, canvas edges, below/above placement, and oversized-panel rejection. This validates the placement calculation, not current text rendering. Run font and sprite analysis against the current source and captured standard control.
|
||||
|
||||
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.
|
||||
|
||||
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 |
|
||||
| --- | --- |
|
||||
| Normal Release build, using the command below | Passed with 0 warnings and 0 errors. |
|
||||
| `ProductionCheck` | 569 checks passed. |
|
||||
| Actual-source placement harness | All cases and assertions above passed on the final source. |
|
||||
| Whole-diff code review and `git diff --check` | Passed. |
|
||||
For this revision, the normal Release build passed with 0 warnings and 0 errors, and `git diff --check` passed. These checks do not execute Unity rendering or interaction.
|
||||
|
||||
## Managed production checks
|
||||
|
||||
@@ -83,9 +71,9 @@ 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. 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.
|
||||
1. Open each inspector in English and Simplified Chinese with different custom-field counts. Confirm the entry text shares the native title's baseline. Focus the description input so its icon appears; the entry must remain before that icon and its clickable area must not cover the input below. Open the options and check title clearance, compact checkbox spacing, visible captions, 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.
|
||||
3. Open the rectangular production-basis list. Confirm text has clear left padding and space for the arrow. The list must overlay the footer without changing panel size or footer position. Select each item and confirm it closes the list without generating text or changing the native resolution setting. Reopen the popup and change language; selector dimensions and text 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.
|
||||
5. Reopen each inspector and repeatedly refresh or change the blueprint selection. Confirm there is one entry, options are initially closed, the production basis resets to final-product output on opening, Spray Coaters set the automatic proliferation default, and a manual checkbox choice survives content refreshes in the current session. Successful generation, a replacement blueprint, and inspector closure must dismiss the popup.
|
||||
6. Generate both production bases for an unbalanced chain. Final-product output should retain rated final capacity and show the missing intermediate; lowest intermediate throughput should reduce the common final-output mix, use correspondingly reduced external inputs, and show no internal shortage when the chain is complete and balanceable. Power should remain the same full-load estimate. Check necessary coproduct output separately from unused intermediate capacity.
|
||||
|
||||
@@ -70,11 +70,11 @@ Native research uses the current lab technology's matrix point requirements, wit
|
||||
|
||||
## Blueprint descriptions
|
||||
|
||||
The shared `UIBlueprintInspector` in browser, copy, and paste modes adds a compact `Auto-fill` entry after the measured native description title, with an 8-pixel gap. Reserve the actual native icon button's bounds and another 8-pixel gap even when that icon is inactive; hide the owned entry if it cannot fit. Its options panel is an owned child of `inspector.rectTrans`, outside the scroll mask. On opening, actual entry corners and root-canvas bounds are converted into that parent's coordinates. The private placement method in `InspectorControls` prefers a position below the entry with their right edges aligned, flips above when needed, and clamps against canvas bounds; a panel too large for those bounds is closed. A `Canvas.willRenderCanvases` subscription follows the entry after native layout and scrolling only while the options are open; hiding the entry or scrolling it completely outside its viewport closes the popup. Native fields, groups, anchors, and scroll height remain owned by the game. Closing, disabling, and destruction unsubscribe the positioning callback and remove only owned controls as appropriate.
|
||||
The shared `UIBlueprintInspector` in browser, copy, and paste modes adds a compact `Auto-fill` entry after the measured native description title, with an 8-pixel gap. Its text copies the native title's font, size, style, line spacing, and alignment, with a zero top inset; its hit rectangle stays within the 22-pixel header. Reserve the actual native icon button's bounds and another 8-pixel gap even when that icon is inactive; hide the owned entry if it cannot fit. Its options panel is an owned child of `inspector.rectTrans`, outside the scroll mask. On opening, actual entry corners and root-canvas bounds are converted into that parent's coordinates. The private placement method in `InspectorControls` prefers a position below the entry with their right edges aligned, flips above when needed, and clamps against canvas bounds; a panel too large for those bounds is closed. A `Canvas.willRenderCanvases` subscription follows the entry after native layout and scrolling only while the options are open; hiding the entry or scrolling it completely outside its viewport closes the popup. Native fields, groups, anchors, and scroll height remain owned by the game. Closing, disabling, and destruction unsubscribe the positioning callback and remove only owned controls as appropriate.
|
||||
|
||||
The options use a title and the actual native X subtree, followed by proliferation, production basis with help, and one `Generate` action at the lower right. Content margins start inside the sliced background's visible fill: add `DataUtility.GetPadding(sprite) / image.pixelsPerUnit` to the desired gaps. Keep the 20-pixel checkbox independent of its label's height, at least 26 pixels or preferred glyph height plus padding, with vertical overflow allowed and an 8-pixel horizontal gap. Owned button and combo captions disable inherited best-fit sizing and have explicit text insets. Localized preferred sizes determine row, item, button, and panel dimensions; the footer follows the selector and its expanded list instead of a fixed panel height. The cloned X must receive a new `Button.ButtonClickedEvent`: its source has a persistent callback to the original inserter window that `RemoveAllListeners` does not remove.
|
||||
The options use a title and the actual native X subtree, followed by proliferation, production basis with help, and one `Generate` action at the lower right. Content margins start inside the sliced background's visible fill: add `DataUtility.GetPadding(sprite) / image.pixelsPerUnit` to the desired gaps. The title has 12 pixels more left inset than the body and 18 pixels after the top sprite trim. Keep the 20-pixel checkbox independent of its label's height, at least 26 pixels or preferred glyph height plus padding, with vertical overflow allowed and a 4-pixel horizontal gap. Owned button and combo captions disable inherited best-fit sizing and have explicit text insets. Localized preferred sizes determine the form dimensions; opening the dropdown overlays the footer without changing panel size or footer position. The cloned X must receive a new `Button.ButtonClickedEvent`: its source has a persistent callback to the original inserter window that `RemoveAllListeners` does not remove.
|
||||
|
||||
The production-basis selector clones the star-detail combo. Disable and remove the clone root's inherited `Localizer` before assigning owned dimensions: that source component writes a star-panel-specific width on enable and language changes. Turn off the clone's `UIComboBox.autoWidth` before populating items, stretch its main button within the owned root, and align its selected and template text to the left. Preserve the native dropdown, content, item-template, and selection anchors; native `UIComboBox.SetState` controls row heights and the native row event selects an item before closing the list. These adjustments belong to this selector rather than the shared combo helper.
|
||||
The production-basis selector directly clones the standard rectangular `optionWindow.resolutionComp` as an owned `UIComboBox`. Remove cloned runtime resolution rows, clear items, and replace its submit/change events before assigning the two production choices. Keep the native row-selection and dropdown behavior; the main caption has 8-pixel left and 30-pixel right insets, and the row template has 8-pixel horizontal insets. Main and item captions use single-line overflow so measuring preferred height before the new width is assigned cannot wrap against the previous width. The shared combo helper is unchanged.
|
||||
|
||||
Handle dismissal in the owning inspector's `_OnUpdate` postfix. Processed `VFInput.escape` respects an earlier native message-box handler; close an expanded dropdown first, otherwise close the popup, then consume Escape before later native window-closing handlers run. Left, right, or middle clicks outside the popup, entry, and open dropdown close the options while preserving the clicked native target's normal behavior. Successful generation, blueprint replacement, and inspector closure also close the options.
|
||||
|
||||
|
||||
Reference in new issue
Block a user