public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); F5toExec.Draw(group); SyncExecution.Draw(group, (b) => { PythonConsole.CreateInstance(); }); ShowRemoteConsole.Draw(group); DoNotLaunchRemoteConsole.Draw(group); group.AddSpace(10); group.AddButton("Kill python engine", () => { PythonConsole.KillInstance(); }); } catch (Exception e) { Debug.Log("OnSettingsUI failed"); Debug.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; sb_SuppressAllExceptions.Draw(group); group.AddSpace(10); group.AddButton("Clear list of suppressed exceptions", () => { ExceptionTemplate.ResetSuppressing(); }); group.AddSpace(10); group.AddButton("Open log folder", () => { Utils.OpenInFileBrowser(Application.dataPath); }); } catch (Exception e) { Debug.Log("OnSettingsUI failed"); Debug.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; UICheckBox skipVanillaVehicles = (UICheckBox)group.AddCheckbox("Skip prop conversion for all vanilla vehicles", Settings.skipVanillaVehicles, (b) => { Settings.skipVanillaVehicles = b; XMLUtils.SaveSettings(); }); skipVanillaVehicles.tooltip = "Generated vanilla vehicle props will disappear next time when a save file is loaded"; group.AddSpace(10); UICheckBox skipVanillaTrees = (UICheckBox)group.AddCheckbox("Skip prop conversion for all vanilla trees", Settings.skipVanillaTrees, (b) => { Settings.skipVanillaTrees = b; XMLUtils.SaveSettings(); }); skipVanillaVehicles.tooltip = "Generated vanilla tree props will disappear next time when a save file is loaded"; group.AddSpace(10); // show path to TVPropPatchConfig.xml string path = Path.Combine(DataLocation.executableDirectory, "TVPropPatchConfig.xml"); UITextField customTagsFilePath = (UITextField)group.AddTextfield("Configuration File - TVPropPatchConfig.xml", path, _ => { }, _ => { }); customTagsFilePath.width = panel.width - 30; group.AddButton("Show in File Explorer", () => UnityEngine.Application.OpenURL(DataLocation.executableDirectory)); } catch (Exception e) { Debug.Log("OnSettingsUI failed"); Debug.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UICheckBox checkBox = (UICheckBox)group.AddCheckbox("Disable button capture", MoreShortcuts.disableCapture.value, (b) => { MoreShortcuts.disableCapture.value = b; }); checkBox.tooltip = "If checked, you will not be able to add new shortcuts.\nThe capture key will no longer highlight buttons.\n"; group.AddSpace(10); UIDropDown dropDown = (UIDropDown)group.AddDropdown("Capture key:", new string[] { "Alt", "Ctrl", "Shift", "Alt + Ctrl", "Alt + Shift", "Ctrl + Shift", "Ctrl + Alt + Shift" }, MoreShortcuts.captureKey.value, (b) => { MoreShortcuts.captureKey.value = b; }); dropDown.tooltip = "Select the desired capture key combination"; group.AddSpace(10); UIPanel panel = group.self as UIPanel; UILabel label = panel.AddUIComponent <UILabel>(); label.textScale = 1.125f; label.text = "Shortcuts:"; panel.gameObject.AddComponent <OptionsKeymapping>(); } catch (Exception e) { DebugUtils.Log("OnSettingsUI failed"); DebugUtils.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; UICheckBox checkBox = (UICheckBox)group.AddCheckbox("Disable debug messages logging", DebugUtils.hideDebugMessages.value, (b) => { DebugUtils.hideDebugMessages.value = b; }); checkBox.tooltip = "If checked, debug messages won't be logged."; group.AddSpace(10); panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); } catch (Exception e) { DebugUtils.Log("OnSettingsUI failed"); DebugUtils.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; UICheckBox checkBox = (UICheckBox)group.AddCheckbox("Hide tips", MoveItTool.hideTips.value, (b) => { MoveItTool.hideTips.value = b; if (UITipsWindow.instance != null) { UITipsWindow.instance.isVisible = false; } }); checkBox.tooltip = "Check this if you don't want to see the tips.\n"; checkBox = (UICheckBox)group.AddCheckbox("Use cardinal movements", MoveItTool.useCardinalMoves.value, (b) => { MoveItTool.useCardinalMoves.value = b; }); checkBox.tooltip = "If checked, Up will move in the North direction, Down is South, Left is West, Right is East.\n"; group.AddSpace(10); panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); } catch (Exception e) { DebugUtils.Log("OnSettingsUI failed"); DebugUtils.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { if (FindIt.instance == null) { AssetTagList.instance = new AssetTagList(); } UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; UICheckBox checkBox = (UICheckBox)group.AddCheckbox("Disable debug messages logging", DebugUtils.hideDebugMessages.value, (b) => { DebugUtils.hideDebugMessages.value = b; }); checkBox.tooltip = "If checked, debug messages won't be logged."; group.AddSpace(10); checkBox = (UICheckBox)group.AddCheckbox("Center the main toolbar", FindIt.centerToolbar.value, (b) => { FindIt.centerToolbar.value = b; if (FindIt.instance != null) { FindIt.instance.UpdateMainToolbar(); } }); checkBox.tooltip = "The main toolbar will be centered if it exceed a certain length."; checkBox = (UICheckBox)group.AddCheckbox("Unlock all", FindIt.unlockAll.value, (b) => { FindIt.unlockAll.value = b; }); checkBox.tooltip = "Let you select and place items even when locked."; group.AddSpace(10); UICheckBox fixProps = (UICheckBox)group.AddCheckbox("Fix bad props next loaded save", false, (b) => { FindIt.fixBadProps = b; }); fixProps.tooltip = "Remove all props causing issue\nCheck the option and load your save"; group.AddSpace(10); panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); } catch (Exception e) { DebugUtils.Log("OnSettingsUI failed"); DebugUtils.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { /* * NoBuoysModConfig config = Configuration<NoBuoysModConfig>.Load(); * * bool isEnabled = config.NoBuoysEnabled; * * helper.AddCheckbox( "Remove buoys", isEnabled, sel => { * config.NoBuoysEnabled = sel; * Configuration<NoBuoysModConfig>.Save(); * } ); */ UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; UICheckBox checkBox = (UICheckBox)group.AddCheckbox(translation.GetTranslation("NBM_REMOVE_BUOYS"), NoBuoysMod.noBuoysEnabled.value, (b) => { NoBuoysMod.noBuoysEnabled.value = b; }); checkBox.tooltip = translation.GetTranslation("NBM_REMOVE_BUOYS_TOOLTIP"); panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); // Disable SJA PublishedFileId SJA_ID = new PublishedFileId(553184329); foreach (PluginManager.PluginInfo plugin in PluginManager.instance.GetPluginsInfo()) { if (plugin.publishedFileID == SJA_ID && plugin.isEnabled) { try { DebugUtils.Log("Disabling SJA"); plugin.isEnabled = false; } catch { } } } } catch (Exception e) { DebugUtils.Log("OnSettingsUI failed"); DebugUtils.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); UICheckBox checkBox = (UICheckBox)group.AddCheckbox("Disable Undo/Redo shortcuts when using unsupported tools", sa_disableShortcuts.value, (b) => { sa_disableShortcuts.value = b; }); checkBox.tooltip = "Shortcuts are inactive when using unsupported tools (eg. zoning tool) or tools with their own undo implementation (eg. Move It!)\n" + "Warning: Although the shortcuts are disabled, all actions are still saved in undo queue!"; checkBox = (UICheckBox)group.AddCheckbox("Ignore costs", sa_ignoreCosts.value, (b) => { sa_ignoreCosts.value = b; }); checkBox.tooltip = "Undo/Redo won't change account balance"; group.AddSpace(10); UITextField tf = null; tf = (UITextField)group.AddTextfield("Undo queue capacity (hit enter to submit): ", sa_queueCapacity.value.ToString(), (text) => { }, (text) => { int val; if (int.TryParse(text, out val) && val > 0) { UndoMod.Instsance.ChangeQueueCapacity(val); sa_queueCapacity.value = val; } else { tf.text = "10"; } }); tf.tooltip = "Warning: Current queue will be discarded\nDefault value is 10"; } catch (Exception e) { Debug.Log("OnSettingsUI failed"); Debug.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel uipanel = group.self as UIPanel; group.AddSpace(10); uipanel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); UICheckBox checkBox = (UICheckBox)group.AddCheckbox("Show mod icon on toolbar (needs reload)", ShowUIButton.value, (b) => { ShowUIButton.value = b; }); checkBox.tooltip = "Show Adjust Pathfinding icon in road tools panel (You can always use the shortcut to open mod menu)"; group.AddSpace(10); group.AddButton("Reset tool window position", () => { savedWindowX.Delete(); savedWindowY.Delete(); if (UIWindow.Instance != null) { UIWindow.Instance.absolutePosition = defWindowPosition; } }); group.AddSpace(10); group.AddButton("Acknowledgements & Developer Info", () => { UIWindow.ThrowErrorMsg(DeveloperInfo); }); } catch (Exception e) { Debug.LogError("OnSettingsUI failed"); Debug.Log(e); } }
public static void Make(ExtUITabstrip tabStrip) { UIHelper panelHelper = tabStrip.AddTabPage("Startup"); panelHelper.AddLabel("restart required to take effect.", textColor: Color.yellow); panelHelper.AddSpace(10); panelHelper.AddButton("Reset load orders", OnResetLoadOrdersClicked); panelHelper.AddCheckbox( "remove ad panels", ConfigUtil.Config.TurnOffSteamPanels, val => { ConfigUtil.Config.TurnOffSteamPanels = val; ConfigUtil.SaveConfig(); }); var c2 = panelHelper.AddCheckbox( "Improve content manager", ConfigUtil.Config.FastContentManager, val => { ConfigUtil.Config.FastContentManager = val; ConfigUtil.SaveConfig(); }) as UIComponent; c2.tooltip = "faster content manager"; var c3 = panelHelper.AddCheckbox( "Add harmony resolver", ConfigUtil.Config.AddHarmonyResolver, val => { ConfigUtil.Config.AddHarmonyResolver = val; ConfigUtil.SaveConfig(); }) as UICheckBox; var c4 = panelHelper.AddCheckbox( "Cache asset details for the tool.", ConfigUtil.Config.UGCCache, val => { ConfigUtil.Config.UGCCache = val; ConfigUtil.SaveConfig(); }) as UICheckBox; var c5 = panelHelper.AddCheckbox( "Hide steam download errors (Ignorance is bliss!)", ConfigUtil.Config.IgnoranceIsBliss, val => { ConfigUtil.Config.IgnoranceIsBliss = val; ConfigUtil.SaveConfig(); }) as UICheckBox; }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; UICheckBox checkBox = (UICheckBox)group.AddCheckbox(Translations.Translate("NTCP_SET_VAN"), Settings.skipVanillaProps, (b) => { Settings.skipVanillaProps = b; XMLUtils.SaveSettings(); }); checkBox.tooltip = Translations.Translate("NTCP_SET_VANTP"); group.AddSpace(10); // languate settings UIDropDown languageDropDown = (UIDropDown)group.AddDropdown(Translations.Translate("TRN_CHOICE"), Translations.LanguageList, Translations.Index, (value) => { Translations.Index = value; XMLUtils.SaveSettings(); }); languageDropDown.width = 300; group.AddSpace(10); // show path to NonTerrainConformingPropsConfig.xml string path = Path.Combine(DataLocation.executableDirectory, "NonTerrainConformingPropsConfig.xml"); UITextField customTagsFilePath = (UITextField)group.AddTextfield(Translations.Translate("NTCP_SET_CONF") + " - NonTerrainConformingPropsConfig.xml", path, _ => { }, _ => { }); customTagsFilePath.width = panel.width - 30; group.AddButton(Translations.Translate("NTCP_SET_CONFFE"), () => System.Diagnostics.Process.Start(DataLocation.executableDirectory)); } catch (Exception e) { Debug.Log("OnSettingsUI failed"); Debug.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); } catch (Exception e) { DebugUtils.Log("OnSettingsUI failed"); DebugUtils.LogException(e); } }
/// <summary> /// Called by the game when the mod options panel is setup. /// </summary> public void OnSettingsUI(UIHelperBase helper) { try { if (FindIt.instance == null) { AssetTagList.instance = new AssetTagList(); } UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; // Disable debug messages logging UICheckBox checkBox = (UICheckBox)group.AddCheckbox(Translations.Translate("FIF_SET_DM"), Settings.hideDebugMessages, (b) => { Settings.hideDebugMessages = b; XMLUtils.SaveSettings(); }); checkBox.tooltip = Translations.Translate("FIF_SET_DMTP"); group.AddSpace(10); // Center the main toolbar checkBox = (UICheckBox)group.AddCheckbox(Translations.Translate("FIF_SET_CMT"), Settings.centerToolbar, (b) => { Settings.centerToolbar = b; XMLUtils.SaveSettings(); if (FindIt.instance != null) { FindIt.instance.UpdateMainToolbar(); } }); checkBox.tooltip = Translations.Translate("FIF_SET_CMTTP"); group.AddSpace(10); // Unlock all checkBox = (UICheckBox)group.AddCheckbox(Translations.Translate("FIF_SET_UL"), Settings.unlockAll, (b) => { Settings.unlockAll = b; XMLUtils.SaveSettings(); }); checkBox.tooltip = Translations.Translate("FIF_SET_ULTP"); group.AddSpace(10); // Fix bad props next loaded save // Implemented by samsamTS. Need to figure out why this is needed. UICheckBox fixProps = (UICheckBox)group.AddCheckbox(Translations.Translate("FIF_SET_BP"), false, (b) => { Settings.fixBadProps = b; XMLUtils.SaveSettings(); }); fixProps.tooltip = Translations.Translate("FIF_SET_BPTP"); group.AddSpace(10); // Use system default browser instead of steam overlay UICheckBox useDefaultBrowser = (UICheckBox)group.AddCheckbox(Translations.Translate("FIF_SET_DB"), Settings.useDefaultBrowser, (b) => { Settings.useDefaultBrowser = b; XMLUtils.SaveSettings(); }); useDefaultBrowser.tooltip = Translations.Translate("FIF_SET_DBTP"); group.AddSpace(10); // Disable update notice UICheckBox disableUpdateNotice = (UICheckBox)group.AddCheckbox(Translations.Translate("FIF_SET_DUN"), Settings.disableUpdateNotice, (b) => { Settings.disableUpdateNotice = b; XMLUtils.SaveSettings(); }); useDefaultBrowser.tooltip = Translations.Translate("FIF_SET_DBTP"); group.AddSpace(10); // Disable update notice UICheckBox separateSearchKeyword = (UICheckBox)group.AddCheckbox(Translations.Translate("FIF_SET_SSK"), Settings.separateSearchKeyword, (b) => { Settings.separateSearchKeyword = b; XMLUtils.SaveSettings(); }); separateSearchKeyword.tooltip = Translations.Translate("FIF_SET_SSKTP"); group.AddSpace(10); // languate settings UIDropDown languageDropDown = (UIDropDown)group.AddDropdown(Translations.Translate("TRN_CHOICE"), Translations.LanguageList, Translations.Index, (value) => { Translations.Index = value; XMLUtils.SaveSettings(); }); languageDropDown.width = 300; group.AddSpace(10); // show path to FindItCustomTags.xml string path = Path.Combine(DataLocation.localApplicationData, "FindItCustomTags.xml"); UITextField customTagsFilePath = (UITextField)group.AddTextfield(Translations.Translate("FIF_SET_CTFL"), path, _ => { }, _ => { }); customTagsFilePath.width = panel.width - 30; // from aubergine10's AutoRepair if (Application.platform == RuntimePlatform.WindowsPlayer) { group.AddButton(Translations.Translate("FIF_SET_CTFOP"), () => System.Diagnostics.Process.Start("explorer.exe", "/select," + path)); } // shortcut keys panel.gameObject.AddComponent <MainButtonKeyMapping>(); panel.gameObject.AddComponent <AllKeyMapping>(); panel.gameObject.AddComponent <NetworkKeyMapping>(); panel.gameObject.AddComponent <PloppableKeyMapping>(); panel.gameObject.AddComponent <GrowableKeyMapping>(); panel.gameObject.AddComponent <RicoKeyMapping>(); panel.gameObject.AddComponent <GrwbRicoKeyMapping>(); panel.gameObject.AddComponent <PropKeyMapping>(); panel.gameObject.AddComponent <DecalKeyMapping>(); panel.gameObject.AddComponent <TreeKeyMapping>(); panel.gameObject.AddComponent <RandomSelectionKeyMapping>(); group.AddSpace(10); } catch (Exception e) { Debugging.Message("OnSettingsUI failed"); Debugging.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { if (FindIt.instance == null) { AssetTagList.instance = new AssetTagList(); } UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; UICheckBox checkBox = (UICheckBox)group.AddCheckbox(Translations.Translate("FIF_SET_DM"), Debugging.hideDebugMessages.value, (b) => { Debugging.hideDebugMessages.value = b; }); checkBox.tooltip = Translations.Translate("FIF_SET_DMTP"); group.AddSpace(10); checkBox = (UICheckBox)group.AddCheckbox(Translations.Translate("FIF_SET_CMT"), FindIt.centerToolbar.value, (b) => { FindIt.centerToolbar.value = b; if (FindIt.instance != null) { FindIt.instance.UpdateMainToolbar(); } }); checkBox.tooltip = Translations.Translate("FIF_SET_CMTTP"); checkBox = (UICheckBox)group.AddCheckbox(Translations.Translate("FIF_SET_UL"), FindIt.unlockAll.value, (b) => { FindIt.unlockAll.value = b; }); checkBox.tooltip = Translations.Translate("FIF_SET_ULTP"); group.AddSpace(10); UICheckBox fixProps = (UICheckBox)group.AddCheckbox(Translations.Translate("FIF_SET_BP"), false, (b) => { FindIt.fixBadProps = b; }); fixProps.tooltip = Translations.Translate("FIF_SET_BPTP"); group.AddSpace(10); panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); UIDropDown languageDropDown = (UIDropDown)group.AddDropdown(Translations.Translate("TRN_CHOICE"), Translations.LanguageList, Translations.Index, (value) => { Translations.Index = value; }); group.AddSpace(10); } catch (Exception e) { Debugging.Message("OnSettingsUI failed"); Debugging.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; FollowRoadToolSelection.Draw(group); NeedMoney.Draw(group); CtrlToReverseDirection.Draw(group); UnlimitedRadius.Draw(group, (b) => { if (UIWindow.instance != null) { UIWindow.instance.InitPanels(); } }); SelectTwoWayRoads.Draw(group, (b) => { if (UIWindow.instance != null) { UIWindow.instance.dropDown.Populate(); // Reload dropdown menu } }); DoNotFilterPrefabs.Draw(group, (b) => { if (UIWindow.instance != null) { UIWindow.instance.dropDown.Populate(); // Reload dropdown menu } }); DoNotRemoveAnyRoads.Draw(group); group.AddSpace(10); ShowUIButton.Draw(group); UseExtraKeys.Draw(group); UseOldSnappingAlgorithm.Draw(group); LegacyEllipticRoundabouts.Draw(group, (b) => { if (UIWindow.instance != null) { UIWindow.instance.InitPanels(); } }); group.AddSpace(10); panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); group.AddButton("Reset tool window position", () => { savedWindowX.Delete(); savedWindowY.Delete(); if (UIWindow.instance) { UIWindow.instance.absolutePosition = defWindowPosition; } }); group.AddSpace(10); group.AddButton("Remove glitched roads (Save game inbefore)", () => { Tools.GlitchedRoadsCheck.RemoveGlitchedRoads(); }); } catch (Exception e) { Debug.Log("OnSettingsUI failed"); Debug.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; UICheckBox checkBox = (UICheckBox)group.AddCheckbox("Show mod icon on toolbar (needs reload)", ShowUIButton.value, (b) => { ShowUIButton.value = b; }); checkBox.tooltip = "Show the Roundabout Builder icon in road tools panel (You can always use CTRL+O to open the mod menu)"; checkBox = (UICheckBox)group.AddCheckbox("Use the selected road in roads menu as the roundabout road", FollowRoadToolSelection.value, (b) => { FollowRoadToolSelection.value = b; }); checkBox.tooltip = "Your selected road for the roundabout will change as you browse through the roads menu"; checkBox = (UICheckBox)group.AddCheckbox("Require money", NeedMoney.value, (b) => { NeedMoney.value = b; }); checkBox.tooltip = "Building a roundabout will cost you money"; checkBox = (UICheckBox)group.AddCheckbox("Use old snapping algorithm", UseOldSnappingAlgorithm.value, (b) => { UseOldSnappingAlgorithm.value = b; }); checkBox.tooltip = "Old snapping algorithm connects roads at 90° angle, but distorts their geometry"; checkBox = (UICheckBox)group.AddCheckbox("Allow selection of two-way roads", SelectTwoWayRoads.value, (b) => { SelectTwoWayRoads.value = b; UIWindow2.instance.dropDown.Populate(); // Reload dropdown menu }); checkBox.tooltip = "You can select two-way roads for your roundabouts through the roads menu (if that option is enabled)"; checkBox = (UICheckBox)group.AddCheckbox("Do not remove or connect any roads (experimental)", DoNotRemoveAnyRoads.value, (b) => { DoNotRemoveAnyRoads.value = b; }); checkBox.tooltip = "No roads will be removed or connected when the roundabout is built"; checkBox = (UICheckBox)group.AddCheckbox("Do not filter prefabs (include all networks in the menu)", DoNotFilterPrefabs.value, (b) => { DoNotFilterPrefabs.value = b; UIWindow2.instance.dropDown.Populate(); // Reload dropdown menu }); checkBox.tooltip = "The dropdown menu will include all prefabs available, not only one-way roads"; checkBox = (UICheckBox)group.AddCheckbox("Use secondary increase / decrease radius keys", UseExtraKeys.value, (b) => { UseExtraKeys.value = b; }); checkBox.tooltip = "If checked, you can use bound keys from the list below to increase / decrease radius (besides the ones on numpad)"; group.AddSpace(10); panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); group.AddButton("Reset tool window position", () => { savedWindowX.Delete(); savedWindowY.Delete(); if (UIWindow2.instance) { UIWindow2.instance.absolutePosition = defWindowPosition; } }); group.AddSpace(10); group.AddButton("Remove glitched roads (Save game inbefore)", () => { Tools.GlitchedRoadsCheck.RemoveGlitchedRoads(); }); } catch (Exception e) { Debug.Log("OnSettingsUI failed"); Debug.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; group.AddSpace(10); group.AddDropdown(Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-SORTING"), new string[] { Translation.Instance.GetTranslation("FOREST-BRUSH-DATA-NAME"), Translation.Instance.GetTranslation("FOREST-BRUSH-DATA-AUTHOR"), Translation.Instance.GetTranslation("FOREST-BRUSH-DATA-TEXTURE"), Translation.Instance.GetTranslation("FOREST-BRUSH-DATA-TRIANGLES") }, (int)Settings.Sorting, (index) => { Settings.Sorting = (TreeSorting)index; SaveSettings(); }); group.AddSpace(10); group.AddDropdown(Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-SORTING-ORDER"), new string[] { Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-SORTING-DESCENDING"), Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-SORTING-ASCENDING") }, (int)Settings.SortingOrder, (index) => { Settings.SortingOrder = (SortingOrder)index; SaveSettings(); }); group.AddSpace(10); searchLogic = (UIDropDown)group.AddDropdown(Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-FILTERING-LOGIC"), new string[] { Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-FILTERING-AND"), Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-FILTERING-OR"), Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-FILTERING-SIMPLE") }, (int)Settings.FilterStyle, (index) => { Settings.FilterStyle = (FilterStyle)index; SaveSettings(); }); searchLogic.width = 500.0f; group.AddSpace(10); newBrushBehaviour = (UIDropDown)group.AddDropdown(Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-NEWBRUSH"), new string[] { Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-NEWBRUSH-CLEAR"), Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-NEWBRUSH-KEEP") }, Settings.KeepTreesInNewBrush ? 1 : 0, (index) => { Settings.KeepTreesInNewBrush = index == 1 ? true : false; SaveSettings(); }); newBrushBehaviour.width = 500.0f; group.AddSpace(10); group.AddCheckbox(Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-SHOWMESHDATA"), Settings.ShowTreeMeshData, (b) => { Settings.ShowTreeMeshData = b; SaveSettings(); }); group.AddSpace(10); group.AddCheckbox(Translation.Instance.GetTranslation("FOREST-BRUSH-OPTIONS-IGNORE-VANILLA"), Settings.IgnoreVanillaTrees, (b) => { Settings.IgnoreVanillaTrees = b; SaveSettings(); if (LoadingManager.instance.m_loadingComplete) { ForestBrush.Instance.LoadTrees(); ForestBrush.Instance.ForestBrushPanel.BrushEditSection.SetupFastlist(); } }); group.AddSpace(20); optionKeys = panel.gameObject.AddComponent <OptionsKeyBinding>(); group.AddSpace(10); } catch (Exception) { Debug.LogWarning("OnSettingsUI failure."); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; UICheckBox checkBox = (UICheckBox)group.AddCheckbox("Disable debug messages logging", DebugUtils.hideDebugMessages.value, (b) => { DebugUtils.hideDebugMessages.value = b; }); checkBox.tooltip = "If checked, debug messages won't be logged."; group.AddSpace(10); checkBox = (UICheckBox)group.AddCheckbox("Reduce rail catenary masts", FineRoadTool.reduceCatenary.value, (b) => { FineRoadTool.reduceCatenary.value = b; if (FineRoadTool.instance != null) { FineRoadTool.instance.UpdateCatenary(); } }); checkBox.tooltip = "Reduce the number of catenary mast of rail lines from 3 to 1 per segment.\n"; group.AddSpace(10); checkBox = (UICheckBox)group.AddCheckbox("Change max turn angle for more realistic tram tracks turns", FineRoadTool.changeMaxTurnAngle.value, (b) => { FineRoadTool.changeMaxTurnAngle.value = b; if (b) { RoadPrefab.SetMaxTurnAngle(FineRoadTool.maxTurnAngle); } else { RoadPrefab.ResetMaxTurnAngle(); } }); checkBox.tooltip = "Change all roads with tram tracks max turn angle by the value below if current value is higher"; group.AddTextfield("Max turn angle: ", FineRoadTool.maxTurnAngle.ToString(), (f) => {}, (s) => { float f = 0; float.TryParse(s, out f); FineRoadTool.maxTurnAngle.value = Mathf.Clamp(f, 0f, 180f); if (FineRoadTool.changeMaxTurnAngle.value) { RoadPrefab.SetMaxTurnAngle(FineRoadTool.maxTurnAngle.value); } }); group.AddSpace(10); panel.gameObject.AddComponent <OptionsKeymapping>(); group.AddSpace(10); group.AddButton("Reset tool window position", () => { UIToolOptionsButton.savedWindowX.Delete(); UIToolOptionsButton.savedWindowY.Delete(); if (UIToolOptionsButton.toolOptionsPanel) { UIToolOptionsButton.toolOptionsPanel.absolutePosition = new Vector3(-1000, -1000); } }); } catch (Exception e) { DebugUtils.Log("OnSettingsUI failed"); DebugUtils.LogException(e); } }
public void OnSettingsUI(UIHelperBase helper) { LoadSettings(); UIDropDown uIDropDown = (UIDropDown)helper.AddDropdown("Select Preset", EmergencyLightPresets, SelectedPreset, delegate(int sel) { if (sel == 1) { CustomSettingsVisibility = true; } else { CustomSettingsVisibility = false; } SelectedPreset = sel; if (loaded) { Apply(); } }); UIScrollablePanel uIScrollablePanel = ((UIHelper)helper).self as UIScrollablePanel; uIScrollablePanel.autoLayout = false; int num = 100; int num2 = 10; int num3 = 40; strip = uIScrollablePanel.AddUIComponent <UITabstrip>(); strip.relativePosition = new Vector3(num2, num); strip.size = new Vector2(744 - num2, num3); container = uIScrollablePanel.AddUIComponent <UITabContainer>(); container.relativePosition = new Vector3(num2, num3 + num); container.size = new Vector3(744 - num2, 713 - num); strip.tabPages = container; UIButton uIButton = (UIButton)UITemplateManager.Peek("OptionsButtonTemplate"); UIButton uIButton2 = strip.AddTab("Police Car", uIButton, fillText: true); uIButton2.textColor = uIButton.textColor; uIButton2.pressedTextColor = uIButton.pressedTextColor; uIButton2.hoveredTextColor = uIButton.hoveredTextColor; uIButton2.focusedTextColor = uIButton.hoveredTextColor; uIButton2.disabledTextColor = uIButton.hoveredTextColor; UIPanel uIPanel = strip.tabContainer.components[0] as UIPanel; uIPanel.autoLayout = true; uIPanel.wrapLayout = true; uIPanel.autoLayoutDirection = LayoutDirection.Horizontal; UIHelper uIHelper = new UIHelper(uIPanel); uIHelper.AddSpace(15); uIHelper.AddDropdown("Left", ColorNames, Array.IndexOf(ColorNames, settings[Setting.PoliceLeft]), delegate(int sel) { settings[Setting.PoliceLeft] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); uIHelper.AddDropdown("Right", ColorNames, Array.IndexOf(ColorNames, settings[Setting.PoliceRight]), delegate(int sel) { settings[Setting.PoliceRight] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); uIButton2 = strip.AddTab("Fire Truck"); uIButton2.textColor = uIButton.textColor; uIButton2.pressedTextColor = uIButton.pressedTextColor; uIButton2.hoveredTextColor = uIButton.hoveredTextColor; uIButton2.focusedTextColor = uIButton.hoveredTextColor; uIButton2.disabledTextColor = uIButton.hoveredTextColor; uIPanel = (strip.tabContainer.components[1] as UIPanel); uIPanel.autoLayout = true; uIPanel.wrapLayout = true; uIPanel.autoLayoutDirection = LayoutDirection.Horizontal; uIHelper = new UIHelper(uIPanel); uIHelper.AddSpace(15); uIHelper.AddDropdown("Left", ColorNames, Array.IndexOf(ColorNames, settings[Setting.FireLeft]), delegate(int sel) { settings[Setting.FireLeft] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); uIHelper.AddDropdown("Right", ColorNames, Array.IndexOf(ColorNames, settings[Setting.FireRight]), delegate(int sel) { settings[Setting.FireRight] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); uIHelper.AddSpace(15); chkManualRearFire = (uIHelper.AddCheckbox("Configure Rear Lights Separately", Convert.ToBoolean(settings[Setting.ManualRearFire]), delegate(bool chkd) { settings[Setting.ManualRearFire] = chkd.ToString(); ExportSettings(); RearFireVisibility(chkd); if (loaded) { Apply(); } }) as UICheckBox); chkManualRearFire.width = 744f; uIHelper.AddSpace(15); ddFireLeftRear = (UIDropDown)uIHelper.AddDropdown("Left", ColorNames, Array.IndexOf(ColorNames, settings[Setting.FireLeftRear]), delegate(int sel) { settings[Setting.FireLeftRear] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); ddFireRightRear = (UIDropDown)uIHelper.AddDropdown("Right", ColorNames, Array.IndexOf(ColorNames, settings[Setting.FireRightRear]), delegate(int sel) { settings[Setting.FireRightRear] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); RearFireVisibility(Convert.ToBoolean(settings[Setting.ManualRearFire])); uIButton2 = strip.AddTab("Ambulance"); uIButton2.textColor = uIButton.textColor; uIButton2.pressedTextColor = uIButton.pressedTextColor; uIButton2.hoveredTextColor = uIButton.hoveredTextColor; uIButton2.focusedTextColor = uIButton.hoveredTextColor; uIButton2.disabledTextColor = uIButton.hoveredTextColor; uIPanel = (strip.tabContainer.components[2] as UIPanel); uIPanel.autoLayout = true; uIPanel.wrapLayout = true; uIPanel.autoLayoutDirection = LayoutDirection.Horizontal; uIHelper = new UIHelper(uIPanel); uIHelper.AddSpace(15); uIHelper.AddDropdown("Left", ColorNames, Array.IndexOf(ColorNames, settings[Setting.AmbulanceLeft]), delegate(int sel) { settings[Setting.AmbulanceLeft] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); uIHelper.AddDropdown("Right", ColorNames, Array.IndexOf(ColorNames, settings[Setting.AmbulanceRight]), delegate(int sel) { settings[Setting.AmbulanceRight] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); uIHelper.AddSpace(15); chkManualRearAmbulance = (uIHelper.AddCheckbox("Configure Rear Lights Separately", Convert.ToBoolean(settings[Setting.ManualRearAmbulance]), delegate(bool chkd) { settings[Setting.ManualRearAmbulance] = chkd.ToString(); ExportSettings(); RearAmbulanceVisibility(chkd); if (loaded) { Apply(); } }) as UICheckBox); chkManualRearAmbulance.width = 744f; uIHelper.AddSpace(15); ddAmbulanceLeftRear = (UIDropDown)uIHelper.AddDropdown("Left", ColorNames, Array.IndexOf(ColorNames, settings[Setting.AmbulanceLeftRear]), delegate(int sel) { settings[Setting.AmbulanceLeftRear] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); ddAmbulanceRightRear = (UIDropDown)uIHelper.AddDropdown("Right", ColorNames, Array.IndexOf(ColorNames, settings[Setting.AmbulanceRightRear]), delegate(int sel) { settings[Setting.AmbulanceRightRear] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); RearAmbulanceVisibility(Convert.ToBoolean(settings[Setting.ManualRearAmbulance])); uIButton2 = strip.AddTab("Rotary (e.g. Snow Plow)", uIButton, fillText: true); uIButton2.textColor = uIButton.textColor; uIButton2.pressedTextColor = uIButton.pressedTextColor; uIButton2.hoveredTextColor = uIButton.hoveredTextColor; uIButton2.focusedTextColor = uIButton.hoveredTextColor; uIButton2.disabledTextColor = uIButton.hoveredTextColor; uIPanel = strip.tabContainer.components[3] as UIPanel; uIPanel.autoLayout = true; uIPanel.wrapLayout = true; uIPanel.autoLayoutDirection = LayoutDirection.Horizontal; uIHelper = new UIHelper(uIPanel); uIHelper.AddSpace(15); uIHelper.AddDropdown("Left", ColorNames, Array.IndexOf(ColorNames, settings[Setting.SnowPlowLeft]), delegate(int sel) { settings[Setting.SnowPlowLeft] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); uIHelper.AddDropdown("Right", ColorNames, Array.IndexOf(ColorNames, settings[Setting.SnowPlowRight]), delegate(int sel) { settings[Setting.SnowPlowRight] = ColorNames[sel]; ExportSettings(); if (loaded) { Apply(); } }); strip.selectedIndex = -1; strip.selectedIndex = 0; int selectedIndex = uIDropDown.selectedIndex; uIDropDown.selectedIndex = -1; uIDropDown.selectedIndex = selectedIndex; }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper uiHelper = helper.AddGroup(this.Name) as UIHelper; UIPanel self = uiHelper.self as UIPanel; ((UIComponent)uiHelper.AddCheckbox( "Enable custom vehicles", Settings.enableCustomVehicles, b => Settings.enableCustomVehicles.value = b)) .tooltip = "Enable ability to set vehicle types used by service buildings. Disable to use default game logic or other mods."; ((UIComponent)uiHelper.AddCheckbox( "Enable dummy cargo traffic", Settings.enableDummyCargoTraffic, b => Settings.enableDummyCargoTraffic.value = b)) .tooltip = "By default, the base game will generate a little dummy cargo traffic. Disable this option if you have massive traffic problems emanating from outside connections."; ((UIComponent)uiHelper.AddCheckbox( "Enable ability to customize industries supply chain", Settings.enableIndustriesControl, b => Settings.enableIndustriesControl.value = b)) .tooltip = "By default, the mod offers the ability to control your industries supply chain. Disable this option if you want the base game to control the supply chain."; ((UIComponent)uiHelper.AddCheckbox( "Enable legacy ability to select individual outside connections using the tool", Settings.enableSelectOutsideConnection, b => Settings.enableSelectOutsideConnection.value = b)) .tooltip = "Strongly recommend against enabling this legacy feature. This was originally put in to deal with massive traffic originating from outside connections. Not needed anymore."; ((UIComponent)uiHelper.AddCheckbox( "Show campus districts in district dropdown menu", Settings.showCampusDistricts, b => Settings.showCampusDistricts.value = b)) .tooltip = "Disable this option if you do not wish to be able to see campus districts in the dropdown menu."; ((UIComponent)uiHelper.AddCheckbox( "Show industry districts in district dropdown menu", Settings.showIndustryDistricts, b => Settings.showIndustryDistricts.value = b)) .tooltip = "Disable this option if you do not wish to be able to see industry districts in the dropdown menu."; ((UIComponent)uiHelper.AddCheckbox( "Show park districts in district dropdown menu", Settings.showParkDistricts, b => Settings.showParkDistricts.value = b)) .tooltip = "Disable this option if you do not wish to be able to see park districts in the dropdown menu."; ((UIComponent)uiHelper.AddCheckbox( "Show welcome message", Settings.showWelcomeMessage, b => Settings.showWelcomeMessage.value = b)) .tooltip = "Automatically disabled upon first viewing the welcome message."; uiHelper.AddSpace(10); self.gameObject.AddComponent <UIOptionsKeymapping>(); } catch (Exception ex) { Logger.Log("EnhancedDistrictServicesMod::OnSettingsUI failed"); Logger.LogException(ex); } }
public void OnSettingsUI(UIHelperBase helper) { try { UIHelper group = helper.AddGroup(Name) as UIHelper; UIPanel panel = group.self as UIPanel; // Integrate main button with UUI UICheckBox integrateMainButtonUUI = (UICheckBox)group.AddCheckbox(Translations.Translate("YAT_SET_UUI"), Settings.integrateMainButtonUUI, (b) => { Settings.integrateMainButtonUUI = b; XMLUtils.SaveSettings(); if (YetAnotherToolbar.instance?.mainButton != null) { if (Settings.integrateMainButtonUUI) { UUIIntegration.AttachMainButton(); } else { UUIIntegration.DetachMainButton(); } } }); group.AddSpace(10); // Hide main button UICheckBox hideMainButton = (UICheckBox)group.AddCheckbox(Translations.Translate("YAT_SET_HMB"), Settings.hideMainButton, (b) => { Settings.hideMainButton = b; XMLUtils.SaveSettings(); if (YetAnotherToolbar.instance?.mainButton != null) { YetAnotherToolbar.instance.mainButton.isVisible = !Settings.hideMainButton; } }); group.AddSpace(10); UIButton mainButtonPositionReset = (UIButton)group.AddButton(Translations.Translate("YAT_SET_HMBRST"), () => { Settings.mainButtonX = 538.0f; Settings.mainButtonY = 947.0f; XMLUtils.SaveSettings(); if (YetAnotherToolbar.instance?.mainButton != null) { UIView view = UIView.GetAView(); Vector2 screenResolution = view.GetScreenResolution(); YetAnotherToolbar.instance.mainButton.absolutePosition = new Vector3(Settings.mainButtonX * screenResolution.x / 1920f, Settings.mainButtonY * screenResolution.y / 1080f);// advisorButton.absolutePosition + new Vector3(advisorButton.width, 0); } }); group.AddSpace(10); // Hide Advisor Button UICheckBox hideAdvisorButton = (UICheckBox)group.AddCheckbox(Translations.Translate("YAT_SET_HAB"), Settings.hideAdvisorButton, (b) => { Settings.hideAdvisorButton = b; XMLUtils.SaveSettings(); if (YetAnotherToolbar.instance != null) { YetAnotherToolbar.instance.SetAdvisorButtonVisibility(); } }); group.AddSpace(10); /* * // Hide Filter Panels * UICheckBox hideFilterPanels = (UICheckBox)group.AddCheckbox(Translations.Translate("YAT_SET_HFP"), Settings.hideFilterPanels, (b) => * { * Settings.hideFilterPanels = b; * XMLUtils.SaveSettings(); * if (YetAnotherToolbar.instance != null) * { * YetAnotherToolbar.instance.hideFilterPanels = Settings.hideFilterPanels; * YetAnotherToolbar.instance.SetFilterPanelsVisibility(); * } * }); * group.AddSpace(10); */ // Disable update notice UICheckBox disableUpdateNotice = (UICheckBox)group.AddCheckbox(Translations.Translate("YAT_SET_DUN"), Settings.disableUpdateNotice, (b) => { Settings.disableUpdateNotice = b; XMLUtils.SaveSettings(); }); group.AddSpace(10); // languate settings UIDropDown languageDropDown = (UIDropDown)group.AddDropdown(Translations.Translate("TRN_CHOICE"), Translations.LanguageList, Translations.Index, (value) => { Translations.Index = value; XMLUtils.SaveSettings(); }); languageDropDown.width = 300; group.AddSpace(10); // show path to YetAnotherToolbarConfig.xml string path = Path.Combine(DataLocation.executableDirectory, "YetAnotherToolbarConfig.xml"); UITextField ConfigFilePath = (UITextField)group.AddTextfield($"{Translations.Translate("YAT_SET_CFP")} - YetAnotherToolbarConfig.xml", path, _ => { }, _ => { }); ConfigFilePath.width = panel.width - 30; group.AddButton(Translations.Translate("YAT_SET_OFE"), () => System.Diagnostics.Process.Start(DataLocation.executableDirectory)); // shortcut keys panel.gameObject.AddComponent <ModeToggleKeyMapping>(); panel.gameObject.AddComponent <QuickMenuKeyMapping>(); panel.gameObject.AddComponent <HideMenuKeyMapping>(); group.AddSpace(10); } catch (Exception e) { Debugging.Message("OnSettingsUI failed"); Debugging.LogException(e); } }