1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 04:13:32 +08:00

UXAssist v1.0.8

This commit is contained in:
2023-12-22 03:35:56 +08:00
parent 51af7592e8
commit 27f62ee11a
3 changed files with 35 additions and 27 deletions

View File

@@ -689,6 +689,7 @@ public static class FactoryPatch
private static KeyCode _lastKey = KeyCode.None;
private static long _nextKeyTick;
private static bool _skipNextEvent;
private static bool UpdateKeyPressed(KeyCode code)
{
@@ -706,6 +707,7 @@ public static class FactoryPatch
_nextKeyTick = currTick + 4;
return true;
}
public static void OnUpdate()
{
if (_lastKey != KeyCode.None && Input.GetKeyUp(_lastKey))
@@ -742,49 +744,41 @@ public static class FactoryPatch
if (stationStorage is null) continue;
var station = stationStorage.station;
ref var storage = ref station.storage[stationStorage.index];
var modelProto = LDB.models.Select(stationStorage.stationWindow.factory.entityPool[station.entityId].modelIndex);
var newMax = storage.max + delta;
var oldMax = storage.max;
var newMax = oldMax + delta;
if (newMax < 0)
{
newMax = 0;
}
else
{
var modelProto = LDB.models.Select(stationStorage.stationWindow.factory.entityPool[station.entityId].modelIndex);
var itemCountMax = 0;
if (modelProto != null)
{
itemCountMax = modelProto.prefabDesc.stationMaxItemCount;
}
int extraMax;
if (station.isCollector)
itemCountMax += station.isStellar ? GameMain.history.remoteStationExtraStorage : GameMain.history.localStationExtraStorage;
if (newMax > itemCountMax)
{
extraMax = GameMain.history.localStationExtraStorage;
}
else if (station.isVeinCollector)
{
extraMax = GameMain.history.localStationExtraStorage;
}
else if (station.isStellar)
{
extraMax = GameMain.history.remoteStationExtraStorage;
}
else
{
extraMax = GameMain.history.localStationExtraStorage;
}
if (newMax > itemCountMax + extraMax)
{
newMax = itemCountMax + extraMax;
newMax = itemCountMax;
}
}
UXAssist.Logger.LogInfo($"Set storage[{stationStorage.index}].max from {storage.max} to {newMax}");
storage.max = newMax;
_skipNextEvent = oldMax / 100 != newMax / 100;
break;
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(UIStationStorage), nameof(UIStationStorage.OnMaxSliderValueChange))]
private static bool UIStationStorage_OnMaxSliderValueChange_Prefix()
{
if (!_skipNextEvent) return true;
_skipNextEvent = false;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(PlanetTransport), nameof(PlanetTransport.OnTechFunctionUnlocked))]
private static bool PlanetTransport_OnTechFunctionUnlocked_Prefix(PlanetTransport __instance, int _funcId, double _valuelf, int _level)

View File

@@ -5,7 +5,7 @@
## Changlog
* 1.0.8
+ New function: logistic storage limits are not scaled on upgrading `Logistics Carrier Capacity`, if they are not set to maximum capacity.
+ New function: `Enhanced control for logistic storage limits`
* 1.0.7
+ Fix a crash issue on choosing language other than English and Chinese
+ Games saved in Peace-Mode after Dark-Forg update can also be loaded as Combat-Mode now.
@@ -56,6 +56,9 @@
- Larger area for upgrade and dismantle(30x30 at max)
- Larger area for terraform(30x30 at max)
- Enable player actions in globe view
- Enhanced control for logistic storage limits
- Logistic storage limits are not scaled on upgrading `Logistics Carrier Capacity`, if they are not set to maximum capacity.
- You can use arrow keys to adjust logistic storage limits gracefully.
- Enhanced count control for hand-make
- Re-intialize planet (without reseting veins)
- Quick dismantle all buildings (without drops)
@@ -79,7 +82,7 @@
## 更新日志
* 1.0.8
+ 新功能:当升级`运输机舱扩容`时,不会对各种物流塔存储限制按比例提升,除非设置为最大允许容量。
+ 新功能:`物流塔存储数量限制控制改进`
* 1.0.7
+ 修复了选择英文和中文以外的语言时的崩溃问题
+ 黑雾更新后使用和平模式保存的存档现在也可以转换为战斗模式了
@@ -130,6 +133,9 @@
- 范围升级和拆除的最大区域扩大(最大30x30)
- 范围铺设地基的最大区域扩大(最大30x30)
- 在行星视图中允许玩家操作
- 物流塔存储数量限制控制改进
- 当升级`运输机舱扩容`时,不会对各种物流塔的存储限制按比例提升,除非设置为最大允许容量。
- 你可以使用方向键微调物流塔存储限制
- 手动制造物品的数量控制改进
- 初始化本行星(不重置矿脉)
- 快速拆除所有建筑(不掉落)

View File

@@ -27,6 +27,8 @@ public static class UIConfigWindow
I18N.Add("Larger area for terraform", "Larger area for terraform", "范围铺设地基的最大区域扩大");
I18N.Add("Off-grid building and stepped rotation", "Off-grid building and stepped rotation (Hold Shift)", "脱离网格建造以及小角度旋转(按住Shift)");
I18N.Add("Enable player actions in globe view", "Enable player actions in globe view", "在行星视图中允许玩家操作");
I18N.Add("Enhance control for logistic storage limits", "Enhance control for logistic storage limits", "物流塔存储限制控制改进");
I18N.Add("Enhance control for logistic storage limits tips", "Logistic storage limits are not scaled on upgrading 'Logistics Carrier Capacity', if they are not set to maximum capacity.\nUse arrow keys to adjust logistic storage limits:\n \u2190/\u2192: -/+10 \u2193\u2191: -/+100", "当升级'运输机舱扩容'时,不会对各种物流塔的存储限制按比例提升,除非设置为最大允许容量。\n你可以使用方向键微调物流塔存储限制\n \u2190\u2192: -/+10 \u2193\u2191: -/+100");
I18N.Add("Enhanced count control for hand-make", "Enhanced count control for hand-make", "手动制造物品的数量控制改进");
I18N.Add("Enhanced count control for hand-make tips", "Maximum count is increased to 1000.\nHold Ctrl/Shift/Alt to change the count rapidly.", "最大数量提升至1000\n按住Ctrl/Shift/Alt可快速改变数量");
I18N.Add("Initialize This Planet", "Initialize this planet", "初始化本行星");
@@ -82,8 +84,14 @@ public static class UIConfigWindow
y += 36f;
MyCheckBox.CreateCheckBox(x, y, tab2, PlanetPatch.PlayerActionsInGlobeViewEnabled, "Enable player actions in globe view");
y += 36f;
MyCheckBox.CreateCheckBox(x, y, tab2, FactoryPatch.LogisticsCapacityTweaksEnabled, "Enhance control for logistic storage limits");
x = 270f;
y += 6f;
MyWindow.AddTipsButton(x, y, tab2, "Enhance control for logistic storage limits", "Enhance control for logistic storage limits tips", "enhanced-logistic-limit-tips");
x = 0f;
y += 30f;
MyCheckBox.CreateCheckBox(x, y, tab2, PlayerPatch.EnhancedMechaForgeCountControlEnabled, "Enhanced count control for hand-make");
x = 240f;
x = 270f;
y += 6f;
MyWindow.AddTipsButton(x, y, tab2, "Enhanced count control for hand-make", "Enhanced count control for hand-make tips", "enhanced-count-control-tips");
x = 400f;