public override void OnLevelLoaded(LoadMode mode) { // Check if in-game: if (mode != LoadMode.LoadGame && mode != LoadMode.NewGame) { DebugUtils.Log($"Mod not loaded: only available in-game, not in editors."); return; } // Initialize the mod: AmericanRoadsignsTool.Initialize(); // Load mod config: AmericanRoadsignsTool.LoadConfig(); // Set assets path: AmericanRoadsignsTool.SetModPath(); // Init. assets: AmericanRoadsignsTool.InitProps(); // Localize props? if (AmericanRoadsignsTool.config.roadsignpack > 0) { // Replace props: AmericanRoadsignsTool.ReplacePropsOnLoad(); // Retexture props: AmericanRoadsignsTool.RetexturePropsOnLoad(); // Set prop visibility: AmericanRoadsignsTool.HidePropsOnLoad(); } // Hide props: AmericanRoadsignsTool.ChangePropsOnLoad(); // base.OnLevelLoaded(mode); }
public void OnSettingsUI(UIHelperBase helper) { try { AmericanRoadsignsTool.LoadConfig(); // Mod options: UIHelperBase group = helper.AddGroup(Name); group.AddSpace(10); // Select Options (Road signs): group.AddDropdown("Select your preferred keyboard shortcut for toggling the mod panel", new[] { "Shift + A", "Ctrl + A", "Alt + A" }, AmericanRoadsignsTool.config.keyboardshortcut, OnKeyboardShortcutChanged); group.AddSpace(10); // Select Options (Road signs): group.AddDropdown("Select the road signs pack you want to use in-game", new[] { "Vanilla", "American" }, AmericanRoadsignsTool.config.roadsignpack, OnRoadsignPackChanged); group.AddSpace(5); group.AddGroup("NOTE: changing the road sign pack you want to use requires a restart of your city."); group.AddSpace(10); // Toggle Options (Misc.): group.AddCheckbox("Write additional data to debug log", AmericanRoadsignsTool.config.enable_debug, new OnCheckChanged(OnEnableDebugChanged)); group.AddSpace(5); group.AddGroup("WARNING: enabling debug data may increase loading times!\nEnabling this setting is only recommended when you experience problems."); group.AddSpace(20); } catch (Exception e) { DebugUtils.LogException(e); } }