예제 #1
0
    public void CreateList(PacketStructAchievementGroup[] packetGroupList)
    {
        if (packetGroupList.Length == 0)
        {
            return;
        }

        Missons.Clear(); // アイテムを空にする

        foreach (PacketStructAchievementGroup packetGroup in packetGroupList)
        {
            //----------------------------------------
            // ミッション表示ステータス決定
            //----------------------------------------
            //初期値は「NEW」にしておく
            MasterDataDefineLabel.AchievementState cState = MasterDataDefineLabel.AchievementState.NEW;
            string strState = "";
            Color  cColor   = ColorUtil.GetColor(APP_COLOR.LABEL_YELLOW);

            //string stateText
            if (packetGroup.clear_unacquired_cnt > 0)
            {                                                                 // (分子=分母且つ、ステータス2+3のミッション数>0の場合、または分子≠分母且つ、ステータス2+3のアチーブメント数>0の場合)
                cState   = MasterDataDefineLabel.AchievementState.GET_REWARD; // 報酬未取得の場合「GET REWARD!!」表示
                strState = GameTextUtil.GetText("ACHIEVEMENT_GP_STATE_GET_REWARD");
                cColor   = ColorUtil.GetColor(APP_COLOR.LABEL_LIGHT_BLUE);
            }
            else if (packetGroup.list_cnt != packetGroup.clear_cnt)
            {                                                          // 分子≠分母且つ、ステータス2+3のミッション数=0の場合
                cState   = MasterDataDefineLabel.AchievementState.NEW; // 「NEW!」表示
                strState = GameTextUtil.GetText("ACHIEVEMENT_GP_STATE_NEW");
                cColor   = ColorUtil.GetColor(APP_COLOR.LABEL_YELLOW);
            }
            else if (packetGroup.list_cnt == packetGroup.clear_cnt)
            {                                                            //分子=分母且つ、ステータス2+3のミッション数=0の場合
                cState   = MasterDataDefineLabel.AchievementState.CLEAR; // 「CLEAR」表示
                strState = GameTextUtil.GetText("ACHIEVEMENT_GP_STATE_CLEAR");
                cColor   = ColorUtil.GetColor(APP_COLOR.LABEL_PURPLE);
            }


            // 情報設定
            MissonGroupListItemContext group = new MissonGroupListItemContext();
            group.AchievementState      = cState;
            group.AchievementStateText  = strState;
            group.AchievementStateColor = cColor;
            group.GroupListData         = packetGroup;
            group.DetailText            = packetGroup.draw_msg;
            group.MissonClearCount      = packetGroup.clear_cnt;
            group.MissonMaxCount        = packetGroup.list_cnt;
            group.ProgressText          = string.Format(GameTextUtil.GetText("MISSION_GROUP_CNT")
                                                        , packetGroup.clear_cnt
                                                        , packetGroup.list_cnt);
            group.TextColor = (cState == MasterDataDefineLabel.AchievementState.CLEAR)
                            ? ColorUtil.COLOR_GRAY : ColorUtil.COLOR_WHITE;
            group.DidSelectItem += SelectedMissonGroupListItem;
            Missons.Add(group);
        }

        IsActiveEmptyText = (Missons.Count == 0);
    }
예제 #2
0
 public void SelectedMissonGroupListItem(MissonGroupListItemContext misson)
 {
     OnSelectItemAction(misson);
 }