Пример #1
0
    protected override void PageSwitchSetting(bool initalize)
    {
        base.PageSwitchSetting(initalize);

        //ページ初期化処理
        if (m_AreaSelect == null)
        {
            m_AreaSelect = m_CanvasObj.GetComponentInChildren <AreaSelect>();
            m_AreaSelect.SetPositionAjustStatusBar(new Vector2(0, -46.25f), new Vector2(0, -172.5f));
        }
        if (m_MenuBanner == null)
        {
            m_MenuBanner = m_CanvasObj.GetComponentInChildren <MenuBanner>();
            m_MenuBanner.SetPositionAjustStatusBar(new Vector2(-125, -217));
            m_MenuBanner.bannerSetup(true);
        }

        m_bReturnHome = false;

        m_ChallengeAreaCategory = null;
        List <MasterDataChallengeEvent> eventList = MasterDataUtil.GetActiveChallengeEvent();

        if (eventList != null &&
            eventList.Count > 0)
        {
            m_ChallengeAreaCategory = MasterDataUtil.GetChallengeAreaCategoryMaster(eventList[0].event_id);
        }

        SettingArea();

        MainMenuManager.Instance.currentCategory = MAINMENU_CATEGORY.QUEST;

        StartCoroutine(MainMenuWebViewShowChk.PopupWebViewStart(MainMenuWebViewShowChk.PopupWebViewType.Mission));
    }
Пример #2
0
    private void setupChallengeTitle(EventScheduleInfo data)
    {
        //開催中のイベントからチェック
        List <MasterDataChallengeEvent> challengeEvents = MasterDataUtil.GetActiveChallengeEvent();

        if (challengeEvents != null &&
            challengeEvents.Count > 0)
        {
            MasterDataChallengeEvent challengeEvent = challengeEvents.Where(a => a.event_id == data.m_MasterDataEvent.event_id).FirstOrDefault();
            if (challengeEvent != null)
            {
                data.m_AreaName = challengeEvent.title;
                return;
            }
        }

        //ないときは開催前
        challengeEvents = MasterFinder <MasterDataChallengeEvent> .Instance.GetAll().Where(a => a.event_id == data.m_MasterDataEvent.event_id).ToList();

        if (challengeEvents != null &&
            challengeEvents.Count > 0)
        {
            challengeEvents.Sort((a, b) => (int)a.timing_start - (int)b.timing_start);
            for (int i = 0; i < challengeEvents.Count; i++)
            {
                if (data.m_MasterDataEvent.timing_start < challengeEvents[i].timing_start)
                {
                    data.m_AreaName = challengeEvents[i].title;
                    return;
                }
            }
        }

        return;
    }
Пример #3
0
    /// <summary>
    /// 選択保存:選択情報から遷移を設定
    /// </summary>
    /// <returns>設定されなかったら[false]を返す</returns>
    static public bool SetupSaveSelect()
    {
        bool bRet = false;

        switch (m_SaveSelectQuestType)
        {
        case MasterDataDefineLabel.QuestType.NORMAL:
        {
            //有効なエリアカテゴリかどうかチェック
            if (MainMenuUtil.CheckRNAreaCategory(m_SaveSelectAreaCategoryID))
            {
                //クエスト選択画面へ
                SetQuestSelectParam(m_SaveSelectAreaCategoryID, m_SaveSelectAreaID);
                bRet = MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_QUEST_SELECT, false, false);
            }
            else
            {
                //有効でない場合は属しているマップに遷移
                MasterDataDefineLabel.REGION_CATEGORY caegory = MainMenuUtil.GetRegionCategory(m_SaveSelectAreaCategoryID);
                MainMenuParam.m_RegionID = MasterDataUtil.GetRegionIDFromCategory(caegory);
                bRet = MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_QUEST_SELECT_AREA_STORY, false, false);
            }
        }
        break;

        case MasterDataDefineLabel.QuestType.CHALLENGE:
        {
            //有効な成長ボスイベントリスト取得
            List <MasterDataChallengeEvent> eventList = MasterDataUtil.GetActiveChallengeEvent();
            if (eventList.Count > 0)
            {
                //成長ボス選択画面へ
                SetChallengeSelectParam(m_SaveSelectChallengeQuestID);
                bRet = MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_CHALLENGE_SELECT, false, false);
            }
            else
            {
                //表示できる成長ボスイベントが1つもない場合はイベントマップへ遷移
                MainMenuParam.m_RegionID = MasterDataUtil.GetRegionIDFromCategory(MasterDataDefineLabel.REGION_CATEGORY.EVENT);
                bRet = MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_QUEST_SELECT_AREA_STORY, false, false);
            }
        }
        break;
        }
        return(bRet);
    }
Пример #4
0
    protected override void PageSwitchSetting(bool initalize)
    {
        base.PageSwitchSetting(initalize);

        if (m_HomeMenu == null)
        {
            m_HomeMenu = m_CanvasObj.GetComponentInChildren <HomeMenu>();
            m_HomeMenu.SetPositionAjustStatusBar(new Vector2(0, -25), new Vector2(0, -215));
            m_HomeMenu.DidSelectStory     = changeQuestStory;
            m_HomeMenu.DidSelectMaster    = changeMaster;
            m_HomeMenu.DidSelectChallenge = changeChallengeSelect;

            m_HomeMenu.DidSelectGoodInfo  = openGoodInfo;
            m_HomeMenu.DidSelectBossInfo  = openBossInfo;
            m_HomeMenu.DidSelectUnitInfo  = openUnitInfo;
            m_HomeMenu.DidSelectScoreInfo = openScoreInfo;
            m_HomeMenu.DidSelectMission   = openMission;
            m_HomeMenu.DidSelectPresent   = openPresent;
        }
        m_HomeMenu.Initialize();
        m_HomeMenu.HeroImage      = m_HeroImage;
        m_HomeMenu.HeroImage_mask = m_HeroImage_mask;

        if (m_MenuBanner == null)
        {
            m_MenuBanner = m_CanvasObj.GetComponentInChildren <MenuBanner>();
            m_MenuBanner.SetPositionAjustStatusBar(new Vector2(-125, -218));
            m_MenuBanner.bannerSetup();
        }

        //イベント開催中フラグ
        bool bFlag = false;

        if (m_RecvData != null && m_RecvData.pickup != null)
        {
            PacketStructPickup _info = m_RecvData.pickup;
            if (_info.text != null)
            {
                for (int i = 0; i < _info.text.Length; i++)
                {
                    if (!ChkTiming(_info.text[i].timing_start, _info.text[i].timing_end))
                    {
                        continue;
                    }

                    if (_info.text[i].event_flag != 0)
                    {
                        bFlag = true;
                    }
                }
            }
        }
        m_HomeMenu.IsActiveEventFlag = bFlag;

        //スコアイベントチェック
        m_HomeMenu.IsViewScoreInfo = false;
        scoreEventList             = MasterDataUtil.GetActiveScoreEvent();
        if (scoreEventList.Count != 0)
        {
            m_HomeMenu.IsViewScoreInfo = true;
        }

        //成長ボスイベントチェック
        m_HomeMenu.IsViewChallenge = false;
        challengeEventList         = MasterDataUtil.GetActiveChallengeEvent();
        if (challengeEventList.Count != 0)
        {
            MasterDataAreaCategory areaCategory = MasterDataUtil.GetChallengeAreaCategoryMaster(challengeEventList[0].event_id);
            if (areaCategory != null)
            {
                m_HomeMenu.ChallengeButton.LoadIcon(areaCategory.fix_id);
                m_HomeMenu.IsViewChallenge = true;
            }
        }

        //
        updateFlag();

        MainMenuManager.Instance.currentCategory = MAINMENU_CATEGORY.HOME;

        StartCoroutine(MainMenuWebViewShowChk.PopupWebViewStart(MainMenuWebViewShowChk.PopupWebViewType.Mission));
    }
Пример #5
0
    /// <summary>
    /// 成長ボス情報取得API呼び出し
    /// </summary>
    private void sendGetUserChallenge()
    {
        List <MasterDataChallengeEvent> eventList = MasterDataUtil.GetActiveChallengeEvent();

        if (eventList == null ||
            eventList.Count == 0)
        {
            //有効なデータがない
            openReturnHomeDialog();
            return;
        }

        int[] event_ids = new int[eventList.Count];
        for (int i = 0; i < eventList.Count; i++)
        {
            event_ids[i] = (int)eventList[i].event_id;
        }

        ServerDataUtilSend.SendPacketAPI_GetChallengeInfo(event_ids)
        .setSuccessAction((data) =>
        {
            //
            m_ChallengeSelect.ClearAll();

            RecvGetChallengeInfo challengeInfo = data.GetResult <RecvGetChallengeInfo>();
            if (challengeInfo != null &&
                challengeInfo.result != null &&
                challengeInfo.result.challenge_infos != null)
            {
                for (int i = 0; i < challengeInfo.result.challenge_infos.Length; i++)
                {
                    PacketStructChallengeInfo info = challengeInfo.result.challenge_infos[i];
                    if (info == null)
                    {
                        continue;
                    }

                    MasterDataChallengeEvent master = eventList.Find((m) => m.event_id == info.event_id);
                    if (master == null)
                    {
                        continue;
                    }

                    m_ChallengeSelect.AddEventData(master, info);
                }
            }
            if (m_ChallengeSelect.Events.Count != 0)
            {
                uint select_event_id = m_ChallengeSelect.Events[0].eventMaster.event_id;

                //
                if (MainMenuParam.m_ChallengeQuestMissionID != 0 &&
                    MasterDataUtil.GetQuestType(MainMenuParam.m_ChallengeQuestMissionID) == MasterDataDefineLabel.QuestType.CHALLENGE)
                {
                    MasterDataChallengeQuest master = (MasterDataChallengeQuest)MasterDataUtil.GetQuest2ParamFromID(MainMenuParam.m_ChallengeQuestMissionID);
                    if (master != null)
                    {
                        select_event_id = (uint)master.event_id;
                    }
                }

                m_ChallengeSelect.setup(select_event_id);
            }
            else
            {
                //有効なデータがない
                openReturnHomeDialog();
            }
        })
        .setErrorAction((data) =>
        {
            //エラー
        })
        .SendStart();
    }