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.

314 lines
8.5 KiB
C#

4 years ago
using System;
using System.Collections;
using System.Collections.Generic;
2 years ago
using Assets.Scripts;
4 years ago
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;
4 years ago
if (Func != null)
{
if (dict == null)
4 years ago
{
dict = new Dictionary<string, int>(2)
4 years ago
{
{
"inputname",
0
},
{
"kakin",
1
}
};
}
int num;
if (dict.TryGetValue(Func, out num))
4 years ago
{
if (num != 0)
{
if (num == 1)
{
if (Debug.IsAutoKsDebug)
{
return true;
}
KsInput.Enable = false;
KsInput.Clear();
4 years ago
/*bool flag = KsExec.ExecPay(Param, Value, count);
4 years ago
if (flag)
{
KsInput.Enable = true;
}
4 years ago
return flag;*/
//should disable all payment checks
return true;
4 years ago
}
}
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)
{
4 years ago
//UnityEngine.Debug.LogWarning(count);
4 years ago
if (count == 0)
{
4 years ago
UnityEngine.Debug.LogWarning("first");
4 years ago
KsExec.confirm = false;
KsExec.confirmResult = false;
2 years ago
switch (UnityApp.Instance.locale)
4 years ago
{
2 years ago
case Assets.Scripts.LocaleEnum.English:
KsExec.editName = "Alice";
KsExec.editLastName = "Liddell";
break;
case Assets.Scripts.LocaleEnum.Spanish:
KsExec.editName = "Alice";
KsExec.editLastName = "Liddell";
break;
default:
KsExec.editName = "アリス";
KsExec.editLastName = "リデル";
break;
}
4 years ago
NameInputKeyboard.DebugInputText = KsExec.editName;
NameInputKeyboard.DebugInputTextLastName = KsExec.editLastName;
KsExec.KeyboardMain();
4 years ago
}
else if (KsExec.confirm)
{
if (KsExec.confirmResult)
{
2 years ago
GameData.SetParamString("firstname", NameInputKeyboard.InputText, KsExec.editName);
GameData.SetParamString("familyname", NameInputKeyboard.InputTextLastName, KsExec.editLastName);
//GameData.SetParamString("firstname", string.Empty, KsExec.editName);
//GameData.SetParamString("familyname", string.Empty, KsExec.editLastName);
NameInputKeyboard.Close();
4 years ago
return true;
}
KsExec.KeyboardMain();
KsExec.confirm = false;
KsExec.confirmResult = false;
}
else
{
KsExec.editName = NameInputKeyboard.InputText;
KsExec.editLastName = NameInputKeyboard.InputTextLastName;
if (KsExec.editName.Length == 0 || KsExec.checkSpaceOnly(KsExec.editName))
4 years ago
{
4 years ago
UnityTask.SetSubNoUnityTask(MessageDlg.ExecDlg("No name entered", null));
4 years ago
KsExec.KeyboardMain();
}
else if (KsExec.editName.Length > 7)
{
4 years ago
UnityTask.SetSubNoUnityTask(MessageDlg.ExecDlg("You can enter up to 7 characters for the name.", null));
4 years ago
KsExec.KeyboardMain();
}
else if (!Singleton<UnityGraph>.Instance.Font.Font.CheckGlyph(KsExec.editName))
{
4 years ago
UnityTask.SetSubNoUnityTask(MessageDlg.ExecDlg("Contains characters that cannot be displayed.", null));
4 years ago
KsExec.KeyboardMain();
}
else
{
string arg = KsExec.editName;
string arg2 = KsExec.editLastName;
string paramString = GameData.GetParamString("familyname", string.Empty);
4 years ago
string[] msgs;
/*if (UnityApp.Instance.isJapanese)
4 years ago
{
msgs = new string[]
{
string.Format("「{0}{1}」です。", arg, paramString),
"よろしいですか?"
};
}
else
{
msgs = new string[]
{
string.Format("Is {0} {1} correct?", arg, paramString)
};
}*/
2 years ago
msgs = new string[]
{
string.Format(
UnityApp.Instance.locale switch
{
LocaleEnum.English => "{0} {1}",
LocaleEnum.Spanish => "{0} {1}",
_ => "「{0}{1}」です。"
}, arg, arg2),
UnityApp.Instance.locale switch
{
LocaleEnum.English => "Is this Correct?",
LocaleEnum.Spanish => "Spanish translation name confirmation message",
_ => "よろしいですか?"
}
};
/*if (UnityApp.Instance.isJapanese)
{
msgs = new string[]
{
string.Format("「{0}{1}」です。", arg, arg2),
"よろしいですか?"
};
}
else
{
msgs = new string[]
{
string.Format("Is {0} {1} correct?", arg, arg2)
};
2 years ago
}*/
UnityTask.SetSubNoUnityTask(MessageDlg.ExecDlg(msgs, new Action<bool>(KsExec.SetResult)));
4 years ago
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()
{
UnityTask.SetSubTask(NameInputKeyboard.Open(KsExec.editName, KsExec.editLastName, true));
4 years ago
/*switch (UnityEngine.Application.platform)
4 years ago
{
case RuntimePlatform.IPhonePlayer:
case RuntimePlatform.Android:
UnityTask.SetSubTask(NameInputKeyboard.Open(KsExec.editName, true));
break;
4 years ago
}*/
4 years ago
}
// 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;
private static string editLastName = string.Empty;
}
4 years ago
}