static void MarkButton(Listing_Toggles view, string group) { if (ActiveGroup.Equals(group)) { GUI.color = ClickedColor; } if (view.ButtonText(group.Translate())) { ActiveGroup = group; } GUI.color = DefaultColor; }
static void DoMetaSettingsView(Rect middleRect) { float middleY = 10 * 25f; var view = new Listing_Toggles(); view.BeginListing(middleRect, ref scrollPositionMiddle, middleY); view.CustomLabel("HotkeysHeader".Translate(), -1, "HotkeysDesc".Translate()); foreach (string defName in HotkeyHandler.HotKeyDict.Keys) { Hotkey hotkey = HotkeyHandler.HotKeyDict.TryGetValue(defName); hotkey.CustomLabel = view.TextEntry(hotkey.CustomLabel); } view.Gap(); if (view.ButtonText("KeyBindingsButton".Translate(), width: 100f)) { Find.WindowStack.Add(new Dialog_KeyBindings()); } view.EndListing(); }