public void DoWindowContents(Rect rect) { Listing_Standard options = new Listing_Standard(); Color defaultColor = new Color(100, 65, 164); options.Begin(rect); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; GUI.color = Color.magenta; options.Label("TwitchToolkitSettingsTitle".Translate()); GUI.color = defaultColor; Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; options.GapLine(); options.Gap(); options.ColumnWidth = (rect.width / 3) - 20f; // Left column if (options.ButtonText("TwitchToolkitChat".Translate())) { currentTab = SettingsTab.Chat; } if (options.ButtonText("TwitchToolkitCoins".Translate())) { currentTab = SettingsTab.Coins; } if (options.ButtonText("Storyteller")) { currentTab = SettingsTab.Storyteller; } if (options.ButtonText("Patches")) { currentTab = SettingsTab.Patches; } options.Gap(); if (options.ButtonText("Wiki")) { Application.OpenURL("https://github.com/hodldeeznuts/twitchtoolkit/wiki"); } // Middle column options.NewColumn(); options.Gap(53f); if (options.ButtonText("TwitchToolkitStore".Translate())) { currentTab = SettingsTab.Store; } if (options.ButtonText("TwitchToolkitKarma".Translate())) { currentTab = SettingsTab.Karma; } if (options.ButtonText("TwitchToolkitCommands".Translate())) { currentTab = SettingsTab.Commands; } if (options.ButtonText("TwitchToolkitCooldowns".Translate())) { currentTab = SettingsTab.Cooldowns; } // Right Column options.NewColumn(); options.Gap(53f); if (options.ButtonText("")) { currentTab = SettingsTab.Options; } if (options.ButtonText("TwitchToolkitViewers".Translate())) { currentTab = SettingsTab.Viewers; } if (options.ButtonText("")) { currentTab = SettingsTab.Integrations; } if (options.ButtonText("")) { currentTab = SettingsTab.Votes; } options.End(); Listing_Standard gapline = new Listing_Standard(); Rect gapliRect = new Rect(rect.x, rect.y, rect.width, rect.height); gapline.Begin(gapliRect); gapline.Gap(); gapline.End(); Rect optionsRect = rect; optionsRect.y = 145; optionsRect.height = 620f; optionsRect.yMax = 765f; Rect scrollViewer = new Rect(optionsRect); scrollViewer.height -= 145f; scrollViewer.yMax -= 145f; Rect viewRect = new Rect(0, 0, rect.width - 125f, 430f); if (currentTab == SettingsTab.Chat) { viewRect.height += 150f; } if (currentTab == SettingsTab.Storyteller) { viewRect.height += 400f; } if (currentTab == SettingsTab.Karma) { viewRect.height += 250f; } if (currentTab == SettingsTab.Viewers) { viewRect.height += 80f; } Listing_Standard optionsListing = new Listing_Standard(); optionsListing.Begin(optionsRect); optionsListing.BeginScrollView(scrollViewer, ref scrollVector2, ref viewRect); switch (currentTab) { case SettingsTab.Coins: Settings_Coins.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Storyteller: Settings_Storyteller.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Patches: Settings_Patches.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Store: Settings_Store.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Karma: Settings_Karma.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Commands: Settings_Commands.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Cooldowns: Settings_Cooldowns.DoWindowContents(viewRect, optionsListing); break; //case SettingsTab.Options: // Settings_Options.DoWindowContents(viewRect, optionsListing); // break; case SettingsTab.Viewers: Settings_Viewers.DoWindowContents(viewRect, optionsListing); break; //case SettingsTab.Integrations: // Settings_Integrations.DoWindowContents(viewRect, optionsListing); // break; //case SettingsTab.Votes: // Settings_VoteWeights.DoWindowContents(viewRect, optionsListing); // break; default: Settings_Chat.DoWindowContents(viewRect, optionsListing); break; } optionsListing.EndScrollView(ref viewRect); optionsListing.End(); }
public void DoWindowContents(Rect rect) { Listing_Standard options = new Listing_Standard(); Color defaultColor = new Color(100, 65, 164); options.Begin(rect); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; GUI.color = Color.magenta; options.Label("TwitchToolkitSettingsTitle".Translate()); GUI.color = defaultColor; Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; options.GapLine(); options.Gap(); options.ColumnWidth = rect.width / 3; // Left column if (options.ButtonText("TwitchToolkitChat".Translate())) { currentTab = SettingsTab.Chat; } if (options.ButtonText("TwitchToolkitCoins".Translate())) { currentTab = SettingsTab.Coins; } if (options.ButtonText("TwitchToolkitEvents".Translate())) { currentTab = SettingsTab.Events; } if (options.ButtonText("TwitchToolkitItems".Translate())) { currentTab = SettingsTab.Items; } // Middle column options.NewColumn(); options.Gap(53f); if (options.ButtonText("TwitchToolkitStore".Translate())) { currentTab = SettingsTab.Store; } if (options.ButtonText("TwitchToolkitKarma".Translate())) { currentTab = SettingsTab.Karma; } if (options.ButtonText("TwitchToolkitCommands".Translate())) { currentTab = SettingsTab.Commands; } if (options.ButtonText("TwitchToolkitCooldowns".Translate())) { currentTab = SettingsTab.Cooldowns; } // Right Column options.NewColumn(); options.Gap(53f); if (options.ButtonText("TwitchToolkitOptions".Translate())) { currentTab = SettingsTab.Options; } if (options.ButtonText("TwitchToolkitViewers".Translate())) { currentTab = SettingsTab.Viewers; } if (options.ButtonText("TwitchToolkitIntegrations".Translate())) { currentTab = SettingsTab.Integrations; } options.End(); Listing_Standard gapline = new Listing_Standard(); Rect gapliRect = new Rect(rect.x, rect.y, rect.width, rect.height); gapline.Begin(gapliRect); gapline.Gap(); gapline.End(); Rect optionsRect = rect; optionsRect.y = 145; optionsRect.height = 620f; optionsRect.yMax = 765f; Rect scrollViewer = new Rect(optionsRect); scrollViewer.height -= 145f; scrollViewer.yMax -= 145f; Rect viewRect = new Rect(0, 0, rect.width - 100f, 430f); viewRect.width -= 25f; if (currentTab == SettingsTab.Karma) { viewRect.height += 250f; } Listing_Standard optionsListing = new Listing_Standard(); optionsListing.Begin(optionsRect); optionsListing.BeginScrollView(scrollViewer, ref scrollVector2, ref viewRect); switch (currentTab) { case SettingsTab.Coins: Settings_Coins.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Events: Settings_Events.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Items: Settings_Items.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Store: Settings_Store.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Karma: Settings_Karma.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Commands: Settings_Commands.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Cooldowns: Settings_Cooldowns.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Options: Settings_Options.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Viewers: Settings_Viewers.DoWindowContents(viewRect, optionsListing); break; case SettingsTab.Integrations: Settings_Integrations.DoWindowContents(viewRect, optionsListing); break; default: Settings_Chat.DoWindowContents(viewRect, optionsListing); break; } optionsListing.EndScrollView(ref viewRect); optionsListing.End(); }