mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-22 18:19:02 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58d08cbcd7 | ||
|
|
19d19ce38d | ||
|
|
51af1430bc | ||
|
|
8fd449d991 | ||
|
|
64a23e9772 | ||
|
|
2eae91fa18 | ||
|
|
d728e8b4ae |
No files matched your search
@@ -4,6 +4,7 @@
|
||||
## Changlog
|
||||
|
||||
* 2.4.8
|
||||
* `Mecha and Drones/Fleets invincible`: Fix mecha HP and energy shield protection failing when enabled after taking damage, and restore protection for space fleets.
|
||||
* `Finish build immediately`: Fix possible errors when starting a new game. Construction begins after the opening cutscene ends or is skipped.
|
||||
* `Belt signal item generation`:
|
||||
* Improve raw-material, intermediate, by-product and proliferator statistics using current recipes, with production and consumption counted separately. Incomplete recipe data only pauses the affected upstream statistics; item generation continues.
|
||||
@@ -207,6 +208,7 @@
|
||||
## 更新日志
|
||||
|
||||
* 2.4.8
|
||||
* `机甲和战斗无人机无敌`:修复受伤后启用时机甲耐久度和能量护盾保护可能失效的问题,并恢复太空编队的无敌保护。
|
||||
* `建造秒完成`:修复开始新游戏时可能报错的问题。建造会在开场动画播放结束或跳过后开始。
|
||||
* `传送带信号物品生成`:
|
||||
* 按当前配方完善原料、中间产物、副产物和增产剂的统计,分别记录生产和消耗。配方数据不完整时,仅暂停受影响物品的上游统计,物品仍会正常生成。
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using UXAssist.Common;
|
||||
using UXAssist.Common.ModFeatures;
|
||||
using UXAssist.Common.Patching;
|
||||
|
||||
namespace CheatEnabler.Patches;
|
||||
|
||||
@@ -48,27 +49,37 @@ public static class CombatPatch
|
||||
);
|
||||
return matcher.InstructionEnumeration();
|
||||
}
|
||||
// Harmony transpiler: SkillSystem_DamageObject_Transpiler
|
||||
// Target: SkillSystem.DamageGroundObjectByLocalCaster, SkillSystem.DamageGroundObjectByRemoteCaster, SkillSystem.DamageObject
|
||||
// Fallback: None — patch will fail loudly if the target method body changes.
|
||||
// Harmony transpiler: Mecha_Invincible_Transpiler
|
||||
// Target: Mecha.TakeDamage, Mecha.EnergyShieldResist (both overloads)
|
||||
// Fallback: Return original instructions if the invincibility check is not found.
|
||||
[HarmonyTranspiler]
|
||||
[HarmonyPatch(typeof(Mecha), nameof(Mecha.TakeDamage))]
|
||||
[HarmonyPatch(typeof(Mecha), nameof(Mecha.EnergyShieldResist), [typeof(int)], [ArgumentType.Ref])]
|
||||
[HarmonyPatch(typeof(Mecha), nameof(Mecha.EnergyShieldResist), [typeof(int), typeof(int)], [ArgumentType.Ref, ArgumentType.Out])]
|
||||
private static IEnumerable<CodeInstruction> Mecha_Invincible_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
|
||||
{
|
||||
// Repatch the consumers too: an already inlined getter bypasses its own Harmony patch.
|
||||
var original = instructions.ToList();
|
||||
var matcher = new CodeMatcher(original, generator);
|
||||
matcher.MatchForward(false, new CodeMatch(ci => ci.Calls(AccessTools.PropertyGetter(typeof(Player), nameof(Player.invincible)))));
|
||||
if (matcher.IsInvalid) return matcher.Finish(original, CheatEnabler.Logger, nameof(Mecha_Invincible_Transpiler));
|
||||
matcher.Set(OpCodes.Pop, null).Advance(1).Insert(new CodeInstruction(OpCodes.Ldc_I4_1));
|
||||
return matcher.InstructionEnumeration();
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByLocalCaster))]
|
||||
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByRemoteCaster))]
|
||||
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageObject))]
|
||||
private static IEnumerable<CodeInstruction> SkillSystem_DamageObject_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator, MethodBase __originalMethod)
|
||||
private static void SkillSystem_DamageGroundObject_Prefix(ref int damage, ref SkillTargetLocal target)
|
||||
{
|
||||
var matcher = new CodeMatcher(instructions, generator);
|
||||
matcher.MatchForward(false,
|
||||
new CodeMatch(ci => ci.IsLdarg()),
|
||||
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(SkillTargetLocal), nameof(SkillTargetLocal.type))),
|
||||
new CodeMatch(OpCodes.Ldc_I4_6),
|
||||
new CodeMatch(ci => ci.opcode == OpCodes.Bne_Un || ci.opcode == OpCodes.Bne_Un_S)
|
||||
);
|
||||
matcher.Repeat(m => m.Advance(4).InsertAndAdvance(
|
||||
new CodeInstruction(OpCodes.Ldc_I4_0),
|
||||
new CodeInstruction(OpCodes.Starg_S, __originalMethod.Name == "DamageObject" ? 1 : 2)
|
||||
));
|
||||
return matcher.InstructionEnumeration();
|
||||
if (target.type == ETargetType.Craft) damage = 0;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageObject))]
|
||||
private static void SkillSystem_DamageObject_Prefix(ref int damage, ref SkillTarget target)
|
||||
{
|
||||
if (target.type == ETargetType.Craft) damage = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,8 @@
|
||||
* Keep the highest-production shells and remove the others
|
||||
* Duplicate the highest-production shells with a configurable shell count
|
||||
* Mecha/Combat:
|
||||
* Mecha and Drones/Fleets invicible
|
||||
* Mecha and Drones/Fleets invincible
|
||||
* Protects mecha HP and energy shields, ground combat drones, and space fleets, including when enabled during combat.
|
||||
* Buildings invicible
|
||||
* Enable warp without space warpers
|
||||
* Teleport to outer space
|
||||
@@ -180,6 +181,7 @@ The item icon selects the output; no hotkey is needed.
|
||||
* 从发电量最高的壳复制戴森壳,可设置壳面数量
|
||||
* 机甲/战斗:
|
||||
* 机甲和战斗无人机无敌
|
||||
* 保护机甲耐久度和能量护盾、地面战斗无人机和太空编队,战斗中开启同样生效。
|
||||
* 建筑无敌
|
||||
* 无需空间翘曲器即可曲速飞行
|
||||
* 传送到外太空
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
## Changlog
|
||||
|
||||
* 1.6.4
|
||||
* `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`:
|
||||
* Add a Factory-tab button to arrange ordinary Mining Machines densely around the nearest solid vein group. Each miner covers at least 3 nodes from that group, without including nearby groups. Layouts are not limited by stock; missing miners remain as ghosts awaiting materials. Placement respects construction range and does not include belts or power facilities. Click again to cancel a search.
|
||||
@@ -444,6 +447,9 @@
|
||||
|
||||
## 更新日志
|
||||
|
||||
* 1.6.4
|
||||
* `蓝图说明`:「自动填写」入口与说明标题的文字基线对齐,并为原生图标按钮保留空间。生成选项滚动时跟随入口,在屏幕边缘调整位置;标题保留边距,复选框间距紧凑,文字尺寸适应当前语言。使用原生直边下拉框,展开时覆盖底部操作区域,面板尺寸和单个「生成说明」按钮的位置保持不变。可通过原生叉号、点击外部或 Esc 关闭;下拉列表展开时,Esc 先收起列表。保留原生检查面板布局。
|
||||
* `在和平模式下隐藏战斗相关科技`:修复在同一次游戏运行中从和平模式存档切换到战斗模式存档后打开科技树时的数组越界,以及再次加载和平模式存档后关闭选项时的同类问题。
|
||||
* 1.6.3
|
||||
* `快速铺设采矿机`:
|
||||
* 在「工厂」页增加按钮,自动在最近的固体矿脉周围密集铺设普通采矿机。每台至少覆盖选中矿脉的 3 个矿点,不混入附近其他矿脉。布局数量不受库存限制,采矿机不足的位置保留待建造虚影。遵守建造范围,不自动铺设传送带和电力设施。计算期间再次点击可取消。
|
||||
|
||||
@@ -6,6 +6,7 @@ public static class I18NKeys
|
||||
{
|
||||
public const string Unknown = "Unknown";
|
||||
public const string BlueprintAutoFillDescription = "UXAssist Blueprint Auto-fill description";
|
||||
public const string BlueprintGenerateDescription = "UXAssist Blueprint Generate Description";
|
||||
public const string BlueprintDescriptionOptions = "UXAssist Blueprint Description Options";
|
||||
public const string BlueprintDescriptionOptionsTip = "UXAssist Blueprint Description Options Tip";
|
||||
public const string BlueprintProliferation = "UXAssist Blueprint Proliferation";
|
||||
@@ -244,6 +245,7 @@ public static class I18NKeys
|
||||
{
|
||||
I18N.Add(Unknown, "Unknown", "未知");
|
||||
I18N.Add(BlueprintAutoFillDescription, "Auto-fill description", "自动填写说明");
|
||||
I18N.Add(BlueprintGenerateDescription, "Generate", "生成说明");
|
||||
I18N.Add(BlueprintDescriptionOptions, "Auto-fill…", "自动填写…");
|
||||
I18N.Add(BlueprintDescriptionOptionsTip,
|
||||
"Choose production basis and proliferation, then fill the blueprint description.",
|
||||
|
||||
@@ -70,6 +70,12 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPostfix, HarmonyPatch(typeof(UIBlueprintInspector), nameof(UIBlueprintInspector._OnUpdate))]
|
||||
private static void OnUpdate(UIBlueprintInspector __instance)
|
||||
{
|
||||
if (Inspectors.TryGetValue(__instance, out var controls)) controls.HandleInput();
|
||||
}
|
||||
|
||||
[HarmonyPostfix, HarmonyPatch(typeof(UIBlueprintInspector), nameof(UIBlueprintInspector.OnLanguageChanged))]
|
||||
private static void OnLanguageChanged(UIBlueprintInspector __instance)
|
||||
{
|
||||
@@ -103,7 +109,7 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
private sealed class InspectorControls
|
||||
{
|
||||
private const float Left = 12f;
|
||||
private const float ControlsGap = 12f;
|
||||
private const float ControlsGap = 6f;
|
||||
|
||||
private readonly UIBlueprintInspector _inspector;
|
||||
private RectTransform _panel;
|
||||
@@ -111,10 +117,16 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
private Text _entryText;
|
||||
private UIButton _button;
|
||||
private Text _buttonText;
|
||||
private UIButton _cancelButton;
|
||||
private Text _cancelText;
|
||||
private UIButton _closeButton;
|
||||
private Text _title;
|
||||
private readonly Vector3[] _corners = new Vector3[4];
|
||||
private readonly Canvas _canvas;
|
||||
private readonly RectTransform _viewport;
|
||||
private readonly Text _descriptionLabel;
|
||||
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;
|
||||
@@ -123,56 +135,103 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
public InspectorControls(UIBlueprintInspector inspector)
|
||||
{
|
||||
_inspector = inspector;
|
||||
_canvas = inspector.rectTrans.GetComponentInParent<Canvas>().rootCanvas;
|
||||
_viewport = inspector.descGroupTrans.GetComponentInParent<ScrollRect>()?.viewport;
|
||||
_descriptionLabel = inspector.descGroupTrans.Find("label").GetComponent<Text>();
|
||||
_descriptionIcon = (RectTransform)inspector.descTextInput.transform.Find("sel-icon-btn");
|
||||
try
|
||||
{
|
||||
// The native description has a 22px title row above its editable text.
|
||||
_entry = LayoutHelper.AddButton(0, 0, inspector.descGroupTrans,
|
||||
I18NKeys.BlueprintDescriptionOptions, 13, "blueprint-description-options", ToggleOptions);
|
||||
I18NKeys.BlueprintDescriptionOptions, 12, "blueprint-description-options", ToggleOptions);
|
||||
_entryText = _entry.transform.Find("button-text").GetComponent<Text>();
|
||||
_entry.tips = inspector.tipButton2.tips;
|
||||
_entry.tips.topLevel = true;
|
||||
Util.NormalizeRectWithTopRight(_entry, 0, 0, inspector.descGroupTrans);
|
||||
_entryText.resizeTextForBestFit = false;
|
||||
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;
|
||||
child.SetActive(false);
|
||||
UnityEngine.Object.Destroy(child);
|
||||
}
|
||||
_panel.anchorMin = new Vector2(0, 1);
|
||||
_panel.anchorMax = Vector2.one;
|
||||
_panel.anchorMin = _panel.anchorMax = new Vector2(0, 1);
|
||||
_panel.pivot = new Vector2(0, 1);
|
||||
_panel.anchoredPosition = new Vector2(Left, -Left);
|
||||
_panel.sizeDelta = new Vector2(-Left * 2, 152);
|
||||
_button = LayoutHelper.AddButton(Left, 12, _panel,
|
||||
I18NKeys.BlueprintAutoFillDescription, 15, "blueprint-auto-fill-description", Generate);
|
||||
_panel.GetComponent<Image>().raycastTarget = true;
|
||||
_title = LayoutHelper.AddText(Left, 10, _panel, I18NKeys.BlueprintAutoFillDescription, 16);
|
||||
_title.color = _entryText.color;
|
||||
var closeSource = UIRoot.instance.uiGame.inserterWindow.transform
|
||||
.Find("panel-bg/btn-box/close-wnd-btn").GetComponent<UIButton>();
|
||||
_closeButton = UnityEngine.Object.Instantiate(closeSource, _panel);
|
||||
Util.ResetButton(_closeButton);
|
||||
// The source's persistent callback closes the original inserter window.
|
||||
_closeButton.button.onClick = new Button.ButtonClickedEvent();
|
||||
_closeButton.button.onClick.AddListener(CloseOptions);
|
||||
Util.NormalizeRectWithTopRight(_closeButton, 0, 0, _panel);
|
||||
_button = LayoutHelper.AddButton(0, 0, _panel,
|
||||
I18NKeys.BlueprintGenerateDescription, 15, "blueprint-auto-fill-description", Generate);
|
||||
_buttonText = _button.transform.Find("button-text").GetComponent<Text>();
|
||||
_cancelButton = LayoutHelper.AddButton(0, 0, _panel,
|
||||
I18NKeys.Cancel, 14, "blueprint-description-cancel", CloseOptions);
|
||||
_cancelText = _cancelButton.transform.Find("button-text").GetComponent<Text>();
|
||||
Util.NormalizeRectWithTopRight(_cancelButton, Left, 14, _panel);
|
||||
_checkbox = MyCheckBox.CreateCheckBox(Left, 52, _panel, false,
|
||||
I18NKeys.BlueprintProliferation.Translate(), 15).WithSmallerBox(22f);
|
||||
_buttonText.resizeTextForBestFit = false;
|
||||
_buttonText.alignment = TextAnchor.MiddleCenter;
|
||||
Util.NormalizeRectWithMargin(_buttonText, 4, 10, 4, 10);
|
||||
_checkbox = MyCheckBox.CreateCheckBox(Left, 42, _panel, false,
|
||||
I18NKeys.BlueprintProliferation.Translate(), 15);
|
||||
_checkbox.rectTrans.sizeDelta = new Vector2(20, 20);
|
||||
_checkbox.checkImage.rectTransform.sizeDelta = new Vector2(20, 20);
|
||||
_checkbox.labelText.verticalOverflow = VerticalWrapMode.Overflow;
|
||||
_checkbox.gameObject.name = "blueprint-proliferation";
|
||||
_checkbox.OnChecked += OnProliferationChecked;
|
||||
_basisLabel = LayoutHelper.AddText(Left, 80, _panel, I18NKeys.BlueprintProductionBasis, 14);
|
||||
_basisCombo = MyCornerComboBox.CreateComboBox(Left, 108, _panel).WithFontSize(14)
|
||||
.WithItems(I18NKeys.BlueprintFinalProducts, I18NKeys.BlueprintBottleneckIntermediate)
|
||||
.WithIndex(0);
|
||||
var combo = _basisCombo.GetComponent<UIComboBox>();
|
||||
_basisLabel = LayoutHelper.AddText(Left, 68, _panel, I18NKeys.BlueprintProductionBasis, 14);
|
||||
_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--)
|
||||
{
|
||||
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);
|
||||
}
|
||||
combo.ItemButtons.Clear();
|
||||
combo.Items.Clear();
|
||||
combo.onSubmit = new UIComboBox.SubmitEvent();
|
||||
combo.onItemIndexChange = new UIComboBox.ChangeEvent();
|
||||
combo.CanInput = false;
|
||||
combo.autoWidth = false;
|
||||
var comboRect = (RectTransform)_basisCombo.transform;
|
||||
comboRect.anchorMax = Vector2.one;
|
||||
comboRect.sizeDelta = new Vector2(-Left * 2, 28);
|
||||
_basisHelp = LayoutHelper.AddTipsButton(Left, 80, _panel,
|
||||
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;
|
||||
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
|
||||
{
|
||||
@@ -185,58 +244,218 @@ 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();
|
||||
_entry.gameObject.SetActive(_inspector.blueprint != null);
|
||||
UpdateLabels();
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
SyncDefault();
|
||||
_entry.gameObject.SetActive(_inspector.blueprint != null);
|
||||
PositionEntry();
|
||||
}
|
||||
|
||||
private void ToggleOptions()
|
||||
{
|
||||
if (_optionsOpen)
|
||||
{
|
||||
CloseOptions();
|
||||
return;
|
||||
}
|
||||
_optionsOpen = true;
|
||||
_panel.SetAsLastSibling();
|
||||
_panel.gameObject.SetActive(!_panel.gameObject.activeSelf);
|
||||
_panel.gameObject.SetActive(true);
|
||||
PositionOptions();
|
||||
if (_optionsOpen) Canvas.willRenderCanvases += PositionOptions;
|
||||
}
|
||||
|
||||
private void CloseOptions() => _panel.gameObject.SetActive(false);
|
||||
private void CloseOptions()
|
||||
{
|
||||
Canvas.willRenderCanvases -= PositionOptions;
|
||||
_optionsOpen = false;
|
||||
if (_panel) _panel.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void HandleInput()
|
||||
{
|
||||
PositionEntry();
|
||||
if (!_optionsOpen) return;
|
||||
var combo = _basisCombo;
|
||||
if (VFInput.escape)
|
||||
{
|
||||
if (combo.isDroppedDown)
|
||||
{
|
||||
combo.isDroppedDown = false;
|
||||
combo.m_DropDownList.gameObject.SetActive(false);
|
||||
}
|
||||
else CloseOptions();
|
||||
VFInput.UseEscape();
|
||||
return;
|
||||
}
|
||||
if (!Input.GetMouseButtonDown(0) && !Input.GetMouseButtonDown(1) && !Input.GetMouseButtonDown(2)) return;
|
||||
var mouse = (Vector2)Input.mousePosition;
|
||||
if (RectTransformUtility.RectangleContainsScreenPoint(_panel, mouse, _canvas.worldCamera) ||
|
||||
RectTransformUtility.RectangleContainsScreenPoint((RectTransform)_entry.transform, mouse, _canvas.worldCamera) ||
|
||||
combo.isDroppedDown && RectTransformUtility.RectangleContainsScreenPoint(combo.m_DropDownList, mouse, _canvas.worldCamera))
|
||||
return;
|
||||
CloseOptions();
|
||||
}
|
||||
|
||||
private Rect BoundsIn(RectTransform rect, Transform parent)
|
||||
{
|
||||
rect.GetWorldCorners(_corners);
|
||||
var min = new Vector2(float.PositiveInfinity, float.PositiveInfinity);
|
||||
var max = new Vector2(float.NegativeInfinity, float.NegativeInfinity);
|
||||
foreach (var corner in _corners)
|
||||
{
|
||||
var point = parent.InverseTransformPoint(corner);
|
||||
min = Vector2.Min(min, point);
|
||||
max = Vector2.Max(max, point);
|
||||
}
|
||||
return Rect.MinMaxRect(min.x, min.y, max.x, max.y);
|
||||
}
|
||||
|
||||
private void PositionEntry()
|
||||
{
|
||||
var parent = _inspector.descGroupTrans;
|
||||
var label = BoundsIn(_descriptionLabel.rectTransform, parent);
|
||||
var labelWidth = parent.InverseTransformVector(_descriptionLabel.transform.TransformVector(
|
||||
new Vector3(Util.GetPreferredWidth(_descriptionLabel), 0, 0))).x;
|
||||
var left = label.xMin + labelWidth + 8;
|
||||
var right = Math.Min(parent.rect.xMax, BoundsIn(_descriptionIcon, parent).xMin) - 8;
|
||||
var entryRect = (RectTransform)_entry.transform;
|
||||
var visible = _inspector.blueprint != null && left + entryRect.rect.width <= right;
|
||||
_entry.gameObject.SetActive(visible);
|
||||
if (!visible) return;
|
||||
Util.NormalizeRectWithTopLeft(_entry, left - parent.rect.xMin,
|
||||
parent.rect.yMax - label.yMax, parent);
|
||||
}
|
||||
|
||||
private void PositionOptions()
|
||||
{
|
||||
if (!_optionsOpen) return;
|
||||
if (!_entry || !_entry.gameObject.activeInHierarchy)
|
||||
{
|
||||
CloseOptions();
|
||||
return;
|
||||
}
|
||||
var anchor = BoundsIn((RectTransform)_entry.transform, _panel.parent);
|
||||
var screen = BoundsIn((RectTransform)_canvas.transform, _panel.parent);
|
||||
if (!anchor.Overlaps(screen) || _viewport && !anchor.Overlaps(BoundsIn(_viewport, _panel.parent)))
|
||||
{
|
||||
CloseOptions();
|
||||
return;
|
||||
}
|
||||
if (!TryGetPopupPosition(anchor, screen, _panel.sizeDelta, out var position))
|
||||
{
|
||||
CloseOptions();
|
||||
return;
|
||||
}
|
||||
var parent = (RectTransform)_panel.parent;
|
||||
_panel.anchoredPosition = position - new Vector2(parent.rect.xMin, parent.rect.yMax);
|
||||
}
|
||||
|
||||
private static bool TryGetPopupPosition(Rect anchor, Rect screen, Vector2 size, out Vector2 position)
|
||||
{
|
||||
const float gap = 6;
|
||||
const float margin = 8;
|
||||
position = default;
|
||||
if (size.x > screen.width - margin * 2 || size.y > screen.height - margin * 2) return false;
|
||||
var left = Math.Max(screen.xMin + margin,
|
||||
Math.Min(anchor.xMax - size.x, screen.xMax - margin - size.x));
|
||||
var top = anchor.yMin - gap;
|
||||
if (top - size.y < screen.yMin + margin)
|
||||
top = anchor.yMax + gap + size.y;
|
||||
top = Math.Min(screen.yMax - margin, Math.Max(screen.yMin + margin + size.y, top));
|
||||
position = new Vector2(left, top);
|
||||
return true;
|
||||
}
|
||||
|
||||
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) + 16, 20);
|
||||
new Vector2(Util.GetPreferredWidth(_entryText) + 20, 22);
|
||||
_entry.tips.tipTitle = I18NKeys.BlueprintAutoFillDescription.Translate();
|
||||
_entry.tips.tipText = I18NKeys.BlueprintDescriptionOptionsTip.Translate();
|
||||
_entry.UpdateTip();
|
||||
_buttonText.text = I18NKeys.BlueprintAutoFillDescription.Translate();
|
||||
_cancelText.text = I18NKeys.Cancel.Translate();
|
||||
((RectTransform)_cancelButton.transform).sizeDelta =
|
||||
new Vector2(Util.GetPreferredWidth(_cancelText) + 20, 24);
|
||||
_title.text = I18NKeys.BlueprintAutoFillDescription.Translate();
|
||||
_buttonText.text = I18NKeys.BlueprintGenerateDescription.Translate();
|
||||
_checkbox.SetLabelText(I18NKeys.BlueprintProliferation.Translate());
|
||||
_basisLabel.text = I18NKeys.BlueprintProductionBasis.Translate();
|
||||
var combo = _basisCombo.GetComponent<UIComboBox>();
|
||||
var index = combo.itemIndex;
|
||||
_basisCombo.SetItems(I18NKeys.BlueprintFinalProducts, I18NKeys.BlueprintBottleneckIntermediate);
|
||||
_basisCombo.SetIndex(index);
|
||||
var combo = _basisCombo;
|
||||
var index = Math.Max(0, combo.itemIndex);
|
||||
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();
|
||||
var width = Math.Max(160f, Util.GetPreferredWidth(_buttonText) + 26f);
|
||||
_button.transform.GetComponent<RectTransform>().sizeDelta =
|
||||
new Vector2(width, _button.transform.GetComponent<RectTransform>().sizeDelta.y);
|
||||
var image = _panel.GetComponent<Image>();
|
||||
// Sliced window artwork has transparent borders; content margins start inside its visible fill.
|
||||
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) + 18;
|
||||
var titleHeight = Math.Max(30, Mathf.Ceil(_title.preferredHeight) + 4);
|
||||
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);
|
||||
Util.NormalizeRectWithTopLeft(_checkbox, left, rowTop + (labelHeight - 20) / 2, _panel);
|
||||
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(24, 0);
|
||||
checkLabel.sizeDelta = new Vector2(Util.GetPreferredWidth(_checkbox.labelText) + 4, labelHeight);
|
||||
rowTop += labelHeight + 8;
|
||||
var labelWidth = Util.GetPreferredWidth(_basisLabel);
|
||||
_basisLabel.rectTransform.sizeDelta = new Vector2(labelWidth, _basisLabel.rectTransform.sizeDelta.y);
|
||||
Util.NormalizeRectWithTopLeft(_basisHelp, Left + labelWidth + ControlsGap, 80, _panel);
|
||||
var itemText = combo.m_ListItemRes.GetComponentInChildren<Text>();
|
||||
var comboWidth = 180f;
|
||||
var textHeight = 0f;
|
||||
foreach (var item in combo.Items)
|
||||
{
|
||||
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));
|
||||
}
|
||||
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);
|
||||
_basisLabel.rectTransform.sizeDelta = new Vector2(labelWidth, rowHeight);
|
||||
var helpRect = (RectTransform)_basisHelp.transform;
|
||||
Util.NormalizeRectWithTopLeft(_basisHelp, left + labelWidth + ControlsGap,
|
||||
rowTop + (rowHeight - helpRect.rect.height) / 2, _panel);
|
||||
var comboLeft = left + labelWidth + ControlsGap + helpRect.rect.width + ControlsGap;
|
||||
Util.NormalizeRectWithTopLeft(_basisCombo, comboLeft, rowTop, _panel);
|
||||
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) + 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();
|
||||
}
|
||||
|
||||
public void Destroy()
|
||||
{
|
||||
CloseOptions();
|
||||
if (_entry)
|
||||
{
|
||||
_entry.button.onClick.RemoveListener(ToggleOptions);
|
||||
@@ -244,8 +463,8 @@ public class BlueprintDescriptionPatch : PatchImpl<BlueprintDescriptionPatch>
|
||||
}
|
||||
if (_button)
|
||||
_button.button.onClick.RemoveListener(Generate);
|
||||
if (_cancelButton)
|
||||
_cancelButton.button.onClick.RemoveListener(CloseOptions);
|
||||
if (_closeButton)
|
||||
_closeButton.button.onClick.RemoveListener(CloseOptions);
|
||||
if (_checkbox)
|
||||
_checkbox.OnChecked -= OnProliferationChecked;
|
||||
if (!_panel) return;
|
||||
@@ -318,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))
|
||||
{
|
||||
|
||||
@@ -222,11 +222,22 @@ public static class TechPatch
|
||||
foreach (var item in nodes)
|
||||
{
|
||||
var node = item.Value;
|
||||
var postTechArray = node.techProto.postTechArray;
|
||||
// A new session can initialize nodes while the peace-mode graph is still filtered.
|
||||
var arrowCount = node.arrows.Length;
|
||||
if (arrowCount < postTechArray.Length)
|
||||
{
|
||||
System.Array.Resize(ref node.arrows, postTechArray.Length);
|
||||
for (var i = arrowCount; i < postTechArray.Length; i++)
|
||||
{
|
||||
node.arrows[i] = UnityEngine.Object.Instantiate(node.arrowPrefab, node.arrowPrefab.parent);
|
||||
node.arrows[i].SetAsFirstSibling();
|
||||
}
|
||||
}
|
||||
foreach (var arrow in node.arrows)
|
||||
{
|
||||
arrow.gameObject.SetActive(false);
|
||||
}
|
||||
var postTechArray = node.techProto.postTechArray;
|
||||
var active = postTechArray.Length > 0;
|
||||
node.connGroup.gameObject.SetActive(active);
|
||||
node.connImages = active ? node.connGroup.GetComponentsInChildren<Image>(true) : [];
|
||||
|
||||
+6
-2
@@ -17,7 +17,8 @@
|
||||
* Strict hotkey dectection for build menu, thus building hotkeys(0~9, F1~F10, X, U) are not triggered while holding Ctrl/Alt/Shift.
|
||||
* 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 generation options without moving or resizing native fields or covering the file list
|
||||
* 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. 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.
|
||||
@@ -171,6 +172,7 @@
|
||||
* Buy out techs with their prerequisites
|
||||
* This enables batch buying out techs with their prerequisites. Buy-out buttons are shown for locked techs/upgrades.
|
||||
* Hide battle-related techs in Peace mode
|
||||
* Battle-related techs and their connections return when disabling the option or loading a Combat-mode save; switching saves does not require restarting the game.
|
||||
* Unlock all techs with metadata
|
||||
* Use the config-panel button to confirm the metadata cost and buy out eligible techs in a batch; unlimited upgrade chains are excluded.
|
||||
* Combat
|
||||
@@ -224,7 +226,8 @@
|
||||
* 更严格的建造菜单热键检测,因此在按住Ctrl/Alt/Shift时不再会触发建造热键(0~9, F1~F10, X, U)
|
||||
* 修复了`矿物利用`升级到8000级以上时弹出警告的bug
|
||||
* 保存蓝图前对建筑进行排序,以减少生成的蓝图数据大小
|
||||
* 在蓝图浏览、复制和粘贴检查面板的说明标题行增加「自动填写」入口,点击展开生成选项,不移动或缩放原生字段,也不遮挡文件列表
|
||||
* 在蓝图浏览、复制和粘贴检查面板的说明标题行增加「自动填写」入口,点击后在入口旁打开生成选项,不移动或缩放原生字段;滚动时弹出面板跟随入口,并在屏幕边缘调整位置
|
||||
* 面板包含「自动填写说明」标题、原生叉号关闭按钮、增产和产量基准选项,以及底部单个「生成说明」按钮。展开下拉列表时,列表覆盖在底部操作区域前方,面板尺寸和按钮位置保持不变。可通过叉号、点击外部或 Esc 关闭;下拉列表展开时,Esc 先收起列表。生成成功后关闭面板。
|
||||
* 每次打开检查面板时,「产量基准」默认为「最终产物产量」,保留最终产物的额定产量,并显示中间产物的缺口和余量。选择「最低产量中间产物」后,按配方比例和共享中间物料的需求换算瓶颈,等比例缩放各最终产物。数据完整且可平衡的生产链没有内部缺口,未使用的中间产能列为「多余」;外部输入和最终输出采用同一基准。
|
||||
* 蓝图含喷涂机时默认勾选「增产」,也可手动修改。两种产量基准均按所选全部建筑满载估算耗电。
|
||||
* 用每分钟的物料流量替换原说明,将耗电写入「耗电」自定义字段,保留其他自定义字段。无法确定瓶颈基准时保留原说明;可检查缺失的建筑参数和生产链输出,或改选「最终产物产量」。填写后需手动保存蓝图。
|
||||
@@ -378,6 +381,7 @@
|
||||
* 买断科技也同时买断所有前置科技
|
||||
* 可批量买断科技及其前置科技,未解锁的科技和升级会显示买断按钮。
|
||||
* 在和平模式下隐藏战斗相关科技
|
||||
* 关闭选项或加载战斗模式存档后恢复相关科技及连线,切换存档无需重启游戏。
|
||||
* 使用元数据解锁所有科技
|
||||
* 在配置面板点击按钮并确认元数据消耗,批量买断符合条件的科技;不包含无限升级科技链。
|
||||
* 战斗
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid>
|
||||
<Description>DSP MOD - UXAssist</Description>
|
||||
<Version>1.6.3</Version>
|
||||
<Version>1.6.4</Version>
|
||||
<PackageId>UXAssist</PackageId>
|
||||
<RootNamespace>UXAssist</RootNamespace>
|
||||
<PackHasChangelog>true</PackHasChangelog>
|
||||
|
||||
@@ -4,13 +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:
|
||||
|
||||
@@ -22,11 +23,37 @@ 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; it does not move the title, input, groups, or scroll content. Options appear only on request inside the inspector and close after successful generation or inspector closure. The browser's file grid remains outside the UXAssist controls. Following the separate native settings panel is unnecessary, and no per-frame positioning patch is used.
|
||||
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 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 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 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 |
|
||||
| --- | --- |
|
||||
| `UIRoot._OnUpdate()` and `EscapeInputLogic()` | Give native message boxes Escape priority before the game UI updates. |
|
||||
| `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 inserter close-button subtree and combo row event routing | Supply the actual X artwork/hit area and the select-then-close event order. |
|
||||
|
||||
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 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.
|
||||
|
||||
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
|
||||
|
||||
@@ -44,10 +71,12 @@ 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 all three inspectors in English and Simplified Chinese. Confirm the header entry is readable without covering the title or editable description. Open and close its options, generate, and close the inspector. The options must not remain over the file grid or survive an inspector close.
|
||||
2. Scroll the native description and custom fields and expand native foundation, fill-only, and reform settings. All native fields must retain their positions and sizes, and scrolling must reach every field.
|
||||
3. 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.
|
||||
4. 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.
|
||||
5. Edit the description and unrelated custom fields before generating. Generate twice, including with 20 custom fields and with existing English or Chinese power fields. Confirm unrelated edits survive, duplicate power fields are consolidated, and failed generation leaves the prior description and fields intact. Include missing building settings, an unavailable bottleneck basis, and the native description length limit.
|
||||
6. Save, copy the share code, and reopen or paste the blueprint through the native buttons. Confirm the generated main description, power field, and unrelated fields persist correctly. With a research-mode lab, confirm net produced matrices appear under Research without fabricated matrix imports or research speed.
|
||||
7. Restart the test profile without UXAssist, then restore it and restart again. Confirm the entry and options are absent without UXAssist, native fields keep their normal layout in both cases, and repeated opening and generation work with the installed blueprint mods. `OnDisable` and inspector-destruction cleanup are code-review checks unless a development harness exercises them; a supported user-facing hot-disable workflow is not assumed.
|
||||
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 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.
|
||||
7. Edit the description and unrelated custom fields before generating. Generate twice, including with 20 custom fields and with existing English or Chinese power fields. Confirm unrelated edits survive, duplicate power fields are consolidated, and failed generation leaves the prior description and fields intact. Include missing building settings, an unavailable bottleneck basis, and the native description length limit.
|
||||
8. Save, copy the share code, and reopen or paste the blueprint through the native buttons. Confirm the generated main description, power field, and unrelated fields persist correctly. With a research-mode lab, confirm net produced matrices appear under Research without fabricated matrix imports or research speed.
|
||||
9. Restart the test profile without UXAssist, then restore it and restart again. Confirm the entry and options are absent without UXAssist, native fields keep their normal layout in both cases, and repeated opening and generation work with the installed blueprint mods. `OnDisable` and inspector-destruction cleanup are code-review checks unless a development harness exercises them; a supported user-facing hot-disable workflow is not assumed.
|
||||
@@ -70,9 +70,15 @@ 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 to the existing description header. Its options open on demand within the inspector, rather than occupying the browser file grid. Only UXAssist-owned transforms are positioned: native fields, groups, anchors, and scroll height remain owned by the game. No per-frame layout patch or native-settings tracking is needed. Disable and destruction remove only the UXAssist controls.
|
||||
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 contain `Auto-fill description`, `Proliferation`, and a `Production basis` selector with a localized help tip. Each inspector open resets the basis to `Final-product output`, retaining existing calculation behavior; selecting `Lowest intermediate throughput` opts into `BottleneckIntermediate` for generation. The checkbox initially reflects the blueprint's Spray Coater prefab capability and tracks content changes until manually changed in the current editing session; changing it does not modify the blueprint. Generation captures only `blueprint.buildings` with `BlueprintSelectionReader.FromBlueprint` on the game thread, then runs `FactoryBlackBoxAnalyzer` against the captured catalog. A successful bottleneck solve supplies classification and steady-state balances directly; the original classifier runs only in final-product mode or after an unavailable bottleneck result. The maximum supported proliferation level applies while each building keeps its acceleration or extra-products mode. Input coating is assumed to be supplied externally; no spray routing or spray consumption is inferred from the Spray Coater.
|
||||
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 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.
|
||||
|
||||
Each inspector open resets the basis to `Final-product output`, retaining existing calculation behavior; selecting `Lowest intermediate throughput` opts into `BottleneckIntermediate` for generation. The checkbox initially reflects the blueprint's Spray Coater prefab capability and tracks content changes until manually changed in the current editing session; changing it does not modify the blueprint. Generation captures only `blueprint.buildings` with `BlueprintSelectionReader.FromBlueprint` on the game thread, then runs `FactoryBlackBoxAnalyzer` against the captured catalog. A successful bottleneck solve supplies classification and steady-state balances directly; the original classifier runs only in final-product mode or after an unavailable bottleneck result. The maximum supported proliferation level applies while each building keeps its acceleration or extra-products mode. Input coating is assumed to be supplied externally; no spray routing or spray consumption is inferred from the Spray Coater.
|
||||
|
||||
`BlueprintDescriptionFormatter` builds replacement multiline `blueprint.desc` text in this order: optional `Missing:` and `Excess:` lines for intermediate shortages and excess classified by the selected production basis; `Input:` for external inputs capped by downstream demand; `Output:` for ordinary final products and necessary coproduct surplus; and `Research:` for positive net matrix production accepted by a selected research-mode lab. Each warning category has one label followed by comma-separated items; warnings do not repeat in Input, and a matrix on Research does not repeat in Output. It uses `SteadyStateExternalSupply` for complete and independently known partial inputs, labeling partial values as known portions. The assumed lab adds no numerical matrix consumption or external input; other buildings' known matrix demand is subtracted from the Research rate. Omit each empty line, including Research when no produced matrix remains. A single optional `Power` custom field separates factory and configured logistics consumption, omitting categories with no demand and removing the field altogether if neither consumes power; a present but unknown category displays `Unknown` rather than zero. Material rates remain items per minute even though the description labels omit the unit. Rates are rounded only for display. Large displayed rates use the largest exact K/M/G suffix with at most one decimal place (for example, 1,234,000 becomes 1,234K); if no suffix preserves that display precision, keep the ordinary number. Numbers with four or more integer digits use comma thousands separators, including coefficients before material or power units. Rates are ordered by item ID within each category, and use native item icon/name tags with comma-separated entries inside each description line. Uncertain final-product, overbuild, or coproduct conclusions are omitted. Veins and other scene objects are not blueprint entries or requested parameters.
|
||||
|
||||
@@ -129,7 +135,7 @@ Use a test game for the following manual checks. Compare full-load rates only wi
|
||||
- Select miners at different machine speeds, including one with a backed-up output, a gas collector, and renewable generators. Check native miner power scaling, full-load miner output regardless of the output backlog, per-minute gas output without added grid demand, and ideal rated renewable power rather than local conditions.
|
||||
- Select ray receivers in both modes, fuel generators, ejectors, and silos. Toggle proliferation and compare working power, generation, accumulator exchange, and Dyson demand as separate quantities. In a sandbox game, capture boosted artificial stars and launchers, and confirm that blueprint analysis of boosted buildings requires `BoostEnabled`.
|
||||
- Remove an upstream producer from a mixed production selection. Confirm that downstream capacity is unchanged and the missing material appears as required external supply. Add one producer more than downstream demand needs, and confirm that only that whole building's output is reported as excess.
|
||||
- In browser, copy, and paste inspectors, check the localized description-header entry and options, Spray Coater defaults and manual overrides, and native item tags in the generated description and `Power` field. Confirm options close after successful generation or inspector closure, the file grid stays usable, and native settings and description fields retain their positions. Generate twice and at the 20-field limit; verify that pending manual edits, unrelated fields, save/copy behavior, and ordinary blueprint sharing remain intact.
|
||||
- In browser, copy, and paste inspectors, check that the localized options follow their header entry when scrolling and use the available canvas space. Verify the native X, outside-click dismissal, and Escape priority, including an expanded dropdown and a native message box. Confirm both dropdown rows fit above the footer, options close after successful generation or inspector closure, and native settings and description fields retain their positions. Check Spray Coater defaults and manual overrides, generate twice and at the 20-field limit, and verify pending edits, unrelated fields, native item tags, and save/copy behavior.
|
||||
- Compare both production bases on an undersupplied chain, uneven recipe ratios, shared intermediate branches, and a joint-product chain. Final-product mode must retain rated final outputs and expose intermediate shortages. Bottleneck mode must scale final outputs together, update raw inputs to the same throughput, and leave no internal shortage for a complete, balanceable chain. Confirm unused intermediate capacity and necessary coproduct output remain distinct, and that power stays at the same full-load estimate. Test a chain without internal intermediates, missing building settings, and a cycle without a final outlet; an unavailable bottleneck basis must preserve existing description and fields.
|
||||
- Place one research-mode lab alongside one or all six matrix production chains. Confirm the matrices' positive net production appears only in the Research line, other final products stay in Output, and known in-blueprint matrix consumption reduces the Research rate. Do not fabricate lab matrix imports, excess, or an estimated lab consumption rate; change current technology, add more labs, and toggle proliferation to check matrix routing stays independent while full working power updates. Without the lab, normal matrix output and overbuild rules resume.
|
||||
- Combine planner targets with shared coproducts, explicit raw-material boundaries, and alternate selected recipes. Confirm material conservation, shared surplus reuse, and no introduction of unselected recipes.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "UXAssist",
|
||||
"version_number": "1.6.3",
|
||||
"version_number": "1.6.4",
|
||||
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist",
|
||||
"description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁",
|
||||
"dependencies": [
|
||||
|
||||
Reference in new issue
Block a user