1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2026-02-04 17:02:17 +08:00

UXAssist and CheatEnabler new release

This commit is contained in:
2024-08-22 17:16:55 +08:00
parent fec947e71a
commit 7430f20181
14 changed files with 178 additions and 29 deletions

View File

@@ -380,8 +380,8 @@ public static class GamePatch
{
var matcher = new CodeMatcher(instructions, generator);
matcher.Start().MatchForward(false,
new CodeMatch(instr => (instr.opcode == OpCodes.Ldc_I4 || instr.opcode == OpCodes.Ldc_I4_S) && instr.OperandIs(0x1B)),
new CodeMatch(OpCodes.Call, AccessTools.Method(typeof(PerformanceMonitor), nameof(PerformanceMonitor.EndData)))
new CodeMatch(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Player), nameof(Player.mecha))),
new CodeMatch(OpCodes.Callvirt, AccessTools.Method(typeof(Mecha), nameof(Mecha.CheckCombatModuleDataIsValidPatch)))
);
matcher.Advance(2).Opcode = OpCodes.Brfalse;
matcher.Insert(

View File

@@ -4,6 +4,10 @@
#### 一些提升用户体验的功能和补丁
## Changlog
* 1.1.3
+ UI texts are updated following game settings now
+ Fix hover area for checkboxes in config panel
+ Fix an issue which makes `Convert Peace-Mode saves to Combat-Mode on loading` not working
* 1.1.2
+ `Belt signals for buy out dark fog items automatically`: Always add belt signals to the panel to fix missing belt icons when disabled.
* 1.1.1
@@ -227,6 +231,10 @@
* [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.1.3
+ 界面文本现在完全跟随游戏语言设置改变
+ 修复了配置面板中勾选框的鼠标悬停区域
+ 修复了`加载和平模式存档时将其转换为战斗模式`不起作用的问题
* 1.1.2
+ `用于自动购买黑雾物品的传送带信号`: 总是将传送带信号添加到面板,以修复禁用时传送带图标丢失的问题。
* 1.1.1

View File

@@ -1,5 +1,6 @@
using System;
using BepInEx.Configuration;
using UITools;
using UnityEngine;
using UnityEngine.UI;
@@ -57,6 +58,8 @@ public class MyCheckBox : MonoBehaviour
cb.labelText = child.GetComponent<Text>();
cb.labelText.fontSize = fontSize;
cb.SetLabelText(label);
var width = cb.labelText.preferredWidth;
cb.labelText.rectTransform.sizeDelta = new Vector2(width, rect.sizeDelta.y);
}
//value

View File

@@ -14,6 +14,11 @@ public class MyConfigWindow : MyWindowWithTabs
{
return MyWindowManager.CreateWindow<MyConfigWindow>("UXAConfigWindow", "UXAssist Config");
}
public static void DestroyInstance(MyConfigWindow win)
{
MyWindowManager.DestroyWindow(win);
}
public override void _OnCreate()
{
@@ -27,6 +32,7 @@ public class MyConfigWindow : MyWindowWithTabs
public override void _OnDestroy()
{
_windowTrans = null;
}
public override bool _OnInit()

View File

@@ -388,6 +388,14 @@ public static class MyWindowManager
Windows.Add(win);
return (T)win;
}
public static void DestroyWindow(ManualBehaviour win)
{
if (win == null) return;
Windows.Remove(win);
win._Free();
win._Destroy();
}
/*
public static void SetRect(ManualBehaviour win, RectTransform rect)
@@ -409,7 +417,7 @@ public static class MyWindowManager
}
*/
[HarmonyPostfix, HarmonyPatch(typeof(UIRoot), "_OnDestroy")]
[HarmonyPostfix, HarmonyPatch(typeof(UIRoot), nameof(UIRoot._OnDestroy))]
public static void UIRoot__OnDestroy_Postfix()
{
foreach (var win in Windows)
@@ -420,7 +428,7 @@ public static class MyWindowManager
Windows.Clear();
}
[HarmonyPostfix, HarmonyPatch(typeof(UIRoot), "_OnOpen")]
[HarmonyPostfix, HarmonyPatch(typeof(UIRoot), nameof(UIRoot._OnOpen))]
public static void UIRoot__OnOpen_Postfix()
{
if (_initialized) return;
@@ -442,7 +450,7 @@ public static class MyWindowManager
}
*/
[HarmonyPostfix, HarmonyPatch(typeof(UIRoot), "_OnUpdate")]
[HarmonyPostfix, HarmonyPatch(typeof(UIRoot), nameof(UIRoot._OnUpdate))]
public static void UIRoot__OnUpdate_Postfix()
{
if (GameMain.isPaused || !GameMain.isRunning)
@@ -455,7 +463,7 @@ public static class MyWindowManager
}
}
[HarmonyPostfix, HarmonyPatch(typeof(UIGame), "ShutAllFunctionWindow")]
[HarmonyPostfix, HarmonyPatch(typeof(UIGame), nameof(UIGame.ShutAllFunctionWindow))]
public static void UIGame_ShutAllFunctionWindow_Postfix()
{
foreach (var win in Windows)

View File

@@ -145,6 +145,7 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
DysonSpherePatch.Init();
I18N.Apply();
I18N.OnInitialized += RecreateConfigWindow;
}
private void OnDestroy()
@@ -200,6 +201,16 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
}
}
private static void RecreateConfigWindow()
{
if (!_configWinInitialized) return;
var wasActive = _configWin.active;
if (wasActive) _configWin._Close();
MyConfigWindow.DestroyInstance(_configWin);
_configWinInitialized = false;
if (wasActive) ToggleConfigWindow();
}
// Add config button to main menu
[HarmonyPostfix, HarmonyPatch(typeof(UIRoot), nameof(UIRoot.OpenMainMenuUI))]
public static void UIRoot_OpenMainMenuUI_Postfix()

View File

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

View File

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