Example #1
0
    private void SelectReward(int idx)
    {
        initrrd();
        var        items = GetChargeReward(rrds[idx]);
        List <int> ids   = new List <int>();

        if (items != null)
        {
            foreach (var item in items)
            {
                if (ItemParentData.GetItem(item.Key) != null)
                {
                    ids.Add(item.Key);
                }
            }
            NewChargeRewardUILogicManager.Instance.SetItemList(ids);
        }
        if (chargedReward.Contains(rrds[idx].id))
        {
            NewChargeRewardUILogicManager.Instance.ShowGetBtn(false);
        }
        else
        {
            NewChargeRewardUILogicManager.Instance.ShowGetBtn(true);
        }
        if (idx > currStep)
        {
            NewChargeRewardUILogicManager.Instance.ShowGetBtn(false);
        }
        currSelect = idx;
    }
    public int CalculateJewelMarks(int level)
    {
        int dataID     = level;
        int totalMarks = 0;

        foreach (var item in EquipSpecialEffectData.dataMap)
        {
            if (item.Value.group == 1)
            {
                if (item.Value.level == level)
                {
                    dataID = item.Key;
                    break;
                }
            }
        }

        foreach (var item in InventoryManager.Instance.EquipOnDic)
        {
            for (int i = 0; i < item.Value.jewelSlots.Count; ++i)
            {
                if (item.Value.jewelSlots[i] != -1)
                {
                    Debug.LogError(dataID);
                    totalMarks += EquipSpecialEffectData.dataMap[dataID].scoreList[ItemParentData.GetItem(
                                                                                       item.Value.jewelSlots[i]).level];
                }
            }
        }

        return(totalMarks);
    }
Example #3
0
    /// <summary>
    /// ʹ�÷�������������
    /// </summary>
    /// <param name="hasGetArenaRewardList">����ȡ�Ľ����б�</param>
    /// <param name="allRewardDataList">���еĽ����б�</param>
    /// <param name="callback"></param>
    public void AddRewardUnit(List <int> hasGetArenaRewardList, Dictionary <int, ArenaRewardData> allRewardDataList, Action callback)
    {
        List <int> allSortRewardList = SortAllReward(hasGetArenaRewardList, allRewardDataList);

        m_rewardList.GetComponent <MogoListImproved>().SetGridLayout <ArenaRewardGrid>(allSortRewardList.Count(), m_rewardList.transform,
                                                                                       () =>
        {
            int iter = 0;
            if (m_rewardList.GetComponent <MogoListImproved>().DataList.Count > 0)
            {
                foreach (var rewardID in allSortRewardList)
                {
                    ArenaRewardGrid unit = (ArenaRewardGrid)(m_rewardList.GetComponent <MogoListImproved>().DataList[iter]);
                    unit.RewardID        = rewardID;
                    unit.Icon            = ArenaScoreRewardData.dataMap.Get(rewardID).reward.Keys.
                                           Select(x => ItemParentData.GetItem(x).Icon).ToList();
                    unit.Color = ArenaScoreRewardData.dataMap.Get(rewardID).reward.Keys.
                                 Select(x => ItemParentData.GetItem(x).color).ToList();
                    unit.clickHandler = ArenaRewardUILogicManager.Instance.OnGetReward;

                    foreach (KeyValuePair <int, int> pair in ArenaScoreRewardData.dataMap.Get(rewardID).reward)
                    {
                        string name = (GetNameByItemID(pair.Key));

                        int num             = allRewardDataList[rewardID].num;
                        string numText      = string.Concat(" x ", num);
                        string qualityColor = ItemParentData.GetQualityColorByItemID(pair.Key);
                        numText             = string.Concat("[", qualityColor, "]", numText, "[-]");

                        unit.Name = string.Concat(name, numText);
                        break;
                    }

                    bool IsAlreadyGet = false;
                    if (hasGetArenaRewardList.Contains(rewardID))
                    {
                        IsAlreadyGet = true;
                    }
                    else
                    {
                        IsAlreadyGet = false;
                    }

                    unit.SetDetailInfo(ArenaScoreRewardData.dataMap.Get(rewardID).type,
                                       ArenaScoreRewardData.dataMap.Get(rewardID).score,
                                       ArenaUILogicManager.Instance.m_ObtainDayPoint,
                                       ArenaUILogicManager.Instance.m_ObtainWeekPoint,
                                       IsAlreadyGet);
                    iter++;
                }
            }
        });
    }
    void ReportResourceLoaded()
    {
        var m_reportDataList = m_reportList.GetComponentsInChildren <MogoListImproved>(true)[0].DataList;
        int len = m_reportDataList.Count;

        for (int i = 0; i < len; i++)
        {
            BattleReportUnit unit = (BattleReportUnit)m_reportDataList[i];
            if (i == 0)
            {
                unit.content = LanguageData.dataMap.Get(20014).content;
                unit.head    = true;
                unit.line    = false;
            }
            else if (i == 1)
            {
                if (m_reportData.money > 0)
                {
                    unit.content = String.Concat(LanguageData.MONEY, String.Format("x{0}", m_reportData.money), "  ",
                                                 LanguageData.EXP, String.Format("x{0}", m_reportData.exp));
                }
                else
                {
                    unit.content = String.Concat(LanguageData.EXP, String.Format("x{0}", m_reportData.exp));
                }
                unit.head = false;
                unit.line = false;
            }
            else if (i > 1 && i < len)
            {
                string[] temp = (from x in m_reportData.Items select String.Concat(ItemParentData.GetItem(x.Key).Name, "x", x.Value)).ToArray();

                unit.head = false;
                if (i == len - 1) //last one
                {
                    unit.content = String.Join(",", temp, RowNum * (i - 2), (len - 2) % RowNum == 0 ? RowNum : (len - 2) % RowNum);
                    unit.line    = true;
                }
                else
                {
                    unit.content = String.Join(",", temp, RowNum * (i - 2), RowNum);
                    unit.line    = false;
                }
            }
            else
            {
                Debug.LogError("Calculate Error");
            }
        }
        m_rewardTitle.text = LanguageData.dataMap.Get(20015).Format(MogoWorld.thePlayer.name);
        OpenReport();
    }
Example #5
0
    public void ShowRespInfo(int errorId, int slot = 0)
    {
        if (errorId == 5 && slot != 0 && InventoryManager.Instance.EquipOnDic.ContainsKey(slot))
        {
            ItemEquipment equip = InventoryManager.Instance.EquipOnDic.Get(slot);

            MogoMsgBox.Instance.ShowFloatingText(LanguageData.GetContent(1385, ItemParentData.GetItem(equip.GetEnhantMaterialId()).Name));
        }
        else if (errorId != 0)
        {
            MogoMsgBox.Instance.ShowFloatingText(LanguageData.GetContent(errorId + 1380));
        }
    }
Example #6
0
    static public string GetNameByItemID(int itemID)
    {
        if (ItemParentData.GetItem(itemID) != null)
        {
            return(ItemParentData.GetItem(itemID).Name);
        }

        else
        {
            Debug.Log(String.Format("cannot find itemID {0} in all item xml", itemID));
            return(String.Empty);
        }
    }
 void onClick(int id)
 {
     if (id > 0)
     {
         List <string> reward = new List <string>();
         foreach (var item in TowerXMLData.dataMap[id].item)
         {
             reward.Add(ItemParentData.GetItem(item.Key).Name + "  x" + item.Value);
         }
         SetRewardGridTipData(reward, LanguageData.dataMap.Get(20013).Format(id));
         ShowRewardGridTip(true);
     }
 }
Example #8
0
 public int GetEnhantQuality()
 {
     //Debug.LogError("GetEnhantSum");
     if (enchant == null)
     {
         //Debug.LogError("enchant == null");
         return(1);
     }
     foreach (int id in enchant.Keys)
     {
         return(ItemParentData.GetItem(id).quality);
     }
     return(1);
 }
Example #9
0
    /// <summary>
    /// Boss宝箱奖励
    /// </summary>
    /// <param name="bossID"></param>
    void OnBossRewardUp(int bossID)
    {
        if (InstanceBossTreasureUIViewManager.Instance != null)
        {
            InstanceBossTreasureUIViewManager.Instance.ShowInstanceBossTreasureUIRewardUI(true);

            var           data         = BossChestData.dataMap.Get(bossID);
            List <string> rewardString = new List <string>();
            foreach (var item in data.reward)
            {
                rewardString.Add(string.Concat(ItemParentData.GetItem(item.Key).Name, " * ", item.Value));
            }
            InstanceBossTreasureUIViewManager.Instance.SetInstanceBossTreasureUIRewardList(rewardString);
        }
    }
Example #10
0
    private List <List <EquipExchangeViewData> > GetViewData(int level)
    {
        List <List <EquipExchangeViewData> > dataList = new List <List <EquipExchangeViewData> >();

        dataList.Add(new List <EquipExchangeViewData>());
        dataList.Add(new List <EquipExchangeViewData>());
        Debug.Log("item.level:" + level);
        HashSet <int> dataSet = ItemExchangeData.DataDic[level];

        foreach (int i in dataSet)
        {
            ItemExchangeData exchangeData = ItemExchangeData.dataMap.Get(i);
            Debug.Log("exchangeData.GetRewardByVocation(MogoWorld.thePlayer.vocation):" + exchangeData.GetRewardByVocation(MogoWorld.thePlayer.vocation));
            ItemParentData        itemReward = ItemParentData.GetItem(exchangeData.GetRewardByVocation(MogoWorld.thePlayer.vocation));
            EquipExchangeViewData viewData   = new EquipExchangeViewData()
            {
                goldNum     = "x" + exchangeData.GoldNum,
                title       = itemReward.Name,
                itemId      = itemReward.id,
                materialNum = "x" + exchangeData.MeterailNum,
                materialId  = exchangeData.MeterialId,
                onExchange  = () => { OnExchange(exchangeData.id); }
            };
            if (exchangeData.GoldNum <= 0)
            {
                viewData.goldNum = string.Empty;
            }
            if (exchangeData.GoldNum > MogoWorld.thePlayer.gold)
            {
                viewData.goldNum = MogoUtils.GetRedString(viewData.goldNum);
            }
            if (exchangeData.MeterailNum > InventoryManager.Instance.GetItemNumById(exchangeData.MeterialId))
            {
                viewData.materialNum = MogoUtils.GetRedString(viewData.materialNum);
            }
            if (exchangeData.subtype < 3)
            {
                dataList[exchangeData.subtype - 1].Add(viewData);
                m_materilaIdDic[exchangeData.subtype - 1] = exchangeData.MeterialId;
            }
            else
            {
                dataList[0].Add(viewData);
                m_materilaIdDic[0] = exchangeData.MeterialId;
            }
        }
        return(dataList);
    }
    private EquipUpgradeViewManager.EquipUpgradeViewData GetViewdata(ItemEquipment m_equip)
    {
        EquipUpgradeViewManager.EquipUpgradeViewData viewData = new EquipUpgradeViewManager.EquipUpgradeViewData();
        viewData.oldEquipId = m_equip.templateId;

        ItemEffectData    itemEffect = ItemEffectData.dataMap.Get(m_equip.effectId);
        ItemEquipmentData newEquip   = null;

        foreach (int id in itemEffect.reward1.Keys)
        {
            newEquip            = ItemEquipmentData.dataMap.Get(id);
            viewData.newEquipId = newEquip.id;
            break;
        }
        viewData.materialIdList    = new List <int>();
        viewData.materilNumStrList = new List <string>();
        foreach (KeyValuePair <int, int> pair in itemEffect.costId)
        {
            Mogo.Util.LoggerHelper.Debug(pair.Key);
            ItemParentData item = ItemParentData.GetItem(pair.Key);
            if (item.itemType > 0)
            {
                viewData.materialIdList.Add(item.id);
                string numStr  = string.Empty;
                int    num     = InventoryManager.Instance.GetItemNumByIdAndType(item.id, item.itemType);
                int    needNum = pair.Value;
                numStr = string.Concat(num, "/", needNum);
                if (needNum > num)
                {
                    numStr = MogoUtils.GetRedString(numStr);
                }
                viewData.materilNumStrList.Add(numStr);
            }
            else
            {
                viewData.needGold = "X" + pair.Value;
            }
        }

        int level = MogoWorld.thePlayer.level;

        viewData.power = LanguageData.GetContent(190000, newEquip.GetScore(level) - m_equip.GetScore(level));

        return(viewData);
    }
Example #12
0
    public void Fumo(int slot)
    {
        LoggerHelper.Debug(slot);
        int currentSlot = slot;

        if (HasFumoProccess(out currentSlot))
        {
            //提示附魔
            ShowFumoInfo();
        }
        else
        {
            //FumoReq(slot);
            //m_currentSlot = slot;

            ItemEquipment  equip    = InventoryManager.Instance.EquipOnDic[slot];
            ItemParentData material = ItemParentData.GetItem(equip.GetEnhantMaterialId());
            if (InventoryManager.Instance.GetItemNumById(material.id) <= 0)
            {
                MogoMsgBox.Instance.ShowFloatingText(LanguageData.GetContent(1385, material.Name));
                return;
            }

            EquipTipManager.Instance.CloseEquipTip();
            string        title       = LanguageData.GetContent(28120, material.Name);
            List <string> contentList = new List <string>();
            for (int i = 0; i < 5; i++)
            {
                contentList.Add(LanguageData.GetContent(28113 + i));
            }
            FumoUIViewManager.Instance.ShowFumoProcess(title, contentList,
                                                       () =>
            {
                FumoReq(slot);
                m_currentSlot = slot;
            }
                                                       , () =>
            {
                FumoUIViewManager.Instance.CloseUI();
                InventoryManager.Instance.OnEquipGridUp(m_currentSlot);
            });
        }
    }
Example #13
0
    public void OnSelectOtherPlayer(int index)
    {
        Debug.Log("OnSelectOtherPlayer:" + index);

        //显示tip
        DragonMatchPlayerInfo playUIInfo = new DragonMatchPlayerInfo();
        DragonPlayerInfo      info       = m_currentData.playerList[index];

        playUIInfo.dragon = DragonQualityData.GetDragonQualityData(info.quality).GetName(true);
        int exp  = 0;
        int gold = 0;

        if (info.reward.ContainsKey(2))
        {
            gold = info.reward[2];
        }
        if (info.reward.ContainsKey(1))
        {
            exp = info.reward[1];
        }
        playUIInfo.hitObtainGold = gold.ToString() + ItemParentData.GetItem(2).Name;
        playUIInfo.hitObtainExp  = exp.ToString() + ItemParentData.GetItem(1).Name;

        playUIInfo.hitTimes = string.Concat(info.hittedTime, "/", DragonBaseData.dataMap[1].convoyAttackedTimes);
        playUIInfo.level    = "LV" + info.level.ToString();
        playUIInfo.power    = info.power.ToString();
        playUIInfo.status   = info.GetStatusInfo();
        playUIInfo.tong     = info.tongName;
        playUIInfo.name     = info.name;
        bool showBtn = (info.dbid != MogoWorld.thePlayer.dbid) && (info.hittedTime < DragonBaseData.dataMap[1].convoyAttackedTimes);

        DragonMatchUIViewManager.Instance.ShowDragonMatchPlayerInfoUIBtnHit(showBtn);
        DragonMatchUIViewManager.Instance.SetDragonMatchPlayerInfo(playUIInfo);
        DragonMatchUIViewManager.Instance.ShowDragonMatchPlayerInfoUI(true);
        m_selectedPlayer = index;
    }
    public void RefreshUI(int page)
    {
        switch (page)
        {
        case 0:
        {
            //SanctuaryUIViewManager.Instance.SetCurrentAchieve(weekContri.ToString());
            //SanctuaryUIViewManager.Instance.SetNextAchieve(MyInfo.nextLvNeedContribution.ToString());
            //SanctuaryUIViewManager.Instance.SetAcieveReward(SanctuaryRewardXMLData.GetAccuNextRankIcon(weekContri));
            //SanctuaryUIViewManager.Instance.SetNextAchievementRewardGoldNum(SanctuaryRewardXMLData.GetAccuNextGold(weekContri));
            var rwd = new List <MyRewardData>();
            foreach (var item in SanctuaryRewardXMLData.dataMap.
                     Where(x => x.Value.type == 3 && x.Value.level[0] <= weekLevel &&
                           weekLevel <= x.Value.level[1]))
            {
                if (weekContri >= item.Value.contribution)
                {
                    //可以领取
                    if (alreadyGetList.Contains(item.Key))
                    {
                        //已经领取过了
                        rwd.Add(new MyRewardData()
                            {
                                name         = string.Concat(ItemParentData.GetItem((int)ItemCode.GOLD).Name, " x ", item.Value.gold),
                                rewardID     = item.Key,
                                icon         = IconData.dataMap.Get(item.Value.icon).path,
                                isAlreadyGet = true,
                                isEnable     = true,
                                needScore    = item.Value.contribution,
                                progress     = (LanguageData.GetContent(46915, String.Concat(weekContri, '/', item.Value.contribution)))
                            });
                    }
                    else
                    {
                        rwd.Add(new MyRewardData()
                            {
                                name         = string.Concat(ItemParentData.GetItem((int)ItemCode.GOLD).Name, " x ", item.Value.gold),
                                rewardID     = item.Key,
                                icon         = IconData.dataMap.Get(item.Value.icon).path,
                                isAlreadyGet = false,
                                isEnable     = true,
                                needScore    = item.Value.contribution,
                                progress     = (LanguageData.GetContent(46915, String.Concat(weekContri, '/', item.Value.contribution)))
                            });
                    }
                }
                else
                {
                    rwd.Add(new MyRewardData()
                        {
                            name         = string.Concat(ItemParentData.GetItem((int)ItemCode.GOLD).Name, " x ", item.Value.gold),
                            rewardID     = item.Key,
                            icon         = IconData.dataMap.Get(item.Value.icon).path,
                            isAlreadyGet = false,
                            isEnable     = false,
                            needScore    = item.Value.contribution,
                            progress     = (LanguageData.GetContent(46915, String.Concat(weekContri, '/', item.Value.contribution)))
                        });
                }
            }

            SanctuaryUIViewManager.Instance.GenerateMyRewardList(rwd);
        }
        break;

        case 1:
        {
            SanctuaryUIViewManager.Instance.ClearRankGridList();
            for (int i = 0; i < weekData.Count; i++)
            {
                RankGridData data = new RankGridData();
                data.achieve = weekData[i].contribution.ToString();
                data.name    = weekData[i].name;
                data.rank    = (i + 1).ToString();
                if (data.name.Equals(MogoWorld.thePlayer.name))
                {
                    data.highLight = true;
                }
                else
                {
                    data.highLight = false;
                }
                SanctuaryUIViewManager.Instance.AddRankGrid(data, i);
            }
            SanctuaryUIViewManager.Instance.SetPlayerName(MogoWorld.thePlayer.name);
            SanctuaryUIViewManager.Instance.SetPlayerRank(MyWeek.ToString());
            SanctuaryUIViewManager.Instance.SetPlayerContribute(weekContri.ToString());
            var weekRank = SanctuaryRewardXMLData.GetWeekRankID();
            SanctuaryUIViewManager.Instance.ClearRewardGridList();

            for (int i = 0; i < weekRank.Count; i++)
            {
                RankRewardGridData rrgd = new RankRewardGridData();
                rrgd.imgName = IconData.dataMap.Get(SanctuaryRewardXMLData.dataMap.Get(weekRank[i]).icon).path;
                rrgd.text    = String.Format("第{0}名宝箱", i + 1);
                SanctuaryUIViewManager.Instance.AddRewardGrid(rrgd);
            }
            break;
        }

        case 2:
        {
            SanctuaryUIViewManager.Instance.ClearRankGridList();
            for (int i = 0; i < dayData.Count; i++)
            {
                RankGridData data = new RankGridData();
                data.achieve = dayData[i].contribution.ToString();
                data.name    = dayData[i].name;
                data.rank    = (i + 1).ToString();
                if (data.name.Equals(MogoWorld.thePlayer.name))
                {
                    data.highLight = true;
                }
                else
                {
                    data.highLight = false;
                }
                SanctuaryUIViewManager.Instance.AddRankGrid(data, i);
            }
            SanctuaryUIViewManager.Instance.SetPlayerName(MogoWorld.thePlayer.name);
            SanctuaryUIViewManager.Instance.SetPlayerRank(MyDay.ToString());
            SanctuaryUIViewManager.Instance.SetPlayerContribute(dayContri.ToString());
            var dayRank = SanctuaryRewardXMLData.GetDayRankID();
            SanctuaryUIViewManager.Instance.ClearRewardGridList();

            for (int i = 0; i < dayRank.Count; i++)
            {
                RankRewardGridData rrgd = new RankRewardGridData();
                rrgd.imgName = IconData.dataMap.Get(SanctuaryRewardXMLData.dataMap.Get(dayRank[i]).icon).path;
                rrgd.text    = String.Format("第{0}名宝箱", i + 1);
                SanctuaryUIViewManager.Instance.AddRewardGrid(rrgd);
            }
            break;
        }

        default:
            break;
        }
    }
Example #15
0
    private void SetupChooseDragonView()
    {
        //Debug.Log("SetupChooseDragonView");
        List <ChooseDragonGridData> chooseDragonGridDataList = new List <ChooseDragonGridData>();
        List <DragonQualityData>    dragonDataList           = DragonQualityData.GetDataList();

        for (int i = 0; i < dragonDataList.Count; i++)
        {
            ChooseDragonGridData gridData = new ChooseDragonGridData();
            gridData.dragonID      = dragonDataList[i].id;
            gridData.dragonQuality = dragonDataList[i].quality;
            if (dragonDataList[i].quality != m_currentData.dragonQuality)
            {
                gridData.enable = false;
            }
            else
            {
                gridData.enable = true;
            }

            gridData.finishTime     = LanguageData.dataMap.Get(26300).Format((dragonDataList[i].convoyCompleteTime[m_currentData.currentRound + 1] / 60));
            gridData.additionReward = LanguageData.GetContent(26301, (dragonDataList[i].rewardAddition / 100));
            if (i == 4 && m_currentData.dragonQuality != 6)
            {
                gridData.showBuy = true;
            }
            else
            {
                gridData.showBuy = false;
            }
            chooseDragonGridDataList.Add(gridData);
        }
        ChooseDragonUILogicManager.Instance.SetChooseDragonGridDataList(chooseDragonGridDataList);

        DragonQualityData currentDragon  = DragonQualityData.GetDragonQualityData(m_currentData.dragonQuality);
        string            nextDragonName = string.Empty;

        if (m_currentData.dragonQuality < 6)
        {
            nextDragonName = DragonQualityData.GetDragonQualityData(m_currentData.dragonQuality + 1).GetName(true);
        }
        ChooseDragonUIViewManager.Instance.SetCurrentChooseDragon(currentDragon.GetName(true), nextDragonName);
        ChooseDragonUIViewManager.Instance.SetRewardCurrentTime(m_currentData.currentRound + 1);

        ChooseDragonUIViewManager.Instance.SetRewardExp(Rewards[1]);
        ChooseDragonUIViewManager.Instance.SetRewardGold(Rewards[2]);
        int[]  cost        = DragonBaseData.GetCostItem();
        int    costNum     = cost[1];
        int    costID      = cost[0];
        int    materialNum = InventoryManager.Instance.GetItemNumById(costID);
        string costStr     = string.Empty;

        if (costNum <= materialNum)
        {
            ChooseDragonUIViewManager.Instance.SetUpgradeNeedIcon(ItemParentData.GetItem(costID).Icon);
            costStr = string.Concat(costNum, "/", materialNum);
            ChooseDragonUIViewManager.Instance.SetUpgradeNeedNum(costStr);
        }
        else
        {
            int priceId = DragonBaseData.dataMap[1].upgradeQualityCost;
            int price   = PriceListData.GetPrice(priceId, 0);

            costStr = string.Concat(price, "/", MogoWorld.thePlayer.diamond);
            if (price > MogoWorld.thePlayer.diamond)
            {
                costStr = MogoUtils.GetRedString(costStr);
            }
            ChooseDragonUIViewManager.Instance.SetUpgradeNeedIcon(ItemParentData.GetItem(3).Icon);
            ChooseDragonUIViewManager.Instance.SetUpgradeNeedNum(costStr);
        }
    }
    public void ShowChargeRewardByBtn(int offset)
    {
        //MogoMsgBox.Instance.ShowFloatingText(LanguageData.GetContent(25570));

        List <KeyValuePair <int, int> > spItemMessages = new List <KeyValuePair <int, int> >();
        List <int> spIDs = new List <int>();

        int count = -1;

        foreach (var data in RewardRechargeData.dataMap)
        {
            count++;
            if (count == currentChargeRewardPage + offset)
            {
                Dictionary <int, int> items;
                switch (MogoWorld.thePlayer.vocation)
                {
                case Vocation.Warrior:
                    items = data.Value.items1;
                    break;

                case Vocation.Assassin:
                    items = data.Value.items2;
                    break;

                case Vocation.Archer:
                    items = data.Value.items3;
                    break;

                case Vocation.Mage:
                    items = data.Value.items4;
                    break;

                default:
                    items = new Dictionary <int, int>();
                    break;
                }

                foreach (var item in items)
                {
                    if (ItemParentData.GetItem(item.Key) != null)
                    {
                        spIDs.Add(item.Key);
                        spItemMessages.Add(item);
                    }
                }

                // 设置按钮
                if (data.Value.money <= MogoWorld.thePlayer.chargeSum)
                {
                    isCharge = false;
                }
                else
                {
                    isCharge = true;
                }
                ChargeRewardUIViewManager.Instance.SwitchBtn(isCharge);
                break;
            }
        }

        if (spItemMessages.Count != 0)
        {
            ChargeRewardUIViewManager.Instance.SetChargeRewardListGrid(spIDs);
            ChargeRewardUIViewManager.Instance.SetChargeRewardListIcon(spItemMessages);
        }

        ChargeRewardUIViewManager.Instance.SetBtnGroupPress(offset);
        Debug.Log(offset);
        ChargeRewardUIViewManager.Instance.SetProgressMark(offset);
    }
Example #17
0
    void RefreshCurSkillDesc(int skillId)
    {
        SpriteUIViewManager.Instance.SetDetailCurrentSkill(
            LanguageData.GetContent(SkillData.dataMap.Get(skillId).name),
            IconData.dataMap.Get(SkillData.dataMap.Get(skillId).icon).path,
            SkillData.dataMap.Get(skillId).level
            );
        SpriteUIViewManager.Instance.SetDetailCurrentSkillDesc(LanguageData.GetContent(SkillData.dataMap.Get(skillId).desc));

        var nextSkillId = ElfSkillUpgradeData.dataMap.FirstOrDefault(x => x.Value.preSkillId == skillId);

        if (nextSkillId.Value != null)
        {
            SpriteUIViewManager.Instance.SetDetailNextSkillDesc(LanguageData.GetContent(SkillData.dataMap.Get(nextSkillId.Key).desc));
            var pair = ElfSkillUpgradeData.dataMap.Get(nextSkillId.Key).consume.ToList()[0];
            SpriteUIViewManager.Instance.SetDetailNextSkillRequest(LanguageData.GetContent(29600, pair.Value, ItemParentData.GetItem(pair.Key).Name));
            SpriteUIViewManager.Instance.SetDetailNextSkillProgress(MogoWorld.thePlayer.inventoryManager.GetItemNumById(pair.Key) / (float)pair.Value);
            SpriteUIViewManager.Instance.ShowDetailNextSkillInfo(true);
        }
        else
        {
            SpriteUIViewManager.Instance.ShowDetailNextSkillInfo(false);
        }
    }
Example #18
0
    public void ShowMaterial(bool refresh, int itemId1, int itemId2 = 0)
    {
        if (refresh == false)
        {
            return;
        }

        m_goGOMaterialObtainNormalCrystal.SetActive(false);
        m_goGOMaterialObtainPerfectCrystal.SetActive(false);
        m_goMaterialObtainTipBGLine.SetActive(false);

        // subtype = 1 普通;subtype = 2 完美
        ItemParentData data1 = ItemParentData.GetItem(itemId1);

        if (data1 != null)
        {
            if (data1.subtype == 1)
            {
                m_goGOMaterialObtainNormalCrystal.SetActive(true);
                m_goGOMaterialObtainNormalCrystal.transform.localPosition = m_goMaterialObtainTipMat1Pos.transform.localPosition;

                InventoryManager.SetIcon(itemId1, m_spNormalItemFG);
                SetNormalItemText(data1.level);
                SetNormalEquipmentText(data1.level);
            }
            else if (data1.subtype == 2)
            {
                m_goGOMaterialObtainPerfectCrystal.SetActive(true);
                m_goGOMaterialObtainPerfectCrystal.transform.localPosition = m_goMaterialObtainTipMat1Pos.transform.localPosition;

                InventoryManager.SetIcon(itemId1, m_spPerfectItemFG);
                SetPerfectItemText(data1.level);
                SetPerfectArenaReqLevel();
            }
        }

        if (itemId2 > 0)
        {
            ItemParentData data2 = ItemParentData.GetItem(itemId2);
            if (data2.subtype == 1)
            {
                m_goGOMaterialObtainNormalCrystal.SetActive(true);
                m_goGOMaterialObtainNormalCrystal.transform.localPosition = m_goMaterialObtainTipMat2Pos.transform.localPosition;
                m_goMaterialObtainTipBGLine.SetActive(true);

                InventoryManager.SetIcon(itemId2, m_spNormalItemFG);
                SetNormalItemText(data2.level);
                SetNormalEquipmentText(data2.level);
            }
            else if (data2.subtype == 2)
            {
                m_goGOMaterialObtainPerfectCrystal.SetActive(true);
                m_goGOMaterialObtainPerfectCrystal.transform.localPosition = m_goMaterialObtainTipMat2Pos.transform.localPosition;
                m_goMaterialObtainTipBGLine.SetActive(true);

                InventoryManager.SetIcon(itemId2, m_spPerfectItemFG);
                SetPerfectItemText(data2.level);
                SetPerfectArenaReqLevel();
            }
        }
    }
Example #19
0
    public Dictionary <TDBID, Mail> m_mailList = new Dictionary <TDBID, Mail>();// 邮件详细内容列表,用于拖动切换邮件
    void OnReadMailResp(Mail mail)
    {
        m_mailList[mail.mailId] = mail;

        LoggerHelper.Debug(mail.from + " " + mail.to);
        SocietyUIViewManager.Instance.ShowMailGridListDialog(false);
        SocietyUIViewManager.Instance.ShowMailDetailDialog(true);

        MailDetailData md = new MailDetailData();

        if (mail.state == MAIL_STATE.NO_ATTACH_NO_READ || mail.state == MAIL_STATE.NO_ATTACH_READ)
        {
            SocietyUIViewManager.Instance.ShowOneKeyGetItemBtn(false);
            SocietyUIViewManager.Instance.ShowMailItemGetSign(false);
        }
        else if (mail.state == MAIL_STATE.ATTACH_READ || mail.state == MAIL_STATE.ATTACH_NO_READ)
        {
            SocietyUIViewManager.Instance.ShowOneKeyGetItemBtn(true);
            SocietyUIViewManager.Instance.ShowMailItemGetSign(false);
        }
        else
        {
            SocietyUIViewManager.Instance.ShowOneKeyGetItemBtn(false);
            SocietyUIViewManager.Instance.ShowMailItemGetSign(true);
        }

        if (mail.mailType == MAIL_TYPE.ID)
        {
            try
            {
                int fromId = System.Int32.Parse(mail.from);
                md.senderName = LanguageData.GetContent(fromId);
                int titleId = System.Int32.Parse(mail.title);
                md.title = LanguageData.GetContent(titleId);
                int textId = System.Int32.Parse(mail.text);
                md.infoText = LanguageData.GetContent(textId, mail.args.ToArray());
            }
            catch (System.Exception ex)
            {
                md.infoText   = mail.text;
                md.senderName = mail.from;
                md.title      = mail.title;
            }
        }
        else
        {
            md.infoText   = mail.text;
            md.senderName = mail.from;
            md.title      = mail.title;
        }
        md.reciverName = mail.to;

        md.time = mail.time.ToString();

        md.listItemImg = new List <string>();
        md.listItemNum = new List <int>();
        md.listItemID  = new List <int>();

        Mogo.Util.LoggerHelper.Debug(mail);

        for (int i = 0; i < mail.items.Count; ++i)
        {
            //  Mogo.Util.LoggerHelper.Debug(ItemParentData.GetItem(mail.items[i]).Icon);
            ItemParentData data = ItemParentData.GetItem(mail.items[i]);
            if (data != null)
            {
                md.listItemImg.Add(data.Icon);
                md.listItemID.Add(mail.items[i]);
            }
            else
            {
                md.listItemImg.Add("");
            }
            Mogo.Util.LoggerHelper.Debug(mail.nums.Count);
            md.listItemNum.Add(mail.nums[i]);
        }

        md.mailId = mail.mailId;
        SocietyUIViewManager.Instance.FillMailDetailData(md);

        if (mail.state == MAIL_STATE.NO_ATTACH_NO_READ || mail.state == MAIL_STATE.NO_ATTACH_READ)
        {
            SocietyUIViewManager.Instance.ShowOneKeyGetItemBtn(false);
            SocietyUIViewManager.Instance.ShowMailItemGetSign(false);
        }
        else if (mail.state == MAIL_STATE.ATTACH_READ || mail.state == MAIL_STATE.ATTACH_NO_READ)
        {
            SocietyUIViewManager.Instance.ShowOneKeyGetItemBtn(true);
            SocietyUIViewManager.Instance.ShowMailItemGetSign(false);
        }
        else
        {
            SocietyUIViewManager.Instance.ShowOneKeyGetItemBtn(false);
            SocietyUIViewManager.Instance.ShowMailItemGetSign(true);
        }
    }
Example #20
0
 private void UpdateChargeRewardView()
 {
     initrrd();
     if (m_self.chargeSum > 0)
     {
         List <string> prices = new List <string>();
         int           curr   = 0;
         for (int i = 0; i < rrds.Count; i++)
         {
             if (m_self.chargeSum >= rrds[i].money)
             {
                 curr = i;
                 NewChargeRewardUILogicManager.Instance.SetProgressSize(500);
             }
             if (chargedReward.Contains(rrds[i].id))
             {
                 prices.Add(LanguageData.GetContent(7802));
             }
             else
             {
                 prices.Add(rrds[i].money + "");
             }
         }
         currStep = curr;
         int size = CalChargePrg(curr, rrds[curr]);
         NewChargeRewardUILogicManager.Instance.SetProgressSize(size);
         NewChargeRewardUILogicManager.Instance.AddChargePriceItem(prices);
         NewChargeRewardUILogicManager.Instance.ShowAsCharged(true);
         var        items = GetChargeReward(rrds[curr]);
         List <int> ids   = new List <int>();
         if (items != null)
         {
             foreach (var item in items)
             {
                 if (ItemParentData.GetItem(item.Key) != null)
                 {
                     ids.Add(item.Key);
                 }
             }
             NewChargeRewardUILogicManager.Instance.SetItemList(ids);
         }
         //TimerHeap.AddTimer(500, 0, UpdateChargeBtnSt);
         //NewChargeRewardUILogicManager.Instance.ShowGetBtn(true);
     }
     else
     {
         NewChargeRewardUILogicManager.Instance.ShowAsCharged(false);
         var        items = GetDefaultChargeReward();
         List <int> ids   = new List <int>();
         if (items != null)
         {
             foreach (var item in items)
             {
                 if (ItemParentData.GetItem(item.Key) != null)
                 {
                     ids.Add(item.Key);
                 }
             }
             NewChargeRewardUILogicManager.Instance.SetItemList(ids);
         }
     }
     NewChargeRewardUILogicManager.Instance.SetUIDirty();
 }
Example #21
0
    /// <summary>
    /// 设置限时活动详细信息列表
    /// </summary>
    /// <param name="id"></param>
    public void SetAllActivityInfo()
    {
        //Debug.Log("SetAllActivityInfo");

        List <LimitActivityInfoGridData> listActivityInfoData = new List <LimitActivityInfoGridData>();

        foreach (var activityIDMessage in sortResult)
        {
            int id = activityIDMessage.Key;
            if (!EventData.dataMap.ContainsKey(id))
            {
                continue;
            }

            LimitActivityInfoGridData aid = new LimitActivityInfoGridData();
            var data = activityIDMessage.Value;

            int acceptTime  = data.accept_time;
            int timeOutTime = data.accept_time + EventData.dataMap[id].limit_time * 60;

            DateTime timeOutDate = MogoTime.Instance.GetDateTimeBySecond(timeOutTime);
            TimeSpan theInterval = MogoTime.Instance.CalculateTimeSpanDateTime(timeOutTime);

            string endTime = theInterval.TotalHours >= 1000 ? "999:59:59" : (int)theInterval.TotalHours + ":" + theInterval.Minutes + ":" + theInterval.Seconds;

            string timeOutDateStr = GetTimeOutTimeStr(EventData.dataMap[id], timeOutDate);

            if (data.is_doing) // 已领取
            {
                if (data.is_reward > 0)
                {
                    aid.CDText = LanguageData.GetContent(7134);
                    aid.Status = ActivityStatus.HasReward;

                    TimeLimitActivityUIViewManager.Instance.SetGridCountDownStop(id);
                }
                else if (data.is_finish > 0) // 已完成
                {
                    aid.CDText = LanguageData.GetContent(7133);
                    aid.Status = ActivityStatus.HasFinished;

                    TimeLimitActivityUIViewManager.Instance.SetGridCountDownStop(id);
                }
                else if (EventData.dataMap[id].limit_time == 0) // 活动中-不限时间
                {
                    aid.CDText = LanguageData.GetContent(7137);
                    aid.Status = ActivityStatus.OtherStatus;

                    TimeLimitActivityUIViewManager.Instance.SetGridCountDownStop(id);
                }
                else
                {
                    aid.CDText = (int)theInterval.TotalDays + ":" + (int)theInterval.Hours + ":" + theInterval.Minutes + ":" + theInterval.Seconds;
                    aid.Status = ActivityStatus.OtherStatus;
                }
            }
            else
            {
                aid.CDText = LanguageData.GetContent(7132);
                aid.Status = ActivityStatus.OtherStatus;
            }

            aid.ID    = id;
            aid.Title = LanguageData.dataMap.ContainsKey(EventData.dataMap[id].name) ? LanguageData.dataMap[EventData.dataMap[id].name].content : "";
            aid.Desc  = LanguageData.dataMap.ContainsKey(EventData.dataMap[id].title) ? LanguageData.dataMap[EventData.dataMap[id].title].content : "";

            //if (data.is_doing)
            //{
            aid.Rule = LanguageData.dataMap.ContainsKey(EventData.dataMap[id].describtion) ? LanguageData.dataMap[EventData.dataMap[id].describtion].Format(timeOutDateStr) : "";
            //}
            //else
            //{
            //    if (EventData.dataMap.ContainsKey(id))
            //        aid.Rule = LanguageData.GetContent(7130) + GetBeginTimeStr(EventData.dataMap[id]) + LanguageData.GetContent(7131);
            //}

            aid.InfoImgName = IconData.dataMap[EventData.dataMap[id].icon].path;

            //if (progress != null)
            //    aid.Rule = EventData.dataMap[id].Format(progress.ToArray());
            //else
            //    aid.Rule = LanguageData.dataMap.ContainsKey(EventData.dataMap[id].rule) ? LanguageData.dataMap[EventData.dataMap[id].rule].content : "";

            if (EventData.dataMap.ContainsKey(id))
            {
                List <int> listID = new List <int>();

                Dictionary <int, int> items;
                switch (MogoWorld.thePlayer.vocation)
                {
                case Vocation.Warrior:
                    items = EventData.dataMap[id].items1;
                    break;

                case Vocation.Assassin:
                    items = EventData.dataMap[id].items2;
                    break;

                case Vocation.Archer:
                    items = EventData.dataMap[id].items3;
                    break;

                case Vocation.Mage:
                    items = EventData.dataMap[id].items4;
                    break;

                default:
                    items = new Dictionary <int, int>();
                    break;
                }

                if (items != null)
                {
                    foreach (var item in items)
                    {
                        if (ItemParentData.GetItem(item.Key) != null)
                        {
                            listID.Add(item.Key);
                        }
                        else
                        {
                            Debug.Log("Item Not Exist");
                        }
                    }
                }

                aid.ItemListID = listID;
            }

            listActivityInfoData.Add(aid);
        }

        TimeLimitActivityUIViewManager.Instance.SetLimitActivityInfoListData(listActivityInfoData);
    }
    public void SetGridInfo(int dataID, RewardLoginData data)
    {
        LoginRewardGridData ld = new LoginRewardGridData();

        ld.LeftGetSignImgName  = "jl_yiwancheng";
        ld.RightGetSignImgName = "jl_yiwancheng";

        ld.IsOldServer    = !isOldServer;
        ld.ListLeftItem   = new List <KeyValuePair <int, int> >();
        ld.ListLeftItemID = new List <int>();

        Dictionary <int, int> items;

        switch (MogoWorld.thePlayer.vocation)
        {
        case Vocation.Warrior:
            items = data.items1;
            break;

        case Vocation.Assassin:
            items = data.items2;
            break;

        case Vocation.Archer:
            items = data.items3;
            break;

        case Vocation.Mage:
            items = data.items4;
            break;

        default:
            items = new Dictionary <int, int>();
            break;
        }

        foreach (var item in items)
        {
            if (ItemParentData.GetItem(item.Key) != null)
            {
                ld.ListLeftItemID.Add(item.Key);
                ld.ListLeftItem.Add(item);
            }
            else
            {
                LoggerHelper.Debug("Item" + item.Key + " Not Exist");
            }
        }

        if (data.exp > 0)
        {
            ld.ListLeftItemID.Add(1);
            ld.ListLeftItem.Add(new KeyValuePair <int, int>(1, data.exp));
        }

        if (data.gold > 0)
        {
            ld.ListLeftItemID.Add(2);
            ld.ListLeftItem.Add(new KeyValuePair <int, int>(2, data.gold));
        }

        if (data.energy > 0)
        {
            ld.ListLeftItemID.Add(6);
            ld.ListLeftItem.Add(new KeyValuePair <int, int>(6, data.energy));
        }

        if (true)
        {
            //Mogo.Util.LoggerHelper.Debug("loginMarketCircleDay" + loginMarketCircleDay);

            if (lastPage == -1 || loginCircleDay == -1 || loginMarketCircleDay == -1)
            {
                loginCircleDay = MogoWorld.thePlayer.login_days == 0 ? 1 : (int)(MogoWorld.thePlayer.login_days % defaultLoginCircleDays == 0 ? defaultLoginCircleDays : MogoWorld.thePlayer.login_days % defaultLoginCircleDays); // to do

                // loginMarketCircleDay = MogoWorld.thePlayer.login_days == 0 ? 1 : (int)(MogoWorld.thePlayer.login_days % DefaultLoginMarketCircleDay); // to do
                loginMarketCircleDay = MogoTime.Instance.GetCurrentDateTime().Day;
            }

            // if (data.days == loginCircleDay)
            //{
            int             dayOffset = data.days - loginCircleDay;
            System.DateTime tempTime  = MogoTime.Instance.GetCurrentDateTime().AddDays(dayOffset);

            if (LoginMarketData.dataMap.ContainsKey(tempTime.Day))
            {
                var marketData = LoginMarketData.dataMap[tempTime.Day];

                if (marketData.priceType == 1)
                {
                    ld.OldServerCostSignImgName = "bb_zuanshi";
                }
                else
                {
                    ld.OldServerCostSignImgName = "bb_zuanshi";
                }

                var item = ItemParentData.GetItem(marketData.itemId);
                if (item != null)
                {
                    ld.OldServerItemFGImgID   = marketData.itemId;
                    ld.OldServerItemFGImgName = marketData.itemId;
                    ld.OldServerItemName      = item.Name;
                    ld.OldServerRightText     = LanguageData.GetContent(47006); // "登陆特惠限购"
                }
                else
                {
                    LoggerHelper.Debug("Item " + marketData.itemId + " Not Exit");
                }

                ld.OldServerCostText = marketData.price.ToString();
            }
        }
        //为消除警告而注释以下代码
        //else
        //{
        //    if (data.extra_items != null)
        //    {
        //        ld.NewServerRightText = "新服奖励";
        //        ld.ListRightItem = new List<string>();
        //        foreach (var extra_item in data.extra_items)
        //        {
        //            ld.ListRightItem.Add(ItemParentData.GetItem(extra_item.Key).Icon);
        //        }
        //    }
        //}

        //Mogo.Util.LoggerHelper.Debug("isOldServer" + ld.ListLeftItem.Count);

        LoginRewardUIViewManager.Instance.AddLoginRewardGrid(ld, data.days);
    }