/// <param name="value">0-3</param> void SetHotKey(int value, KeyCode key) { TaikoConfig ts = (TaikoConfig)ConfigManager.GetOrLoadOrAdd <TaikoConfig>(); switch (value) { default: case 0: key1Text.text = key.ToString(); ts.Key1 = key1Text.text; break; case 1: key2Text.text = key.ToString(); ts.Key2 = key2Text.text; break; case 2: key3Text.text = key.ToString(); ts.Key3 = key3Text.text; break; case 3: key4Text.text = key.ToString(); ts.Key4 = key4Text.text; break; } }
void Start() { GlobalConfig tss = (GlobalConfig)ConfigManager.GetOrLoadOrAdd <GlobalConfig>(); TaikoConfig ts = (TaikoConfig)ConfigManager.GetOrLoadOrAdd <TaikoConfig>(); HotkeyManager.Initialize(); new Hotkey("ToggleDevMode", KeyCode.D, KeyCode.LeftControl, KeyCode.LeftShift, HotkeyType.OnKeyDown) .OnInvoked += hk => OnDevModeToggle(); new Hotkey("ToggleDevConsole", KeyCode.KeypadMinus, HotkeyType.OnKeyDown) .OnInvoked += hk => OnDevConsoleHotkey(); key1Text.text = ts.Key1; key2Text.text = ts.Key2; key3Text.text = ts.Key3; key4Text.text = ts.Key4; Application.targetFrameRate = tss.FPSMenu; QualitySettings.vSyncCount = 0; Logger.Log($"Set FPS limit to {Application.targetFrameRate} and VSYNC {(QualitySettings.vSyncCount <= 0 ? "false" : "true")}"); //Initialize static AutoInit Attributes System.Reflection.Assembly.GetExecutingAssembly().ActivateAttributeMethods <AutoInitAttribute>(); resolutions = Screen.resolutions; ResolutionDropdown.ClearOptions(); List <string> options = new List <string>(); int currentResolutionIndex = 0; for (int i = 0; i < resolutions.Length; i++) { string option = $"{resolutions[i].width} x {resolutions[i].height} {resolutions[i].refreshRate} hz"; options.Add(option); if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height && resolutions[i].refreshRate == Screen.currentResolution.refreshRate) { currentResolutionIndex = i; } } ResolutionDropdown.AddOptions(options); ResolutionDropdown.value = currentResolutionIndex; ResolutionDropdown.RefreshShownValue(); SetFullscreen(tss.Fullscreen); SetResolution(tss.ScreenWidth, tss.ScreenHeight, tss.RefreshRate); if (tss.IsDeveloperMode) { _devModeText.gameObject.SetActive(true); } }
public override void Execute(params string[] args) { if (args.Length < 2) { DevConsole.WriteLine("key keyId keyString"); return; } TaikoConfig taiko = (TaikoConfig)ConfigManager.GetOrLoadOrAdd <TaikoConfig>(); if (!int.TryParse(args[0], out int keyId)) { DevConsole.WriteLine($"Could not parse key id {args[0]}"); return; } switch (keyId) { default: keyId = 1; goto case 1; case 1: taiko.Key1 = args[1]; break; case 2: taiko.Key2 = args[1]; break; case 3: taiko.Key3 = args[1]; break; case 4: taiko.Key4 = args[1]; break; } taiko.Save(); DevConsole.WriteLine($"Updated key {keyId} to key {args[1]}"); }
public override void Execute(params string[] args) { TaikoConfig taiko = (TaikoConfig)ConfigManager.GetOrLoadOrAdd <TaikoConfig>(); if (args == null || args.Length == 0) { DevConsole.WriteLine("Autoplay: " + taiko.Autoplay); return; } if (!bool.TryParse(args[0], out bool newAP)) { DevConsole.WriteLine($"Could not parse {args[0]} to float!"); return; } bool oldAP = taiko.Autoplay; ActiveTaikoSettings.IsAutoplayActive = newAP; taiko.Save(); DevConsole.WriteLine($"Changed Autoplay from {oldAP} to {newAP}"); }