Beispiel #1
0
 public void OpenStatusMenuScreen(Squad ActiveSquad)
 {
     this.ActiveSquad         = ActiveSquad;
     StatusPannel             = StatusPannels.Summary;
     SecondaryMenuIndex       = 0;
     SelectedPilotSkillIndex  = -1;
     SelectedPilotSpiritIndex = -1;
     AttackCursorIndex        = 0;
     AttackAttributeIndex     = -1;
     Alive = true;
     PushScreen(this);
 }
Beispiel #2
0
        public override void Update(GameTime gameTime)
        {
            if (SecondaryMenuIndex == 0)
            {
                if (InputHelper.InputLeftPressed())
                {
                    --StatusPannel;
                    if (StatusPannel < StatusPannels.Summary)
                    {
                        StatusPannel = StatusPannels.Attacks;
                    }
                    sndSelection.Play();
                }
                else if (InputHelper.InputRightPressed())
                {
                    ++StatusPannel;
                    if (StatusPannel > StatusPannels.Attacks)
                    {
                        StatusPannel = StatusPannels.Summary;
                    }
                    sndSelection.Play();
                }
                else if (InputHelper.InputCancelPressed())
                {
                    RemoveWithoutUnloading(this);
                    sndCancel.Play();
                }
            }

            #region Pilot Pannel

            if (StatusPannel == StatusPannels.Pilot)
            {
                if (SecondaryMenuIndex == 0)
                {
                    if (InputHelper.InputDownPressed() || InputHelper.InputConfirmPressed())
                    {
                        if (ActiveSquad.CurrentLeader.Pilot.ArrayPilotSkill.Length > 0)
                        {
                            SelectedPilotSkillIndex = 0;
                        }
                        else if (ActiveSquad.CurrentLeader.Pilot.ArrayPilotSpirit.Length > 0)
                        {
                            SelectedPilotSpiritIndex = 0;
                        }
                        else
                        {
                            return;
                        }

                        SecondaryMenuIndex = 1;

                        sndSelection.Play();
                    }
                }
                else
                {
                    if (InputHelper.InputLeftPressed() || InputHelper.InputRightPressed())
                    {
                        if (SelectedPilotSkillIndex >= 0 && ActiveSquad.CurrentLeader.Pilot.ArrayPilotSpirit.Length > 0)
                        {
                            SelectedPilotSpiritIndex = SelectedPilotSkillIndex;
                            SelectedPilotSkillIndex  = -1;
                            sndSelection.Play();
                        }
                        else if (SelectedPilotSpiritIndex >= 0 && ActiveSquad.CurrentLeader.Pilot.ArrayPilotSkill.Length > 0)
                        {
                            SelectedPilotSkillIndex  = SelectedPilotSpiritIndex;
                            SelectedPilotSpiritIndex = -1;
                            sndSelection.Play();
                        }
                    }
                    else if (InputHelper.InputDownPressed())
                    {
                        if (SelectedPilotSkillIndex >= 0)
                        {
                            ++SelectedPilotSkillIndex;
                            if (SelectedPilotSkillIndex >= ActiveSquad.CurrentLeader.Pilot.ArrayPilotSkill.Length)
                            {
                                SelectedPilotSkillIndex = 0;
                            }
                            sndSelection.Play();
                        }
                        else if (SelectedPilotSpiritIndex >= 0)
                        {
                            ++SelectedPilotSpiritIndex;
                            if (SelectedPilotSpiritIndex >= ActiveSquad.CurrentLeader.Pilot.ArrayPilotSpirit.Length)
                            {
                                SelectedPilotSpiritIndex = 0;
                            }
                            sndSelection.Play();
                        }
                    }
                    else if (InputHelper.InputUpPressed())
                    {
                        if (SelectedPilotSkillIndex >= 0)
                        {
                            --SelectedPilotSkillIndex;
                            if (SelectedPilotSkillIndex < 0)
                            {
                                SecondaryMenuIndex = 0;
                            }

                            sndSelection.Play();
                        }
                        else if (SelectedPilotSpiritIndex >= 0)
                        {
                            --SelectedPilotSpiritIndex;
                            if (SelectedPilotSpiritIndex < 0)
                            {
                                SecondaryMenuIndex = 0;
                            }

                            sndSelection.Play();
                        }
                    }
                    else if (InputHelper.InputCancelPressed())
                    {
                        SecondaryMenuIndex = 0;
                        sndCancel.Play();
                    }
                }
            }

            #endregion

            #region Unit Pannel

            else if (StatusPannel == StatusPannels.Unit)
            {
                if (SecondaryMenuIndex == 0)
                {
                    if (InputHelper.InputDownPressed() || InputHelper.InputConfirmPressed())
                    {
                        if (ActiveSquad.CurrentLeader.ArrayUnitAbility.Length > 0)
                        {
                            SelectedUnitAbilityIndex = 0;
                        }
                        else
                        {
                            return;
                        }

                        SecondaryMenuIndex = 1;
                        sndSelection.Play();
                    }
                }
                else
                {
                    if (InputHelper.InputLeftPressed() || InputHelper.InputRightPressed())
                    {
                        if (SelectedUnitAbilityIndex < 4 && SelectedUnitAbilityIndex + 4 < ActiveSquad.CurrentLeader.ArrayUnitAbility.Length)
                        {
                            SelectedUnitAbilityIndex += 4;
                            sndSelection.Play();
                        }
                        else if (SelectedUnitAbilityIndex >= 4 && SelectedUnitAbilityIndex - 4 >= 0)
                        {
                            SelectedUnitAbilityIndex -= 4;
                            sndSelection.Play();
                        }
                    }
                    else if (InputHelper.InputDownPressed())
                    {
                        ++SelectedUnitAbilityIndex;
                        if (SelectedUnitAbilityIndex >= ActiveSquad.CurrentLeader.ArrayUnitAbility.Length)
                        {
                            SelectedUnitAbilityIndex = 0;
                        }

                        sndSelection.Play();
                    }
                    else if (InputHelper.InputUpPressed())
                    {
                        --SelectedUnitAbilityIndex;
                        if (SelectedUnitAbilityIndex < 0)
                        {
                            SecondaryMenuIndex = 0;
                        }

                        sndSelection.Play();
                    }
                    else if (InputHelper.InputCancelPressed())
                    {
                        SecondaryMenuIndex = 0;
                        sndCancel.Play();
                    }
                }
            }

            #endregion

            #region Attacks Pannel

            else if (StatusPannel == StatusPannels.Attacks)
            {
                if (SecondaryMenuIndex == 0)
                {
                    if (InputHelper.InputUpPressed())
                    {
                        --AttackCursorIndex;
                        if (AttackCursorIndex < 0)
                        {
                            AttackCursorIndex = 0;
                        }

                        sndSelection.Play();
                    }
                    else if (InputHelper.InputDownPressed())
                    {
                        ++AttackCursorIndex;
                        if (AttackCursorIndex >= ActiveSquad.CurrentLeader.ListAttack.Count)
                        {
                            AttackCursorIndex = 0;
                        }

                        sndSelection.Play();
                    }
                    else if (InputHelper.InputConfirmPressed())
                    {
                        if (ActiveSquad.CurrentLeader.ListAttack[AttackCursorIndex].ArrayAttackAttributes.Length > 0)
                        {
                            SecondaryMenuIndex   = 1;
                            AttackAttributeIndex = 0;

                            sndConfirm.Play();
                        }
                    }
                }
                else
                {
                    if (InputHelper.InputLeftPressed() || InputHelper.InputRightPressed())
                    {
                        if (AttackAttributeIndex < 2 && AttackAttributeIndex + 2 < ActiveSquad.CurrentLeader.ListAttack[AttackCursorIndex].ArrayAttackAttributes.Length)
                        {
                            AttackAttributeIndex += 2;
                            sndSelection.Play();
                        }
                        else if (AttackAttributeIndex >= 2 && AttackAttributeIndex - 2 >= 0)
                        {
                            AttackAttributeIndex -= 2;
                            sndSelection.Play();
                        }
                    }
                    else if (InputHelper.InputUpPressed())
                    {
                        --AttackAttributeIndex;
                        if (AttackAttributeIndex < 0)
                        {
                            AttackAttributeIndex = ActiveSquad.CurrentLeader.ListAttack[AttackCursorIndex].ArrayAttackAttributes.Length - 1;
                        }

                        sndSelection.Play();
                    }
                    else if (InputHelper.InputDownPressed())
                    {
                        ++AttackAttributeIndex;
                        if (AttackAttributeIndex >= ActiveSquad.CurrentLeader.ListAttack[AttackCursorIndex].ArrayAttackAttributes.Length)
                        {
                            AttackAttributeIndex = 0;
                        }

                        sndSelection.Play();
                    }
                    else if (InputHelper.InputCancelPressed())
                    {
                        SecondaryMenuIndex   = 0;
                        AttackAttributeIndex = -1;
                        sndCancel.Play();
                    }
                }
            }

            #endregion
        }