Пример #1
0
    /// <summary>
    /// ダイアログ 不足警告
    /// </summary>
    public void openWarningLowDialog()
    {
        if (Context.IsUsedTip)
        {
            Dialog newDialog = Dialog.Create(DialogType.DialogYesNo).SetStrongYes();
            newDialog.SetDialogTextFromTextkey(DialogTextType.Title, "sc148q_title");
            newDialog.SetDialogTextFromTextkey(DialogTextType.MainText, "sc148q_content");
            newDialog.SetDialogTextFromTextkey(DialogTextType.YesText, "common_button4");
            newDialog.SetDialogEvent(DialogButtonEventType.YES, () =>
            {
                //チップ購入ダイアログ
                StoreDialogManager.Instance.OpenBuyStone();
            });
            newDialog.SetDialogTextFromTextkey(DialogTextType.NoText, "common_button5");
            newDialog.DisableCancelButton();
            newDialog.Show();
        }
        else
        {
            string pname = "";
            switch (Context.gachaMaster.type)
            {
            case MasterDataDefineLabel.GachaType.NORMAL:
                pname = GameTextUtil.GetText("common_text1");
                break;

            case MasterDataDefineLabel.GachaType.ITEM_POINT:
                //pname = GameTextUtil.GetText("common_text5");
                pname = MasterDataUtil.GetItemNameFromGachaMaster(Context.gachaMaster);
                break;
            }
            Dialog newDialog   = Dialog.Create(DialogType.DialogOK);
            string titleFormat = GameTextUtil.GetText("sc148q_title2");
            newDialog.SetDialogText(DialogTextType.Title, string.Format(titleFormat, pname));
            string mainFormat = GameTextUtil.GetText("sc148q_content2");
            newDialog.SetDialogText(DialogTextType.MainText, string.Format(mainFormat, pname));
            newDialog.SetDialogTextFromTextkey(DialogTextType.OKText, "common_button1");
            newDialog.Show();
        }
    }
Пример #2
0
    public void updatePointText()
    {
        if (m_Master == null)
        {
            return;
        }

        string pointFormat = GameTextUtil.GetText("scratch_pt_text");

        switch (m_Master.type)
        {
        case MasterDataDefineLabel.GachaType.NONE:
            //Money使用
            break;

        case MasterDataDefineLabel.GachaType.RARE:
        case MasterDataDefineLabel.GachaType.EVENT:
        case MasterDataDefineLabel.GachaType.TUTORIAL:
        {
            // チップ使用
            IsUsedTip = true;

            if (MasterDataUtil.IsFirstTimeFree(m_Master))
            {
                //初回無料
                PointText       = GameTextUtil.GetText("gacha_first free");
                IsViewMaxButton = false;
            }
            else
            {
                string name  = "";
                uint   point = 0;
                if (m_Master.paid_tip_only == MasterDataDefineLabel.BoolType.ENABLE)
                {
                    //有料のみ
                    name            = GameTextUtil.GetText("common_text13");
                    point           = UserDataAdmin.Instance.m_StructPlayer.have_stone_pay;
                    IsViewMaxButton = false;
                }
                else
                {
                    name  = GameTextUtil.GetText("common_text6");
                    point = UserDataAdmin.Instance.m_StructPlayer.have_stone;
                }
                PointText = string.Format(pointFormat, name, m_Master.price, point);
            }
        }
        break;

        case MasterDataDefineLabel.GachaType.NORMAL:
        {
            // フレンドポイント
            string name  = GameTextUtil.GetText("common_text1");
            uint   point = UserDataAdmin.Instance.m_StructPlayer.have_friend_pt;
            PointText = string.Format(pointFormat, name, m_Master.price, point);
        }
        break;

        case MasterDataDefineLabel.GachaType.LUNCH:
        case MasterDataDefineLabel.GachaType.TICKET:
        case MasterDataDefineLabel.GachaType.EVENT_POINT:
            break;

        case MasterDataDefineLabel.GachaType.ITEM_POINT:
        {
            //  アイテムポイント使用
            string name  = MasterDataUtil.GetItemNameFromGachaMaster(m_Master);
            uint   point = UserDataAdmin.Instance.GetItemPoint(m_Master.cost_item_id);
            PointText = string.Format(pointFormat, name, m_Master.price, point);
        }
        break;

        case MasterDataDefineLabel.GachaType.STEP_UP:
        {
            // チップ使用
            IsUsedTip = true;
            string name  = "";
            uint   point = 0;
            if (m_StepMaster.paid_tip_only == MasterDataDefineLabel.BoolType.ENABLE)
            {
                //有料のみ
                name            = GameTextUtil.GetText("common_text13");
                point           = UserDataAdmin.Instance.m_StructPlayer.have_stone_pay;
                IsViewMaxButton = false;
            }
            else
            {
                name  = GameTextUtil.GetText("common_text6");
                point = UserDataAdmin.Instance.m_StructPlayer.have_stone;
            }
            PointText = string.Format(pointFormat, name, m_StepManageMaster.price, point);
        }
        break;

        default:
            break;
        }
    }
Пример #3
0
    public static string GetGachaPlayText(int count, MasterDataGacha _master)
    {
        string _ret    = "";
        string payItem = "";
        uint   price   = (uint)(_master.price * count);

        MasterDataDefineLabel.BoolType paid_tip_only = _master.paid_tip_only;

        switch (_master.type)
        {
        case MasterDataDefineLabel.GachaType.NONE:
            //Money使用
            payItem = "Money";
            break;

        case MasterDataDefineLabel.GachaType.RARE:
        case MasterDataDefineLabel.GachaType.EVENT:
        case MasterDataDefineLabel.GachaType.TUTORIAL:
            // チップ使用
            payItem = GameTextUtil.GetText("common_text6");
            //有料チップ専用なら有料チップ数を設定
            if (paid_tip_only == MasterDataDefineLabel.BoolType.ENABLE)
            {
                payItem = GameTextUtil.GetText("common_text13");
            }
            break;

        case MasterDataDefineLabel.GachaType.NORMAL:
        case MasterDataDefineLabel.GachaType.LUNCH:
            // フレンドポイント使用
            payItem = GameTextUtil.GetText("common_text1");
            break;

        case MasterDataDefineLabel.GachaType.TICKET:
            break;

        case MasterDataDefineLabel.GachaType.EVENT_POINT:
            break;

        case MasterDataDefineLabel.GachaType.ITEM_POINT:
            // アイテムポイント使用
            payItem = MasterDataUtil.GetItemNameFromGachaMaster(_master);
            break;

        case MasterDataDefineLabel.GachaType.STEP_UP:
            MasterDataStepUpGacha stepMaster = MasterDataUtil.GetMasterDataStepUpGachaFromGachaID(_master.fix_id);
            paid_tip_only = stepMaster.paid_tip_only;

            // チップ使用
            payItem = GameTextUtil.GetText("common_text6");
            //有料チップ専用なら有料チップ数を設定
            if (paid_tip_only == MasterDataDefineLabel.BoolType.ENABLE)
            {
                payItem = GameTextUtil.GetText("common_text13");
            }
            break;

        default:
            break;
        }
        uint itemVal = 0;

        //--------------------------------
        // ガチャタイプにあわせて引ける回数を計算
        //--------------------------------
        switch (_master.type)
        {
        // 友情ガチャ
        case MasterDataDefineLabel.GachaType.NORMAL:
        {
            itemVal = UserDataAdmin.Instance.m_StructPlayer.have_friend_pt;
        }
        break;

        // レア
        case MasterDataDefineLabel.GachaType.RARE:
        // イベント(コラボ)
        case MasterDataDefineLabel.GachaType.EVENT:
        // チュートリアル
        case MasterDataDefineLabel.GachaType.TUTORIAL:
        // イベント2
        case MasterDataDefineLabel.GachaType.EVENT_2:
        {
            itemVal = UserDataAdmin.Instance.m_StructPlayer.have_stone;
            //有料チップ専用なら有料チップ数を設定
            if (paid_tip_only == MasterDataDefineLabel.BoolType.ENABLE)
            {
                itemVal = UserDataAdmin.Instance.m_StructPlayer.have_stone_pay;
            }
        }
        break;

        // ランチ
        case MasterDataDefineLabel.GachaType.LUNCH:
        {
            itemVal = 1;
        }
        break;

        case MasterDataDefineLabel.GachaType.EVENT_POINT:
        {
            itemVal = 1;
        }
        break;

        case MasterDataDefineLabel.GachaType.ITEM_POINT:
        {
            itemVal = UserDataAdmin.Instance.GetItemPoint(_master.cost_item_id);
        }
        break;

        // ステップアップ
        case MasterDataDefineLabel.GachaType.STEP_UP:
        {
            MasterDataStepUpGachaManage stepManageMaster = MasterDataUtil.GetCurrentStepUpGachaManageMaster(_master.fix_id);
            price   = stepManageMaster.price;
            itemVal = UserDataAdmin.Instance.m_StructPlayer.have_stone;
            //有料チップ専用なら有料チップ数を設定
            if (paid_tip_only == MasterDataDefineLabel.BoolType.ENABLE)
            {
                itemVal = UserDataAdmin.Instance.m_StructPlayer.have_stone_pay;
            }
        }
        break;
        }
        if (count == 1)
        {
            string mainFormat = GetText("sc146q_content1");
            _ret = string.Format(mainFormat, payItem, price, itemVal);
        }
        else
        {
            string mainFormat = GetText("sc147q_content");
            _ret = string.Format(mainFormat, payItem, price, itemVal, count);
        }

#if BUILD_TYPE_DEBUG
        if (DebugOption.Instance.disalbeDebugMenu == false)
        {
            _ret += "\n\r" + "\n\r<color=#FF0000>デバッグ表示</color>\n\r";
            _ret += "スクラッチID[ " + _master.fix_id + " ]";
        }
#endif

        return(_ret);
    }