예제 #1
0
    public void BroadcastTipsEvent()
    {
        bool arg = false;

        using (Dictionary <int, AchievementItemInfo> .ValueCollection.Enumerator enumerator = this.AllIdList.get_Values().GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                AchievementItemInfo current = enumerator.get_Current();
                if (current.isAccept == 1)
                {
                    arg = true;
                    break;
                }
            }
        }
        EventDispatcher.Broadcast <string, bool>(EventNames.OnTipsStateChange, TipsEvents.ButtonTipsModuleAchievement, arg);
    }
예제 #2
0
 private void OnAchievementItemChangedNty(short state, AchievementItemChangedNty down = null)
 {
     if (state != 0 || down == null)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     using (List <AchievementItemInfo> .Enumerator enumerator = down.achievementItemInfos.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             AchievementItemInfo current = enumerator.get_Current();
             this.OwnIdMap.Remove(current.achievementId);
             this.OwnIdMap.Add(current.achievementId, current);
         }
     }
     this.RefreshAchievementInfo();
     this.BroadcastTipsEvent();
 }
예제 #3
0
    private void AllAchievementInfo()
    {
        for (int i = 0; i < achObjContainer.childCount; i++)
        {
            achievementObjs[i] = achObjContainer.GetChild(i);
        }

        // MoneyMaker Achievement
        achMoneyMakerInfo[0] = new AchievementItemInfo(1000, 50, 2);
        achMoneyMakerInfo[1] = new AchievementItemInfo(20000, 1250, 6);
        achMoneyMakerInfo[2] = new AchievementItemInfo(150000, 7625, 15);

        // SwiftSwift Achievement
        achSwiftSwiftInfo[0] = new AchievementItemInfo(175, 65, 3);
        achSwiftSwiftInfo[1] = new AchievementItemInfo(550, 1425, 8);
        achSwiftSwiftInfo[2] = new AchievementItemInfo(1125, 8500, 20);

        // Learner Achievement
        achLearnerInfo[0] = new AchievementItemInfo(600, 50, 2);
        achLearnerInfo[1] = new AchievementItemInfo(2000, 1250, 6);
        achLearnerInfo[2] = new AchievementItemInfo(7000, 7625, 15);

        // Progress Achievement
        achProgressInfo[0] = new AchievementItemInfo(3, 50, 2);
        achProgressInfo[1] = new AchievementItemInfo(10, 1250, 6);
        achProgressInfo[2] = new AchievementItemInfo(20, 7625, 15);

        // Tough Achievement
        achToughInfo[0] = new AchievementItemInfo(45, 65, 3);
        achToughInfo[1] = new AchievementItemInfo(240, 1425, 8);
        achToughInfo[2] = new AchievementItemInfo(850, 8500, 20);

        // Tougher Achievement
        achTougherInfo[0] = new AchievementItemInfo(20, 80, 4);
        achTougherInfo[1] = new AchievementItemInfo(115, 1600, 12);
        achTougherInfo[2] = new AchievementItemInfo(400, 9750, 25);

        // MasterQuizer Achievement
        achMasterQuizerInfo[0] = new AchievementItemInfo(3, 120, 5);
        achMasterQuizerInfo[1] = new AchievementItemInfo(12, 1450, 15);
        achMasterQuizerInfo[2] = new AchievementItemInfo(30, 9999, 30);
    }
예제 #4
0
    public void UpdateItem(int id)
    {
        this.RewardItems.get_gameObject().SetActive(true);
        this.id   = id;
        this.data = DataReader <Achievement> .Get(id);

        AchievementItemInfo achievementItemInfo = AchievementManager.Instance.AllIdList.get_Item(id);

        this.state = achievementItemInfo.isAccept;
        if (this.data.icon > 0)
        {
            ResourceManager.SetSprite(this.Icon, GameDataUtils.GetIcon(this.data.icon));
        }
        this.Name.set_text(GameDataUtils.GetChineseContent(this.data.name, false));
        string text       = GameDataUtils.GetChineseContent(this.data.introduction, false);
        int    linkSystem = this.data.linkSystem;

        switch (linkSystem)
        {
        case 5:
            goto IL_E8;

        case 6:
        case 7:
IL_C5:
            switch (linkSystem)
            {
            case 15:
            case 19:
                goto IL_E8;

            case 17:
                text = "配置表被删,找策划哥!(通关主线副本第X章第X节XXX)";
                goto IL_158;
            }
            text = string.Format(text, this.data.size.get_Item(0));
            goto IL_158;

        case 8:
        case 9:
            text = "配置表被删,找策划哥!(通关精英副本第X章第X节XXX)";
            goto IL_158;
        }
        goto IL_C5;
IL_E8:
        text = string.Format(text, this.data.size.get_Item(0), this.data.size.get_Item(1));
IL_158:
        this.NameDes.set_text(text);
        int num = achievementItemInfo.completeProgress.get_Item(0);

        if (this.data.schedule == -1)
        {
            this.ProgressText.get_gameObject().SetActive(false);
        }
        else
        {
            this.ProgressText.get_gameObject().SetActive(true);
            this.ProgressText.set_text(string.Concat(new object[]
            {
                string.Empty,
                num,
                "/",
                this.data.schedule
            }));
        }
        IEnumerator enumerator = this.RewardItems.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                Transform transform = (Transform)enumerator.get_Current();
                Object.Destroy(transform.get_gameObject());
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
        if (this.data.dropId > 0)
        {
            List <DiaoLuoZu> itemList = DropUtil.GetItemList(this.data.dropId);
            for (int i = 0; i < itemList.get_Count(); i++)
            {
                DiaoLuoZu  diaoLuoZu  = itemList.get_Item(i);
                GameObject gameObject = Object.Instantiate <GameObject>(this.itemPrefab);
                ResourceManager.SetInstantiateUIRef(gameObject, null);
                gameObject.SetActive(true);
                gameObject.get_transform().SetParent(this.RewardItems);
                gameObject.get_transform().set_localScale(new Vector3(1f, 1f, 1f));
                gameObject.get_transform().set_localPosition(new Vector3(0f, 0f, 0f));
                gameObject.get_transform().set_localEulerAngles(new Vector3(0f, 0f, 0f));
                ResourceManager.SetSprite(gameObject.get_transform().FindChild("Frame").GetComponent <Image>(), GameDataUtils.GetItemFrame(diaoLuoZu.itemId));
                ResourceManager.SetSprite(gameObject.get_transform().FindChild("Icon").GetComponent <Image>(), GameDataUtils.GetIcon(DataReader <Items> .Get(diaoLuoZu.itemId).littleIcon));
                gameObject.get_transform().FindChild("Num").GetComponent <Text>().set_text("x" + diaoLuoZu.maxNum.ToString());
            }
        }
        this.FinishImg.get_gameObject().SetActive(false);
        this.RewardBtn.get_gameObject().SetActive(false);
        this.GotoBtn.get_gameObject().SetActive(false);
        if (this.data.go != -1 && this.state == 0)
        {
            this.GotoBtn.get_gameObject().SetActive(true);
        }
        else if (this.state == 1)
        {
            this.RewardBtn.get_gameObject().SetActive(true);
        }
        else if (this.state == 2)
        {
            this.FinishImg.get_gameObject().SetActive(true);
            this.RewardItems.get_gameObject().SetActive(false);
        }
    }
예제 #5
0
    private void RefreshAchievementInfo()
    {
        this.AllIdList.Clear();
        SortedList <int, AchievementItemInfo> sortedList  = new SortedList <int, AchievementItemInfo>();
        SortedList <int, AchievementItemInfo> sortedList2 = new SortedList <int, AchievementItemInfo>();
        SortedList <int, AchievementItemInfo> sortedList3 = new SortedList <int, AchievementItemInfo>();

        using (Dictionary <int, AchievementItemInfo> .ValueCollection.Enumerator enumerator = this.OwnIdMap.get_Values().GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                AchievementItemInfo current     = enumerator.get_Current();
                Achievement         achievement = DataReader <Achievement> .Get(current.achievementId);

                if (achievement == null)
                {
                    Debug.LogError("GameData.Achievement no find id = " + current.achievementId);
                }
                else if (current.isAccept == 1)
                {
                    sortedList.Remove(achievement.sort);
                    sortedList.Add(achievement.sort, current);
                }
                else if (current.isAccept == 0)
                {
                    sortedList2.Remove(achievement.sort);
                    sortedList2.Add(achievement.sort, current);
                }
                else if (current.isAccept == 2)
                {
                    sortedList3.Remove(achievement.sort);
                    sortedList3.Add(achievement.sort, current);
                }
            }
        }
        using (IEnumerator <KeyValuePair <int, AchievementItemInfo> > enumerator2 = sortedList.GetEnumerator())
        {
            while (enumerator2.MoveNext())
            {
                KeyValuePair <int, AchievementItemInfo> current2 = enumerator2.get_Current();
                this.AllIdList.Add(current2.get_Value().achievementId, current2.get_Value());
            }
        }
        using (IEnumerator <KeyValuePair <int, AchievementItemInfo> > enumerator3 = sortedList2.GetEnumerator())
        {
            while (enumerator3.MoveNext())
            {
                KeyValuePair <int, AchievementItemInfo> current3 = enumerator3.get_Current();
                this.AllIdList.Add(current3.get_Value().achievementId, current3.get_Value());
            }
        }
        using (IEnumerator <KeyValuePair <int, AchievementItemInfo> > enumerator4 = sortedList3.GetEnumerator())
        {
            while (enumerator4.MoveNext())
            {
                KeyValuePair <int, AchievementItemInfo> current4 = enumerator4.get_Current();
                this.AllIdList.Add(current4.get_Value().achievementId, current4.get_Value());
            }
        }
        EventDispatcher.Broadcast(EventNames.RefreshAchievementInfo);
    }