Example #1
0
    public void SwapTeam()
    {
//		curMonster = null;
        mSelectIndex = 0;
        SQYUIManager.getInstance().opIndex   = 0;
        SQYUIManager.getInstance().opMonster = Core.Data.playerManager.RTData.curTeam.getMember(0);
    }
Example #2
0
    //强化
    public void OnClickStrengthen()
    {
        switch (m_selBagItem.curItemType)
        {
        case RUIType.EMItemType.Charator:
            SQYUIManager.getInstance().opMonster = m_selBagItem.curData as Monster;
            SQYPetBoxController.mInstance.SetPetBoxType(RUIType.EMBoxType.QiangHua);
            SQYPetBoxController.enterStrengthIndex = 1;
            break;

        case RUIType.EMItemType.Equipment:
            Equipment equip = m_selBagItem.curData as Equipment;
            SQYUIManager.getInstance().targetEquip = equip;
            if (equip.ConfigEquip.type == 0)
            {
                SQYPetBoxController.mInstance.SetPetBoxType(RUIType.EMBoxType.Equip_QH_ATK);
            }
            else
            {
                SQYPetBoxController.mInstance.SetPetBoxType(RUIType.EMBoxType.Equip_QH_DEF);
            }
            break;

        case RUIType.EMItemType.AtkFrag:
        case RUIType.EMItemType.DefFrag:
        case RUIType.EMItemType.MonFrag:
            OpenFatePanel();
            break;
        }
    }
 /// <summary>
 /// Destroies the panel.
 /// </summary>
 public void DestroyPanel()
 {
     if (gameObject != null)
     {
         Destroy(gameObject);
     }
     SQYUIManager.getInstance().targetEquip = null;
 }
Example #4
0
    int GetStrengthEquipFinalLv()
    {
        Equipment equip    = SQYUIManager.getInstance().targetEquip;
        int       totalexp = equip.RtEquip.exp + GetStrengthEqipTotalExp();

        totalexp += Core.Data.EquipManager.GetEquipTotalExp(equip.RtEquip.lv, equip.ConfigEquip.star);
        int lv = Core.Data.EquipManager.GetEquipLv(totalexp, equip.ConfigEquip.star);

        return(lv);
    }
Example #5
0
    int GetStrengthMonFinalLv(int eatExp)
    {
        Monster mon      = SQYUIManager.getInstance().opMonster;
        int     totalexp = mon.RTData.curExp + eatExp;

        totalexp += Core.Data.monManager.GetMonTotalExp(mon.RTData.curLevel, mon.Star);
        int lv = Core.Data.monManager.GetMonLevel(totalexp, mon.Star);

        return(lv);
    }
Example #6
0
    public void OnClick()
    {
        if (TeamModifyUI.mInstance != null)
        {
            TeamModifyUI.DestroyUI();
        }

        if (UIWXLActivityMainController.Instance != null)
        {
            UIWXLActivityMainController.Instance.OnBtnClick();
        }

//		SQYUIManager.getInstance().opIndex = m_nPos;

        m_monster = Core.Data.playerManager.RTData.curTeam.getMember(m_nPos);
        if (m_monster == null)
        {
            if (!IsLock(m_nPos))
            {
                SQYUIManager.getInstance().opMonster = null;
                DBUIController.mDBUIInstance.SetViewState(RUIType.EMViewState.S_Bag, RUIType.EMBoxType.CHANGE);
                Core.Data.temper.infoPetAtk = 0;
                Core.Data.temper.infoPetDef = 0;

                //当前选中 monster
                Core.Data.temper.curShowMonster = null;

                SQYUIManager.getInstance().opIndex = m_nPos;
                if (TeamUI.mInstance != null)
                {
                    TeamUI.mInstance.SetShow(false);
                }
            }
//			else {
//				SQYUIManager.getInstance ().opIndex = 0;
//			}
        }
        else
        {
            TeamUI.mInstance.ClickTeamMonster(this);
            DBUIController.mDBUIInstance.HiddenFor3D_UI(false);
            Core.Data.temper.curShowMonster   = m_monster;
            Core.Data.temper.curSelectEquip   = null;
            Core.Data.temper.bagSelectMonster = null;
            SQYUIManager.getInstance().opIndex = m_nPos;
        }
    }
Example #7
0
    public void OnBtnTeamViewWitnIndex(int index, bool curPosHaveMon = true)
    {
        switch (index)
        {
        case SQYTeamInfoView.BTN_BACK:
            CloseUI();
            DBUIController.mDBUIInstance.ShowFor2D_UI();
            if (m_callBack != null)
            {
                m_callBack();
            }
            break;

        case SQYTeamInfoView.BTN_CHANGE:
            if (curMonster != null)
            {
                SQYUIManager.getInstance().opTeam    = curTeam;
                SQYUIManager.getInstance().opMonster = curMonster;
                //              SQYUIManager.getInstance().opIndex = mSelectIndex;
                Core.Data.temper.infoPetAtk = 0;
                Core.Data.temper.infoPetDef = 0;

                SetShow(false);
                DBUIController.mDBUIInstance.SetViewState(RUIType.EMViewState.S_Bag, RUIType.EMBoxType.CHANGE);
            }
            break;

        case SQYTeamInfoView.BTN_QiangHua:
            if (curMonster != null)
            {
                SQYUIManager.getInstance().opMonster = curMonster;
                SQYPetBoxController.enterStrengthIndex = 2;

                if (curPosHaveMon)
                {
                    Core.Data.temper.infoPetAtk = (int)curTeam.MemberAttack(mSelectIndex);
                    Core.Data.temper.infoPetDef = (int)curTeam.MemberDefend(mSelectIndex);
                }
                DBUIController.mDBUIInstance.SetViewState(RUIType.EMViewState.S_Bag, RUIType.EMBoxType.QiangHua);

                SetShow(false);
            }
            break;
        }
    }
Example #8
0
    int GetStrengthCoin()
    {
        int addcoin = 0;
        int star    = 0;

        if (_boxType == EMBoxType.QiangHua)
        {
            star = SQYUIManager.getInstance().opMonster.Star;
        }
        else if (_boxType == EMBoxType.Equip_QH_ATK || _boxType == EMBoxType.Equip_QH_DEF)
        {
            star = SQYUIManager.getInstance().targetEquip.ConfigEquip.star;
        }

        switch (star)
        {
        case 1:
            addcoin = 200;
            break;

        case 2:
            addcoin = 300;
            break;

        case 3:
            addcoin = 400;
            break;

        case 4:
            addcoin = 800;
            break;

        case 5:
            addcoin = 1500;
            break;

        case 6:
            addcoin = 2000;
            break;
        }
        int totalCoin = szSelectCharator.Count * addcoin;

        return(totalCoin);
    }
Example #9
0
    void StrengthBtn()
    {
        if (szSelectCharator.Count == 0 || szSelectCharator.Count > 1)
        {
            return;
        }

        Monster monster = szSelectCharator[0]._boxItem.curData as Monster;

        if (monster.RTData.curLevel >= 60)
        {
            SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(5139));
            return;
        }

        SQYUIManager.getInstance().opMonster = monster;
        DBUIController.mDBUIInstance.SetViewState(RUIType.EMViewState.S_Bag, RUIType.EMBoxType.QiangHua);
        enterStrengthIndex = 1;
        //  ShowUI (false);
    }
Example #10
0
 public static void OpenUI(ExitTeamCallback callback = null, FromType type = FromType.FromMainUI)
 {
     if (_mInstance == null)
     {
         Object prefab = PrefabLoader.loadFromPack("ZQ/TeamUI");
         if (prefab != null)
         {
             GameObject obj = Instantiate(prefab) as GameObject;
             RED.AddChild(obj, DBUIController.mDBUIInstance._bottomRoot);
             _mInstance = obj.GetComponent <TeamUI> ();
         }
     }
     else
     {
         _mInstance.SetShow(true);
     }
     _mInstance.mSelectIndex = 0;
     SQYUIManager.getInstance().opIndex = 0;
     _mInstance.m_type     = type;
     _mInstance.m_callBack = callback;
 }
Example #11
0
    public void FreshSelMonster()
    {
        if (curMonster == null)
        {
            mSelectIndex = 0;
        }


        if (curMonster != null)
        {
            bool allFated = m_teamView.FreshSelMonster();
            EquipmentTableManager.Instance.RefreshEquipment(mSelectIndex);

            show3DModel(curMonster.num, curMonster.RTData.Attribute, allFated);
            Core.Data.temper.curShowMonster = curMonster;
            SQYUIManager.getInstance().opIndex = Core.Data.playerManager.RTData.curTeam.GetMonsterPos(curMonster.pid);
        }
//		else
//		{
//			OnBtnTeamViewWitnIndex(SQYTeamInfoView.BTN_CHANGE,false);
//		}
    }
Example #12
0
    public void ClickTeamMonster(TeamMonsterCell cell)
    {
        TeamMonsterCell cv = cell;

        SQYUIManager.getInstance().opIndex = cell.m_nPos;
        mSelectIndex = cell.m_nPos;
//		curMonster = cv.m_monster;

        //阵容
        Core.Data.temper.curShowMonster = curMonster;

        if (cv.m_monster == null)
        {
            TeamUI.mInstance.OnBtnTeamViewWitnIndex(SQYTeamInfoView.BTN_CHANGE, false);
        }
        else
        {
            FreshSelMonster();
        }

        m_teamCtrller.SetMonSelected(cell);
        RED.SetActive(true, m_teamView.gameObject);
    }
Example #13
0
    /// <summary>
    /// 点击了返回按钮
    /// </summary>
    public void OnBtnBack()
    {
        switch (_boxType)
        {
        case EMBoxType.CHANGE:
            if (TeamUI.mInstance != null)
            {
                TeamUI.mInstance.SetShow(true);
                SQYUIManager.getInstance().opIndex = TeamUI.mInstance.mSelectIndex;
                UIMiniPlayerController.Instance.gameObject.SetActive(false);
            }
            else
            {
                DBUIController.mDBUIInstance.ShowFor2D_UI();
            }
            viewWillHidden();
            break;

        case EMBoxType.QiangHua:
            if (SQYPetBoxController.enterStrengthIndex == 2)
            {
                viewWillHidden();
                TeamUI.mInstance.SetShow(true);
                UIMiniPlayerController.Instance.SetActive(false);
                TeamUI.mInstance.RefreshMonster(SQYUIManager.getInstance().opMonster);
            }
            else if (SQYPetBoxController.enterStrengthIndex == 1)
            {
                SetPetBoxType(EMBoxType.LOOK_Charator);
            }

            ClearStar();

            break;

        case EMBoxType.Equip_ADD_ATK:
        case EMBoxType.Equip_ADD_DEF:
            viewWillHidden();
            UIMiniPlayerController.Instance.SetActive(false);
            TeamUI.mInstance.SetShow(true);
            break;

        case EMBoxType.SELL_Charator:
            SetPetBoxType(EMBoxType.LOOK_Charator);
            break;

        case EMBoxType.SELL_GEM:
            SetPetBoxType(EMBoxType.LOOK_Gem);
            break;

        case EMBoxType.SELL_Equiement:
            SetPetBoxType(EMBoxType.LOOK_Equipment);
            break;

        case EMBoxType.Equip_QH_ATK:
        case EMBoxType.Equip_QH_DEF:
        case EMBoxType.Equipment_SWAP_ATK:
        case EMBoxType.Equipment_SWAP_DEF:
            if (TeamUI.mInstance != null)
            {
                TeamUI.mInstance.SetShow(true);
                TeamUI.mInstance.FreshCurTeam();
                UIMiniPlayerController.Instance.SetActive(false);
                viewWillHidden();
            }
            else
            {
                SetPetBoxType(EMBoxType.LOOK_Equipment);
            }
            break;

        case EMBoxType.GEM_HECHENG_MAIN:
        case EMBoxType.GEM_HECHENG_SUB:
            FrogingSystem.ForgingRoomUI.Instance.Visible = true;
            FrogingSystem.ForgingRoomUI.Instance.SyntheticSystem.ClearLastSelected();
            viewWillHidden();
            break;

        case EMBoxType.SELECT_EQUIPMENT_INLAY:
            FrogingSystem.ForgingRoomUI.Instance.Visible = true;
            viewWillHidden();
            break;

        case EMBoxType.SELECT_GEM_INLAY:
            FrogingSystem.ForgingRoomUI.Instance.Visible = true;
            viewWillHidden();
            break;

        case EMBoxType.SELECT_EQUIPMENT_RECAST:
            FrogingSystem.ForgingRoomUI.Instance.Visible = true;
            viewWillHidden();
            break;

        case EMBoxType.HECHENG_SHENREN_MAIN:
        case EMBoxType.HECHENG_SHENREN_SUB:
        case EMBoxType.HECHENG_ZHENREN_MAIN:
        case EMBoxType.HECHENG_ZHENREN_SUB:
        case EMBoxType.ZHENREN_HE_SHENREN_MAIN:
        case EMBoxType.ZHENREN_HE_SHENREN_SUB:
            viewWillHidden();
            TrainingRoomUI.mInstance.SetShow(true);
            TrainingRoomUI.mInstance.m_hechengUI.RepositionCard();

            TrainingRoomUI.mInstance.m_hechengUI.initXX();
            break;

        case EMBoxType.ATTR_SWAP:
            viewWillHidden();
            TrainingRoomUI.mInstance.SetShow(true);

            break;

        case EMBoxType.QIANLI_XUNLIAN:
            viewWillHidden();
            TrainingRoomUI.mInstance.SetShow(true);
            TrainingRoomUI.mInstance.m_qianLiUI.initXX();
            break;

        case EMBoxType.LOOK_Equipment:
        case EMBoxType.LOOK_Gem:
        case EMBoxType.LOOK_Props:
        case EMBoxType.LOOK_Charator:

            if (star != null)
            {
                star.gameObject.SetActive(false);
                star.ClearS();
            }

            viewWillHidden();
            DBUIController.mDBUIInstance.ShowFor2D_UI();
            break;

        case EMBoxType.LOOK_AtkFrag:
        case EMBoxType.LOOK_DefFrag:
        case EMBoxType.LOOK_MonFrag:
            if (TopMenuUI.mInstance != null)
            {
                DBUIController.mDBUIInstance.HiddenFor3D_UI();
                DBUIController.mDBUIInstance._PVERoot.SetActive(true);
                if (FinalTrialMgr.GetInstance()._PvpShaluBuouRoot != null)
                {
                    FinalTrialMgr.GetInstance()._PvpShaluBuouRoot.SetActive(true);
                }

                TopMenuUI.OpenUI();

                if (FightRoleSelectPanel.Instance != null)
                {
                    UIMiniPlayerController.Instance.SetActive(false);
                }
            }
            else
            {
                DBUIController.mDBUIInstance.ShowFor2D_UI();
            }
            viewWillHidden();
            break;

        case EMBoxType.DECOMPOSE_MONSTER:
            if (TrainingRoomUI.mInstance != null)
            {
                TrainingRoomUI.mInstance.SetShow(true);
                TrainingRoomUI.mInstance.m_monEvolveUI.FreshUI();
                viewWillHidden();
            }
            else
            {
                SetPetBoxType(EMBoxType.LOOK_Charator);
            }
            break;

        case EMBoxType.EVOLVE_MONSTER:
            viewWillHidden();
            TrainingRoomUI.mInstance.SetShow(true);
            TrainingRoomUI.mInstance.m_monEvolveUI.FreshUI();
            break;

        default:
            viewWillHidden();
            DBUIController.mDBUIInstance.ShowFor2D_UI();
            break;
        }

        ClearItemNewState(resetItemType(_boxType));
    }
    /// <summary>
    /// 初始化界面信息
    /// </summary>
    public void InitPanel(Equipment o)
    {
        mEquipData = o;
        SQYUIManager.getInstance().targetEquip = o;
        EquipNameLabel.text = o.name;
        LVLabel.text        = "LV" + o.RtEquip.lv.ToString();
        DesLabel.text       = o.ConfigEquip.description;

        starObj.SetStar(o.ConfigEquip.star);

        EquipmentICON.spriteName = mEquipData.ConfigEquip.ID.ToString();
        RED.SetActive(mEquipData.equipped, m_spEquiped.gameObject);

        int totalExp = Core.Data.EquipManager.GetEquipTotalExp(o.RtEquip.lv + 1, o.ConfigEquip.star);

        ProgressLabel.text = o.RtEquip.exp.ToString() + "/" + totalExp.ToString();
        float rate = (float)o.RtEquip.exp / (float)totalExp;

        if (rate > 0.1f)
        {
            m_slider.value = rate;
        }
        else
        {
            m_slider.value = 0.1f;
        }

        List <MonsterData> monsterlist = Core.Data.fateManager.getMonsterFateByEquipNum(Core.Data.monManager, o.ConfigEquip.ID);;
        int count = monsterlist.Count;

        if (count > 4)
        {
            count = 4;
        }
        int i = 0;

        //  need to change
        for (; i < count; i++)
        {
            RED.SetActive(true, m_arryMonsterHead[i].transform.parent.gameObject);
            FateNamelabelArray [i].text = monsterlist [i].name;
            AtlasMgr.mInstance.SetHeadSprite(m_arryMonsterHead[i], monsterlist[i].ID.ToString());
        }

        for (; i < 4; i++)
        {
            RED.SetActive(false, m_arryMonsterHead[i].transform.parent.gameObject);
        }

        if (mEquipData.equipped)
        {
            mBtnSell.TextID = 5010;
        }
        else
        {
            mBtnSell.TextID = 5008;
        }
        mBtnStrength.TextID = 5009;
        mBtnChange.TextID   = 5002;

        RED.SetActive(m_bShowChange, mBtnChange.gameObject);

        #region Add by jc

        /*宝石孔和宝石
         * */

        ShowGems(o);


        #endregion
    }