private void Update() { KeyCommandHandler.UpdateState(); if (Configuration.General.ReloadConfigKey.Value.IsPressed) { Configuration.Reload(); } if (Configuration.General.ReloadTranslationsKey.Value.IsPressed) { foreach (var mgr in managers) { mgr.ReloadActiveTranslations(); } } if (Input.GetKey(KeyCode.Keypad0)) { foreach (var languageSource in LocalizationManager.Sources) { Logger.LogInfo($"Got source {languageSource}"); } } }
public RegistrationCommandGroup(string[] commands, KeyCommandHandler handler) { //this.commands = commands; foreach (string command in commands) { this.commands.Add(command); } this.handler = handler; }
public void RegisterCommand(string command, KeyCommandHandler handler) { if (!CommandHandlers.ContainsKey(command)) { CommandHandlers.Add(command, new List <KeyCommandHandler>()); } if (!CommandHandlers[command].Contains(handler)) { CommandHandlers[command].Add(handler); } }
public void RegisterCommand(string command, KeyCommandHandler handler) { if (!CommandHandlers.ContainsKey(command)) { CommandHandlers.Add(command, new List<KeyCommandHandler>()); } if (!CommandHandlers[command].Contains(handler)) { CommandHandlers[command].Add(handler); } }
public RegistrationExact(string command, KeyCommandHandler handler) { this.command = command; this.handler = handler; }
/// <summary> /// Register a group of mutually exclusive commands /// eg editpos vs editrot vs editscale /// </summary> /// <param name="commands"></param> /// <param name="handler"></param> public void RegisterCommandGroup(string[] commands, KeyCommandHandler handler) { registrations.Add(new RegistrationCommandGroup(commands, handler)); }
/// <summary> /// register a single command. Extraneous keys will negate the down state /// </summary> /// <param name="command"></param> /// <param name="handler"></param> public void RegisterExactCommand(string command, KeyCommandHandler handler) { registrations.Add(new RegistrationExact(command, handler)); }
/// <summary> /// Register a single command, if the keys are pressed this is signalled as down /// regardless of any extra keys that may be present /// </summary> /// <param name="command"></param> /// <param name="handler"></param> public void RegisterAtLeastCommand(string command, KeyCommandHandler handler) { registrations.Add(new RegistrationAtLeastCommand(command, handler)); }
public RegistrationAtLeastCommand(string command, KeyCommandHandler handler) { this.command = command; this.handler = handler; }
bool isdown = false; // state from previous check #endregion Fields #region Constructors public RegistrationExact(string command, KeyCommandHandler handler) { this.command = command; this.handler = handler; }
bool isdown = false; // state from previous check #endregion Fields #region Constructors public RegistrationAtLeastCommand(string command, KeyCommandHandler handler) { this.command = command; this.handler = handler; }