Compare commits

3 Commits
Author SHA1 Message Date
soarqin 4ed33b2638 chore: ignore agent worktrees 2026-06-23 01:42:19 +08:00
soarqin ee7ea6ec35 fix: config ui 2026-06-22 23:01:31 +08:00
soarqin 64f9aee06b fix: logistic storage overflow reset when switching stations in panel 2026-06-20 15:22:05 +08:00
3 changed files with 34 additions and 3 deletions
+1
View File
@@ -23,3 +23,4 @@ build/
# Agent files
/.omo/
/.worktrees/
+32 -2
View File
@@ -487,6 +487,8 @@ public static class LogisticsPatch
private static long _nextKeyTick;
private static bool _skipNextUIStationStorageEvent;
private static bool _skipNextUIControlPanelStationStorageEvent;
private static bool _refreshingUIStationStorage;
private static bool _refreshingUIControlPanelStationStorage;
private static bool UpdateKeyPressed(KeyCode code)
{
@@ -627,11 +629,39 @@ public static class LogisticsPatch
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(UIStationStorage), "RefreshValues")]
private static void UIStationStorage_RefreshValues_Prefix()
{
_refreshingUIStationStorage = true;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(UIStationStorage), "RefreshValues")]
private static void UIStationStorage_RefreshValues_Postfix()
{
_refreshingUIStationStorage = false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(UIControlPanelStationStorage), "RefreshValues")]
private static void UIControlPanelStationStorage_RefreshValues_Prefix()
{
_refreshingUIControlPanelStationStorage = true;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(UIControlPanelStationStorage), "RefreshValues")]
private static void UIControlPanelStationStorage_RefreshValues_Postfix()
{
_refreshingUIControlPanelStationStorage = false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(UIStationStorage), nameof(UIStationStorage.OnMaxSliderValueChange))]
private static bool UIStationStorage_OnMaxSliderValueChange_Prefix()
{
if (!_skipNextUIStationStorageEvent) return true;
if (!_refreshingUIStationStorage && !_skipNextUIStationStorageEvent) return true;
_skipNextUIStationStorageEvent = false;
return false;
}
@@ -640,7 +670,7 @@ public static class LogisticsPatch
[HarmonyPatch(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.OnMaxSliderValueChange))]
private static bool UIControlPanelStationStorage_OnMaxSliderValueChange_Prefix()
{
if (!_skipNextUIControlPanelStationStorageEvent) return true;
if (!_refreshingUIControlPanelStationStorage && !_skipNextUIControlPanelStationStorageEvent) return true;
_skipNextUIControlPanelStationStorageEvent = false;
return false;
}
+1 -1
View File
@@ -537,7 +537,7 @@ public static class UIConfigWindow
y += 36f;
wnd.AddCheckBox(x, y, tab3, LogisticsPatch.AllowOverflowInLogisticsEnabled, "Allow overflow for Logistic Stations and Advanced Mining Machines");
y += 30f;
wnd.AddCheckBox(x, y, tab2, LogisticsPatch.GreaterPowerUsageInLogisticsEnabled, "Increase maximum power usage in Logistic Stations and Advanced Mining Machines");
wnd.AddCheckBox(x, y, tab3, LogisticsPatch.GreaterPowerUsageInLogisticsEnabled, "Increase maximum power usage in Logistic Stations and Advanced Mining Machines");
y += 36f;
checkBoxForMeasureTextWidth = wnd.AddCheckBox(x, y, tab3, LogisticsPatch.LogisticsConstrolPanelImprovementEnabled, "Logistics Control Panel Improvement");
wnd.AddTipsButton2(x + checkBoxForMeasureTextWidth.Width + 5f, y + 6f, tab3, "Logistics Control Panel Improvement", "Logistics Control Panel Improvement tips", "lcp-improvement-tips");