private void newKeyControl(UI.DraggableWindow window, string title, PreciseManeuverConfig.HotkeyType type) { GameObject keybindingsCtrlObject = Object.Instantiate(m_KeybindingsCtrlPrefab); if (keybindingsCtrlObject == null) { return; } UI.KeybindingControl keybindingCtrl = keybindingsCtrlObject.GetComponent <UI.KeybindingControl> (); keybindingCtrl.setControl(new KeybindingControlInterface(this, type, title)); window.AddToContent(keybindingsCtrlObject); }
internal void FillKeymapperWindow(UI.DraggableWindow window) { NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_enable"), PreciseManeuverConfig.HotkeyType.HIDEWIN); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_proginc"), PreciseManeuverConfig.HotkeyType.PROGINC); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_progdec"), PreciseManeuverConfig.HotkeyType.PROGDEC); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_progzero"), PreciseManeuverConfig.HotkeyType.PROGZER); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_norminc"), PreciseManeuverConfig.HotkeyType.NORMINC); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_normdec"), PreciseManeuverConfig.HotkeyType.NORMDEC); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_normzero"), PreciseManeuverConfig.HotkeyType.NORMZER); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_radinc"), PreciseManeuverConfig.HotkeyType.RADIINC); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_raddec"), PreciseManeuverConfig.HotkeyType.RADIDEC); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_radzero"), PreciseManeuverConfig.HotkeyType.RADIZER); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_timeinc"), PreciseManeuverConfig.HotkeyType.TIMEINC); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_timedex"), PreciseManeuverConfig.HotkeyType.TIMEDEC); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_circularize"), PreciseManeuverConfig.HotkeyType.CIRCORB); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_turnup"), PreciseManeuverConfig.HotkeyType.TURNOUP); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_turndown"), PreciseManeuverConfig.HotkeyType.TURNODN); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_encfocus"), PreciseManeuverConfig.HotkeyType.FOCNENC); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_patchesmore"), PreciseManeuverConfig.HotkeyType.PLUSORB); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_patchesless"), PreciseManeuverConfig.HotkeyType.MINUORB); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_timex10"), PreciseManeuverConfig.HotkeyType.PAGEX10); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_nextnode"), PreciseManeuverConfig.HotkeyType.NEXTMAN); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_prevnode"), PreciseManeuverConfig.HotkeyType.PREVMAN); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_delnode"), PreciseManeuverConfig.HotkeyType.MNVRDEL); GameObject label = new GameObject("PreciseManeuverKeybindingsAltLabel"); label.AddComponent <RectTransform> (); var text = label.AddComponent <TMPro.TextMeshProUGUI> (); text.text = Localizer.Format("precisemaneuver_keybindings_alt"); text.font = UISkinManager.TMPFont; text.fontSize = 14; text.richText = false; text.color = Color.white; window.AddToContent(label); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_pageinc"), PreciseManeuverConfig.HotkeyType.PAGEINC); NewKeyControl(window, Localizer.Format("precisemaneuver_keybindings_pageconics"), PreciseManeuverConfig.HotkeyType.PAGECON); }