Beispiel #1
0
    public override void show()
    {
        base.show();
        popupSort.hide();
        btnSort.gameObject.SetActive(true);

        setMode(Mode.Normal);

        selectSlot = null;

        updateGold();
        updateRuby();
        updateRuneStone();


        tabPlayer.tabChangeDispatcher -= changePlayerTab;
        tabPlayer.tabChangeDispatcher += changePlayerTab;
        tabPlayer.init(GameIDData.Type.Unit);


        refreshSort();
        refreshMyUnits();
        refreshUnitInven(true);

        reinforcePanel.hide();
        composePanel.hide();
        sellPanel.hide();

//		if(GameDataManager.instance.historyUnitRunes == null) EpiServer.instance.sendUnitRuneHistory();

        checkTutorial();
    }
Beispiel #2
0
    public void onCompleteChangeUnit(bool refresh = true)
    {
        selectSlot = null;
        setMode(Mode.Normal);

        if (refresh)
        {
            refreshMyUnits();
            refreshUnitInven();
        }
    }
Beispiel #3
0
 void resetSelectSlot(GameIDData d, bool isInventorySlot)
 {
     if (selectSlot == null && d != null)
     {
         UISummonInvenSlot[] ts = invenList.GetComponentsInChildren <UISummonInvenSlot>();
         foreach (UISummonInvenSlot t in ts)
         {
             if (t.data != null && d.serverId == t.data.serverId)               // && t.isChecked == !isInventorySlot)
             {
                 selectSlot = t;
                 break;
             }
         }
     }
 }
Beispiel #4
0
    public void onClick(UISummonInvenSlot invenSlot)
    {
        if (invenSlot.data == null)
        {
            return;
        }

        switch (onClick(invenSlot.index, invenSlot.data))
        {
        case 1: invenSlot.select = true; break;

        case -1: invenSlot.select = false; break;
        }

        refresh();
    }
Beispiel #5
0
    public void onSelectSlot(UISummonInvenSlot s, GameIDData data)
    {
        if (UIReinforceBarPanel.isReinforceMode)
        {
            selectSlot = null;
            if (s.data == null)
            {
                return;
            }
            reinforcePanel.onClick(s);
        }
        else if (UIComposePanel.isComposeMode)
        {
            selectSlot = null;
            if (s.data == null)
            {
                return;
            }
            composePanel.onClick(s);
        }
        else if (UIMultiSellPanel.isMultiSell)
        {
            selectSlot = null;
            if (s.data == null)
            {
                return;
            }
            sellPanel.onClick(s);
        }
        else if (mode == Mode.Normal)
        {
            if (data != null)
            {
                selectSlot = s;
                s.select   = false;

                GameManager.me.uiManager.popupSummonDetail.show(data, RuneInfoPopup.Type.Normal, s.isInventorySlot);
            }
        }
        else if (mode == Mode.PutOn)
        {
            if (s.isInventorySlot || _selectSlotData == null)
            {
                return;
            }

            switch (s.index)
            {
            case 0: _slotId = UnitSlot.U1; break;

            case 1: _slotId = UnitSlot.U2; break;

            case 2: _slotId = UnitSlot.U3; break;

            case 3: _slotId = UnitSlot.U4; break;

            case 4: _slotId = UnitSlot.U5; break;
            }

            SoundData.play("uirn_runeattach");
            EpiServer.instance.sendChangeUnitRune(tabPlayer.currentTab, _slotId, _selectSlotData.serverId);
        }
    }
Beispiel #6
0
    void setMode(Mode m, GameIDData gd = null)
    {
        mode = m;

        if (m == Mode.Normal)
        {
            if (selectSlot != null)
            {
                selectSlot.select = false;
            }
            refreshMyUnits();
            selectSlot = null;
            putOnPanel.SetActive(false);
        }
        else if (m == Mode.PutOn)
        {
            putOnPanel.SetActive(true);
            //_selectSlot.select = true;

            _selectSlotData = null;

            bool alreadyPutOnItem = false;

            if (selectSlot != null && selectSlot.data != null)
            {
                spSelectSlotBorder.enabled = true;
                spSelectSlotBorder.cachedTransform.position = selectSlot.spSelectBorder.cachedTransform.position;
                alreadyPutOnItem = isSettingSameBaseUnit(selectSlot.data.unitData, tabPlayer.currentTab);
                _selectSlotData  = selectSlot.data;
            }
            else if (gd != null)
            {
                spSelectSlotBorder.enabled = false;
                alreadyPutOnItem           = isSettingSameBaseUnit(gd.unitData, tabPlayer.currentTab);
                _selectSlotData            = gd;
            }


            if (alreadyPutOnItem)
            {
                lbPutOnModeMsg.text = Util.getUIText("CAN_PUTON_SAMERUNE");
            }
            else
            {
                lbPutOnModeMsg.text = Util.getUIText("SELECT_SLOT");
            }

            for (int i = 0; i < 5; ++i)
            {
                if (GameDataManager.instance.playerUnitSlots[tabPlayer.currentTab][i].isOpen)
                {
                    if (alreadyPutOnItem)
                    {
                        if (TutorialManager.instance.isTutorialMode)
                        {
                            spNowSelectedSlots[i].SetActive(false);
                        }
                        else
                        {
                            spNowSelectedSlots[i].SetActive(_selectSlotData.unitData.baseUnitId == GameDataManager.instance.playerUnitSlots[tabPlayer.currentTab][i].unitData.baseUnitId);
                        }

                        nowSlots[i].buttonEnabled = (_selectSlotData.unitData.baseUnitId == GameDataManager.instance.playerUnitSlots[tabPlayer.currentTab][i].unitData.baseUnitId);
                    }
                    else
                    {
                        if (TutorialManager.instance.isTutorialMode)
                        {
                            spNowSelectedSlots[i].SetActive(false);
                        }
                        else
                        {
                            spNowSelectedSlots[i].SetActive(true);
                        }
                        nowSlots[i].buttonEnabled = true;
                    }
                }
                else
                {
                    if (TutorialManager.instance.isTutorialMode)
                    {
                        spNowSelectedSlots[i].SetActive(false);
                    }
                    else
                    {
                        spNowSelectedSlots[i].SetActive(!alreadyPutOnItem);
                    }
                    nowSlots[i].buttonEnabled = (!alreadyPutOnItem);
                }

                if (TutorialManager.nowPlayingTutorial("T44"))
                {
                    nowSlots[i].buttonEnabled = true;
                }
            }
        }
    }
Beispiel #7
0
 void onClickShop(GameObject go)
 {
     selectSlot = null;
     GameManager.me.uiManager.popupShop.showSpecialShop();
 }