This commit is contained in:
Lucastaa
2026-04-26 00:27:56 +07:00
parent 32c598da8b
commit 966642bdcd
44 changed files with 9296 additions and 441 deletions

View File

@@ -48,6 +48,29 @@ namespace UI
private void Update()
{
if (Input.GetKeyDown(KeyCode.Escape)) ToggleSettings();
HandleAltCursor();
}
private void HandleAltCursor()
{
// Only handle Alt cursor when we are in game (HUD is active)
// and Settings is NOT currently toggled on.
var settingsData = screens.Find(s => s.screenName == "Settings");
bool settingsActive = settingsData != null && settingsData.isActive;
if (_currentScreenName == "HUD" && !settingsActive)
{
if (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt))
{
UnityEngine.Cursor.visible = true;
UnityEngine.Cursor.lockState = CursorLockMode.None;
}
else
{
UnityEngine.Cursor.visible = false;
UnityEngine.Cursor.lockState = CursorLockMode.Locked;
}
}
}
public void ShowOnly(string name) => ShowScreen(name);