diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 980c78ce..a1203e28 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -73,6 +73,7 @@ namespace NewHorizons Debug = config.GetSettingsValue("Debug"); DebugReload.UpdateReloadButton(); + DebugMenu.UpdatePauseMenuButton(); Logger.UpdateLogLevel(Debug ? Logger.LogType.Log : Logger.LogType.Error); _defaultSystemOverride = config.GetSettingsValue("Default System Override"); diff --git a/NewHorizons/Utility/DebugUtilities/DebugMenu.cs b/NewHorizons/Utility/DebugUtilities/DebugMenu.cs index 7366f6d8..1046c194 100644 --- a/NewHorizons/Utility/DebugUtilities/DebugMenu.cs +++ b/NewHorizons/Utility/DebugUtilities/DebugMenu.cs @@ -1,6 +1,7 @@ using NewHorizons.External; using NewHorizons.External.Configs; using NewHorizons.External.Modules; +using NewHorizons.Handlers; using Newtonsoft.Json; using OWML.Common; using OWML.Common.Menus; @@ -43,7 +44,6 @@ namespace NewHorizons.Utility.DebugUtilities public static readonly char separatorCharacter = '☧'; // since no chars are illegal in game object names, I picked one that's extremely unlikely to be used to be a separator private static readonly string favoritePropsPlayerPrefKey = "FavoriteProps"; - //private string workingModName = ""; private static IModBehaviour loadedMod = null; private Dictionary loadedConfigFiles = new Dictionary(); private bool saveButtonUnlocked = false; @@ -65,7 +65,6 @@ namespace NewHorizons.Utility.DebugUtilities private void Start() { - if (!Main.Debug) return; if (!staticInitialized) { staticInitialized = true; @@ -91,9 +90,17 @@ namespace NewHorizons.Utility.DebugUtilities private void PauseMenuInitHook() { - pauseMenuButton = Main.Instance.ModHelper.Menus.PauseMenu.OptionsButton.Duplicate("Toggle Prop Placer Menu".ToUpper()); + pauseMenuButton = Main.Instance.ModHelper.Menus.PauseMenu.OptionsButton.Duplicate(TranslationHandler.GetTranslation("Toggle Prop Placer Menu", TranslationHandler.TextType.UI).ToUpper()); InitMenu(); } + public static void UpdatePauseMenuButton() + { + if (pauseMenuButton != null) + { + if (Main.Debug) pauseMenuButton.Show(); + else pauseMenuButton.Hide(); + } + } private void RestoreMenuOpennessState() { menuOpen = openMenuOnPause; } private void ToggleMenu() { menuOpen = !menuOpen; openMenuOnPause = !openMenuOnPause; } @@ -324,6 +331,8 @@ namespace NewHorizons.Utility.DebugUtilities { if (_editorMenuStyle != null) return; + UpdatePauseMenuButton(); + // TODO: figure out how to clear this event list so that we don't pile up useless instances of the DebugMenu that can't get garbage collected pauseMenuButton.OnClick += ToggleMenu; diff --git a/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs b/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs index d675d846..170f5ee3 100644 --- a/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs +++ b/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs @@ -12,6 +12,10 @@ using static NewHorizons.External.Modules.PropModule; namespace NewHorizons.Utility.DebugUtilities { + // + // The prop placer. Doesn't interact with any files, just places and tracks props. + // + [RequireComponent(typeof(DebugRaycaster))] class DebugPropPlacer : MonoBehaviour { @@ -23,9 +27,10 @@ namespace NewHorizons.Utility.DebugUtilities public DetailInfo detailInfo; } + // VASE public static readonly string DEFAULT_OBJECT = "BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District1/Props_HangingCity_District1/OtherComponentsGroup/Props_HangingCity_Building_10/Prefab_NOM_VaseThin"; - public string currentObject { get; private set; } + public string currentObject { get; private set; } // path of the prop to be placed private bool hasAddedCurrentObjectToRecentsList = false; private List props = new List(); private List deletedProps = new List(); @@ -230,8 +235,8 @@ namespace NewHorizons.Utility.DebugUtilities for(int i = 0; i < bodyProps.Count; i++) { bodyProps[i].detailInfo.position = bodyProps[i].gameObject.transform.localPosition; - bodyProps[i].detailInfo.rotation = bodyProps[i].gameObject.transform.localEulerAngles; bodyProps[i].detailInfo.scale = bodyProps[i].gameObject.transform.localScale.x; + if (!bodyProps[i].detailInfo.alignToNormal) bodyProps[i].detailInfo.rotation = bodyProps[i].gameObject.transform.localEulerAngles; infoArray[i] = bodyProps[i].detailInfo; }