示例#1
0
    public void AddRecord(int id, MasterDataPointShopProduct product)
    {
        var model  = new ListItemModel((uint)id);
        var contex = new ProductsListItemContex(id, product, model);

        model.OnClicked += () =>
        {
            OnClickedRecordButton(contex);
        };
        model.OnLongPressed += () =>
        {
            contex.OnClickedButton();
        };

        // レコードの追加先を指定
        switch (product.product_type)
        {
        case MasterDataDefineLabel.PointShopType.ITEM:
            Records0.Add(contex);
            break;

        case MasterDataDefineLabel.PointShopType.UNIT:
            Records1.Add(contex);
            break;

        case MasterDataDefineLabel.PointShopType.UNIT_BUILDUP:
            Records2.Add(contex);
            break;

        case MasterDataDefineLabel.PointShopType.UNIT_EVOL:
            Records3.Add(contex);
            break;
        }
    }
示例#2
0
    public void AddRecord(
        ItemType type,
        MasterDataUseItem item_master,
        int item_count,
        long use_timing,
        System.Action <ItemDataContext> selectAction)
    {
        ItemDataContext contex = new ItemDataContext();

        contex.setupIcon(item_master);
        contex.ItemMaster = item_master;
        contex.Count      = item_count; // アイテムの所持数
        contex.use_timing = use_timing; //使用開始した時間

        contex.DidSelectItem += selectAction;

        // レコードの追加先を指定
        switch (type)
        {
        case ItemType.Stamina:
            Records0.Add(contex);
            break;

        case ItemType.RewardUp:
            Records1.Add(contex);
            break;

        case ItemType.Other:
            Records2.Add(contex);
            break;
        }
    }
示例#3
0
    // レコードの追加
    public void AddRecord(int category, ServerDataDefine.PacketStructPresent data)
    {
        var contex = new PresentRecordListItemContex();

        // 共通
        contex.FixId         = data.serial_id;
        contex.CaptionText00 = MainMenuUtil.GetPresentCount(data).ToString();
        contex.CaptionText01 = data.message;
        contex.NoticeText    = "";
        contex.NoticeEnable  = false;
        if ((MasterDataDefineLabel.PresentType)data.present_type == MasterDataDefineLabel.PresentType.NOTICE)
        {
            string[] notice = data.message.Split(new String[] { message_split_text }, StringSplitOptions.None);
            if (notice.Length >= 2)
            {
                contex.CaptionText00 = "1";
                contex.CaptionText01 = notice[0];
                contex.NoticeText    = notice[1];
                contex.NoticeEnable  = true;
            }
        }
        contex.Category = category;

        // 画像はカテゴリ別に差し替え可能にする
        image(data, sprite => { contex.IconImage = sprite; });

        // ボタンフィードバック
        contex.DidSelectItem += OnClickedRecordButton;

        // 枠色変更
        contex.IconColor  = IconColor[contex.Category];
        contex.FrameColor = FrameColor[contex.Category];

        // レコードの追加先を指定
        switch ((Category)contex.Category)
        {
        case Category.Present:
            // アイテム受領期間までの残り時間
            if (data.delete_timing == 1)
            {
                // 無期限
                //contex.CaptionText02 = "ENDLESS";
            }
            else
            {
                DateTime date = TimeUtil.ConvertServerTimeToLocalTime((ulong)data.delete_timing);
                contex.CaptionText02 = contex.TimeLeftText(date);
            }
            contex.Caption01_H = 110;

            Records0.Add(contex);
            break;

        case Category.PresentLog:
            contex.CaptionText02 = "";
            contex.Caption01_H   = 80;
            Records1.Add(contex);
            break;
        }
    }
示例#4
0
    /// <summary>
    /// レコードの追加
    /// </summary>
    private void AddRecord(Category category, EventScheduleInfo data)
    {
        var contex = new EventRecordListItemContex();

        contex.FixId   = (int)data.m_MasterDataEvent.fix_id;
        contex.EventId = (int)data.m_MasterDataEvent.event_id;

        // アイコンイメージの設定

        //クエスト情報
        contex.questType = MasterDataDefineLabel.QuestType.NONE;
        //通常クエスト
        MasterDataQuest2 lastQuestMaster = MasterFinder <MasterDataQuest2> .Instance.SelectFirstWhere("where area_id = ? AND boss_chara_id > 0 AND story = 0 ORDER BY fix_id DESC"
                                                                                                      , data.m_MasterDataEvent.area_id);

        if (lastQuestMaster != null)
        {
            contex.questType = MasterDataDefineLabel.QuestType.NORMAL;
        }
        else
        {
            //成長ボスクエスト
            lastQuestMaster = MasterFinder <MasterDataChallengeQuest> .Instance.SelectFirstWhere("where area_id = ? AND boss_chara_id > 0 AND story = 0 ORDER BY fix_id DESC"
                                                                                                 , data.m_MasterDataEvent.area_id);

            if (lastQuestMaster != null)
            {
                contex.questType = MasterDataDefineLabel.QuestType.CHALLENGE;

                //タイトル差し替え
                setupChallengeTitle(data);
            }
        }

        if (lastQuestMaster == null)
        {
            // ボスが居ない場合の画像
            contex.IconImage = ResourceManager.Instance.Load("divine1", ResourceType.Common);

#if BUILD_TYPE_DEBUG
            DialogManager.Open1B_Direct("EventSchedule AddRecord",
                                        "renew_quest_masterのarea_idに下記の\nidが含まれていません。\nプランナーさんに画面を見せるか\n画面キャプチャーして報告してください。\n\n" +
                                        "area_id: " + data.m_MasterDataEvent.area_id,
                                        "common_button7", true, true).
            SetOkEvent(() =>
            {
            });
#endif
            Debug.LogError("[none x.boss_chara_id > 0]: " + data.m_MasterDataEvent.area_id);
        }
        else
        {
            UnitIconImageProvider.Instance.Get(
                lastQuestMaster.boss_chara_id,
                sprite =>
            {
                contex.IconImage = sprite;
            });
        }

        // 予約済みアイコンの設定
        if (category == Category.Furture)
        {
            LocalSaveEventNotification cEventNotification = LocalSaveManager.Instance.CheckFuncNotificationRequest((uint)data.m_MasterDataEvent.fix_id);
            if (cEventNotification != null)
            {
                contex.IsReserveBadge = cEventNotification.m_Push;
            }
        }

        // タイトル(エリア名称)表示
        contex.CaptionText01 = data.m_AreaName;

        // 枠色変更
        contex.IconColor  = this.IconColor[(int)category];
        contex.FrameColor = this.FrameColor[(int)category];

        // ボタン挙動
        contex.DidSelectItem += OnClickedRecordButton;

        // レコードの追加先の指定
        switch (category)
        {
        case Category.Active:
            // 日付表示
            contex.CaptionText02 = data.m_MasterDataEvent.timing_end != 0 ?
                                   string.Format(GameTextUtil.GetText("schedule_held_text"), TimingFormat(data.m_MasterDataEvent.timing_end, true)) : "";
            Records0.Add(contex);
            break;

        case Category.Furture:
            contex.CaptionText02 = data.m_MasterDataEvent.timing_start != 0 ?
                                   string.Format(GameTextUtil.GetText("schedule_plans_text"), TimingFormat(data.m_MasterDataEvent.timing_start)) : "";
            Records1.Add(contex);
            break;

        default:
            return;
        }
    }