예제 #1
0
        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}");
                }
            }
        }
예제 #2
0
 public RegistrationCommandGroup(string[] commands, KeyCommandHandler handler)
 {
     //this.commands = commands;
     foreach (string command in commands)
     {
         this.commands.Add(command);
     }
     this.handler = handler;
 }
예제 #3
0
 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);
     }
 }
예제 #5
0
 public RegistrationExact(string command, KeyCommandHandler handler)
 {
     this.command = command; this.handler = handler;
 }
예제 #6
0
 /// <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));
 }
예제 #7
0
 /// <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));
 }
예제 #8
0
 /// <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));
 }
예제 #9
0
 public RegistrationAtLeastCommand(string command, KeyCommandHandler handler)
 {
     this.command = command; this.handler = handler;
 }
예제 #10
0
 /// <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));
 }
예제 #11
0
 /// <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));
 }
예제 #12
0
 /// <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));
 }
예제 #13
0
            bool isdown = false; // state from previous check

            #endregion Fields

            #region Constructors

            public RegistrationExact(string command, KeyCommandHandler handler)
            {
                this.command = command; this.handler = handler;
            }
예제 #14
0
 public RegistrationCommandGroup(string[] commands, KeyCommandHandler handler)
 {
     //this.commands = commands;
     foreach (string command in commands)
     {
         this.commands.Add(command);
     }
     this.handler = handler;
 }
예제 #15
0
            bool isdown = false; // state from previous check

            #endregion Fields

            #region Constructors

            public RegistrationAtLeastCommand(string command, KeyCommandHandler handler)
            {
                this.command = command; this.handler = handler;
            }