Exemplo n.º 1
0
        public void OnSettingsUI(UIHelperBase helper)
        {
            try
            {
                AdvancedVehicleOptions.LoadConfig();

                UICheckBox   checkBox;
                UIHelperBase group = helper.AddGroup(Name);

                checkBox = (UICheckBox)group.AddCheckbox("Hide the user interface", AdvancedVehicleOptions.config.hideGUI, (b) =>
                {
                    if (AdvancedVehicleOptions.config.hideGUI != b)
                    {
                        AdvancedVehicleOptions.hideGUI = b;
                        AdvancedVehicleOptions.SaveConfig();
                    }
                });
                checkBox.tooltip = "Hide the UI completely if you feel like you are done with it\nand want to save the little bit of memory it takes\nEverything else will still be functional";

                checkBox = (UICheckBox)group.AddCheckbox("Disable warning at map loading", !AdvancedVehicleOptions.config.onLoadCheck, (b) =>
                {
                    if (AdvancedVehicleOptions.config.onLoadCheck == b)
                    {
                        AdvancedVehicleOptions.config.onLoadCheck = !b;
                        AdvancedVehicleOptions.SaveConfig();
                    }
                });
                checkBox.tooltip = "Disable service vehicle availability check at the loading of a map";
            }
            catch (Exception e)
            {
                DebugUtils.Log("OnSettingsUI failed");
                DebugUtils.LogException(e);
            }
        }
Exemplo n.º 2
0
        public void Start()
        {
            try
            {
                // Loading config
                AdvancedVehicleOptions.LoadConfig();
                AdvancedVehicleOptions.CheckAllServicesValidity();

                m_mainPanel = GameObject.FindObjectOfType <GUI.UIMainPanel>();
                if (m_mainPanel == null && !hideGUI)
                {
                    m_mainPanel = UIView.GetAView().AddUIComponent(typeof(GUI.UIMainPanel)) as GUI.UIMainPanel;
                }
            }
            catch (Exception e)
            {
                DebugUtils.Log("UI initialization failed.");
                DebugUtils.LogException(e);

                GameObject.Destroy(gameObject);
            }
        }