Merge tree2 UI improvements with equipment and safe case integration
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
@@ -41,6 +42,7 @@ namespace Ironspore
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
public SettingsService Settings { get; private set; }
|
||||
public readonly List<string> SelectedCargo = new List<string>();
|
||||
public bool MenuOpen { get; private set; } = true;
|
||||
public bool Paused
|
||||
@@ -79,6 +81,8 @@ namespace Ironspore
|
||||
mainStore = new ProfileStore(ProfileStore.SavePath(false));
|
||||
Store = mainStore;
|
||||
Input = Instantiate(inputTemplate);
|
||||
var defaults = SettingsService.RuntimeDefaults();
|
||||
Settings = new SettingsService(new SettingsStore(Path.Combine(GameDataPaths.DirectoryPath, "settings.json"), defaults), Input, defaults);
|
||||
Input.Enable();
|
||||
World = gameObject.AddComponent<WarzoneDirector>();
|
||||
Hud = gameObject.AddComponent<GameHud>();
|
||||
@@ -182,7 +186,10 @@ namespace Ironspore
|
||||
Pilot = World.Player;
|
||||
SetMenu(false);
|
||||
Hud.ShowField();
|
||||
Notify(Trial ? "notice.range" : "notice.enter");
|
||||
if (Trial)
|
||||
Notify("notice.range", Settings.Bindings.Display("View"), Settings.Bindings.Display("Interact"));
|
||||
else
|
||||
Notify("notice.enter");
|
||||
}
|
||||
public void SetMenu(bool open)
|
||||
{
|
||||
@@ -229,6 +236,8 @@ namespace Ironspore
|
||||
EndSortie(true);
|
||||
return;
|
||||
}
|
||||
if (Hud && (Hud.SettingsOpen || Hud.MenuInputConsumedThisFrame))
|
||||
return;
|
||||
if (Action("Pause").WasPressedThisFrame())
|
||||
{
|
||||
if (MenuOpen)
|
||||
@@ -442,6 +451,11 @@ namespace Ironspore
|
||||
}
|
||||
void OnApplicationFocus(bool focus)
|
||||
{
|
||||
if (!focus && Hud && Hud.SettingsOpen)
|
||||
{
|
||||
Hud.CancelSettingsInput();
|
||||
return;
|
||||
}
|
||||
if (!focus && InField && Hud)
|
||||
{
|
||||
Paused = true;
|
||||
@@ -460,6 +474,7 @@ namespace Ironspore
|
||||
}
|
||||
void OnDestroy()
|
||||
{
|
||||
Settings?.Dispose();
|
||||
if (Input)
|
||||
Destroy(Input);
|
||||
Time.timeScale = 1;
|
||||
|
||||
Reference in New Issue
Block a user