mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
feat: removed the esc key menu toggle, replaced it with a pause menu option
This commit is contained in:
parent
695586c79d
commit
49e6e4503d
@ -40,9 +40,24 @@ namespace NewHorizons.Utility
|
|||||||
_dpp = this.GetRequiredComponent<DebugPropPlacer>();
|
_dpp = this.GetRequiredComponent<DebugPropPlacer>();
|
||||||
_drc = this.GetRequiredComponent<DebugRaycaster>();
|
_drc = this.GetRequiredComponent<DebugRaycaster>();
|
||||||
|
|
||||||
|
Main.Instance.ModHelper.Menus.PauseMenu.OnInit += PauseMenuInitHook;
|
||||||
|
Main.Instance.ModHelper.Menus.PauseMenu.OnClosed += CloseMenu;
|
||||||
LoadFavoriteProps();
|
LoadFavoriteProps();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PauseMenuInitHook()
|
||||||
|
{
|
||||||
|
InitMenu();
|
||||||
|
var editorButton = Main.Instance.ModHelper.Menus.PauseMenu.OptionsButton.Duplicate("Open Prop Placer Menu".ToUpper());
|
||||||
|
editorButton.OnClick += ToggleMenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ToggleMenu() { menuOpen = !menuOpen; }
|
||||||
|
|
||||||
|
private void CloseMenu() { menuOpen = false; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void LoadFavoriteProps()
|
private void LoadFavoriteProps()
|
||||||
{
|
{
|
||||||
string favoritePropsPlayerPref = PlayerPrefs.GetString(favoritePropsPlayerPrefKey);
|
string favoritePropsPlayerPref = PlayerPrefs.GetString(favoritePropsPlayerPrefKey);
|
||||||
@ -61,11 +76,11 @@ namespace NewHorizons.Utility
|
|||||||
{
|
{
|
||||||
if (!Main.Debug) return;
|
if (!Main.Debug) return;
|
||||||
|
|
||||||
if (Keyboard.current[Key.Escape].wasPressedThisFrame)
|
/*if (Keyboard.current[Key.Escape].wasPressedThisFrame)
|
||||||
{
|
{
|
||||||
menuOpen = !menuOpen;
|
menuOpen = !menuOpen;
|
||||||
if (menuOpen) InitMenu();
|
if (menuOpen) InitMenu();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGUI()
|
private void OnGUI()
|
||||||
@ -137,6 +152,7 @@ namespace NewHorizons.Utility
|
|||||||
if (GUILayout.Button(mod.ModHelper.Manifest.UniqueName))
|
if (GUILayout.Button(mod.ModHelper.Manifest.UniqueName))
|
||||||
{
|
{
|
||||||
loadedMod = mod;
|
loadedMod = mod;
|
||||||
|
_dpp.active = true;
|
||||||
|
|
||||||
propsHaveBeenLoaded = true;
|
propsHaveBeenLoaded = true;
|
||||||
var folder = loadedMod.ModHelper.Manifest.ModFolderPath;
|
var folder = loadedMod.ModHelper.Manifest.ModFolderPath;
|
||||||
|
|||||||
@ -43,6 +43,8 @@ namespace NewHorizons.Utility
|
|||||||
|
|
||||||
public HashSet<string> RecentlyPlacedProps = new HashSet<string>();
|
public HashSet<string> RecentlyPlacedProps = new HashSet<string>();
|
||||||
|
|
||||||
|
public bool active = false;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
_rc = this.GetRequiredComponent<DebugRaycaster>();
|
_rc = this.GetRequiredComponent<DebugRaycaster>();
|
||||||
@ -52,8 +54,9 @@ namespace NewHorizons.Utility
|
|||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (!Main.Debug) return;
|
if (!Main.Debug) return;
|
||||||
|
if (!active) return;
|
||||||
|
|
||||||
if (Keyboard.current[Key.Q].wasReleasedThisFrame)
|
if (Keyboard.current[Key.X].wasReleasedThisFrame)
|
||||||
{
|
{
|
||||||
PlaceObject();
|
PlaceObject();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user