Beispiel #1
0
    public void JewelCombineResp(byte subType, byte level, byte errorId)
    {
        m_isComposing = false;
        TimerHeap.DelTimer(m_timerId);
        int type = (int)subType;

        //int level = m_currentJewel.level;
        Debug.Log("JewelCombineResp:" + errorId);
        switch (errorId)
        {
        case 0:
            MogoGlobleUIManager.Instance.ShowComposeSucessSign(true);
            if (ComposeUIViewManager.Instance != null && InventoryManager.Instance.CurrentView == InventoryManager.View.ComposeView)
            {
                ComposeUIViewManager.Instance.PlayUIFXAnim();
            }
            if (MogoUIManager.Instance.CurrentUI == MogoUIManager.Instance.m_ComposeUI)
            {
                RefreshUI();
            }
            break;

        case 4:
            Debug.Log("JewelCombineResp:" + errorId);
            //string msg = LanguageData.dataMap[425].Format(ItemJewelData.JewelDic[type][level - 1].Name);
            //MogoMsgBox.Instance.ShowMsgBox(msg);
            //在背包点合成时候转到合成界面,合成界面无法点合成所以不会有这个返回

            SwitchToCompose(subType, level - 2);
            //InventoryManager.Instance.CurrentView = InventoryManager.View.ComposeView;

            //InventoryManager.Instance.m_currentEquipmentView = InventoryManager.View.ComposeView;
            //EquipTipManager.Instance.CloseEquipTip();
            //m_currentJewel = ItemJewelData.JewelDic[subType][level];
            //m_currentParentId = subType;
            //m_currentChildId = level - 2;
            //m_isSwitchFromBag = true;
            //MogoUIManager.Instance.SwitchComposeUI();//() => { OnSwitchComposeUIDone(subType, level); }

            break;

        default:
            Debug.Log("JewelCombineResp:" + errorId);
            Debug.Log("JewelCombineResp:" + type + "," + level);
            if (ItemJewelData.GetJewelDic()[type][level] == null)
            {
                Debug.Log("f**k!");
            }

            else
            {
                InsetManager.ShowInfoByErrorId(errorId, ItemJewelData.GetJewelDic()[type][level]);
            }
            break;
        }

        Debug.Log("JewelCombineResp:" + errorId);
        EquipTipManager.Instance.CloseEquipTip();
    }
Beispiel #2
0
 private void OnSwitchComposeUIDone(int subType, int level)
 {
     Debug.Log("OnSwitchComposeUIDone(int subType, int level):" + subType + "," + level);
     m_currentJewel    = ItemJewelData.JewelDic[subType][level];
     m_currentParentId = subType;
     m_currentChildId  = level - 2;
     OnJewelSelect(m_currentParentId, m_currentChildId);
 }
Beispiel #3
0
    private void DisassembleJewel(int idx)
    {
        LoggerHelper.Debug("DisassembleJewel:" + idx);
        int jewelId = (m_inventoryManager.EquipOnDic[CurrentSlot].jewelSlots)[idx];

        m_currentJewelData = ItemJewelData.dataMap[jewelId];
        MogoWorld.thePlayer.RpcCall("JewelOutlayReq", CurrentSlot, idx);
    }
Beispiel #4
0
    private void UpgradeJewel(int idx)
    {
        LoggerHelper.Debug("UpgradeJewel");
        int jewelId = (m_inventoryManager.EquipOnDic[CurrentSlot].jewelSlots)[idx];

        m_currentJewelData = ItemJewelData.dataMap[jewelId];
        MogoWorld.thePlayer.RpcCall("JewelCombineInEquiReq", CurrentSlot, idx);
    }
Beispiel #5
0
 private void OnComposeShow()
 {
     //Debug.LogError("OnComposeShow()");
     if (!m_isSwitchFromBag)
     {
         m_currentJewel = null;//在refreshUI里判断但此为null时会重新计算pId,cId
     }
     else
     {
         m_isSwitchFromBag = false;
     }
     RefreshUI();
 }
Beispiel #6
0
    public ItemJewel(ItemJewelInstance _instanceData)
    {
        this.instanceData = _instanceData;
        jewelInstanceData = _instanceData;

        LoggerHelper.Debug("id:" + _instanceData.templeId);
        if (!ItemJewelData.dataMap.ContainsKey(_instanceData.templeId))
        {
            LoggerHelper.Error("can not find jewel: " + _instanceData.templeId);
            return;
        }
        templateData      = ItemJewelData.dataMap[_instanceData.templeId];
        jewelTemplateData = (ItemJewelData)templateData;
    }
Beispiel #7
0
    public ItemJewel(ItemJewelInstance _instanceData)
    {
        this.instanceData = _instanceData;
        jewelInstanceData = _instanceData;

        //Debug.Log("ItemJewel(id=" + _instanceData.templeId+")");
        if (!ItemJewelData.dataMap.ContainsKey(_instanceData.templeId))
        {
            Debug.LogError("can not find jewel: " + _instanceData.templeId);
            return;
        }
        templateData      = ItemJewelData.dataMap[_instanceData.templeId];
        jewelTemplateData = (ItemJewelData)templateData;
    }
Beispiel #8
0
    public ItemJewel(ItemJewelInstance _instanceData)
    {
        this.instanceData = _instanceData;
        jewelInstanceData = _instanceData;

        LoggerHelper.Debug("id:" + _instanceData.templeId);
        if (!ItemJewelData.dataMap.ContainsKey(_instanceData.templeId))
        {
            LoggerHelper.Error("can not find jewel: " + _instanceData.templeId);
            return;
        }
        templateData = ItemJewelData.dataMap[_instanceData.templeId];
        jewelTemplateData = (ItemJewelData)templateData;
    }
Beispiel #9
0
    public void SwitchToCompose(int parentId, int childId)
    {
        InventoryManager.Instance.CurrentView = InventoryManager.View.ComposeView;

        InventoryManager.Instance.m_currentEquipmentView = InventoryManager.View.ComposeView;
        EquipTipManager.Instance.CloseEquipTip();
        if (parentId > 0)
        {
            m_currentJewel    = ItemJewelData.JewelDic[parentId][childId + 2];
            m_currentParentId = parentId;
            m_currentChildId  = childId;
            m_isSwitchFromBag = true;
        }

        MogoUIManager.Instance.SwitchComposeUI();//() => { OnSwitchComposeUIDone(subType, level); }
    }
Beispiel #10
0
    private bool CanJewelUpgrade(int jewelTemplateId)
    {
        if (jewelTemplateId == -1)
        {
            return(false);
        }
        ItemJewelData jewel = ItemJewelData.dataMap[jewelTemplateId];
        int           level = jewel.level;

        PrivilegeData privilegeData = PrivilegeData.dataMap[MogoWorld.thePlayer.VipLevel];

        if (level + 1 > privilegeData.jewelSynthesisMaxLevel)
        {
            return(false);
        }

        int subtype = jewel.subtype;
        int count   = 0;

        if (m_itemsJewelSorted == null)
        {
            return(false);
        }
        for (int i = 0; i < m_itemsJewelSorted.Count; i++)
        {
            ItemJewel item = m_itemsJewelSorted[i];
            if (item.level < level)
            {
                return(false);
            }
            if (item.subtype != subtype)
            {
                continue;
            }
            if (item.level > level)
            {
                continue;
            }
            count += item.stack;
            if (count >= 2)
            {
                return(true);
            }
        }
        return(false);
    }
Beispiel #11
0
 private void OnComposeShow()
 {
     //Debug.LogError("OnComposeShow()");
     if (!m_isSwitchFromBag)
     {
         m_currentJewel = null;//在refreshUI里判断但此为null时会重新计算pId,cId
     }
     else
     {
         m_isSwitchFromBag = false;
     }
     RefreshUI();
 }
Beispiel #12
0
 public ItemJewel(ItemJewelData data)
 {
     templateData      = data;
     jewelTemplateData = data;
 }
Beispiel #13
0
 public ItemJewel(ItemJewelData data)
 {
     templateData = data;
     jewelTemplateData = data;
 }
Beispiel #14
0
    static public void ShowInfoByErrorId(byte errorId, ItemJewelData jewel = null)
    {
        int index = 421;
        string msg = "";
        Mogo.Util.LoggerHelper.Debug("haha");
        switch (errorId)
        {
            case 0:
                //Mogo.Util.LoggerHelper.Debug("haha");
                //msg = LanguageData.dataMap[index].Format(jewel.Name);
                //Mogo.Util.LoggerHelper.Debug("haha:" + msg);
                //MogoMsgBox.Instance.ShowFloatingText(msg);
                //Mogo.Util.LoggerHelper.Debug("haha");
                InsetUIViewManager.Instance.ShowInsetSucessSign(true);
                //MogoGlobleUIManager.Instance.ShowComposeSucessSign(true);
                EquipTipManager.Instance.CloseEquipTip();
                //MogoFXManager.Instance.AttachParticleAnim("fx_ui_gem.prefab", 2000,
                //        GameObject.Find("Camera").transform.position, GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0], 0);    

                return;
            case 1:
                msg = LanguageData.dataMap[index + 1].content;
                break;
            case 2:
                msg = LanguageData.dataMap[index + 2].content;
                break;
            case 3:
                msg = LanguageData.dataMap[index + 3].content;
                break;
            case 4:
                msg = LanguageData.dataMap[index + 4].Format(jewel.Name);
                break;
            case 5:
                msg = LanguageData.dataMap[index + 5].content;
                break;
            case 6:
                msg = LanguageData.dataMap[index + 6].Format(jewel.Name);
                break;
            case 7:
                msg = LanguageData.dataMap[index + 7].content;
                break;
            case 8:
                msg = LanguageData.dataMap[index + 8].content;
                break;
            case 9:
                msg = LanguageData.dataMap[index + 9].content;
                break;
            case 10:
                msg = LanguageData.dataMap[index + 10].content;
                break;
            case 11:
                msg = LanguageData.dataMap[index + 11].content;
                break;
            case 12:
                msg = LanguageData.dataMap[index + 12].content;
                break;
            case 13:
                msg = LanguageData.dataMap[index + 13].content;
                break;
            case 14:
                msg = LanguageData.dataMap[index + 14].content;
                break;
            case 15:
                msg = LanguageData.dataMap[index + 15].content;
                break;
            case 16:
                msg = LanguageData.dataMap[index + 16].content;
                break;
            case 17:
                msg = LanguageData.dataMap[index + 17].content;
                break;
        }
        MogoMsgBox.Instance.ShowMsgBox(msg);
        EquipTipManager.Instance.CloseEquipTip();
        //MogoGlobleUIManager.Instance.Confirm(msg, (rst) => { MogoGlobleUIManager.Instance.ConfirmHide(); });
    }
Beispiel #15
0
 private void DisassembleJewel(int idx)
 {
     LoggerHelper.Debug("DisassembleJewel:" + idx);
     int jewelId = (m_inventoryManager.EquipOnDic[CurrentSlot].jewelSlots)[idx];
     m_currentJewelData = ItemJewelData.dataMap[jewelId];
     MogoWorld.thePlayer.RpcCall("JewelOutlayReq", CurrentSlot, idx);
 }
Beispiel #16
0
 private void UpgradeJewel(int idx)
 {
     LoggerHelper.Debug("UpgradeJewel");
     int jewelId = (m_inventoryManager.EquipOnDic[CurrentSlot].jewelSlots)[idx];
     m_currentJewelData = ItemJewelData.dataMap[jewelId];
     MogoWorld.thePlayer.RpcCall("JewelCombineInEquiReq", CurrentSlot, idx);
 }
Beispiel #17
0
    static public void ShowInfoByErrorId(byte errorId, ItemJewelData jewel = null)
    {
        int    index = 421;
        string msg   = "";

        Mogo.Util.LoggerHelper.Debug("haha");
        switch (errorId)
        {
        case 0:
            //Mogo.Util.LoggerHelper.Debug("haha");
            //msg = LanguageData.dataMap[index].Format(jewel.Name);
            //Mogo.Util.LoggerHelper.Debug("haha:" + msg);
            //MogoMsgBox.Instance.ShowFloatingText(msg);
            //Mogo.Util.LoggerHelper.Debug("haha");
            InsetUIViewManager.Instance.ShowInsetSucessSign(true);
            //MogoGlobleUIManager.Instance.ShowComposeSucessSign(true);
            EquipTipManager.Instance.CloseEquipTip();
            //MogoFXManager.Instance.AttachParticleAnim("fx_ui_gem.prefab", 2000,
            //        GameObject.Find("Camera").transform.position, GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0], 0);

            return;

        case 1:
            msg = LanguageData.dataMap[index + 1].content;
            break;

        case 2:
            msg = LanguageData.dataMap[index + 2].content;
            break;

        case 3:
            msg = LanguageData.dataMap[index + 3].content;
            break;

        case 4:
            msg = LanguageData.dataMap[index + 4].Format(jewel.Name);
            break;

        case 5:
            msg = LanguageData.dataMap[index + 5].content;
            break;

        case 6:
            msg = LanguageData.dataMap[index + 6].Format(jewel.Name);
            break;

        case 7:
            msg = LanguageData.dataMap[index + 7].content;
            break;

        case 8:
            msg = LanguageData.dataMap[index + 8].content;
            break;

        case 9:
            msg = LanguageData.dataMap[index + 9].content;
            break;

        case 10:
            msg = LanguageData.dataMap[index + 10].content;
            break;

        case 11:
            msg = LanguageData.dataMap[index + 11].content;
            break;

        case 12:
            msg = LanguageData.dataMap[index + 12].content;
            break;

        case 13:
            msg = LanguageData.dataMap[index + 13].content;
            break;

        case 14:
            msg = LanguageData.dataMap[index + 14].content;
            break;

        case 15:
            msg = LanguageData.dataMap[index + 15].content;
            break;

        case 16:
            msg = LanguageData.dataMap[index + 16].content;
            break;

        case 17:
            msg = LanguageData.dataMap[index + 17].content;
            break;
        }
        MogoMsgBox.Instance.ShowMsgBox(msg);
        EquipTipManager.Instance.CloseEquipTip();
        //MogoGlobleUIManager.Instance.Confirm(msg, (rst) => { MogoGlobleUIManager.Instance.ConfirmHide(); });
    }
Beispiel #18
0
    private void RefreshDialog1UI()
    {
        Mogo.Util.LoggerHelper.Debug("RefreshDialog1UI");
        //更新装备及其已插宝石情况(界面右上)
        InsetUIViewManager view = InsetUIViewManager.Instance;

        //清空
        //for (int i = 0; i < 4; i++)
        //{
        //view.ShowInsetHoleUnLoadSign(false, i);
        //view.ShowInsetHoleUpdateSign(false, i);
        //view.SetInsetHoleImage(IconData.locked, i);
        //view.SetInsetHoleBGUpImg(IconData.locked, i);
        //view.SetInsetHoleBGDownImg(IconData.locked, i);
        //view.ShowInsetHoleToolTip(i, "", false);

        view.ResetJewelHole();


        //}

        view.SetInsetEquipmentImage(EquipSlotIcon.icons[CurrentSlot]);
        view.SetInsetEquipmentImageBG(IconData.blankBox);
        if (m_inventoryManager.EquipOnDic.ContainsKey(CurrentSlot))
        {
            ItemEquipment item = m_inventoryManager.EquipOnDic[CurrentSlot];
            view.SetInsetEquipmentImage(item.icon);
            view.SetInsetEquipmentImageBG(IconData.GetIconByQuality(item.quality));

            List <JewelHoleViewData> dataList = new List <JewelHoleViewData>();
            if (item.jewelSlotsType != null)
            {
                //Mogo.Util.LoggerHelper.Debug("item.id:" + item.templateId);
                for (int i = 0; i < item.jewelSlotsType.Count; i++)
                {
                    if (item.jewelSlotsType[i] <= 0)
                    {
                        continue;
                    }
                    //Mogo.Util.LoggerHelper.Debug("item.jewelSlotsType[i]:" + item.jewelSlotsType[i]);
                    //view.SetInsetHoleImage(IconData.none, i);
                    //view.SetInsetHoleBGUpImg(IconData.GetJewelSlotIconUpByType(item.jewelSlotsType[i]), i);
                    //view.SetInsetHoleBGDownImg(IconData.GetJewelSlotIconDownByType(item.jewelSlotsType[i]), i);

                    JewelHoleViewData viewData = new JewelHoleViewData()
                    {
                        bgDown     = IconData.JewelSlotSelectedIcon,//GetJewelSlotIconDownByType(item.jewelSlotsType[i]),
                        bgUp       = IconData.GetJewelSlotIconUpByType(item.jewelSlotsType[i]),
                        holeType   = item.jewelSlotsType[i],
                        fg         = IconData.none,
                        canRemove  = false,
                        canUpgrade = false,
                        fgColor    = 0,
                        tipDesc    = "",
                    };

                    dataList.Add(viewData);
                }
            }
            //Mogo.Util.LoggerHelper.Debug("m_currentJewelSlot:" + m_currentJewelSlot);
            if (item.jewelSlots != null)
            {
                for (int i = 0; i < item.jewelSlots.Count; i++)
                {
                    int jewelId = item.jewelSlots[i];
                    if (jewelId == -1)
                    {
                        //view.SetInsetHoleImage(IconData.none, i);
                        continue;
                    }
                    ItemJewelData jewel = ItemJewelData.dataMap[jewelId];
                    //view.SetInsetHoleImage(jewel.Icon, i, jewel.color);

                    dataList[i].fg      = jewel.Icon;
                    dataList[i].fgColor = jewel.color;

                    if (m_currentJewelSlot == i)
                    {
                        Mogo.Util.LoggerHelper.Debug("view.SetJewelSlotCurrentDown(i);" + i);

                        dataList[i].canRemove = true;
                        dataList[i].tipDesc   = jewel.effectDescriptionStr;
                        dataList[i].isShowTip = true;
                        //view.ShowInsetHoleUnLoadSign(true, i);
                        //view.ShowInsetHoleToolTip(i, jewel.effectDescriptionStr, true);
                    }

                    if (CanJewelUpgrade(jewel.id))
                    {
                        dataList[i].canUpgrade = true;
                        //view.ShowInsetHoleUpdateSign(true, i);
                    }
                }
            }

            view.SetJewelHoleList(dataList);
        }
        //else
        //{
        //    view.SetInsetEquipmentImage(IconData.none);
        //    for (int i = 0; i < 4; i++)
        //    {
        //        view.SetInsetHoleImage(IconData.none, i);
        //        view.ShowInsetHoleUnLoadSign(false, i);
        //        view.ShowInsetHoleUpdateSign(false, i);
        //    }
        //}

        if (m_currentJewelSlot < 0)
        {
            view.SetAllJewelSlotUp();
        }


        //更新可用宝石栏(界面右下)
        int m = 0;
        int n = 0;

        //选中宝石插槽时
        if (m_inventoryManager.EquipOnDic.ContainsKey(CurrentSlot) &&
            m_currentJewelSlot != -1
            )
        {
            ItemEquipment item = m_inventoryManager.EquipOnDic[CurrentSlot];

            //装备上真的有该插槽时
            if (item.jewelSlotsType != null &&
                m_currentJewelSlot < item.jewelSlotsType.Count)
            {
                view.SetJewelListTitle(LanguageData.dataMap[176].content);
                m_currentJewelList.Clear();
                for (; m < m_itemsJewelSorted.Count; m++)
                {
                    if (!m_itemsJewelSorted[m].slotType.Contains(item.jewelSlotsType[m_currentJewelSlot]))
                    {
                        continue;
                    }

                    //Debug.LogError("m_itemsJewelSorted[m].icon:" + m_itemsJewelSorted[m].icon);
                    //Debug.LogError("m_itemsJewelSorted[m].color:" + m_itemsJewelSorted[m].color);
                    view.SetInsetPackageItemImage(n, m_itemsJewelSorted[m].templateId);
                    view.SetInsetPackageItemNum(n, m_itemsJewelSorted[m].stack);
                    m_currentJewelList.Add(m_itemsJewelSorted[m]);
                    n++;
                }
                m = n;
            }
            else
            {
                view.SetJewelListTitle(LanguageData.dataMap[446].content);
                for (; m < m_itemsJewelSorted.Count; m++)
                {
                    for (int type = 0; type < item.jewelSlotsType.Count; type++)
                    {
                        if (m_itemsJewelSorted[m].slotType.Contains(item.jewelSlotsType[type]))
                        {
                            view.SetInsetPackageItemImage(n, m_itemsJewelSorted[m].templateId);
                            view.SetInsetPackageItemNum(n, m_itemsJewelSorted[m].stack);
                            m_currentJewelList.Add(m_itemsJewelSorted[m]);
                            n++;
                            break;
                        }
                    }
                }
            }
        }
        else//未选中宝石插槽时
        {
            m_currentJewelList.Clear();
            view.SetJewelListTitle(LanguageData.dataMap[446].content);

            ItemEquipment item = null;
            if (m_inventoryManager.EquipOnDic.ContainsKey(CurrentSlot))
            {
                item = m_inventoryManager.EquipOnDic[CurrentSlot];
            }
            if (item != null)
            {
                for (; m < m_itemsJewelSorted.Count; m++)
                {
                    //Debug.LogError(m + ".color:" + m_itemsJewelSorted[m].color);
                    for (int type = 0; type < item.jewelSlotsType.Count; type++)
                    {
                        if (m_itemsJewelSorted[m].slotType.Contains(item.jewelSlotsType[type]))
                        {
                            view.SetInsetPackageItemImage(n, m_itemsJewelSorted[m].templateId);
                            view.SetInsetPackageItemNum(n, m_itemsJewelSorted[m].stack);
                            m_currentJewelList.Add(m_itemsJewelSorted[m]);
                            n++;
                            break;
                        }
                    }
                }
                m = n;
            }
        }

        if (m == 0)
        {
            view.SetJewelListTitle(LanguageData.dataMap[445].content);
        }

        for (; m < InventoryManager.JEWEL_SORTED_GRID_NUM; m++)
        {
            view.SetInsetPackageItemImage(m, -1);
            view.SetInsetPackageItemNum(m, 0);
        }
    }
Beispiel #19
0
    public void SwitchToCompose(int parentId, int childId)
    {
        InventoryManager.Instance.CurrentView = InventoryManager.View.ComposeView;

        InventoryManager.Instance.m_currentEquipmentView = InventoryManager.View.ComposeView;
        EquipTipManager.Instance.CloseEquipTip();
        if (parentId > 0)
        {
            m_currentJewel = ItemJewelData.JewelDic[parentId][childId + 2];
            m_currentParentId = parentId;
            m_currentChildId = childId;
            m_isSwitchFromBag = true;
        }

        MogoUIManager.Instance.SwitchComposeUI();//() => { OnSwitchComposeUIDone(subType, level); }
    }
Beispiel #20
0
    private void OnJewelSelect(int parentId, int id)
    {
        Mogo.Util.LoggerHelper.Debug("parentId:" + parentId + ",id:" + id);
        ComposeUIViewManager view = ComposeUIViewManager.Instance;
        m_currentParentId = parentId;
        m_currentChildId = id;
        view.SetComposeNowBtnEnable(true);
        view.SetComposeBtnEnable(true);
        if (parentId == 0 && m_jewelCanComposeList.Count > id)
        {
            ItemJewelData data = ItemJewelData.dataMap[m_jewelCanComposeList[id]];
            ItemJewelData composeJewel = ItemJewelData.GetJewelDic()[data.subtype][data.level + 1];
            view.SetComposePearlLeftIcon(data.Icon, data.color, data.id);
            view.SetComposePearlRightIcon(data.Icon, data.color, data.id);
            view.SetComposePearlUpIcon(data.Icon, data.color, data.id);
            view.SetComposePearlFinalIcon(composeJewel.Icon, composeJewel.color, composeJewel.id);
            m_currentJewel = data;
            //Mogo.Util.LoggerHelper.Debug("m_currentParentId:" + m_currentParentId + ",m_currentChildId:" + m_currentChildId);
            view.SetComposeNowBtnEnable(false);
            LoggerHelper.Debug("m_currentJewel:" + m_currentJewel.subtype + ",level:" + m_currentJewel.level);
            return;
        }
        else if (parentId == 0)
        {
            m_currentParentId = 1;
            parentId = 1;
            m_currentChildId = 0;
            id = 0;
        }
        Mogo.Util.LoggerHelper.Debug("m_currentParentId:" + m_currentParentId + ",m_currentChildId:" + m_currentChildId);
        view.SetComposePearlLeftIcon(IconData.none);
        view.SetComposePearlRightIcon(IconData.none);
        view.SetComposePearlUpIcon(IconData.none);

        int type = parentId;
        int level = id + 1;

        m_currentJewel = ItemJewelData.GetJewelDic()[type][level];


        ItemJewelData jewel = ItemJewelData.JewelDic[type][level];
        ItemJewelData nextJewel = ItemJewelData.JewelDic[type][level + 1];
        Mogo.Util.LoggerHelper.Debug("nextJewel:" + nextJewel.Name);
        view.SetComposePearlFinalIcon(nextJewel.Icon, nextJewel.color, nextJewel.id);
        view.SetComposePearlUpIcon(jewel.Icon);
        view.SetComposePearlLeftIcon(jewel.Icon);
        view.SetComposePearlRightIcon(jewel.Icon);
        if (!m_jewelDic.ContainsKey(type))
        {
            view.SetComposeBtnEnable(false);
            return;
        }
        if (!m_jewelDic[type].ContainsKey(level))
        {
            view.SetComposeBtnEnable(false);
            return;
        }

        int num = m_jewelDic[type][level];

        view.SetComposeBtnEnable(false);
        if (num >= 1) view.SetComposePearlUpIcon(jewel.Icon, jewel.color, jewel.id);
        if (num >= 2) view.SetComposePearlLeftIcon(jewel.Icon, jewel.color, jewel.id);
        if (num >= 3)
        {
            view.SetComposePearlRightIcon(jewel.Icon, jewel.color, jewel.id);
            view.SetComposeNowBtnEnable(false);
            view.SetComposeBtnEnable(true);
        }
    }
Beispiel #21
0
    private void OnSwitchComposeUIDone(int subType, int level)
    {
        Mogo.Util.LoggerHelper.Debug("OnSwitchComposeUIDone(int subType, int level):" + subType + "," + level);
        m_currentJewel = ItemJewelData.JewelDic[subType][level];
        m_currentParentId = subType;
        m_currentChildId = level - 2;
        OnJewelSelect(m_currentParentId, m_currentChildId);

    }
Beispiel #22
0
    public void RefreshUI()
    {
        //if (m_versionID >= m_inventoryManager.m_versionId) return;
        if (ComposeUIViewManager.Instance == null)
        {
            return;
        }

        if (m_isRefreshing)
        {
            //Debug.LogError("Debug.LogError(m_isRefreshing);");
            m_isNeedRefresh = true;
            return;
        }
        m_isRefreshing = true;
        Debug.Log("RefreshUI");
        UpdateJewelDic();
        Dictionary <int, LanguageData> nameData = LanguageData.dataMap;
        ComposeUIViewManager           view     = ComposeUIViewManager.Instance;
        Dictionary <int, Dictionary <int, ItemJewelData> > jewelDB = ItemJewelData.GetJewelDic();

        view.RemoveIconList();

        PrivilegeData privilegeData = PrivilegeData.dataMap[MogoWorld.thePlayer.VipLevel];

        //可合成宝石

        int count = 0;

        m_jewelCanComposeList.Clear();

        List <string> canComposeStrList = new List <string>();

        for (int subtype = 1; subtype <= ItemJewelData.TypeNum; subtype++)
        {
            if (!m_jewelDic.ContainsKey(subtype))
            {
                continue;
            }
            for (int level = privilegeData.jewelSynthesisMaxLevel - 1; level >= 1; level--)
            {
                if (!m_jewelDic[subtype].ContainsKey(level))
                {
                    continue;
                }

                if (m_jewelDic[subtype][level] > 2)
                {
                    canComposeStrList.Add(string.Concat("[FFFFFF]", jewelDB[subtype][level + 1].NameWithoutColor, "[-]"));
                    count++;
                    m_jewelCanComposeList.Add(jewelDB[subtype][level].id);
                }
            }
        }

        //计算要加载的条数,用于异步加载
        view.IconGridNum      = ItemJewelData.TypeNum + 1;
        view.IconChildGridNum = (privilegeData.jewelSynthesisMaxLevel - 1) * (ItemJewelData.TypeNum) + canComposeStrList.Count;
        view.AddIconListGrid(nameData[JEWEL_NAME_START_ID].content, 0);

        for (int i = 0; i < canComposeStrList.Count; i++)
        {
            view.AddIconListGridChild(0, i, canComposeStrList[i]);
        }


        //核心宝石
        //int coreJewelType = 1;

        //string coreJewelName = nameData[JEWEL_NAME_START_ID + coreJewelType].content;
        //view.AddIconListGrid(coreJewelName, 1);
        //for (int j = 0; j < 8; ++j)
        //{
        //    int level = j + 2;
        //    if (level > privilegeData.jewelSynthesisMaxLevel) break;
        //    view.AddIconListGridChild(1, j, jewelDB[coreJewelType][j + 2].Name);
        //}

        //其他宝石
        Debug.Log("ItemJewelData.MaxType:" + ItemJewelData.MaxType);

        for (int i = 0; i < ItemJewelData.TypeNum; ++i)
        {
            int type = i + 1;
            if (!jewelDB.ContainsKey(type))
            {
                continue;
            }

            view.AddIconListGrid(nameData[JEWEL_NAME_START_ID + type].content, type);

            for (int j = 0; j < ItemJewelData.JewelLevelNum - 1; ++j)
            {
                int level = j + 2;
                if (level > privilegeData.jewelSynthesisMaxLevel)
                {
                    break;
                }
                string name = jewelDB[type][level].NameWithoutColor;
                //Debug.Log(name);
                if (m_jewelDic.ContainsKey(type))
                {
                    if (m_jewelDic[type].ContainsKey(level - 1))
                    {
                        if (m_jewelDic[type][level - 1] > 2)
                        {
                            name = string.Concat("[FFFFFF]", name, "[-]");
                        }
                    }
                }
                //Debug.Log("type:" + type + ",j:" + j + ",name:" + name);
                view.AddIconListGridChild(type, j, name);
            }
        }

        view.SetComposePearlLeftIcon(IconData.none);
        view.SetComposePearlRightIcon(IconData.none);
        view.SetComposePearlUpIcon(IconData.none);

        view.RepositionNow();


        if (m_currentJewel == null)
        {
            if (m_jewelCanComposeList.Count > 0)
            {
                Debug.Log("(0, 0)");
                m_currentParentId = 0;
                m_currentChildId  = 0;
            }
            else
            {
                Debug.Log("(1, 0)");
                m_currentParentId = 1;
                m_currentChildId  = 0;
            }
        }

        Debug.Log("m_currentParentId:" + m_currentParentId + ",m_currentChildId:" + m_currentChildId);
        OnJewelSelect(m_currentParentId, m_currentChildId);
        m_versionID = m_inventoryManager.m_versionId;
        Debug.Log("m_currentParentId:" + m_currentParentId + ",m_currentChildId:" + m_currentChildId);


        MogoUIManager.Instance.SwitchComposeUI(delegate()
        {
            //Debug.LogError("SwitchComposeUI done");
            view.SetCurrentGridDown(m_currentParentId, m_currentChildId);
            m_isRefreshing = false;
            if (m_isNeedRefresh)
            {
                //Debug.LogError("m_isNeedRefresh");
                m_isNeedRefresh = false;
                RefreshUI();
            }
            //TimerHeap.AddTimer(400, 0, delegate()
            //{
            //    view.SetCurrentGridDown(m_currentParentId, m_currentChildId);
            //});
        }, false);
        //TimerHeap.AddTimer(500, 0, delegate()
        //{
        //    view.SetCurrentGridDown(m_currentParentId, m_currentChildId);
        //});
        Debug.Log("refreshUi done");
    }
Beispiel #23
0
    private void OnJewelSelect(int parentId, int id)
    {
        Debug.Log("parentId:" + parentId + ",id:" + id);
        ComposeUIViewManager view = ComposeUIViewManager.Instance;

        m_currentParentId = parentId;
        m_currentChildId  = id;
        view.SetComposeNowBtnEnable(true);
        view.SetComposeBtnEnable(true);
        if (parentId == 0 && m_jewelCanComposeList.Count > id)
        {
            ItemJewelData data         = ItemJewelData.dataMap[m_jewelCanComposeList[id]];
            ItemJewelData composeJewel = ItemJewelData.GetJewelDic()[data.subtype][data.level + 1];
            view.SetComposePearlLeftIcon(data.Icon, data.color, data.id);
            view.SetComposePearlRightIcon(data.Icon, data.color, data.id);
            view.SetComposePearlUpIcon(data.Icon, data.color, data.id);
            view.SetComposePearlFinalIcon(composeJewel.Icon, composeJewel.color, composeJewel.id);
            m_currentJewel = data;
            //Debug.Log("m_currentParentId:" + m_currentParentId + ",m_currentChildId:" + m_currentChildId);
            view.SetComposeNowBtnEnable(false);
            Debug.Log("m_currentJewel:" + m_currentJewel.subtype + ",level:" + m_currentJewel.level);
            return;
        }
        else if (parentId == 0)
        {
            m_currentParentId = 1;
            parentId          = 1;
            m_currentChildId  = 0;
            id = 0;
        }
        Debug.Log("m_currentParentId:" + m_currentParentId + ",m_currentChildId:" + m_currentChildId);
        view.SetComposePearlLeftIcon(IconData.none);
        view.SetComposePearlRightIcon(IconData.none);
        view.SetComposePearlUpIcon(IconData.none);

        int type  = parentId;
        int level = id + 1;

        m_currentJewel = ItemJewelData.GetJewelDic()[type][level];


        ItemJewelData jewel     = ItemJewelData.JewelDic[type][level];
        ItemJewelData nextJewel = ItemJewelData.JewelDic[type][level + 1];

        Debug.Log("nextJewel:" + nextJewel.Name);
        view.SetComposePearlFinalIcon(nextJewel.Icon, nextJewel.color, nextJewel.id);
        view.SetComposePearlUpIcon(jewel.Icon);
        view.SetComposePearlLeftIcon(jewel.Icon);
        view.SetComposePearlRightIcon(jewel.Icon);
        if (!m_jewelDic.ContainsKey(type))
        {
            view.SetComposeBtnEnable(false);
            return;
        }
        if (!m_jewelDic[type].ContainsKey(level))
        {
            view.SetComposeBtnEnable(false);
            return;
        }

        int num = m_jewelDic[type][level];

        view.SetComposeBtnEnable(false);
        if (num >= 1)
        {
            view.SetComposePearlUpIcon(jewel.Icon, jewel.color, jewel.id);
        }
        if (num >= 2)
        {
            view.SetComposePearlLeftIcon(jewel.Icon, jewel.color, jewel.id);
        }
        if (num >= 3)
        {
            view.SetComposePearlRightIcon(jewel.Icon, jewel.color, jewel.id);
            view.SetComposeNowBtnEnable(false);
            view.SetComposeBtnEnable(true);
        }
    }