mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-02-04 17:02:17 +08:00
UXAssist and CheatEnabler release
This commit is contained in:
@@ -21,6 +21,7 @@ public static class FactoryPatch
|
||||
public static ConfigEntry<bool> TreatStackingAsSingleEnabled;
|
||||
public static ConfigEntry<bool> QuickBuildAndDismantleLabsEnabled;
|
||||
public static ConfigEntry<bool> ProtectVeinsFromExhaustionEnabled;
|
||||
public static ConfigEntry<bool> DoNotRenderEntitiesEnabled;
|
||||
|
||||
private static Harmony _factoryPatch;
|
||||
|
||||
@@ -37,6 +38,7 @@ public static class FactoryPatch
|
||||
TreatStackingAsSingleEnabled.SettingChanged += (_, _) => TreatStackingAsSingle.Enable(TreatStackingAsSingleEnabled.Value);
|
||||
QuickBuildAndDismantleLabsEnabled.SettingChanged += (_, _) => QuickBuildAndDismantleLab.Enable(QuickBuildAndDismantleLabsEnabled.Value);
|
||||
ProtectVeinsFromExhaustionEnabled.SettingChanged += (_, _) => ProtectVeinsFromExhaustion.Enable(ProtectVeinsFromExhaustionEnabled.Value);
|
||||
DoNotRenderEntitiesEnabled.SettingChanged += (_, _) => DoNotRenderEntities.Enable(DoNotRenderEntitiesEnabled.Value);
|
||||
UnlimitInteractive.Enable(UnlimitInteractiveEnabled.Value);
|
||||
RemoveSomeConditionBuild.Enable(RemoveSomeConditionEnabled.Value);
|
||||
NightLight.Enable(NightLightEnabled.Value);
|
||||
@@ -48,6 +50,7 @@ public static class FactoryPatch
|
||||
TreatStackingAsSingle.Enable(TreatStackingAsSingleEnabled.Value);
|
||||
QuickBuildAndDismantleLab.Enable(QuickBuildAndDismantleLabsEnabled.Value);
|
||||
ProtectVeinsFromExhaustion.Enable(ProtectVeinsFromExhaustionEnabled.Value);
|
||||
DoNotRenderEntities.Enable(DoNotRenderEntitiesEnabled.Value);
|
||||
|
||||
_factoryPatch ??= Harmony.CreateAndPatchAll(typeof(FactoryPatch));
|
||||
}
|
||||
@@ -65,6 +68,7 @@ public static class FactoryPatch
|
||||
TreatStackingAsSingle.Enable(false);
|
||||
QuickBuildAndDismantleLab.Enable(false);
|
||||
ProtectVeinsFromExhaustion.Enable(false);
|
||||
DoNotRenderEntities.Enable(false);
|
||||
|
||||
_factoryPatch?.UnpatchSelf();
|
||||
_factoryPatch = null;
|
||||
@@ -739,7 +743,8 @@ public static class FactoryPatch
|
||||
var jmp0 = generator.DefineLabel();
|
||||
var jmp1 = generator.DefineLabel();
|
||||
matcher.InsertAndAdvance(
|
||||
new CodeInstruction(OpCodes.Call, AccessTools.PropertyGetter(typeof(VFInput), nameof(VFInput._ignoreGrid))),
|
||||
new CodeInstruction(OpCodes.Call, AccessTools.PropertyGetter(typeof(VFInput), nameof(VFInput._switchModelStyle))),
|
||||
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(VFInput.InputValue), nameof(VFInput.InputValue.pressing))),
|
||||
new CodeInstruction(OpCodes.Brfalse, jmp0),
|
||||
new CodeInstruction(OpCodes.Ldarg_0),
|
||||
new CodeInstruction(OpCodes.Ldarg_0),
|
||||
@@ -1462,4 +1467,62 @@ public static class FactoryPatch
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static class DoNotRenderEntities
|
||||
{
|
||||
private static Harmony _patch;
|
||||
|
||||
public static void Enable(bool enable)
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
_patch ??= Harmony.CreateAndPatchAll(typeof(DoNotRenderEntities));
|
||||
return;
|
||||
}
|
||||
|
||||
_patch?.UnpatchSelf();
|
||||
_patch = null;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ObjectRenderer), nameof(ObjectRenderer.Render))]
|
||||
[HarmonyPatch(typeof(DynamicRenderer), nameof(DynamicRenderer.Render))]
|
||||
private static bool ObjectRenderer_Render_Prefix(GPUInstancingManager __instance)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(GPUInstancingManager), nameof(GPUInstancingManager.Render))]
|
||||
private static void FactoryModel_DrawInstancedBatches_Postfix(GPUInstancingManager __instance)
|
||||
{
|
||||
__instance.renderEntity = true;
|
||||
}
|
||||
|
||||
[HarmonyTranspiler]
|
||||
[HarmonyPatch(typeof(RaycastLogic), nameof(RaycastLogic.GameTick))]
|
||||
private static IEnumerable<CodeInstruction> RaycastLogic_GameTick_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
|
||||
{
|
||||
var matcher = new CodeMatcher(instructions, generator);
|
||||
matcher.MatchForward(false,
|
||||
new CodeMatch(OpCodes.Ldc_I4_0),
|
||||
new CodeMatch(OpCodes.Brtrue));
|
||||
var branch1 = (Label)matcher.Advance(1).Operand;
|
||||
matcher.Start().MatchForward(false,
|
||||
new CodeMatch(OpCodes.Call),
|
||||
new CodeMatch(ci => ci.IsStloc()),
|
||||
new CodeMatch(OpCodes.Call),
|
||||
new CodeMatch(ci => ci.IsStloc()),
|
||||
new CodeMatch(OpCodes.Call),
|
||||
new CodeMatch(ci => ci.IsStloc()),
|
||||
new CodeMatch(ci => ci.IsLdloc()),
|
||||
new CodeMatch(ci => ci.Branches(out _)),
|
||||
new CodeMatch(OpCodes.Ldarg_0)
|
||||
).Advance(8).Insert(
|
||||
new CodeInstruction(OpCodes.Ldloc_S, 45),
|
||||
new CodeInstruction(OpCodes.Brfalse, branch1)
|
||||
);
|
||||
return matcher.InstructionEnumeration();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ public static class PlayerPatch
|
||||
public static ConfigEntry<bool> HideTipsForSandsChangesEnabled;
|
||||
public static ConfigEntry<bool> AutoNavigationEnabled;
|
||||
public static ConfigEntry<bool> AutoCruiseEnabled;
|
||||
public static ConfigEntry<bool> AutoBoostEnabled;
|
||||
public static ConfigEntry<double> DistanceToWarp;
|
||||
private static PressKeyBind _autoDriveKey;
|
||||
|
||||
@@ -237,13 +238,14 @@ public static class PlayerPatch
|
||||
}
|
||||
return;
|
||||
}
|
||||
var autoCruise = AutoCruiseEnabled.Value;
|
||||
if (GameMain.instance.timei % 6 == 0 || _direction == Vector3.zero)
|
||||
{
|
||||
_direction = astroVec.normalized;
|
||||
|
||||
/* Check nearest astroes, try to bypass them */
|
||||
var localStar = GameMain.localStar;
|
||||
_canUseWarper = AutoCruiseEnabled.Value && !player.warping && player.mecha.warpStorage.GetItemCount(1210) > 0;
|
||||
_canUseWarper = autoCruise && !player.warping && player.mecha.warpStorage.GetItemCount(1210) > 0;
|
||||
if (localStar != null)
|
||||
{
|
||||
var nearestRange = (playerPos - localStar.uPosition).sqrMagnitude;
|
||||
@@ -304,7 +306,7 @@ public static class PlayerPatch
|
||||
if (player.warping)
|
||||
{
|
||||
_speedUp = false;
|
||||
if (AutoCruiseEnabled.Value)
|
||||
if (autoCruise)
|
||||
{
|
||||
/* Speed down if too close */
|
||||
var actionSail = controller.actionSail;
|
||||
@@ -327,7 +329,7 @@ public static class PlayerPatch
|
||||
{
|
||||
var mecha = player.mecha;
|
||||
var energyRatio = mecha.coreEnergy / mecha.coreEnergyCap;
|
||||
if (_canUseWarper && GameMain.localPlanet == null && distance > GalaxyData.AU * DistanceToWarp.Value && energyRatio >= 0.5 && player.mecha.UseWarper())
|
||||
if (_canUseWarper && GameMain.localPlanet == null && distance > GalaxyData.AU * DistanceToWarp.Value && energyRatio >= 0.8 && player.mecha.UseWarper())
|
||||
{
|
||||
player.warpCommand = true;
|
||||
VFAudio.Create("warp-begin", player.transform, Vector3.zero, true);
|
||||
@@ -335,7 +337,7 @@ public static class PlayerPatch
|
||||
else
|
||||
{
|
||||
/* Speed up if needed */
|
||||
_speedUp = speed + 0.2f < player.mecha.maxSailSpeed && energyRatio >= 0.1;
|
||||
_speedUp = autoCruise && AutoBoostEnabled.Value && speed + 0.2f < player.mecha.maxSailSpeed && energyRatio >= 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,19 @@
|
||||
#### 一些提升用户体验的功能和补丁
|
||||
|
||||
## Changlog
|
||||
* 1.0.23
|
||||
+ New features:
|
||||
- `Do not render factory entities (except belts and sorters)`
|
||||
- This also makes players click though factory entities but belts
|
||||
- `Open Dark Fog Communicator` anywhere
|
||||
+ Belts can be built off-grid now, by pressing the shortcut key for `Switch Splitter model`(`Tab` by default)
|
||||
+ Add a suboption `Auto boost` to `Auto-cruise`
|
||||
+ `Auto-cruise` does warp when core energy at least 80% now
|
||||
* 1.0.22
|
||||
+ Fix a crash issue caused by `Quick build and dismantle stacking labs`
|
||||
* 1.0.21
|
||||
+ Fix a bug that stepped rotation is not working in `Off-grid building and stepped rotation`, which is caused by latest game update
|
||||
+ Fix some issues in `Auto nativation` and `Auto-cruise`, now only speeds up when core energy at least 10% and warps when core energy at least 50%
|
||||
+ Fix some issues in `Auto nativation` and `Auto-cruise`, now only boosts when core energy at least 10% and warps when core energy at least 50%
|
||||
* 1.0.20
|
||||
+ Fix a infinite-loop issue when `Quick build and dismantle stacking labs` and `No condition build` are both enabled
|
||||
+ Fix a crash caused by `Re-initialize planet` in combat mode
|
||||
@@ -109,15 +117,30 @@
|
||||
- Remember window position and size on last exit
|
||||
- Convert Peace-Mode saves to Combat-Mode on loading
|
||||
+ Planet/Factory
|
||||
- Unlimited interactive range
|
||||
- Sunlight at night
|
||||
- Remove some build conditions
|
||||
- Remove build count and range limit
|
||||
- Larger area for upgrade and dismantle(30x30 at max)
|
||||
- Larger area for terraform(30x30 at max)
|
||||
- Enable player actions in globe view
|
||||
- Treat stack items as single in monitor components
|
||||
- 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.
|
||||
- Quick build and dismantle stacking labs
|
||||
- Protect veins from exhaustion
|
||||
- By default, the vein amount is protected at 100, and oil speed is protected at 1.0/s, you can set them yourself in config file.
|
||||
- When reach the protection value, veins/oils steeps will not be mined/extracted any longer.
|
||||
- Close this function to resume mining and pumping, usually when you have enough level on `Veins Utilization`
|
||||
- Do not render factory entities (except belts and sorters)
|
||||
- This also makes players click though factory entities but belts
|
||||
- Re-intialize planet (without reseting veins)
|
||||
- Quick dismantle all buildings (without drops)
|
||||
- Quick build Orbital Collectors
|
||||
+ Player/Mecha
|
||||
- Unlimited interactive range
|
||||
- Enable player actions in globe view
|
||||
- Hide tips for soil piles changes
|
||||
- Enhanced count control for hand-make
|
||||
- Auto navigation on sailings
|
||||
- It keeps Icarus on course to the target planet
|
||||
- It will try to bypass any obstacles(planets, stars or dark-fog hives) on the way
|
||||
@@ -125,23 +148,13 @@
|
||||
- Auto-cruise will start when you select a planet as target
|
||||
- It will use warper to fly to the target planet if the planet is too far away, the range can be configured.
|
||||
- It will speed down when approaching the target planet, to avoid overshooting
|
||||
- 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
|
||||
- Quick build and dismantle stacking labs
|
||||
- Protect veins from exhaustion
|
||||
- By default, the vein amount is protected at 100, and oil speed is protected at 1.0/s, you can set them yourself in config file.
|
||||
- When reach the protection value, veins/oils steeps will not be mined/extracted any longer.
|
||||
- Close this function to resume mining and pumping, usually when you have enough level on `Veins Utilization`
|
||||
- Re-intialize planet (without reseting veins)
|
||||
- Quick dismantle all buildings (without drops)
|
||||
- Quick build Orbital Collectors
|
||||
+ Dyson Sphere
|
||||
- Stop ejectors when available nodes are all filled up
|
||||
- Construct only nodes but frames
|
||||
- Re-initialize Dyson Spheres
|
||||
- Quick dismantle Dyson Shells
|
||||
+ Combat
|
||||
- Open Dark Fog Communicator anywhere
|
||||
|
||||
## Notes
|
||||
* Please upgrade `BepInEx` 5.4.21 or later if using with [BlueprintTweaks](https://dsp.thunderstore.io/package/kremnev8/BlueprintTweaks/) to avoid possible conflicts.
|
||||
@@ -156,6 +169,14 @@
|
||||
* [CruiseAssist](https://dsp.thunderstore.io/package/tanu/CruiseAssist/) and its extension [AutoPilot](https://dsp.thunderstore.io/package/tanu/AutoPilot/): `Auto navigation on sailings` and `Auto-cruise` implementations
|
||||
|
||||
## 更新日志
|
||||
* 1.0.23
|
||||
+ 新功能:
|
||||
- `不渲染工厂建筑实体(除了传送带和分拣器)`
|
||||
- 这使得玩家可以点穿工厂实体直接点到传送带
|
||||
- 在任意位置`打开黑雾通讯器`
|
||||
+ 传送带现在可以脱离网格建造了,通过按住`切换分流器样式`的快捷键(默认`Tab`)
|
||||
+ 为`自动巡航`添加一个子选项`自动加速`
|
||||
+ `自动巡航`现在在核心能量至少80%时才加速
|
||||
* 1.0.22
|
||||
+ 修复了`快速建造和拆除堆叠研究站`导致的崩溃问题
|
||||
* 1.0.21
|
||||
@@ -168,7 +189,7 @@
|
||||
+ 新功能:
|
||||
- `快速建造和拆除堆叠研究站`
|
||||
- `保护矿脉不会耗尽`
|
||||
- 默认矿脉数量保护在100,采油速保护在1.0/s,你可以在配置文件中自行设置。
|
||||
- 默认矿脉数量保护于剩余100,采油速保护于速度1.0/s,你可以在配置文件中自行设置。
|
||||
- 当达到保护值时,矿脉和油井将不再被开采。
|
||||
- 关闭此功能以恢复开采,一般是当你在`矿物利用`上有足够的等级时。
|
||||
+ 移除了`自动巡航`的默认快捷键,以避免误操作。如有需要请手动在系统选项窗口中设置。
|
||||
@@ -263,15 +284,29 @@
|
||||
- 将元数据提取的最大数量增加到20000(原来为2000)
|
||||
- 将玩家指令队列的容量增加到128(原来为16)
|
||||
+ 行星/工厂
|
||||
- 无限交互距离
|
||||
- 夜间日光灯
|
||||
- 移除部分不影响游戏逻辑的建造条件
|
||||
- 移除建造数量和范围限制
|
||||
- 范围升级和拆除的最大区域扩大(最大30x30)
|
||||
- 范围铺设地基的最大区域扩大(最大30x30)
|
||||
- 在行星视图中允许玩家操作
|
||||
- 在流速计中将堆叠物品视为单个物品
|
||||
- 物流塔存储数量限制控制改进
|
||||
- 当升级`运输机舱扩容`时,不会对各种物流塔的存储限制按比例提升,除非设置为最大允许容量。
|
||||
- 你可以使用方向键微调物流塔存储限制
|
||||
- 快速建造和拆除堆叠研究站
|
||||
- 保护矿脉不会耗尽
|
||||
- 默认矿脉数量保护在100,采油速保护在1.0/s,你可以在配置文件中自行设置。
|
||||
- 当达到保护值时,矿脉和油井将不再被开采。
|
||||
- 关闭此功能以恢复开采,一般是当你在`矿物利用`上有足够的等级时。
|
||||
- 不渲染工厂建筑实体(除了传送带和分拣器)
|
||||
- 初始化本行星(不重置矿脉)
|
||||
- 快速拆除所有建筑(不掉落)
|
||||
- 快速建造轨道采集器
|
||||
+ 玩家/机甲
|
||||
- 无限交互距离
|
||||
- 移除建造数量和范围限制
|
||||
- 在行星视图中允许玩家操作
|
||||
- 隐藏沙土数量变动的提示
|
||||
- 手动制造物品的数量控制改进
|
||||
- 航行时自动导航
|
||||
- 它会保持伊卡洛斯飞向目标星球
|
||||
- 它会尝试绕过途中的任何障碍物(行星、恒星或黑雾巢穴)
|
||||
@@ -279,23 +314,13 @@
|
||||
- 当你选择目标星球后,自动巡航就会开始
|
||||
- 如果目标星球距离过远会自动使用曲速(超过5AU),你可以在面板上更改这个值。
|
||||
- 它会在接近目标星球时减速,以避免发生越过目标的情况
|
||||
- 物流塔存储数量限制控制改进
|
||||
- 当升级`运输机舱扩容`时,不会对各种物流塔的存储限制按比例提升,除非设置为最大允许容量。
|
||||
- 你可以使用方向键微调物流塔存储限制
|
||||
- 手动制造物品的数量控制改进
|
||||
- 快速建造和拆除堆叠研究站
|
||||
- 保护矿脉不会耗尽
|
||||
- 默认矿脉数量保护在100,采油速保护在1.0/s,你可以在配置文件中自行设置。
|
||||
- 当达到保护值时,矿脉和油井将不再被开采。
|
||||
- 关闭此功能以恢复开采,一般是当你在`矿物利用`上有足够的等级时。
|
||||
- 初始化本行星(不重置矿脉)
|
||||
- 快速拆除所有建筑(不掉落)
|
||||
- 快速建造轨道采集器
|
||||
+ 戴森球
|
||||
- 可用节点全部造完时停止弹射
|
||||
- 只建造节点不建造框架
|
||||
- 初始化戴森球
|
||||
- 快速拆除戴森壳
|
||||
+ 战斗
|
||||
- 在任意位置打开黑雾通讯器
|
||||
|
||||
## 注意事项
|
||||
* 如果和[BlueprintTweaks](https://dsp.thunderstore.io/package/kremnev8/BlueprintTweaks/)一起使用,请升级`BepInEx`到5.4.21或更高版本,以避免可能的冲突。
|
||||
|
||||
@@ -16,7 +16,9 @@ public static class UIConfigWindow
|
||||
I18N.Add("UXAssist", "UXAssist", "UX助手");
|
||||
I18N.Add("General", "General", "常规");
|
||||
I18N.Add("Planet/Factory", "Planet/Factory", "行星/工厂");
|
||||
I18N.Add("Player/Mecha", "Player/Mecha", "玩家/机甲");
|
||||
I18N.Add("Dyson Sphere", "Dyson Sphere", "戴森球");
|
||||
I18N.Add("Combat", "Combat", "战斗");
|
||||
I18N.Add("Enable game window resize", "Enable game window resize (maximum box and thick frame)", "可调整游戏窗口大小(可最大化和拖动边框)");
|
||||
I18N.Add("Remeber window position and size on last exit", "Remeber window position and size on last exit", "记住上次退出时的窗口位置和大小");
|
||||
/*
|
||||
@@ -39,8 +41,11 @@ public static class UIConfigWindow
|
||||
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("Quick build and dismantle stacking labs", "Quick build and dismantle stacking labs(hold shift)", "快速建造和拆除堆叠研究站(按住shift)");
|
||||
I18N.Add("Protect veins from exhaustion", "Protect veins from exhaustion", "保护矿脉不会耗尽");
|
||||
I18N.Add("Protect veins from exhaustion tips", "By default, the vein amount is protected at 100, and oil speed is protected at 1.0/s, you can set them yourself in config file.\nWhen reach the protection value, veins/oils steeps will not be mined/extracted any longer.\nClose this function to resume mining and pumping, usually when you have enough level on `Veins Utilization`", "默认矿脉数量保护于剩余100,采油速保护于速度1.0/s,你可以在配置文件中自行设置。\n当达到保护值时,矿脉和油井将不再被开采。\n关闭此功能以恢复开采,一般是当你在`矿物利用`上有足够的等级时。\n");
|
||||
I18N.Add("Do not render factory entities", "Do not render factory entities (except belts and sorters)", "不渲染工厂建筑实体(除了传送带和分拣器)");
|
||||
I18N.Add("Auto navigation on sailings", "Auto navigation on sailings", "宇宙航行时自动导航");
|
||||
I18N.Add("Enable auto-cruise", "Enable auto-cruise", "启用自动巡航");
|
||||
I18N.Add("Auto boost", "Auto boost", "自动加速");
|
||||
I18N.Add("Distance to use warp", "Distance to use warp (AU)", "使用曲速的距离(AU)");
|
||||
I18N.Add("Treat stack items as single in monitor components", "Treat stack items as single in monitor components", "在流速计中将堆叠物品视为单个物品");
|
||||
I18N.Add("Initialize This Planet", "Initialize this planet", "初始化本行星");
|
||||
@@ -57,6 +62,7 @@ public static class UIConfigWindow
|
||||
I18N.Add("Click to dismantle selected layer", "Click to dismantle selected layer", "点击拆除对应的戴森壳");
|
||||
I18N.Add("Dismantle selected layer", "Dismantle selected layer", "拆除选中的戴森壳");
|
||||
I18N.Add("Dismantle selected layer Confirm", "This operation will dismantle selected layer, are you sure?", "此操作将会拆除选中的戴森壳,确定吗?");
|
||||
I18N.Add("Open Dark Fog Communicator", "Open Dark Fog Communicator", "打开黑雾通讯器");
|
||||
I18N.Apply();
|
||||
MyConfigWindow.OnUICreated += CreateUI;
|
||||
MyConfigWindow.OnUpdateUI += UpdateUI;
|
||||
@@ -85,8 +91,6 @@ public static class UIConfigWindow
|
||||
var tab2 = wnd.AddTab(trans, "Planet/Factory");
|
||||
x = 0f;
|
||||
y = 10f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab2, FactoryPatch.UnlimitInteractiveEnabled, "Unlimited interactive range");
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab2, FactoryPatch.RemoveSomeConditionEnabled, "Remove some build conditions");
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab2, FactoryPatch.RemoveBuildRangeLimitEnabled, "Remove build range limit");
|
||||
@@ -101,45 +105,21 @@ public static class UIConfigWindow
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab2, FactoryPatch.TreatStackingAsSingleEnabled, "Treat stack items as single in monitor components");
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab2, PlanetPatch.PlayerActionsInGlobeViewEnabled, "Enable player actions in globe view");
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab2, PlayerPatch.HideTipsForSandsChangesEnabled, "Hide tips for soil piles changes");
|
||||
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 = 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 = 0f;
|
||||
y += 30f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab2, FactoryPatch.QuickBuildAndDismantleLabsEnabled, "Quick build and dismantle stacking labs");
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab2, FactoryPatch.ProtectVeinsFromExhaustionEnabled, "Protect veins from exhaustion");
|
||||
x = 350f;
|
||||
y -= 108f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab2, PlayerPatch.AutoNavigationEnabled, "Auto navigation on sailings");
|
||||
x += 20f;
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab2, PlayerPatch.AutoCruiseEnabled, "Enable auto-cruise", 14);
|
||||
x -= 20f;
|
||||
y += 36f;
|
||||
MyWindow.AddText(x, y, tab2, "Distance to use warp", 15, "text-distance-to-warp");
|
||||
y += 24f;
|
||||
var distanceToWarp = MySlider.CreateSlider(x, y, tab2, (float)Math.Round(PlayerPatch.DistanceToWarp.Value * 2.0), 1f, 40f, "0.0", 200f);
|
||||
if (PlanetFunctions.OrbitalCollectorMaxBuildCount.Value == 0)
|
||||
{
|
||||
distanceToWarp.SetLabelText(PlayerPatch.DistanceToWarp.Value.ToString("0.0"));
|
||||
}
|
||||
distanceToWarp.OnValueChanged += () =>
|
||||
{
|
||||
PlayerPatch.DistanceToWarp.Value = Math.Round(distanceToWarp.Value) * 0.5;
|
||||
distanceToWarp.SetLabelText(PlayerPatch.DistanceToWarp.Value.ToString("0.0"));
|
||||
};
|
||||
x = 270f;
|
||||
y += 6f;
|
||||
MyWindow.AddTipsButton(x, y, tab2, "Protect veins from exhaustion", "Protect veins from exhaustion tips", "protect-veins-tips");
|
||||
x = 0f;
|
||||
y += 30f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab2, FactoryPatch.DoNotRenderEntitiesEnabled, "Do not render factory entities");
|
||||
x = 400f;
|
||||
y = 10f;
|
||||
wnd.AddButton(x, y, tab2, "Initialize This Planet", 16, "button-init-planet", () =>
|
||||
@@ -175,27 +155,63 @@ public static class UIConfigWindow
|
||||
}
|
||||
};
|
||||
|
||||
var tab3 = wnd.AddTab(trans, "Dyson Sphere");
|
||||
var tab3 = wnd.AddTab(trans, "Player/Mecha");
|
||||
x = 0f;
|
||||
y = 10f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab3, DysonSpherePatch.StopEjectOnNodeCompleteEnabled, "Stop ejectors when available nodes are all filled up");
|
||||
MyCheckBox.CreateCheckBox(x, y, tab3, FactoryPatch.UnlimitInteractiveEnabled, "Unlimited interactive range");
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab3, DysonSpherePatch.OnlyConstructNodesEnabled, "Construct only nodes but frames");
|
||||
MyCheckBox.CreateCheckBox(x, y, tab3, PlanetPatch.PlayerActionsInGlobeViewEnabled, "Enable player actions in globe view");
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab3, PlayerPatch.HideTipsForSandsChangesEnabled, "Hide tips for soil piles changes");
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab3, PlayerPatch.EnhancedMechaForgeCountControlEnabled, "Enhanced count control for hand-make");
|
||||
x = 270f;
|
||||
y += 6f;
|
||||
MyWindow.AddTipsButton(x, y, tab3, "Enhanced count control for hand-make", "Enhanced count control for hand-make tips", "enhanced-count-control-tips");
|
||||
x = 0f;
|
||||
y += 30f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab3, PlayerPatch.AutoNavigationEnabled, "Auto navigation on sailings");
|
||||
x = 20f;
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab3, PlayerPatch.AutoCruiseEnabled, "Enable auto-cruise", 14);
|
||||
x = 10f;
|
||||
y += 32f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab3, PlayerPatch.AutoBoostEnabled, "Auto boost", 15);
|
||||
y += 32f;
|
||||
MyWindow.AddText(x, y, tab3, "Distance to use warp", 15, "text-distance-to-warp");
|
||||
y += 24f;
|
||||
var distanceToWarp = MySlider.CreateSlider(x, y, tab3, (float)Math.Round(PlayerPatch.DistanceToWarp.Value * 2.0), 1f, 40f, "0.0", 200f);
|
||||
if (PlanetFunctions.OrbitalCollectorMaxBuildCount.Value == 0)
|
||||
{
|
||||
distanceToWarp.SetLabelText(PlayerPatch.DistanceToWarp.Value.ToString("0.0"));
|
||||
}
|
||||
distanceToWarp.OnValueChanged += () =>
|
||||
{
|
||||
PlayerPatch.DistanceToWarp.Value = Math.Round(distanceToWarp.Value) * 0.5;
|
||||
distanceToWarp.SetLabelText(PlayerPatch.DistanceToWarp.Value.ToString("0.0"));
|
||||
};
|
||||
|
||||
var tab4 = wnd.AddTab(trans, "Dyson Sphere");
|
||||
x = 0f;
|
||||
y = 10f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab4, DysonSpherePatch.StopEjectOnNodeCompleteEnabled, "Stop ejectors when available nodes are all filled up");
|
||||
y += 36f;
|
||||
MyCheckBox.CreateCheckBox(x, y, tab4, DysonSpherePatch.OnlyConstructNodesEnabled, "Construct only nodes but frames");
|
||||
x = 400f;
|
||||
y = 10f;
|
||||
wnd.AddButton(x, y, tab3, "Initialize Dyson Sphere", 16, "init-dyson-sphere", () =>
|
||||
wnd.AddButton(x, y, tab4, "Initialize Dyson Sphere", 16, "init-dyson-sphere", () =>
|
||||
UIMessageBox.Show("Initialize Dyson Sphere".Translate(), "Initialize Dyson Sphere Confirm".Translate(), "取消".Translate(), "确定".Translate(), 2, null, () =>
|
||||
{
|
||||
DysonSpherePatch.InitCurrentDysonSphere(-1);
|
||||
})
|
||||
);
|
||||
y += 36f;
|
||||
MyWindow.AddText(x, y, tab3, "Click to dismantle selected layer", 16, "text-dismantle-layer");
|
||||
MyWindow.AddText(x, y, tab4, "Click to dismantle selected layer", 16, "text-dismantle-layer");
|
||||
y += 26f;
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
var id = i + 1;
|
||||
var btn = wnd.AddFlatButton(x, y, tab3, id.ToString(), 12, "dismantle-layer-" + id, () =>
|
||||
var btn = wnd.AddFlatButton(x, y, tab4, id.ToString(), 12, "dismantle-layer-" + id, () =>
|
||||
UIMessageBox.Show("Dismantle selected layer".Translate(), "Dismantle selected layer Confirm".Translate(), "取消".Translate(), "确定".Translate(), 2, null, () =>
|
||||
{
|
||||
DysonSpherePatch.InitCurrentDysonSphere(id);
|
||||
@@ -213,7 +229,19 @@ public static class UIConfigWindow
|
||||
x += 40f;
|
||||
}
|
||||
}
|
||||
_dysonTab = tab3;
|
||||
_dysonTab = tab4;
|
||||
|
||||
var tab5 = wnd.AddTab(_windowTrans, "Combat");
|
||||
x = 10;
|
||||
y = 10;
|
||||
wnd.AddButton(x, y, tab5, "Open Dark Fog Communicator", 16, "button-open-df-communicator", () =>
|
||||
{
|
||||
if (!(GameMain.data?.gameDesc.isCombatMode ?? false)) return;
|
||||
var uiGame = UIRoot.instance.uiGame;
|
||||
uiGame.ShutPlayerInventory();
|
||||
uiGame.CloseEnemyBriefInfo();
|
||||
uiGame.OpenCommunicatorWindow(5);
|
||||
});
|
||||
}
|
||||
|
||||
private static void UpdateUI()
|
||||
|
||||
@@ -74,15 +74,19 @@ public class UXAssist : BaseUnityPlugin
|
||||
"Protect veins from exhaustion");
|
||||
FactoryPatch.ProtectVeinsFromExhaustion.KeepVeinAmount = Config.Bind("Factory", "KeepVeinAmount", 100, new ConfigDescription("Keep veins amount (0 to disable)", new AcceptableValueRange<int>(0, 1000))).Value;
|
||||
FactoryPatch.ProtectVeinsFromExhaustion.KeepOilSpeed = Config.Bind("Factory", "KeepOilSpeed", 1.0f, new ConfigDescription("Keep minimal oil speed (< 0.1 to disable)", new AcceptableValueRange<float>(0.0f, 1.0f))).Value;
|
||||
FactoryPatch.DoNotRenderEntitiesEnabled = Config.Bind("Factory", "DoNotRenderEntities", false,
|
||||
"Do not render factory entities");
|
||||
PlanetFunctions.OrbitalCollectorMaxBuildCount = Config.Bind("Factory", "OCMaxBuildCount", 0, "Maximum Orbital Collectors to build once, set to 0 to build as many as possible");
|
||||
PlayerPatch.EnhancedMechaForgeCountControlEnabled = Config.Bind("Player", "EnhancedMechaForgeCountControl", false,
|
||||
"Enhanced count control for hand-make, increases maximum of count to 1000, and you can hold Ctrl/Shift/Alt to change the count rapidly");
|
||||
PlayerPatch.HideTipsForSandsChangesEnabled = Config.Bind("Player", "HideTipsForGettingSands", false,
|
||||
"Hide tips for getting soil piles");
|
||||
PlayerPatch.EnhancedMechaForgeCountControlEnabled = Config.Bind("Player", "EnhancedMechaForgeCountControl", false,
|
||||
"Enhanced count control for hand-make, increases maximum of count to 1000, and you can hold Ctrl/Shift/Alt to change the count rapidly");
|
||||
PlayerPatch.AutoNavigationEnabled = Config.Bind("Player", "AutoNavigation", false,
|
||||
"Auto navigation");
|
||||
PlayerPatch.AutoCruiseEnabled = Config.Bind("Player", "AutoCruise", false,
|
||||
"Auto-cruise enabled");
|
||||
PlayerPatch.AutoBoostEnabled = Config.Bind("Player", "AutoBoost", false,
|
||||
"Auto boost speed with auto-cruise enabled");
|
||||
PlayerPatch.DistanceToWarp = Config.Bind("Player", "DistanceToWarp", 5.0, "Distance to warp (in AU)");
|
||||
DysonSpherePatch.StopEjectOnNodeCompleteEnabled = Config.Bind("DysonSphere", "StopEjectOnNodeComplete", false,
|
||||
"Stop ejectors when available nodes are all filled up");
|
||||
@@ -401,4 +405,12 @@ public class UXAssist : BaseUnityPlugin
|
||||
);
|
||||
return matcher.InstructionEnumeration();
|
||||
}
|
||||
|
||||
// Ignore UIDFCommunicatorWindow.Determine()
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(UIDFCommunicatorWindow), nameof(UIDFCommunicatorWindow.Determine))]
|
||||
private static bool UIDFCommunicatorWindow_Determine_Prefix()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid>
|
||||
<Description>DSP MOD - UXAssist</Description>
|
||||
<Version>1.0.22</Version>
|
||||
<Version>1.0.23</Version>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<PackageId>UXAssist</PackageId>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "UXAssist",
|
||||
"version_number": "1.0.22",
|
||||
"version_number": "1.0.23",
|
||||
"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