Esempio n. 1
0
        private void DecideAdvancingWithDrawalBtn(UIHexButton btn)
        {
            ShipModel_BattleAll shipModel_BattleAll = BattleTaskManager.GetBattleManager().Ships_f[0];

            if (btn.index == 1 && !shipModel_BattleAll.HasRecoverYouin())
            {
                return;
            }
            if (btn.index == 2 && !shipModel_BattleAll.HasRecoverMegami())
            {
                return;
            }
            if (btn.index == 1 && this._btnIndex != btn.index)
            {
                this._btnIndex = btn.index;
                KCV.Utils.SoundUtils.PlaySE(SEFIleInfos.CommonCursolMove);
                this.SetAdvancingWithdrawalBtnState(this._btnIndex);
                return;
            }
            if (btn.index == 2 && this._btnIndex != btn.index)
            {
                this._btnIndex = btn.index;
                KCV.Utils.SoundUtils.PlaySE(SEFIleInfos.CommonCursolMove);
                this.SetAdvancingWithdrawalBtnState(this._btnIndex);
                return;
            }
            if (btn.index == 0 && this._btnIndex != btn.index)
            {
                this._btnIndex = btn.index;
                KCV.Utils.SoundUtils.PlaySE(SEFIleInfos.CommonCursolMove);
                this.SetAdvancingWithdrawalBtnState(this._btnIndex);
                return;
            }
            if (this._isDecide)
            {
                return;
            }
            this._isDecide = true;
            KCV.Utils.SoundUtils.PlaySE(SEFIleInfos.SE_036);
            this._listHexBtns.ForEach(delegate(UIHexButton x)
            {
                x.isColliderEnabled = false;
            });
            this.SetAdvancingWithdrawalBtnState(btn.index);
            UIBattleNavigation battleNavigation = BattleTaskManager.GetPrefabFile().battleNavigation;

            battleNavigation.Hide(0.2f, null);
            if (this._delDecideAdvancingWithdrawalButton != null)
            {
                this._delDecideAdvancingWithdrawalButton(btn);
            }
        }
Esempio n. 2
0
        private bool Init(ShipModel_BattleAll flagShip, Generics.BattleRootType iRootType)
        {
            this._clsShipModel = flagShip;
            this.panel.alpha   = 0f;
            this.SetLabelPos(iRootType);
            this._iSelectType = AdvancingWithdrawalDCType.Withdrawal;
            int cnt = 0;

            this._listLabelButton.ForEach(delegate(UILabelButton x)
            {
                bool isValid = true;
                if (cnt == 2)
                {
                    isValid = flagShip.HasRecoverMegami();
                }
                else if (cnt == 1)
                {
                    isValid = flagShip.HasRecoverYouin();
                }
                else if (cnt == 3)
                {
                    isValid = BattleCutManager.GetBattleManager().ChangeableDeck;
                }
                x.Init(cnt, isValid, KCVColor.ConvertColor(110f, 110f, 110f, 255f), KCVColor.ConvertColor(110f, 110f, 110f, 128f));
                x.isFocus      = false;
                x.toggle.group = 20;
                x.toggle.set_enabled(false);
                x.toggle.onDecide = delegate
                {
                    this.Decide();
                };
                x.toggle.onActive = Util.CreateEventDelegateList(this, "OnActive", (AdvancingWithdrawalDCType)x.index);
                if (x.index == 0)
                {
                    x.toggle.startsActive = true;
                }
                cnt++;
            });
            this.ChangeFocus(this._iSelectType);
            return(true);
        }
Esempio n. 3
0
 public static bool HasRepair(ShipModel_BattleAll model)
 {
     return(model.HasRecoverYouin() || model.HasRecoverMegami());
 }
Esempio n. 4
0
        public void Play(DelDecideAdvancingWithdrawalButton decideCallback)
        {
            this._delDecideAdvancingWithdrawalButton = decideCallback;
            base.get_transform().localScaleOne();
            base.Init();
            if (this._iType == Generics.BattleRootType.Rebellion)
            {
                this.SetHexBtnsPos4Rebellion();
            }
            else
            {
                this.SetHexBtnsPos4Sortie();
            }
            ShipModel_BattleAll shipModel_BattleAll = BattleTaskManager.GetBattleManager().Ships_f[0];

            if (shipModel_BattleAll.HasRecoverYouin())
            {
                this._btnIndex = 1;
            }
            else if (shipModel_BattleAll.HasRecoverMegami())
            {
                this._btnIndex = 2;
            }
            else
            {
                this._btnIndex = 0;
            }
            if (shipModel_BattleAll.HasRecoverYouin())
            {
                this._listIsBtn.set_Item(1, true);
            }
            else
            {
                this._listHexBtns.get_Item(1).uiButton.defaultColor = new Color(0.2f, 0.2f, 0.2f);
            }
            if (shipModel_BattleAll.HasRecoverMegami())
            {
                this._listIsBtn.set_Item(2, true);
            }
            else
            {
                this._listHexBtns.get_Item(2).uiButton.defaultColor = new Color(0.2f, 0.2f, 0.2f);
            }
            if (BattleTaskManager.GetBattleManager().ChangeableDeck)
            {
                this._listIsBtn.set_Item(3, BattleTaskManager.GetBattleManager().ChangeableDeck);
            }
            else
            {
                this._listHexBtns.get_Item(3).uiButton.defaultColor = new Color(0.2f, 0.2f, 0.2f);
            }
            this._listIsBtn.set_Item(0, true);
            this._listHexBtns.ForEach(delegate(UIHexButton x)
            {
                x.SetActive(true);
                x.Play(UIHexButton.AnimationList.HexButtonShow, delegate
                {
                    this._isInputPossible = true;
                    this.SetAdvancingWithdrawalBtnState(this._btnIndex);
                });
            });
            UIBattleNavigation battleNavigation = BattleTaskManager.GetPrefabFile().battleNavigation;

            battleNavigation.SetNavigationInAdvancingWithDrawal();
            battleNavigation.Show(0.2f, null);
            this._uiFleetInfos.Show();
        }