fix(uxassist): only show new navigation shortcut hint when target is set

This commit is contained in:
soarqin committed 2026-09-13 23:53:13 +08:00
1 parent 75017476e3
commit 7dd9830b48
2 files changed
+17 -3

No files matched your search

+15 -1
View File
@@ -802,7 +802,7 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
if (UiTipText == null)
return;
bool showTip = GameMain.isRunning && !DSPGame.IsMenuDemo && UseNewNavigationAlgorithm.Value && !AutoNavigationEnabled.Value;
bool showTip = GameMain.isRunning && !DSPGame.IsMenuDemo && UseNewNavigationAlgorithm.Value && !AutoNavigationEnabled.Value && (EnableTag || HasNavigationTarget());
UiTipText.gameObject.SetActive(showTip);
if (!showTip)
return;
@@ -812,6 +812,20 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
: string.Format(I18NKeys.AutoNavigationEnableHint.Translate(), KeyBindings.GetKeyBindingText(_autoDriveKey));
}
private static bool HasNavigationTarget()
{
Player player = GameMain.mainPlayer;
if (player == null)
return false;
PlayerNavigation navigation = player.navigation;
int indicatorAstroId = navigation.indicatorAstroId;
if (indicatorAstroId == 0)
return navigation.indicatorEnemyId != 0;
return GameMain.localPlanet == null || indicatorAstroId != GameMain.localPlanet.astroId;
}
private static void NormalizeNavigationMode()
{
if (_normalizingNavigationMode || !AutoNavigationEnabled.Value || !UseNewNavigationAlgorithm.Value)