You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
5.7 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections;
using System.Collections.Generic;
using Game;
using Qoo.Input;
using Qoo.Wnd;
using UnityEngine;
namespace Qoo.Game
{
// Token: 0x020000DE RID: 222
public static class KsExec
{
// Token: 0x06000611 RID: 1553 RVA: 0x00019374 File Offset: 0x00017574
internal static bool KsExecProc(string Func, string Param, string Value, int count)
{
Dictionary<string,int> dict = null;
if (Func != null)
{
if (dict == null)
{
dict = new Dictionary<string, int>(2)
{
{
"inputname",
0
},
{
"kakin",
1
}
};
}
int num;
if (dict.TryGetValue(Func, out num))
{
if (num != 0)
{
if (num == 1)
{
if (Debug.IsAutoKsDebug)
{
return true;
}
KsInput.Enable = false;
KsInput.Clear();
bool flag = KsExec.ExecPay(Param, Value, count);
if (flag)
{
KsInput.Enable = true;
}
return flag;
}
}
else
{
if (Debug.IsAutoKsDebug)
{
return true;
}
KsInput.Enable = false;
bool flag2 = KsExec.InputName(count);
if (flag2)
{
KsInput.Enable = true;
}
return flag2;
}
}
}
return false;
}
// Token: 0x06000612 RID: 1554 RVA: 0x0001943C File Offset: 0x0001763C
public static bool InputName(int count)
{
if (count == 0)
{
KsExec.confirm = false;
KsExec.confirmResult = false;
KsExec.editName = "アリス";
NameInputKeyboard.DebugInputText = KsExec.editName;
KsExec.KeyboardMain();
}
else if (KsExec.confirm)
{
if (KsExec.confirmResult)
{
GameData.SetParamString("firstname", string.Empty, KsExec.editName);
NameInputKeyboard.Close();
return true;
}
KsExec.KeyboardMain();
KsExec.confirm = false;
KsExec.confirmResult = false;
}
else
{
KsExec.editName = NameInputKeyboard.InputText;
if (KsExec.editName.Length == 0 || KsExec.checkSpaceOnly(KsExec.editName))
{
UnityTask.SetSubNoUnityTask(MessageDlg.ExecDlg("名前が入力されていません。", null));
KsExec.KeyboardMain();
}
else if (KsExec.editName.Length > 7)
{
UnityTask.SetSubNoUnityTask(MessageDlg.ExecDlg("入力できる名前は7文字までです。", null));
KsExec.KeyboardMain();
}
else if (!Singleton<UnityGraph>.Instance.Font.Font.CheckGlyph(KsExec.editName))
{
UnityTask.SetSubNoUnityTask(MessageDlg.ExecDlg("表示できない文字が含まれています。", null));
KsExec.KeyboardMain();
}
else
{
string arg = KsExec.editName;
string paramString = GameData.GetParamString("familyname", string.Empty);
string[] msgs = new string[]
{
string.Format("「{0}{1}」です。", arg, paramString),
"よろしいですか?"
};
UnityTask.SetSubNoUnityTask(MessageDlg.ExecDlg(msgs, new Action<bool>(KsExec.SetResult)));
KsExec.confirm = true;
KsExec.confirmResult = false;
}
}
return false;
}
// Token: 0x06000613 RID: 1555 RVA: 0x000195C0 File Offset: 0x000177C0
private static bool checkSpaceOnly(string firstname)
{
foreach (char c in firstname)
{
if (c != ' ' && c != '\u3000')
{
return false;
}
}
return true;
}
// Token: 0x06000614 RID: 1556 RVA: 0x00019604 File Offset: 0x00017804
private static void KeyboardMain()
{
switch (UnityEngine.Application.platform)
{
case RuntimePlatform.IPhonePlayer:
case RuntimePlatform.Android:
UnityTask.SetSubTask(NameInputKeyboard.Open(KsExec.editName, true));
break;
}
}
// Token: 0x06000615 RID: 1557 RVA: 0x0001964C File Offset: 0x0001784C
private static void SetResult(bool result)
{
KsExec.confirmResult = result;
}
// Token: 0x06000616 RID: 1558 RVA: 0x00019654 File Offset: 0x00017854
private static bool ExecPay(string Param, string Value, int count)
{
if (count == 0)
{
PaymentParam.Conv();
GameData.StartVoiceCheck();
CHAR_ID charaId = CHAR_ID.NOTHING;
Debug.Print("Param = " + Param + ": Value = " + Value);
if (Param == "param" && Value == "full")
{
Debug.Print("初回処理");
if (GameData.IsPayRouteFull())
{
return true;
}
}
else
{
Debug.Print("初回処理以外");
if (GameData.IsPayRouteFull())
{
return true;
}
if (GameData.IsPayRoute(GameData.GetRoute()))
{
return true;
}
charaId = GameData.GetRoute();
}
Debug.Print("課金処理起動");
Singleton<UnityGraph>.Instance.SetEffect("FadeOut", 1f);
UIValue.Payment_Call = PaymentCallType.ADV;
UnityTask.SetSubNoUnityTask(new PaymentTask().Open(charaId));
return false;
}
PaymentParam.Conv();
if (Param == "param" && Value == "full")
{
if (!GameData.IsPayRouteFull())
{
GameData.IsMoveTitle = true;
}
}
else if (!GameData.IsPayRoute(GameData.GetRoute()))
{
GameData.IsMoveTitle = true;
}
if (!GameData.IsMoveTitle)
{
Singleton<UnityGraph>.Instance.Enable(false);
Singleton<UnityGraph>.Instance.SetEffect("FadeIn", 1f);
}
KsInput.ClearMenu();
KsInput.ClearBacklog();
return true;
}
// Token: 0x06000617 RID: 1559 RVA: 0x000197AC File Offset: 0x000179AC
private static IEnumerator Sample_ExecPay(CHAR_ID idChar)
{
SysData.SetPay(idChar, true, true);
SysData.SetPayFull(true, true);
yield return 0;
yield break;
}
// Token: 0x040005A9 RID: 1449
private static bool confirm;
// Token: 0x040005AA RID: 1450
private static bool confirmResult;
// Token: 0x040005AB RID: 1451
private static string editName = string.Empty;
}
}