/// <summary>
    /// リストの作成
    /// </summary>
    /// <param name="periodLoginMaster"></param>
    public void SetUpList(LoginBonusRecordListContext item)
    {
        SetCount(item.date_count);
        Presents.Clear();
        for (int i = 0; i < item.present_ids.Length; ++i)
        {
            int presentID = item.present_ids[i];
            MasterDataPresent presentMaster = MasterDataUtil.GetPresentParamFromID((uint)presentID);

            LoginBonusPresentListContext present = new LoginBonusPresentListContext();
            MainMenuUtil.GetPresentIcon(presentMaster, sprite => {
                present.IconImage = sprite;
            });
            present.NameText = MasterDataUtil.GetPresentName(presentMaster);
            present.NumText  = string.Format(GameTextUtil.GetText("loginbonus_amount"), MasterDataUtil.GetPresentCount(presentMaster));
            present.NumRate  = GameTextUtil.GetText("loginbonus_multipled");
            Presents.Add(present);
        }

        // 先頭のアイテムの線を非表示にする
        LoginBonusPresentListContext selectItem = Presents.First();

        if (selectItem != null)
        {
            selectItem.IsViewBorder = false;
        }


        PresentItemCount = Presents.Count;
    }
Example #2
0
    /// <summary>
    /// 詳細画面の表示
    /// </summary>
    /// <param name="periodLoginMaster"></param>
    public void OpenDetail(LoginBonusRecordListContext item)
    {
        if (item.present_ids == null)
        {
            return;
        }

        m_RecordPanel.IsViewRecordList = false;

        m_DetailPanel = LoginBonusDetailPanel.Attach(m_DetailRoot);
        m_DetailPanel.SetUpList(item);
        m_DetailPanel.CloseAction = () =>
        {
            m_RecordPanel.IsViewRecordList = true;
        };
        m_DetailPanel.Show();
    }
Example #3
0
    void OnSelectRecord(LoginBonusRecordListContext item)
    {
        SoundUtil.PlaySE(SEID.SE_MENU_OK);

        OpenDetail(item);
    }
Example #4
0
    /// <summary>
    /// 期間ログインボーナスリストの作成
    /// </summary>
    /// <param name="loginPeriodData"></param>
    public void SetUpPeriodLoginList(PacketStructPeriodLogin loginPeriodData)
    {
        m_LoginPeriodData = loginPeriodData;
        //------------------------------------------------
        //開始日
        //------------------------------------------------
        int nStartYear  = TimeUtil.GetDateTimeToYear(loginPeriodData.timing_start);
        int nStartMonth = TimeUtil.GetDateTimeToMonth(loginPeriodData.timing_start);
        int nStartDay   = TimeUtil.GetDateTimeToDay(loginPeriodData.timing_start);
        //int nStartHour = TimeUtil.GetDateTimeToHour(loginPeriodData.timing_start);
        //int nStartMin = 0;//分を設定する箇所は今の所無いので、0固定

        //------------------------------------------------
        //終了日(設定日時から-1分した日時に加工)
        //------------------------------------------------
        DateTime cEndEvent = DateTime.MinValue;

        if (loginPeriodData.timing_end > 0)
        {
            cEndEvent = TimeUtil.GetShowEventEndTime(loginPeriodData.timing_end);
        }

        int nEndYear  = 0;
        int nEndMonth = 0;
        int nEndDay   = 0;
        int nEndHour  = 0;
        int nEndMin   = 0;

        if (cEndEvent != DateTime.MinValue)
        {
            nEndYear  = cEndEvent.Year;
            nEndMonth = cEndEvent.Month;
            nEndDay   = cEndEvent.Day;
            nEndHour  = cEndEvent.Hour;
            nEndMin   = cEndEvent.Minute;
        }

        TitleText      = loginPeriodData.event_name;
        StartDateText  = string.Format(GameTextUtil.GetText("loginbonus_period_start"), nStartYear, nStartMonth, nStartDay);
        StartDateText += GameTextUtil.GetText("loginbonus_period_tilde");

        EndDateText = "";
        if (cEndEvent != DateTime.MinValue)
        {
            EndDateText = string.Format(GameTextUtil.GetText("loginbonus_period_end"), nEndYear, nEndMonth, nEndDay);
        }

        string detailText = "";

        if (loginPeriodData.period_login != null && loginPeriodData.period_login.IsRange((int)loginPeriodData.login_count - 1))
        {
            detailText = loginPeriodData.period_login[(int)loginPeriodData.login_count - 1].message;
        }

        m_RecordPanel.IsViewRecordList  = true;
        m_RecordPanel.DetailText        = detailText;
        m_RecordPanel.m_LoginBonusIndex = loginPeriodData.login_count - 1;

        for (int i = 0; i < loginPeriodData.period_login.Length; ++i)
        {
            MasterDataPeriodLoginConverted periodLoginMaster = loginPeriodData.period_login[i];

            LoginBonusRecordListContext record = new LoginBonusRecordListContext();

            record.present_ids = periodLoginMaster.present_ids;
            record.message     = periodLoginMaster.message;
            record.date_count  = periodLoginMaster.date_count;

            if (periodLoginMaster.present_ids.IsNullOrEmpty() == false)
            {
                int presentID = periodLoginMaster.present_ids[0];
                MainMenuUtil.GetPresentIcon(MasterDataUtil.GetPresentParamFromID((uint)presentID), sprite => {
                    record.IconImage = sprite;
                });
            }
            else
            {
                MainMenuUtil.GetPresentIcon(null, sprite => {
                    record.IconImage = sprite;
                });
            }

            record.SetPeriodLoginState(periodLoginMaster.date_count, loginPeriodData.login_count);

            record.DidSelectItem = OnSelectRecord;
            m_RecordPanel.Records.Add(record);
        }

#if BUILD_TYPE_DEBUG
        DebugDialogCheckNoPresent(m_RecordPanel.Records);
#endif
    }
Example #5
0
    /// <summary>
    /// 月間ログインボーナスリストの作成
    /// </summary>
    /// <param name="loginMonthlyData"></param>
    public void SetUpMonthlyLoginList(PacketStructLoginMonthly loginMonthlyData)
    {
        MasterDataLoginMonthlyConverted[] loginMonthlyMasterArray = loginMonthlyData.monthly_list;
        uint today; // 今日の日付

        if (loginMonthlyData != null && loginMonthlyData.login_date > 0)
        {
            today = loginMonthlyData.login_date;
        }
        else
        {
            today = (uint)(TimeManager.Instance.m_TimeNow.ToString("yyyyMMdd") + "00").ToLong(0);  // 端末時間
        }

        int loginIndex = 0;

        for (int i = 0; i < loginMonthlyMasterArray.Length; ++i)
        {
            if (loginMonthlyMasterArray[i] == null)
            {
                continue;
            }

            // 今日のデータ
            if ((int)loginMonthlyMasterArray[i].date == today)
            {
                loginIndex = i;
            }
        }

        if (loginMonthlyMasterArray.IsNullOrEmpty() == false)
        {
            //------------------------------------------------
            //開始日
            //------------------------------------------------
            uint startMonthDate = loginMonthlyMasterArray[0].date;

            int nStartYear  = (int)(startMonthDate / 100 / 100);
            int nStartMonth = (int)(startMonthDate / 100) % 100;
            int nStartDay   = (int)(startMonthDate) % 100;

            if (startMonthDate.ToString().Length > 8)
            {
                // TODO:Ymd形式未対応サーバー用  後で削除
                nStartYear  = TimeUtil.GetDateTimeToYear(startMonthDate);
                nStartMonth = TimeUtil.GetDateTimeToMonth(startMonthDate);
                nStartDay   = TimeUtil.GetDateTimeToDay(startMonthDate);
            }

            //------------------------------------------------
            //終了日
            //------------------------------------------------
            uint endMonthDate = loginMonthlyMasterArray[loginMonthlyMasterArray.Length - 1].date;

            int nEndYear  = (int)(endMonthDate / 100 / 100);
            int nEndMonth = (int)(endMonthDate / 100) % 100;
            int nEndDay   = (int)(endMonthDate) % 100;

            if (endMonthDate.ToString().Length > 8)
            {
                // TODO:Ymd形式未対応サーバー用 後で削除
                nEndYear  = TimeUtil.GetDateTimeToYear(endMonthDate);
                nEndMonth = TimeUtil.GetDateTimeToMonth(endMonthDate);
                nEndDay   = TimeUtil.GetDateTimeToDay(endMonthDate);
            }

            TitleText      = GameTextUtil.GetText("loginbonus_normal_title");
            StartDateText  = string.Format(GameTextUtil.GetText("loginbonus_period_start"), nStartYear, nStartMonth, nStartDay);
            StartDateText += GameTextUtil.GetText("loginbonus_period_tilde");

            EndDateText = string.Format(GameTextUtil.GetText("loginbonus_period_end"), nEndYear, nEndMonth, nEndDay);

            m_RecordPanel.DetailText = loginMonthlyMasterArray[loginIndex].message;
        }
        else
        {
#if BUILD_TYPE_DEBUG
            // 検証ユーザーの時にユーザー変更で一般ユーザーになるとTimeManager.Instance.m_TimeNowが前のままで、データがおかしくなる
            string messageText = "通常ログインボーナスのデータが取得できませんでした。\n"
                                 + "\n"
                                 + "端末時間とサーバー時間がずれている可能性があります。\n"
                                 + "\n"
                                 + "管理ツールからユーザーのステータスを「開発ユーザー」に変更するか、\n"
                                 + "端末時間を現在の時間に修正してアクセスしてください。";

            Dialog newDialog = Dialog.Create(DialogType.DialogScroll);
            newDialog.SetDialogText(DialogTextType.Title, "No LoginMonthlyData");
            newDialog.SetDialogText(DialogTextType.MainText, messageText);
            newDialog.SetDialogTextFromTextkey(DialogTextType.OKText, "common_button7");
            newDialog.SetDialogEvent(DialogButtonEventType.OK, () =>
            {
            });
            newDialog.Show();
#endif
        }

        m_RecordPanel.IsViewRecordList  = true;
        m_RecordPanel.m_LoginBonusIndex = (uint)loginIndex;

        for (int i = 0; i < loginMonthlyMasterArray.Length; ++i)
        {
            MasterDataLoginMonthlyConverted loginMonthlyMasterData = loginMonthlyMasterArray[i];


            LoginBonusRecordListContext record = new LoginBonusRecordListContext();

            record.present_ids = loginMonthlyMasterData.present_ids;
            record.message     = loginMonthlyMasterData.message;
            record.date_count  = loginMonthlyMasterData.date % 100;
            if (loginMonthlyMasterData.date.ToString().Length > 8)
            {
                // TODO:Ymd形式未対応サーバー用 後で削除
                record.date_count = (loginMonthlyMasterData.date / 100) % 100;
            }

            if (loginMonthlyMasterData.present_ids.IsNullOrEmpty() == false)
            {
                int presentID = loginMonthlyMasterData.present_ids[0];
                MainMenuUtil.GetPresentIcon(MasterDataUtil.GetPresentParamFromID((uint)presentID), sprite => {
                    record.IconImage = sprite;
                });
            }
            else
            {
                MainMenuUtil.GetPresentIcon(null, sprite => {
                    record.IconImage = sprite;
                });
            }

            record.SetMonthlyLoginState(loginMonthlyMasterData.date, loginMonthlyData.login_list, loginMonthlyMasterArray[loginIndex].date);

            record.DidSelectItem = OnSelectRecord;
            m_RecordPanel.Records.Add(record);
        }

#if BUILD_TYPE_DEBUG
        DebugDialogCheckNoPresent(m_RecordPanel.Records);
#endif
    }