예제 #1
0
    private void OnSelectKey(ItemKeyContext _key)
    {
        SoundUtil.PlaySE(SEID.SE_MENU_OK);

        string item_name = "";
        string move_pos  = "";

        switch (_key.Category)
        {
        case ItemKeyContext.CategoryType.FriendPoint:
            item_name = GameTextUtil.GetText("common_text1");
            move_pos  = GameTextUtil.GetText("common_text7");
            break;

        case ItemKeyContext.CategoryType.UnitPoint:
            item_name = GameTextUtil.GetText("common_text2");
            move_pos  = GameTextUtil.GetText("common_text8");
            break;

        case ItemKeyContext.CategoryType.ScratchTicket:
            item_name = _key.itemMaster.item_name;
            move_pos  = GameTextUtil.GetText("common_text7");
            break;

        case ItemKeyContext.CategoryType.QuestKey:
            item_name = _key.keyMaster.key_name;
            move_pos  = GameTextUtil.GetText("common_text9");
            break;
        }
        Dialog _newDialog = Dialog.Create(DialogType.DialogYesNo);

        _newDialog.SetDialogTextFromTextkey(DialogTextType.Title, "mm54q_title");
        string mainFormat = GameTextUtil.GetText("mm54q_content1");

        _newDialog.SetDialogText(DialogTextType.MainText, string.Format(mainFormat, item_name, move_pos));
        _newDialog.SetDialogEvent(DialogButtonEventType.YES, () =>
        {
            switch (_key.Category)
            {
            case ItemKeyContext.CategoryType.FriendPoint:
                MainMenuParam.m_GachaMaster = MasterDataUtil.GetActiveFriendGachaMaster();
                MainMenuManager.Instance.SetResetSubTabFlag();
                MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_GACHA_MAIN, false, false);
                MainMenuManager.Instance.CloseGlobalMenu();
                break;

            case ItemKeyContext.CategoryType.UnitPoint:
                MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_SHOP_POINT, false, false);
                MainMenuManager.Instance.CloseGlobalMenu();
                break;

            case ItemKeyContext.CategoryType.ScratchTicket:
                MainMenuParam.m_GachaMaster = MasterDataUtil.GetActiveItemPointGachaMaster(_key.itemMaster.fix_id);
                MainMenuManager.Instance.SetResetSubTabFlag();
                MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_GACHA_MAIN, false, false);
                MainMenuManager.Instance.CloseGlobalMenu();
                break;

            case ItemKeyContext.CategoryType.QuestKey:
                MainMenuParam.SetQuestSelectParam(_key.keyMaster.key_area_category_id);
                MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_QUEST_SELECT, false, false, false);
                MainMenuManager.Instance.CloseGlobalMenu();
                break;
            }
        });
        _newDialog.SetDialogTextFromTextkey(DialogTextType.YesText, "common_button4");
        _newDialog.SetDialogTextFromTextkey(DialogTextType.NoText, "common_button5");
        _newDialog.DisableCancelButton();
        _newDialog.Show();
    }