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 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; }