Ejemplo n.º 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}");
                }
            }
        }
Ejemplo n.º 2
0
 public RegistrationCommandGroup(string[] commands, KeyCommandHandler handler)
 {
     //this.commands = commands;
     foreach (string command in commands)
     {
         this.commands.Add(command);
     }
     this.handler = handler;
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 5
0
 public RegistrationExact(string command, KeyCommandHandler handler)
 {
     this.command = command; this.handler = handler;
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 9
0
 public RegistrationAtLeastCommand(string command, KeyCommandHandler handler)
 {
     this.command = command; this.handler = handler;
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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;
            }
Ejemplo n.º 14
0
 public RegistrationCommandGroup(string[] commands, KeyCommandHandler handler)
 {
     //this.commands = commands;
     foreach (string command in commands)
     {
         this.commands.Add(command);
     }
     this.handler = handler;
 }
Ejemplo n.º 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;
            }