1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-08 23:33:33 +08:00

UXAsisst 1.3.6

This commit is contained in:
2025-05-25 10:55:03 +08:00
parent b6c182168b
commit f7e1a27be1
8 changed files with 69 additions and 21 deletions

View File

@@ -3,6 +3,11 @@
## Changlog ## Changlog
* 1.3.6
+ `Dismantle blueprint selected buildings`:
- Fix a crash on dismantling preview buildings.
- Rename to `Shortcut keys for Blueprint Copy mode`, while adding a shortcut key to select all buildings (Ctrl+A by default).
+ `Allow overflow for Logistic Stations and Advanced Mining Machines`: Working for Logistics Control Panel now.
* 1.3.5 * 1.3.5
+ `Mod manager profile based save folder`: Fix crash on game startup + `Mod manager profile based save folder`: Fix crash on game startup
* 1.3.4 * 1.3.4
@@ -313,6 +318,11 @@
## 更新日志 ## 更新日志
* 1.3.6
+ `拆除蓝图选中的建筑`
- 修复了拆除虚影建筑时崩溃的问题
- 重命名为`蓝图复制模式快捷键`同时添加了选择所有建筑的快捷键默认为Ctrl+A
+ `允许物流站和大型采矿机物品溢出`:现在也适用于物流控制面板
* 1.3.5 * 1.3.5
+ `基于mod管理器配置档案的存档文件夹`:修复游戏启动时崩溃的问题 + `基于mod管理器配置档案的存档文件夹`:修复游戏启动时崩溃的问题
* 1.3.4 * 1.3.4

View File

@@ -86,6 +86,8 @@ public static class FactoryFunctions
var entityPool = factory.entityPool; var entityPool = factory.entityPool;
var stationPool = factory.transport.stationPool; var stationPool = factory.transport.stationPool;
foreach (var objId in buildPreviewsToRemove) foreach (var objId in buildPreviewsToRemove)
{
if (objId > 0)
{ {
int stationId = entityPool[objId].stationId; int stationId = entityPool[objId].stationId;
if (stationId > 0) if (stationId > 0)
@@ -100,6 +102,7 @@ public static class FactoryFunctions
sc.storage = new StationStore[sc.storage.Length]; sc.storage = new StationStore[sc.storage.Length];
sc.needs = new int[sc.needs.Length]; sc.needs = new int[sc.needs.Length];
} }
}
build.DoDismantleObject(objId); build.DoDismantleObject(objId);
} }
blueprintCopyTool.ClearSelection(); blueprintCopyTool.ClearSelection();
@@ -108,4 +111,21 @@ public static class FactoryFunctions
blueprintCopyTool.ResetBuildPreviews(); blueprintCopyTool.ResetBuildPreviews();
blueprintCopyTool.RefreshBlueprintData(); blueprintCopyTool.RefreshBlueprintData();
} }
public static void SelectAllBuildingsInBlueprintCopy()
{
var localFactory = GameMain.localPlanet?.factory;
if (localFactory == null) return;
var blueprintCopyTool = GameMain.mainPlayer?.controller?.actionBuild?.blueprintCopyTool;
if (blueprintCopyTool == null || !blueprintCopyTool.active) return;
var entityPool = localFactory.entityPool;
foreach (var entity in entityPool)
{
if (entity.id == 0) continue;
blueprintCopyTool.preSelectObjIds.Add(entity.id);
blueprintCopyTool.selectedObjIds.Add(entity.id);
}
blueprintCopyTool.RefreshBlueprintData();
blueprintCopyTool.DeterminePreviews();
}
} }

View File

@@ -41,12 +41,13 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
public static ConfigEntry<int> LabBufferExtraCountForAdvancedAssemble; public static ConfigEntry<int> LabBufferExtraCountForAdvancedAssemble;
public static ConfigEntry<int> LabBufferMaxCountForResearch; public static ConfigEntry<int> LabBufferMaxCountForResearch;
public static ConfigEntry<int> ReceiverBufferCount; public static ConfigEntry<int> ReceiverBufferCount;
public static ConfigEntry<bool> DismantleBlueprintSelectionEnabled; public static ConfigEntry<bool> ShortcutKeysForBlueprintCopyEnabled;
private static PressKeyBind _doNotRenderEntitiesKey; private static PressKeyBind _doNotRenderEntitiesKey;
private static PressKeyBind _offgridfForPathsKey; private static PressKeyBind _offgridfForPathsKey;
private static PressKeyBind _cutConveyorBeltKey; private static PressKeyBind _cutConveyorBeltKey;
private static PressKeyBind _dismantleBlueprintSelectionKey; private static PressKeyBind _dismantleBlueprintSelectionKey;
private static PressKeyBind _selectAllBuildingsInBlueprintCopyKey;
private static int _tankFastFillInAndTakeOutMultiplierRealValue = 2; private static int _tankFastFillInAndTakeOutMultiplierRealValue = 2;
@@ -88,6 +89,15 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
} }
); );
I18N.Add("KEYDismantleBlueprintSelection", "[UXA] Dismantle blueprint selected buildings", "[UXA] 拆除蓝图选中的建筑"); I18N.Add("KEYDismantleBlueprintSelection", "[UXA] Dismantle blueprint selected buildings", "[UXA] 拆除蓝图选中的建筑");
_selectAllBuildingsInBlueprintCopyKey = KeyBindings.RegisterKeyBinding(new BuiltinKey
{
key = new CombineKey((int)KeyCode.A, CombineKey.CTRL_COMB, ECombineKeyAction.OnceClick, false),
conflictGroup = KeyBindConflict.KEYBOARD_KEYBIND,
name = "SelectAllBuildingsInBlueprintCopy",
canOverride = true
}
);
I18N.Add("KEYSelectAllBuildingsInBlueprintCopy", "[UXA] Select all buildings in Blueprint Copy Mode", "[UXA] 蓝图复制时选择所有建筑");
BeltSignalsForBuyOut.InitPersist(); BeltSignalsForBuyOut.InitPersist();
ProtectVeinsFromExhaustion.InitConfig(); ProtectVeinsFromExhaustion.InitConfig();
@@ -182,8 +192,13 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
Functions.FactoryFunctions.CutConveyorBelt(cargoTraffic, beltId); Functions.FactoryFunctions.CutConveyorBelt(cargoTraffic, beltId);
} }
} }
if (DismantleBlueprintSelectionEnabled.Value && _dismantleBlueprintSelectionKey.keyValue) if (ShortcutKeysForBlueprintCopyEnabled.Value)
{
if (_dismantleBlueprintSelectionKey.keyValue)
Functions.FactoryFunctions.DismantleBlueprintSelectedBuildings(); Functions.FactoryFunctions.DismantleBlueprintSelectedBuildings();
if (_selectAllBuildingsInBlueprintCopyKey.keyValue)
Functions.FactoryFunctions.SelectAllBuildingsInBlueprintCopy();
}
} }
public static void Export(BinaryWriter w) public static void Export(BinaryWriter w)

View File

@@ -466,10 +466,11 @@ public static class LogisticsPatch
private class AllowOverflowInLogistics : PatchImpl<AllowOverflowInLogistics> private class AllowOverflowInLogistics : PatchImpl<AllowOverflowInLogistics>
{ {
private static bool _bludprintPasting; private static bool _blueprintPasting;
// Do not check for overflow when try to send hand items into storages // Do not check for overflow when try to send hand items into storages
[HarmonyTranspiler] [HarmonyTranspiler]
[HarmonyPatch(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.OnItemIconMouseDown))]
[HarmonyPatch(typeof(UIStationStorage), nameof(UIStationStorage.OnItemIconMouseDown))] [HarmonyPatch(typeof(UIStationStorage), nameof(UIStationStorage.OnItemIconMouseDown))]
private static IEnumerable<CodeInstruction> UIStationStorage_OnItemIconMouseDown_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator) private static IEnumerable<CodeInstruction> UIStationStorage_OnItemIconMouseDown_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
{ {
@@ -516,7 +517,7 @@ public static class LogisticsPatch
var oldLabels = matcher.Labels; var oldLabels = matcher.Labels;
matcher.Labels = []; matcher.Labels = [];
matcher.InsertAndAdvance( matcher.InsertAndAdvance(
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(AllowOverflowInLogistics), nameof(_bludprintPasting))).WithLabels(oldLabels), new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(AllowOverflowInLogistics), nameof(_blueprintPasting))).WithLabels(oldLabels),
new CodeInstruction(OpCodes.Brfalse, label) new CodeInstruction(OpCodes.Brfalse, label)
); );
matcher.Advance(9).Labels.Add(label); matcher.Advance(9).Labels.Add(label);
@@ -527,14 +528,14 @@ public static class LogisticsPatch
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CreatePrebuilds))] [HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CreatePrebuilds))]
private static void BuildTool_BlueprintPaste_CreatePrebuilds_Prefix() private static void BuildTool_BlueprintPaste_CreatePrebuilds_Prefix()
{ {
_bludprintPasting = true; _blueprintPasting = true;
} }
[HarmonyPostfix] [HarmonyPostfix]
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CreatePrebuilds))] [HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CreatePrebuilds))]
private static void BuildTool_BlueprintPaste_CreatePrebuilds_Postfix() private static void BuildTool_BlueprintPaste_CreatePrebuilds_Postfix()
{ {
_bludprintPasting = false; _blueprintPasting = false;
} }
} }

View File

@@ -121,7 +121,8 @@ public static class UIConfigWindow
I18N.Add("Extra buffer count for Self-evolution Labs", "Extra buffer count for Self-evolution Labs", "自演化研究站矩阵额外缓冲数量"); I18N.Add("Extra buffer count for Self-evolution Labs", "Extra buffer count for Self-evolution Labs", "自演化研究站矩阵额外缓冲数量");
I18N.Add("Buffer count for researching in labs", "Buffer count for researching in labs", "研究站科研模式缓存数量"); I18N.Add("Buffer count for researching in labs", "Buffer count for researching in labs", "研究站科研模式缓存数量");
I18N.Add("Ray Receiver Graviton Lens buffer count", "Ray Receiver Graviton Lens buffer count", "射线接收器透镜缓冲数量"); I18N.Add("Ray Receiver Graviton Lens buffer count", "Ray Receiver Graviton Lens buffer count", "射线接收器透镜缓冲数量");
I18N.Add("Dismantle blueprint selected buildings", "Dismantle blueprint selected buildings", "拆除蓝图选中的建筑"); I18N.Add("Shortcut keys for Blueprint Copy mode", "Shortcut keys for Blueprint Copy mode", "蓝图复制模式快捷键");
I18N.Add("Shortcut keys for Blueprint Copy mode tips", "You can set 2 shortcut keys in Settings panel:\n 1. Select all buildings\n 2. Dismantle selected buildings", "你可以在设置面板中设置2个快捷键\n 1. 选择所有建筑\n 2. 拆除选中的建筑");
I18N.Add("Shortcut keys for showing stars' name", "Shortcut keys for showing stars' name", "启用显示所有星系名称的快捷键"); I18N.Add("Shortcut keys for showing stars' name", "Shortcut keys for showing stars' name", "启用显示所有星系名称的快捷键");
I18N.Add("Auto navigation on sailings", "Auto navigation on sailings", "宇宙航行时自动导航"); I18N.Add("Auto navigation on sailings", "Auto navigation on sailings", "宇宙航行时自动导航");
I18N.Add("Enable auto-cruise", "Enable auto-cruise", "启用自动巡航"); I18N.Add("Enable auto-cruise", "Enable auto-cruise", "启用自动巡航");
@@ -406,7 +407,8 @@ public static class UIConfigWindow
y += 36f; y += 36f;
wnd.AddCheckBox(x, y, tab2, FactoryPatch.DoNotRenderEntitiesEnabled, "Do not render factory entities"); wnd.AddCheckBox(x, y, tab2, FactoryPatch.DoNotRenderEntitiesEnabled, "Do not render factory entities");
y += 36f; y += 36f;
wnd.AddCheckBox(x, y, tab2, FactoryPatch.DismantleBlueprintSelectionEnabled, "Dismantle blueprint selected buildings"); checkBoxForMeasureTextWidth = wnd.AddCheckBox(x, y, tab2, FactoryPatch.ShortcutKeysForBlueprintCopyEnabled, "Shortcut keys for Blueprint Copy mode");
wnd.AddTipsButton2(x + checkBoxForMeasureTextWidth.Width + 5f, y + 6f, tab2, "Shortcut keys for Blueprint Copy mode", "Shortcut keys for Blueprint Copy mode tips", "shortcut-keys-for-blueprint-copy-mode-tips");
y += 36f; y += 36f;
wnd.AddCheckBox(x, y, tab2, FactoryPatch.BeltSignalsForBuyOutEnabled, "Belt signals for buy out dark fog items automatically"); wnd.AddCheckBox(x, y, tab2, FactoryPatch.BeltSignalsForBuyOutEnabled, "Belt signals for buy out dark fog items automatically");

View File

@@ -134,7 +134,7 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
FactoryPatch.LabBufferExtraCountForAdvancedAssemble = Config.Bind("Factory", "LabBufferExtraCountForAdvancedAssemble", 3, new ConfigDescription("Extra buffer count for Self-evolution Labs", new AcceptableValueRange<int>(1, 10))); FactoryPatch.LabBufferExtraCountForAdvancedAssemble = Config.Bind("Factory", "LabBufferExtraCountForAdvancedAssemble", 3, new ConfigDescription("Extra buffer count for Self-evolution Labs", new AcceptableValueRange<int>(1, 10)));
FactoryPatch.LabBufferMaxCountForResearch = Config.Bind("Factory", "LabBufferMaxCountForResearch", 10, new ConfigDescription("Buffer count for researching in labs", new AcceptableValueRange<int>(2, 20))); FactoryPatch.LabBufferMaxCountForResearch = Config.Bind("Factory", "LabBufferMaxCountForResearch", 10, new ConfigDescription("Buffer count for researching in labs", new AcceptableValueRange<int>(2, 20)));
FactoryPatch.ReceiverBufferCount = Config.Bind("Factory", "ReceiverBufferCount", 1, new ConfigDescription("Ray Receiver Graviton Lens buffer count", new AcceptableValueRange<int>(1, 20))); FactoryPatch.ReceiverBufferCount = Config.Bind("Factory", "ReceiverBufferCount", 1, new ConfigDescription("Ray Receiver Graviton Lens buffer count", new AcceptableValueRange<int>(1, 20)));
FactoryPatch.DismantleBlueprintSelectionEnabled = Config.Bind("Factory", "DismantleBlueprintSelection", false, FactoryPatch.ShortcutKeysForBlueprintCopyEnabled = Config.Bind("Factory", "DismantleBlueprintSelection", false,
"Dismantle blueprint selected buildings"); "Dismantle blueprint selected buildings");
LogisticsPatch.AutoConfigLogisticsEnabled = Config.Bind("Factory", "AutoConfigLogistics", false, LogisticsPatch.AutoConfigLogisticsEnabled = Config.Bind("Factory", "AutoConfigLogistics", false,
"Auto-config logistic stations"); "Auto-config logistic stations");

View File

@@ -4,7 +4,7 @@
<TargetFramework>net472</TargetFramework> <TargetFramework>net472</TargetFramework>
<BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid> <BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid>
<Description>DSP MOD - UXAssist</Description> <Description>DSP MOD - UXAssist</Description>
<Version>1.3.5</Version> <Version>1.3.6</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<PackageId>UXAssist</PackageId> <PackageId>UXAssist</PackageId>

View File

@@ -1,6 +1,6 @@
{ {
"name": "UXAssist", "name": "UXAssist",
"version_number": "1.3.5", "version_number": "1.3.6",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist",
"description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁", "description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁",
"dependencies": [ "dependencies": [