fix(uxassist): preserve title-screen background rendering

Require native hide-UI mode before suppressing the space scene, and exclude menu demos and combat cutscenes. Share the visibility check between render hooks and planet simulators.
This commit is contained in:
soarqin committed 2026-09-29 21:49:31 +08:00
1 parent a4ac2efe4b
commit b08eaf13b7
3 files changed
+14 -20

No files matched your search

+1
View File
@@ -40,6 +40,7 @@
- Logistics station overlays must refresh through the native UI lifecycle, independently of typing guards. Reconcile cached tips against live station/entity identities and recycle local tips when stations are removed. - Logistics station overlays must refresh through the native UI lifecycle, independently of typing guards. Reconcile cached tips against live station/entity identities and recycle local tips when stations are removed.
- Planet vein utilization counters belong before resource labels, not beside native icons or highlight controls. Restore original label layout when rows are reused or the feature is disabled. - Planet vein utilization counters belong before resource labels, not beside native icons or highlight controls. Restore original label layout when rows are reused or the feature is disabled.
- UI-only options must preserve native progression, statistics, and event delivery. Suppress presentation handlers rather than bypassing authoritative game-state setters. - UI-only options must preserve native progression, statistics, and event delivery. Suppress presentation handlers rather than bypassing authoritative game-state setters.
- Space-scene rendering suppression must require the native in-game hide-UI state and exclude menu demos and combat cutscenes. A hidden player model alone does not imply hidden scenery; use the same eligibility check for drawing and planet-simulator visibility.
- LiveStreamAssist browser overlays must use single-flight polling and discard stale work after connection changes. Compound queries must reject mixed session IDs; cache only positive production indices so newly tracked items remain discoverable. - LiveStreamAssist browser overlays must use single-flight polling and discard stale work after connection changes. Compound queries must reject mixed session IDs; cache only positive production indices so newly tracked items remain discoverable.
- LiveStreamAssist production reads must schedule the native extra-info calculator for queried factories independently of the statistics UI. Deduplicate and throttle refreshes, let active native batches finish, and clear pending factory indices and deadlines at session boundaries. - LiveStreamAssist production reads must schedule the native extra-info calculator for queried factories independently of the statistics UI. Deduplicate and throttle refreshes, let active native batches finish, and clear pending factory indices and deadlines at session boundaries.
- LiveStreamAssist `ReflectionReader` caches bounded per-type member metadata and clears it during API uninitialization; do not cache mutable game values or arbitrary request results. - LiveStreamAssist `ReflectionReader` caches bounded per-type member metadata and clears it during API uninitialization; do not cache mutable game values or arbitrary request results.
+2
View File
@@ -4,6 +4,7 @@
## Changlog ## Changlog
* 1.6.1 * 1.6.1
* Fix the title-screen background turning black, even when the UXAssist window is closed.
* `Planet vein utilization`: Move vein-group counts to the left of resource names to avoid overlapping the game's new buttons. * `Planet vein utilization`: Move vein-group counts to the left of resource names to avoid overlapping the game's new buttons.
* `Settings help`: Restore the game's native tips on question-mark buttons. * `Settings help`: Restore the game's native tips on question-mark buttons.
* `Auto-cruise`: Align the settings sliders and reduce spacing between their tracks and values. * `Auto-cruise`: Align the settings sliders and reduce spacing between their tracks and values.
@@ -421,6 +422,7 @@
## 更新日志 ## 更新日志
* 1.6.1 * 1.6.1
* 修复标题画面背景变黑的问题,包括关闭 UXAssist 窗口后背景仍不显示的情况。
* `宇宙视图行星/星系矿脉数量显示`:将矿脉数量移至矿物名称左侧,避免与游戏新版按钮重叠。 * `宇宙视图行星/星系矿脉数量显示`:将矿脉数量移至矿物名称左侧,避免与游戏新版按钮重叠。
* `设置提示`:修复问号按钮的游戏内提示不显示的问题。 * `设置提示`:修复问号按钮的游戏内提示不显示的问题。
* `自动巡航`:统一设置滑条的起始位置,并缩小滑条与数值之间的间距。 * `自动巡航`:统一设置滑条的起始位置,并缩小滑条与数值之间的间距。
+11 -20
View File
@@ -228,36 +228,27 @@ public class PersistPatch : PatchImpl<PersistPatch>
return matcher.InstructionEnumeration(); return matcher.InstructionEnumeration();
} }
// Disable rendering when Player is hidden (Press F11 twice) private static bool ShouldHideSpaceScene()
// Harmony transpiler: GameLogic_LateUpdate_Transpiler {
// Target: GameLogic.LateUpdate, GameLogic.Draw, GameLogic.DrawPost return !DSPGame.IsMenuDemo && !DSPGame.IsCombatCutscene &&
// Fallback: None — patch will fail loudly if the target method body changes. UIRoot.instance?.uiGame?.hideAllUI0 == true &&
[HarmonyTranspiler] GameMain.localPlanet == null && GameMain.mainPlayer?.controller?.modelVisible == false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(GameLogic), nameof(GameLogic.LateUpdate))] [HarmonyPatch(typeof(GameLogic), nameof(GameLogic.LateUpdate))]
[HarmonyPatch(typeof(GameLogic), nameof(GameLogic.Draw))] [HarmonyPatch(typeof(GameLogic), nameof(GameLogic.Draw))]
[HarmonyPatch(typeof(GameLogic), nameof(GameLogic.DrawPost))] [HarmonyPatch(typeof(GameLogic), nameof(GameLogic.DrawPost))]
private static IEnumerable<CodeInstruction> GameLogic_LateUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator) private static bool GameLogic_Render_Prefix()
{ {
var matcher = new CodeMatcher(instructions, generator); return !ShouldHideSpaceScene();
matcher.Start();
matcher.CreateLabel(out var label);
matcher.InsertAndAdvance(
Transpilers.EmitDelegate(bool () =>
{
return GameMain.localPlanet == null && !GameMain.mainPlayer.controller.modelVisible;
}),
new CodeInstruction(OpCodes.Brfalse, label),
new CodeInstruction(OpCodes.Ret)
);
return matcher.InstructionEnumeration();
} }
[HarmonyPostfix] [HarmonyPostfix]
[HarmonyPatch(typeof(UniverseSimulator), nameof(UniverseSimulator.SetPlanetSimulator))] [HarmonyPatch(typeof(UniverseSimulator), nameof(UniverseSimulator.SetPlanetSimulator))]
private static void UniverseSimulator_SetPlanetSimulator_Postfix(UniverseSimulator __instance, PlanetSimulator sim) private static void UniverseSimulator_SetPlanetSimulator_Postfix(UniverseSimulator __instance, PlanetSimulator sim)
{ {
if (GameMain.localPlanet == null && !GameMain.mainPlayer.controller.modelVisible) sim.gameObject.SetActive(false); if (ShouldHideSpaceScene()) sim.gameObject.SetActive(false);
} }
#region Cluster Upload Result #region Cluster Upload Result