/// <summary> /// Creates the option panel /// </summary> private void SetupOptionPanel() { m_optionPanel = GameObjectUtils.AddUIComponent <UIOptionPanel>(); m_optionPanel.relativePosition = new Vector2(474 - m_optionPanel.width, 949); m_optionPanel.selectedIndex = 0; m_optionPanel.eventSelectedIndexChanged += OnChangeSelectedIndex; m_optionPanel.eventMouseEnter += OnMouseEnterOptionPanel; m_optionPanel.eventMouseLeave += OnMouseLeaveOptionPanel; }
public override void OnLevelLoaded(LoadMode mode) { base.OnLevelLoaded(mode); Debug.Log("[PropLineTool, hereafter PLT]: start PropLineToolMod.OnLevelLoaded"); m_loadMode = mode; m_onLevelLoadedCount++; Debug.Log("[PLT]: Build Version: " + BUILD_VERSION); string _ordinal = Util.OrdinalSuffix(m_onLevelLoadedCount); Debug.Log("[PLT]: PropLineToolMod.OnLevelLoaded(): This is the " + m_onLevelLoadedCount + _ordinal + " time this method has been called, and the LoadMode is " + mode.ToString() + "."); Debug.Log("[PLT]: PropLineToolMod.OnLevelLoaded(): ItemClass.Availabilty of TMC tool controller is " + ToolsModifierControl.toolController.m_mode.ToString() + "."); bool _initializeToolMan = false; _initializeToolMan = ToolMan.ToolMan.Initialize(); //PropLineTool Initialization PropLineTool.PopulateRandIntArray(0, 10000); if (_initializeToolMan == true) { Debug.Log("[PLT]: PropLineToolMod.OnLevelLoaded(): ToolMan.Initialize() returned true."); Debug.Log("[PLT]: PropLineToolMod.OnLevelLoaded(): Adding/Initializing UI components..."); if (optionPanel == null) { optionPanel = (UIView.GetAView().AddUIComponent(typeof(UIOptionPanel)) as UIOptionPanel); } if (basicControlPanel == null) { basicControlPanel = (UIView.GetAView().AddUIComponent(typeof(UIBasicControlPanel)) as UIBasicControlPanel); } Debug.Log("[PLT]: PropLineToolMod.OnLevelLoaded(): UI components addition/initialization finished."); //debug purposes only //UIView.library.ShowModal<ExceptionPanel>("ExceptionPanel").SetMessage("[DEBUG] Prop Line Tool [PLT] Success in Initialization", "Prop Line Tool succeeded in registering itself with the game's tool controllers!", false); } else { Debug.LogError("[PLT]: PropLineToolMod.OnLevelLoaded(): ToolMan.Initialize() returned false."); //special thanks to RushHour.Compatibility for this UIView.library.ShowModal <ExceptionPanel>("ExceptionPanel").SetMessage("Prop Line Tool [PLT] Failed to Initialize", "Prop Line Tool failed to register itself with the game's tool controllers. Please save your output_log from this game session and post a link to it on the workshop page for PLT.", true); } Debug.Log("[PLT]: end PropLineToolMod.OnLevelLoaded"); }