public static void SetTimedLightsEnabled(bool newValue) {
            Options.RebuildMenu();
            Options.timedLightsEnabled = newValue;

            if (OptionsMaintenanceTab.EnableTimedLightsToggle != null) {
                OptionsMaintenanceTab.EnableTimedLightsToggle.isChecked = newValue;
            }

            if (!newValue) {
                OptionsOverlaysTab.SetTimedLightsOverlay(false);
            }
        }
        public static void MakeSettings(UIHelperBase helper)
        {
            ExtUITabstrip tabStrip = ExtUITabstrip.Create(helper);

            OptionsGeneralTab.MakeSettings_General(tabStrip);
            OptionsGameplayTab.MakeSettings_Gameplay(tabStrip);
            OptionsVehicleRestrictionsTab.MakeSettings_VehicleRestrictions(tabStrip);
            OptionsOverlaysTab.MakeSettings_Overlays(tabStrip);
            OptionsMaintenanceTab.MakeSettings_Maintenance(tabStrip);
            OptionsKeybindsTab.MakeSettings_Keybinds(tabStrip);
            tabStrip.Invalidate();
        }
        public static void SetPrioritySignsEnabled(bool newValue) {
            Options.RebuildMenu();
            Options.prioritySignsEnabled = newValue;

            if (OptionsMaintenanceTab.EnablePrioritySignsToggle != null) {
                OptionsMaintenanceTab.EnablePrioritySignsToggle.isChecked = newValue;
            }

            if (!newValue) {
                OptionsOverlaysTab.SetPrioritySignsOverlay(false);
            }
        }
Пример #4
0
        private static void OnVehicleRestrictionsEnabledChanged(bool val)
        {
            if (!Options.IsGameLoaded())
            {
                return;
            }

            Options.MenuRebuildRequired        = true;
            Options.vehicleRestrictionsEnabled = val;
            if (!val)
            {
                OptionsOverlaysTab.SetVehicleRestrictionsOverlay(false);
            }
        }
        public static void SetLaneConnectorEnabled(bool newValue)
        {
            Options.laneConnectorEnabled = newValue;
            Options.RebuildMenu();

            if (_enableLaneConnectorToggle != null)
            {
                _enableLaneConnectorToggle.isChecked = newValue;
            }

            if (!newValue)
            {
                OptionsOverlaysTab.SetConnectedLanesOverlay(false);
            }
        }
        public static void SetJunctionRestrictionsEnabled(bool newValue)
        {
            Options.junctionRestrictionsEnabled = newValue;
            Options.RebuildMenu();

            if (_enableJunctionRestrictionsToggle != null)
            {
                _enableJunctionRestrictionsToggle.isChecked = newValue;
            }

            if (!newValue)
            {
                OptionsOverlaysTab.SetJunctionRestrictionsOverlay(false);
            }
        }
        public static void SetCustomSpeedLimitsEnabled(bool newValue)
        {
            Options.customSpeedLimitsEnabled = newValue;
            Options.RebuildMenu();

            if (_enableCustomSpeedLimitsToggle != null)
            {
                _enableCustomSpeedLimitsToggle.isChecked = newValue;
            }

            if (!newValue)
            {
                OptionsOverlaysTab.SetSpeedLimitsOverlay(false);
            }
        }
        private static void OnParkingRestrictionsEnabledChanged(bool val)
        {
            if (!Options.IsGameLoaded())
            {
                return;
            }

            Options.parkingRestrictionsEnabled = val;
            Options.RebuildMenu();

            if (!val)
            {
                OptionsOverlaysTab.SetParkingRestrictionsOverlay(false);
            }
        }
        private static void OnCustomSpeedLimitsEnabledChanged(bool val)
        {
            if (!Options.IsGameLoaded())
            {
                return;
            }

            Options.customSpeedLimitsEnabled = val;
            Options.RebuildMenu();

            if (!val)
            {
                OptionsOverlaysTab.SetSpeedLimitsOverlay(false);
            }
        }
Пример #10
0
        public static void SetParkingRestrictionsEnabled(bool newValue)
        {
            Options.MenuRebuildRequired        = true;
            Options.parkingRestrictionsEnabled = newValue;

            if (_enableParkingRestrictionsToggle != null)
            {
                _enableParkingRestrictionsToggle.isChecked = newValue;
            }

            if (!newValue)
            {
                OptionsOverlaysTab.SetParkingRestrictionsOverlay(false);
            }
        }
        private static void OnTimedLightsEnabledChanged(bool val)
        {
            if (!Options.IsGameLoaded())
            {
                return;
            }

            Options.timedLightsEnabled = val;
            Options.RebuildMenu();

            if (!val)
            {
                OptionsOverlaysTab.SetTimedLightsOverlay(false);
                OptionsVehicleRestrictionsTab.SetTrafficLightPriorityRules(false);
            }
        }
Пример #12
0
        private static void OnPrioritySignsEnabledChanged(bool val)
        {
            if (!Options.IsGameLoaded())
            {
                return;
            }

            Options.MenuRebuildRequired  = true;
            Options.prioritySignsEnabled = val;

            if (!val)
            {
                OptionsOverlaysTab.SetPrioritySignsOverlay(false);
                OptionsVehicleRestrictionsTab.SetTrafficLightPriorityRules(false);
            }
        }
        public static void MakeSettings(UIHelperBase helper)
        {
            // tabbing code is borrowed from RushHour mod
            // https://github.com/PropaneDragon/RushHour/blob/release/RushHour/Options/OptionHandler.cs
            UIHelper    actualHelper = helper as UIHelper;
            UIComponent container    = actualHelper.self as UIComponent;

            UITabstrip tabStrip = container.AddUIComponent <UITabstrip>();

            tabStrip.relativePosition = new Vector3(0, 0);
            tabStrip.size             = new Vector2(container.width - 20, 40);

            UITabContainer tabContainer = container.AddUIComponent <UITabContainer>();

            tabContainer.relativePosition = new Vector3(0, 40);
            tabContainer.size             = new Vector2(container.width - 20, container.height - tabStrip.height - 20);
            tabStrip.tabPages             = tabContainer;

            int tabIndex = 0;

            // GENERAL
            OptionsGeneralTab.MakeSettings_General(tabStrip, tabIndex);

            // GAMEPLAY
            ++tabIndex;
            OptionsGameplayTab.MakeSettings_Gameplay(tabStrip, tabIndex);

            // VEHICLE RESTRICTIONS
            ++tabIndex;
            OptionsVehicleRestrictionsTab.MakeSettings_VehicleRestrictions(tabStrip, tabIndex);

            // OVERLAYS
            ++tabIndex;
            OptionsOverlaysTab.MakeSettings_Overlays(tabStrip, tabIndex);

            // MAINTENANCE
            ++tabIndex;
            OptionsMaintenanceTab.MakeSettings_Maintenance(tabStrip, tabIndex);

            // KEYBOARD
            ++tabIndex;
            OptionsKeybindsTab.MakeSettings_Keybinds(tabStrip, tabIndex);

            tabStrip.selectedIndex = 0;
        }
        private static void OnJunctionRestrictionsEnabledChanged(bool val)
        {
            if (!Options.IsGameLoaded())
            {
                return;
            }

            Options.junctionRestrictionsEnabled = val;
            Options.RebuildMenu();

            if (!val)
            {
                OptionsVehicleRestrictionsTab.SetAllowUTurns(false);
                OptionsVehicleRestrictionsTab.SetAllowEnterBlockedJunctions(false);
                OptionsVehicleRestrictionsTab.SetAllowLaneChangesWhileGoingStraight(false);
                SetTurnOnRedEnabled(false);
                OptionsOverlaysTab.SetJunctionRestrictionsOverlay(false);
            }
        }
Пример #15
0
        private static void OnLaneConnectorEnabledChanged(bool val)
        {
            if (!Options.IsGameLoaded())
            {
                return;
            }

            bool changed = val != Options.laneConnectorEnabled;

            if (!changed)
            {
                return;
            }

            Options.MenuRebuildRequired  = true;
            Options.laneConnectorEnabled = val;
            RoutingManager.Instance.RequestFullRecalculation();

            if (!val)
            {
                OptionsOverlaysTab.SetConnectedLanesOverlay(false);
            }
        }