mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
fix(uxassist): only show new navigation shortcut hint when target is set
This commit is contained in:
1 parent
75017476e3
commit
7dd9830b48
2 files changed
+17
-3
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user