static public void Update(List <ActionKey> keys)
        {
            if (TurnSet.bSelectingArea && EncounterInfo.currentTurn() != null && EncounterInfo.currentTurn().bIsPlayerTurnSet)
            {
                if (keys.Count != 0)
                {
                    AreaSelectContext(keys[keys.Count - 1]);
                }
            }
            else
            {
                if (!ScriptProcessor.bIsRunning && !LootScreen.IsRunning())
                {
                    if (BattleGUI.bIsRunning && EncounterInfo.encounterGroups.Count > 0 && !EncounterInfo.currentTurn().bIsEnemyTurnSet&& !BattleGUI.bIsAttacking && (Mouse.GetState().RightButton == ButtonState.Pressed || keys.Last().actionIndentifierString.Equals(Game1.cancelString) || keys.Last().actionIndentifierString.Equals(Game1.SettingsMenu)) && !KeyboardMouseUtility.AnyButtonsPressed())
                    {
                        KeyboardMouseUtility.bPressed = true;
                        BattleGUI.bChooseAbility      = false;
                        BattleGUI.EndWithoutAttacking();
                    }

                    if ((PlayerController.selectedSprite == null && EncounterInfo.encounterGroups.Count != 0 && EncounterInfo.currentTurn().bIsPlayerTurnSet&& !EncounterInfo.currentTurn().bPlayerTurnEnemyOverriden) || (EncounterInfo.encounterGroups.Count != 0 && EncounterInfo.currentTurn().selectedCharTurn == null && CombatProcessor.bMainCombat && EncounterInfo.currentTurn().bIsPlayerTurnSet&& !EncounterInfo.currentTurn().bPlayerTurnEnemyOverriden))
                    {
                        if (keys.Count != 0)
                        {
                            GlobalControls(keys);
                            NoSpriteSelectedControls(keys[keys.Count - 1]);
                            KeyboardMouseUtility.bPressed = true;
                        }
                    }
                    else if (selectedChar != null)
                    {
                        if (keys.Count != 0)
                        {
                            GlobalControls(keys);
                            SpriteSelectedControls(keys[keys.Count - 1]);
                            KeyboardMouseUtility.bPressed = true;
                        }
                        selectedChar = (BaseCharacter)PlayerController.selectedSprite;
                    }
                    else if (selectedChar == null && PlayerController.selectedSprite != null || (EncounterInfo.encounterGroups.Count != 0 && !EncounterInfo.currentTurn().bIsPlayerTurnSet))
                    {
                        selectedChar = (BaseCharacter)PlayerController.selectedSprite;
                        if (keys.Count != 0)
                        {
                            GlobalControls(keys);
                            SpriteSelectedControls(keys[keys.Count - 1]);
                            KeyboardMouseUtility.bPressed = true;
                        }
                    }
                    else if (BattleGUI.bIsRunning)
                    {
                        if (keys.Count != 0)
                        {
                            //GlobalControls(keys);
                            SpriteSelectedControls(keys[keys.Count - 1]);
                            KeyboardMouseUtility.bPressed = true;
                        }
                    }
                }
                else if (LootScreen.IsRunning())
                {
                    if (LootScreen.WaitingForKeyPress())
                    {
                        if (keys.Count != 0)
                        {
                            LootScreenKeys(keys[keys.Count - 1]);
                            KeyboardMouseUtility.bPressed = true;
                        }
                    }
                }
            }
        }