From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/Tutorial/Command.meta | 9 + .../XMainClient/Tutorial/Command/XCommandEmpty.cs | 68 ++ .../Tutorial/Command/XCommandEmpty.cs.meta | 12 + .../Tutorial/Command/XCommandHideSkills.cs | 39 + .../Tutorial/Command/XCommandHideSkills.cs.meta | 12 + .../Tutorial/Command/XCommandIsShowButton.cs | 37 + .../Tutorial/Command/XCommandIsShowButton.cs.meta | 12 + .../XMainClient/Tutorial/Command/XCommandNote.cs | 167 +++ .../Tutorial/Command/XCommandNote.cs.meta | 12 + .../Tutorial/Command/XCommandShowSkills.cs | 39 + .../Tutorial/Command/XCommandShowSkills.cs.meta | 12 + .../Scripts/XMainClient/Tutorial/XTutorialCmd.cs | 81 ++ .../XMainClient/Tutorial/XTutorialCmd.cs.meta | 12 + .../Tutorial/XTutorialCmdExecuteCondition.cs | 40 + .../Tutorial/XTutorialCmdExecuteCondition.cs.meta | 12 + .../XMainClient/Tutorial/XTutorialCmdExecutor.cs | 1276 ++++++++++++++++++++ .../Tutorial/XTutorialCmdExecutor.cs.meta | 12 + .../Tutorial/XTutorialCmdFinishCondition.cs | 27 + .../Tutorial/XTutorialCmdFinishCondition.cs.meta | 12 + .../XMainClient/Tutorial/XTutorialCmdParser.cs | 962 +++++++++++++++ .../Tutorial/XTutorialCmdParser.cs.meta | 12 + .../XMainClient/Tutorial/XTutorialHelper.cs | 116 ++ .../XMainClient/Tutorial/XTutorialHelper.cs.meta | 12 + .../XMainClient/Tutorial/XTutorialMainCmd.cs | 20 + .../XMainClient/Tutorial/XTutorialMainCmd.cs.meta | 12 + .../Scripts/XMainClient/Tutorial/XTutorialMgr.cs | 489 ++++++++ .../XMainClient/Tutorial/XTutorialMgr.cs.meta | 12 + 27 files changed, 3526 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/Command.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmd.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmd.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecuteCondition.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecuteCondition.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdFinishCondition.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdFinishCondition.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdParser.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdParser.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialHelper.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialHelper.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMainCmd.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMainCmd.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMgr.cs create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMgr.cs.meta (limited to 'Client/Assets/Scripts/XMainClient/Tutorial') diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command.meta b/Client/Assets/Scripts/XMainClient/Tutorial/Command.meta new file mode 100644 index 00000000..e7aa6f11 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c5e472204f56cd34aa09add81fc53a06 +folderAsset: yes +timeCreated: 1611402943 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs new file mode 100644 index 00000000..d33f1585 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs @@ -0,0 +1,68 @@ +using System; +using UILib; +using UnityEngine; +using XUpdater; +using XUtliPoolLib; + +namespace XMainClient.Tutorial.Command +{ + internal class XCommandEmpty : XBaseCommand + { + private uint _time = 0u; + + public override bool Execute() + { + this._startTime = Time.time; + bool flag = this._cmd.interalDelay > 0f; + if (flag) + { + base.SetOverlay(); + } + this._time = XSingleton.singleton.SetTimer(this._cmd.interalDelay, new XTimerMgr.ElapsedEventHandler(this.ShowFinger), null); + base.publicModule(); + return true; + } + + protected void ShowFinger(object o) + { + base.SetOverlay(); + base.SetAilin(); + bool flag = string.IsNullOrEmpty(this._cmd.ailinText) && XBaseCommand._Overlay != null; + if (flag) + { + IXUISprite ixuisprite = XBaseCommand._Overlay.transform.Find("Left").GetComponent("XUISprite") as IXUISprite; + ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnMouseClick)); + } + bool pause = this._cmd.pause; + if (pause) + { + XSingleton.singleton.Pause = true; + } + } + + protected override void OnMouseClick(IXUISprite sp) + { + base.OnMouseClick(sp); + bool flag = string.IsNullOrEmpty(this._cmd.ailinText); + if (flag) + { + XSingleton.singleton.OnCmdFinished(); + } + } + + public override void Stop() + { + bool flag = this._time > 0u; + if (flag) + { + XSingleton.singleton.KillTimer(this._time); + this._time = 0u; + } + base.DestroyText(); + base.DestroyAilin(); + base.DestroyOverlay(); + XSingleton.singleton.Pause = false; + XSingleton.singleton.NoforceClick = false; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs.meta new file mode 100644 index 00000000..5935b926 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandEmpty.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 093c136e3192d6c4490514b9e2233552 +timeCreated: 1611403152 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs new file mode 100644 index 00000000..7e1ce75a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs @@ -0,0 +1,39 @@ +using System; +using XMainClient.UI; +using XMainClient.UI.UICommon; + +namespace XMainClient.Tutorial.Command +{ + internal class XCommandHideSkills : XBaseCommand + { + public override bool Execute() + { + bool flag = !string.IsNullOrEmpty(this._cmd.param1); + if (flag) + { + this.Hide(int.Parse(this._cmd.param1)); + } + bool flag2 = !string.IsNullOrEmpty(this._cmd.param2); + if (flag2) + { + this.Hide(int.Parse(this._cmd.param2)); + } + bool flag3 = !string.IsNullOrEmpty(this._cmd.param3); + if (flag3) + { + this.Hide(int.Parse(this._cmd.param3)); + } + base.publicModule(); + return true; + } + + private void Hide(int idx) + { + bool flag = DlgBase.singleton.IsLoaded(); + if (flag) + { + DlgBase.singleton.SkillHandler.DisableSkill(idx); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs.meta new file mode 100644 index 00000000..63b106db --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandHideSkills.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e038412c115d2ac4d8e9ec75c25092b7 +timeCreated: 1611404696 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs new file mode 100644 index 00000000..7d5bbf98 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs @@ -0,0 +1,37 @@ +using System; +using XMainClient.UI.UICommon; + +namespace XMainClient.Tutorial.Command +{ + internal class XCommandIsShowButton : XBaseCommand + { + public override bool Execute() + { + bool flag = this._cmd.param1 == null || this._cmd.param2 == null; + bool result; + if (flag) + { + result = false; + } + else + { + int num = int.Parse(this._cmd.param2); + bool flag2 = num == 0; + bool learnSkillButtonState = !flag2; + bool flag3 = this._cmd.param1 == "LearnSkillButton"; + if (flag3) + { + this.SetLearnSkillButtonState(learnSkillButtonState); + } + base.publicModule(); + result = true; + } + return result; + } + + private void SetLearnSkillButtonState(bool state) + { + DlgBase.singleton.SetLearnSkillButtonState(state); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs.meta new file mode 100644 index 00000000..d666a895 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandIsShowButton.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8ec22b9731eefe142900fac92e5881bc +timeCreated: 1611404131 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs new file mode 100644 index 00000000..cc9a2c95 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs @@ -0,0 +1,167 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XUpdater; +using XUtliPoolLib; + +namespace XMainClient.Tutorial.Command +{ + internal class XCommandNote : XBaseCommand + { + private GameObject _finger; + + private int orgWidth; + + private int orgHeight; + + private GameObject _cloneGo; + + private GameObject _clickGo; + + private uint _time = 0u; + + public override bool Execute() + { + Transform transform = XSingleton.singleton.UIRoot.Find(this._cmd.param1 + "(Clone)"); + bool flag = !transform || !transform.gameObject.activeInHierarchy; + bool result; + if (flag) + { + result = false; + } + else + { + Transform transform2 = XSingleton.singleton.FindChild(transform, this._cmd.param2); + bool flag2 = transform2 == null || !transform2.gameObject.activeInHierarchy; + if (flag2) + { + bool flag3 = transform2 == null && this._cmd.isOutError; + if (flag3) + { + this._cmd.isOutError = false; + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "TutorialId:", + this._cmd.TutorialID, + " Configuration File Path Error! tag:", + this._cmd.tag, + "\nPath:", + this._cmd.param1, + "(Clone)/", + this._cmd.param2 + }), null, null, null, null, null); + } + result = false; + } + else + { + this._startTime = Time.time; + this._clickGo = transform2.gameObject; + bool flag4 = this._cmd.interalDelay > 0f; + if (flag4) + { + base.SetOverlay(); + } + this._time = XSingleton.singleton.SetTimer(this._cmd.interalDelay, new XTimerMgr.ElapsedEventHandler(this.ShowFinger), null); + base.publicModule(); + result = true; + } + } + return result; + } + + protected void ShowFinger(object o) + { + bool flag = this._finger == null; + if (flag) + { + this._finger = (XSingleton.singleton.CreateFromPrefab("UI/Common/TutorialK", true, false) as GameObject); + } + this._finger.SetActive(false); + string param = this._cmd.param3; + string[] array = param.Split(XGlobalConfig.AllSeparators); + float num = float.Parse(array[0]); + float num2 = (array.Length > 1) ? float.Parse(array[1]) : num; + float num3 = (array.Length > 2) ? float.Parse(array[2]) : 0f; + float num4 = (array.Length > 3) ? float.Parse(array[3]) : 0f; + bool flag2 = num > 0f; + if (flag2) + { + IXUISprite ixuisprite = this._finger.transform.Find("Quan").GetComponent("XUISprite") as IXUISprite; + this.orgWidth = ixuisprite.spriteWidth; + this.orgHeight = ixuisprite.spriteHeight; + ixuisprite.spriteWidth = (int)((float)ixuisprite.spriteWidth * num); + ixuisprite.spriteHeight = (int)((float)ixuisprite.spriteHeight * num2); + ixuisprite.gameObject.transform.localPosition = new Vector3(num3, num4, 0f); + } + base.SetOverlay(); + this._cloneGo = XCommon.Instantiate(this._clickGo); + this.SetupCloneButton(this._clickGo, this._cloneGo); + base.SetTutorialText(this._cmd.textPos, this._cloneGo.transform); + this._finger.SetActive(false); + this._finger.SetActive(true); + base.SetAilin(); + bool pause = this._cmd.pause; + if (pause) + { + XSingleton.singleton.Pause = true; + } + } + + public override void Update() + { + base.Update(); + bool flag = this._cloneGo != null && this._clickGo != null; + if (flag) + { + Vector3 position = this._clickGo.transform.position; + Vector3 localPosition = XBaseCommand._Overlay.transform.InverseTransformPoint(position); + localPosition.z = 0f; + this._cloneGo.transform.localPosition = localPosition; + } + } + + protected void SetupCloneButton(GameObject targetGo, GameObject cloneGo) + { + XSingleton.singleton.AddChild(cloneGo.transform, this._finger.transform); + cloneGo.name = targetGo.name; + cloneGo.transform.parent = XBaseCommand._Overlay.transform; + Vector3 position = targetGo.transform.position; + Vector3 localPosition = XBaseCommand._Overlay.transform.InverseTransformPoint(position); + localPosition.z = 0f; + cloneGo.transform.localPosition = localPosition; + cloneGo.transform.localScale = targetGo.transform.localScale; + } + + public override void Stop() + { + bool flag = this._time > 0u; + if (flag) + { + XSingleton.singleton.KillTimer(this._time); + this._time = 0u; + } + bool flag2 = this._finger != null; + if (flag2) + { + IXUISprite ixuisprite = this._finger.transform.Find("Quan").GetComponent("XUISprite") as IXUISprite; + ixuisprite.spriteWidth = this.orgWidth; + ixuisprite.spriteHeight = this.orgHeight; + XResourceLoaderMgr.SafeDestroy(ref this._finger, false); + } + base.DestroyText(); + bool flag3 = this._cloneGo != null; + if (flag3) + { + this._cloneGo.transform.parent = null; + UnityEngine.Object.Destroy(this._cloneGo); + this._cloneGo = null; + } + base.DestroyAilin(); + base.DestroyOverlay(); + XSingleton.singleton.Pause = false; + XSingleton.singleton.NoforceClick = false; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs.meta new file mode 100644 index 00000000..35d519c1 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandNote.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e6548cb3d77bf324697c4717bb9c063f +timeCreated: 1611404746 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs new file mode 100644 index 00000000..eb4a36e7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs @@ -0,0 +1,39 @@ +using System; +using XMainClient.UI; +using XMainClient.UI.UICommon; + +namespace XMainClient.Tutorial.Command +{ + internal class XCommandShowSkills : XBaseCommand + { + public override bool Execute() + { + bool flag = !string.IsNullOrEmpty(this._cmd.param1); + if (flag) + { + this.Show(int.Parse(this._cmd.param1)); + } + bool flag2 = !string.IsNullOrEmpty(this._cmd.param2); + if (flag2) + { + this.Show(int.Parse(this._cmd.param2)); + } + bool flag3 = !string.IsNullOrEmpty(this._cmd.param3); + if (flag3) + { + this.Show(int.Parse(this._cmd.param3)); + } + base.publicModule(); + return true; + } + + private void Show(int idx) + { + bool flag = DlgBase.singleton.IsLoaded(); + if (flag) + { + DlgBase.singleton.SkillHandler.EnableSkill(idx); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs.meta new file mode 100644 index 00000000..d2b63682 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/Command/XCommandShowSkills.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e2cdcb4267af24843b241db51ef82ece +timeCreated: 1611404729 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmd.cs b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmd.cs new file mode 100644 index 00000000..85f427a5 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmd.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace XMainClient +{ + internal class XTutorialCmd + { + public int TutorialID; + + public int step; + + public string tag; + + public int mainTutorialBit; + + public List conditions; + + public List condParams; + + public XTutorialCmdFinishCondition endcondition; + + public List endParam; + + public string cmd; + + public string param1; + + public string param2; + + public string param3; + + public string param4; + + public string param5; + + public string param6; + + public XCmdState state; + + public string text; + + public Vector3 textPos; + + public bool pause; + + public float interalDelay; + + public string ailinText; + + public int ailinPos; + + public string ailinText2; + + public string buttomtext; + + public string audio; + + public string scroll; + + public int scrollPos; + + public string skipCondition; + + public string skipParam1; + + public string skipParam2; + + public string skipParam3; + + public string function; + + public string functionparam1; + + public bool bLastCmdInQueue; + + public bool isOutError; + + public bool isCanDestroyOverlay; + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmd.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmd.cs.meta new file mode 100644 index 00000000..1e969a1f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmd.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 88b2842e5da2d1c469beb929e4faa836 +timeCreated: 1611404085 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecuteCondition.cs b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecuteCondition.cs new file mode 100644 index 00000000..5e3182d7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecuteCondition.cs @@ -0,0 +1,40 @@ +using System; + +namespace XMainClient +{ + internal enum XTutorialCmdExecuteCondition + { + No_Condition, + Player_Level, + In_Level, + After_Level, + Musou_Above, + Cast_Skill, + External_String, + Talk_Npc, + Can_Accept_Task, + Can_Finish_Task, + Task_Over, + Task_Battle, + Task_Scene_Finish, + Time_Delay, + Sys_Notify, + Meet_Enemy, + Art_Skill, + Cutscene_Over, + Get_Focused, + No_SuperAmor, + Boss_Exist, + Enemy_OnGround, + No_Promote, + Team2, + Has_Target, + MainUI, + Has_Item, + Has_Body, + No_Stackui, + Activity_Open, + Dragon_Crusade_Open, + Battle_NPC_Talk_End + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecuteCondition.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecuteCondition.cs.meta new file mode 100644 index 00000000..9c265049 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecuteCondition.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8d051e9822a39534a933a578f33bef6d +timeCreated: 1611404102 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs new file mode 100644 index 00000000..ddc5a61e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs @@ -0,0 +1,1276 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UnityEngine; +using XMainClient.Tutorial.Command; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XTutorialCmdExecutor + { + private XBaseCommand _command; + + public float _lastCmdFinishTime = 0f; + + private XCommandForceClick _forceCmd = new XCommandForceClick(); + + private XCommandCutscene _cutsceneCmd = new XCommandCutscene(); + + private XCommandExec _execCmd = new XCommandExec(); + + private XCommandForceSlide _forceSlideCmd = new XCommandForceSlide(); + + private XCommandGenericClick _genericClickCmd = new XCommandGenericClick(); + + private XCommandNewIcon _newIconCmd = new XCommandNewIcon(); + + private XCommandDirectSys _newDirectSys = new XCommandDirectSys(); + + private XCommandNoforceClick _noforceClickCmd = new XCommandNoforceClick(); + + private XCommandPureText _pureTextCmd = new XCommandPureText(); + + private XCommandMove _moveCmd = new XCommandMove(); + + private XCommandForceSkill _skillCmd = new XCommandForceSkill(); + + private XCommandPureOverlay _overlayCmd = new XCommandPureOverlay(); + + private XCommandPrefab _prefabCmd = new XCommandPrefab(); + + private XCommandNote _noteCmd = new XCommandNote(); + + private XCommandHideSkills _hideskillCmd = new XCommandHideSkills(); + + private XCommandShowSkills _showskillCmd = new XCommandShowSkills(); + + private XCommandIsShowButton _isshowbuttonCmd = new XCommandIsShowButton(); + + private XCommandClickEntity _clickEntityCmd = new XCommandClickEntity(); + + private XCommandEmpty _emptyCmd = new XCommandEmpty(); + + public void ExecuteCmd(ref XTutorialCmd Cmd) + { + this.ResetRelativeFlag(); + bool flag = this.IsSkip(Cmd); + if (flag) + { + bool flag2 = Cmd.skipParam1 != null && int.Parse(Cmd.skipParam1) != 0; + if (flag2) + { + XSingleton.singleton.SkipCurrentTutorial(false); + } + else + { + Cmd.state = XCmdState.Cmd_Finished; + XSingleton.singleton.AddLog("Skip Tutorial:" + Cmd.tag, null, null, null, null, null, XDebugColor.XDebug_None); + } + } + else + { + bool flag3 = Cmd.cmd == "forceclick"; + if (flag3) + { + this._command = this._forceCmd; + this._command.SetCommand(Cmd); + bool flag4 = this._command.Execute(); + if (flag4) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag5 = Cmd.cmd == "forceskill"; + if (flag5) + { + this._command = this._skillCmd; + this._command.SetCommand(Cmd); + bool flag6 = this._command.Execute(); + if (flag6) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag7 = Cmd.cmd == "noforceclick"; + if (flag7) + { + this._command = this._noforceClickCmd; + this._command.SetCommand(Cmd); + bool flag8 = this._command.Execute(); + if (flag8) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag9 = Cmd.cmd == "forceslide"; + if (flag9) + { + this._command = this._forceSlideCmd; + this._command.SetCommand(Cmd); + bool flag10 = this._command.Execute(); + if (flag10) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag11 = Cmd.cmd == "movetutorial"; + if (flag11) + { + this._command = this._moveCmd; + this._command.SetCommand(Cmd); + bool flag12 = this._command.Execute(); + if (flag12) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag13 = Cmd.cmd == "newsys"; + if (flag13) + { + this._command = this._newIconCmd; + this._command.SetCommand(Cmd); + bool flag14 = this._command.Execute(); + if (flag14) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag15 = Cmd.cmd == "directsys"; + if (flag15) + { + this._command = this._newDirectSys; + this._command.SetCommand(Cmd); + bool flag16 = this._command.Execute(); + if (flag16) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + XSingleton.singleton.OnCmdFinished(); + } + else + { + bool flag17 = Cmd.cmd == "clickentity"; + if (flag17) + { + this._command = this._clickEntityCmd; + this._command.SetCommand(Cmd); + bool flag18 = this._command.Execute(); + if (flag18) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag19 = Cmd.cmd == "cutscene"; + if (flag19) + { + this._command = this._cutsceneCmd; + this._command.SetCommand(Cmd); + bool flag20 = this._command.Execute(); + if (flag20) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag21 = Cmd.cmd == "exec"; + if (flag21) + { + this._command = this._execCmd; + this._command.SetCommand(Cmd); + bool flag22 = this._command.Execute(); + if (flag22) + { + Cmd.state = XCmdState.Cmd_Finished; + } + } + else + { + bool flag23 = Cmd.cmd == "puretext"; + if (flag23) + { + this._command = this._pureTextCmd; + this._command.SetCommand(Cmd); + bool flag24 = this._command.Execute(); + if (flag24) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag25 = Cmd.cmd == "overlay"; + if (flag25) + { + this._command = this._overlayCmd; + this._command.SetCommand(Cmd); + bool flag26 = this._command.Execute(); + if (flag26) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag27 = Cmd.cmd == "genericclick"; + if (flag27) + { + this._command = this._genericClickCmd; + this._command.SetCommand(Cmd); + bool flag28 = this._command.Execute(); + if (flag28) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag29 = Cmd.cmd == "showprefab"; + if (flag29) + { + this._command = this._prefabCmd; + this._command.SetCommand(Cmd); + bool flag30 = this._command.Execute(); + if (flag30) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag31 = Cmd.cmd == "notewindow"; + if (flag31) + { + this._command = this._noteCmd; + this._command.SetCommand(Cmd); + bool flag32 = this._command.Execute(); + if (flag32) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag33 = Cmd.cmd == "hideskills"; + if (flag33) + { + this._command = this._hideskillCmd; + this._command.SetCommand(Cmd); + bool flag34 = this._command.Execute(); + if (flag34) + { + Cmd.state = XCmdState.Cmd_Finished; + } + } + else + { + bool flag35 = Cmd.cmd == "showskills"; + if (flag35) + { + this._command = this._showskillCmd; + this._command.SetCommand(Cmd); + bool flag36 = this._command.Execute(); + if (flag36) + { + Cmd.state = XCmdState.Cmd_Finished; + } + } + else + { + bool flag37 = Cmd.cmd == "showbutton"; + if (flag37) + { + this._command = this._isshowbuttonCmd; + this._command.SetCommand(Cmd); + bool flag38 = this._command.Execute(); + if (flag38) + { + Cmd.state = XCmdState.Cmd_Finished; + } + } + else + { + bool flag39 = Cmd.cmd == "empty"; + if (flag39) + { + this._command = this._emptyCmd; + this._command.SetCommand(Cmd); + bool flag40 = this._command.Execute(); + if (flag40) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + + public void UpdateCmd(ref XTutorialCmd Cmd) + { + this._command.Update(); + bool flag = this.CanCmdFinish(Cmd); + if (flag) + { + XSingleton.singleton.OnCmdFinished(); + } + } + + public void StopCmd() + { + this._command.Stop(); + } + + public void OnCmdFinish(ref XTutorialCmd Cmd) + { + this._command.OnFinish(); + Cmd.state = XCmdState.Cmd_Finished; + this._lastCmdFinishTime = Time.time; + } + + private bool ConditionSatisified(List conds, List param) + { + bool flag = true; + for (int i = 0; i < conds.Count; i++) + { + switch (conds[i]) + { + case XTutorialCmdExecuteCondition.Player_Level: + { + bool flag2 = (ulong)XSingleton.singleton.XPlayerData.Level < (ulong)((long)int.Parse(param[i])); + if (flag2) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.In_Level: + { + uint sceneID = XSingleton.singleton.SceneID; + bool flag3 = sceneID != (uint)int.Parse(param[i]); + if (flag3) + { + flag = false; + } + else + { + bool flag4 = sceneID == 1u; + if (flag4) + { + bool flag5 = !DlgBase.singleton.IsVisible(); + if (flag5) + { + flag = false; + } + } + } + break; + } + case XTutorialCmdExecuteCondition.After_Level: + { + uint lastFinishScene = XSingleton.singleton.LastFinishScene; + bool flag6 = lastFinishScene != (uint)int.Parse(param[i]); + if (flag6) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Cast_Skill: + { + bool flag7 = XSingleton.singleton.Boss == null || !XSingleton.singleton.Boss.Skill.IsCasting() || XSingleton.singleton.Boss.Skill.CurrentSkill.MainCore.ID != XSingleton.singleton.XHash(param[i]); + if (flag7) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.External_String: + { + bool flag8 = !XSingleton.singleton.QueryExternalString(param[i], false); + if (flag8) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Talk_Npc: + { + bool flag9 = !DlgBase.singleton.IsVisible(); + if (flag9) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Can_Accept_Task: + { + XTaskDocument specificDocument = XDocuments.GetSpecificDocument(XTaskDocument.uuID); + int num = int.Parse(param[i]); + bool flag10 = false; + for (int j = 0; j < specificDocument.TaskRecord.Tasks.Count; j++) + { + XTaskInfo xtaskInfo = specificDocument.TaskRecord.Tasks[j]; + bool flag11 = xtaskInfo != null && (ulong)xtaskInfo.ID == (ulong)((long)num); + if (flag11) + { + flag10 = true; + bool flag12 = xtaskInfo.Status != TaskStatus.TaskStatus_CanTake || !DlgBase.singleton.IsVisible(); + if (flag12) + { + flag = false; + } + break; + } + } + bool flag13 = !flag10; + if (flag13) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Can_Finish_Task: + case XTutorialCmdExecuteCondition.Task_Scene_Finish: + { + XTaskDocument specificDocument2 = XDocuments.GetSpecificDocument(XTaskDocument.uuID); + int num2 = int.Parse(param[i]); + bool flag14 = false; + for (int k = 0; k < specificDocument2.TaskRecord.Tasks.Count; k++) + { + XTaskInfo xtaskInfo2 = specificDocument2.TaskRecord.Tasks[k]; + bool flag15 = xtaskInfo2 != null && (ulong)xtaskInfo2.ID == (ulong)((long)num2); + if (flag15) + { + flag14 = true; + bool flag16 = xtaskInfo2.Status != TaskStatus.TaskStatus_Finish || !DlgBase.singleton.IsVisible(); + if (flag16) + { + flag = false; + } + break; + } + } + bool flag17 = !flag14; + if (flag17) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Task_Over: + { + XTaskDocument specificDocument3 = XDocuments.GetSpecificDocument(XTaskDocument.uuID); + uint taskid = uint.Parse(param[i]); + flag = specificDocument3.TaskRecord.IsTaskFinished(taskid); + break; + } + case XTutorialCmdExecuteCondition.Task_Battle: + { + XTaskDocument specificDocument4 = XDocuments.GetSpecificDocument(XTaskDocument.uuID); + uint num3 = uint.Parse(param[i]); + bool flag18 = false; + for (int l = 0; l < specificDocument4.TaskRecord.Tasks.Count; l++) + { + XTaskInfo xtaskInfo3 = specificDocument4.TaskRecord.Tasks[l]; + TaskTableNew.RowData tableData = xtaskInfo3.TableData; + uint sceneID2 = XTaskDocument.GetSceneID(ref tableData.PassScene); + uint sceneID3 = XTaskDocument.GetSceneID(ref tableData.TaskScene); + bool flag19 = xtaskInfo3 != null && (sceneID2 == num3 || sceneID3 == num3); + if (flag19) + { + flag18 = true; + bool flag20 = xtaskInfo3.Status != TaskStatus.TaskStatus_Taked || !DlgBase.singleton.IsVisible(); + if (flag20) + { + flag = false; + } + break; + } + } + bool flag21 = !flag18; + if (flag21) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Time_Delay: + { + float num4 = float.Parse(param[i]); + bool flag22 = num4 > 0f && Time.time - this._lastCmdFinishTime < num4; + if (flag22) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Sys_Notify: + { + bool flag23 = flag; + bool flag24 = !XSingleton.singleton.QueryExternalString("OpenSys" + param[i], false); + if (flag24) + { + flag = false; + } + XPlayerAttributes xplayerData = XSingleton.singleton.XPlayerData; + bool flag25 = xplayerData.IsSystemOpened(uint.Parse(param[i])); + if (flag25) + { + flag = flag23; + } + break; + } + case XTutorialCmdExecuteCondition.Meet_Enemy: + { + bool flag26 = !XSingleton.singleton.MeetEnemy; + if (flag26) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Art_Skill: + { + bool flag27 = !XSingleton.singleton.ArtSkillOver; + if (flag27) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Cutscene_Over: + { + bool isPlaying = XSingleton.singleton.IsPlaying; + if (isPlaying) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Get_Focused: + { + bool flag28 = XSingleton.singleton.Boss == null || !XSingleton.singleton.Boss.Skill.IsCasting(); + if (flag28) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.No_SuperAmor: + { + XBoss boss = XSingleton.singleton.Boss; + bool flag29 = boss == null; + if (flag29) + { + flag = false; + } + else + { + List enemyList = DlgBase.singleton.EnemyInfoHandler.EnemyList; + double num5 = 0.0; + bool flag30 = enemyList.Count > 0; + if (flag30) + { + num5 = (double)enemyList[0].m_uiSuperArmor.value; + } + bool flag31 = num5 > 0.0; + if (flag31) + { + flag = false; + } + } + break; + } + case XTutorialCmdExecuteCondition.Boss_Exist: + { + bool flag32 = !XSingleton.singleton.HasBoss; + if (flag32) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Enemy_OnGround: + { + bool flag33 = !XSingleton.singleton.HitDownOnGround; + if (flag33) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.No_Promote: + { + bool flag34 = XSingleton.singleton.Player.TypeID >= 10u; + if (flag34) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Team2: + { + XTeamDocument specificDocument5 = XDocuments.GetSpecificDocument(XTeamDocument.uuID); + bool flag35 = !specificDocument5.bInTeam || specificDocument5.MyTeam.members.Count <= 1; + if (flag35) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Has_Target: + { + bool flag36 = !XSingleton.singleton.HasTarget; + if (flag36) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.MainUI: + { + bool flag37 = XSingleton.singleton.IsUIShowed() || XSingleton.singleton.IsHideTutorial(); + if (flag37) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Has_Item: + { + string[] array = param[i].Split(XGlobalConfig.SequenceSeparator); + int num6 = int.Parse(array[0]); + int num7 = int.Parse(array[1]); + num6 = XBagDocument.ConvertTemplate(num6); + XBagDocument specificDocument6 = XDocuments.GetSpecificDocument(XBagDocument.uuID); + int num8 = (int)specificDocument6.GetItemCount(num6); + XFashionDocument specificDocument7 = XDocuments.GetSpecificDocument(XFashionDocument.uuID); + bool flag38 = specificDocument7.OwnFashion(num6); + if (flag38) + { + num8++; + } + bool flag39 = num8 < num7; + if (flag39) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Has_Body: + { + XBagDocument specificDocument8 = XDocuments.GetSpecificDocument(XBagDocument.uuID); + XItem xitem = null; + string[] array2 = param[i].Split(XGlobalConfig.SequenceSeparator); + string a = array2[0]; + int num9 = 0; + bool flag40 = array2.Length > 1; + if (flag40) + { + num9 = int.Parse(array2[1]); + } + XJadeDocument specificDocument9 = XDocuments.GetSpecificDocument(XJadeDocument.uuID); + int num10 = 0; + bool flag41 = a == "boots"; + if (flag41) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Boots); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag42 = a == "earrings"; + if (flag42) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Earrings); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag43 = a == "gloves"; + if (flag43) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Gloves); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag44 = a == "headgear"; + if (flag44) + { + num10 = XBagDocument.BodyPosition(EquipPosition.EQUIP_START); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag45 = a == "lowerbody"; + if (flag45) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Lowerbody); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag46 = a == "mainweapon"; + if (flag46) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Mainweapon); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag47 = a == "necklace"; + if (flag47) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Necklace); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag48 = a == "rings"; + if (flag48) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Rings); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag49 = a == "secondaryweapon"; + if (flag49) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Secondaryweapon); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag50 = a == "upperbody"; + if (flag50) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Upperbody); + xitem = specificDocument8.EquipBag[num10]; + } + } + } + } + } + } + } + } + } + } + bool flag51 = num9 == 0; + if (flag51) + { + bool flag52 = xitem == null || xitem.itemID == 0; + if (flag52) + { + flag = false; + } + } + else + { + bool flag53 = !specificDocument9.HasRedPoint(num10); + if (flag53) + { + flag = false; + } + } + break; + } + case XTutorialCmdExecuteCondition.No_Stackui: + { + bool flag54 = XSingleton.singleton.IsUIShowed() || XSingleton.singleton.IsHideTutorial(); + if (flag54) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Activity_Open: + { + bool flag55 = !XSingleton.singleton.ActivityOpen; + if (flag55) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Dragon_Crusade_Open: + { + bool flag56 = !XSingleton.singleton.DragonCrusadeOpen; + if (flag56) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Battle_NPC_Talk_End: + { + bool flag57 = !XSingleton.singleton.BattleNPCTalkEnd; + if (flag57) + { + flag = false; + } + break; + } + } + bool flag58 = !flag; + if (flag58) + { + break; + } + } + return flag; + } + + public bool CanTutorialExecute(XTutorialMainCmd tutorial) + { + return this.ConditionSatisified(tutorial.conditions, tutorial.condParams); + } + + public bool CanCmdExecute(XTutorialCmd cmd) + { + bool flag = cmd.state == XCmdState.Cmd_In_Process || cmd.state == XCmdState.Cmd_Finished; + bool result; + if (flag) + { + result = false; + } + else + { + bool flag2 = this.ConditionSatisified(cmd.conditions, cmd.condParams); + bool flag3 = flag2; + if (flag3) + { + for (int i = 0; i < cmd.conditions.Count; i++) + { + XTutorialCmdExecuteCondition xtutorialCmdExecuteCondition = cmd.conditions[i]; + if (xtutorialCmdExecuteCondition != XTutorialCmdExecuteCondition.External_String) + { + if (xtutorialCmdExecuteCondition == XTutorialCmdExecuteCondition.Sys_Notify) + { + XSingleton.singleton.QueryExternalString("OpenSys" + cmd.condParams[i], true); + } + } + else + { + XSingleton.singleton.QueryExternalString(cmd.condParams[i], true); + } + } + result = true; + } + else + { + result = false; + } + } + return result; + } + + public bool CanCmdFinish(XTutorialCmd cmd) + { + bool flag = cmd.state != XCmdState.Cmd_In_Process; + bool result; + if (flag) + { + result = false; + } + else + { + bool flag2 = cmd.endcondition == XTutorialCmdFinishCondition.No_Condition; + if (flag2) + { + result = false; + } + else + { + bool flag3 = false; + switch (cmd.endcondition) + { + case XTutorialCmdFinishCondition.Time: + { + float time = Time.time; + float num = (cmd.endParam.Count > 0) ? float.Parse(cmd.endParam[0]) : 3f; + bool flag4 = time - this._command._startTime > num; + if (flag4) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.TalkingNpc: + { + bool flag5 = DlgBase.singleton.IsVisible(); + if (flag5) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.WorldMap: + { + bool flag6 = DlgBase.singleton.IsVisible(); + if (flag6) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.SkillLevelup: + { + bool skillLevelup = XSingleton.singleton.SkillLevelup; + if (skillLevelup) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.SkillBind: + { + bool skillBind = XSingleton.singleton.SkillBind; + if (skillBind) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.UseItem: + { + bool useItem = XSingleton.singleton.UseItem; + if (useItem) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.SysOpened: + { + XPlayerAttributes xplayerData = XSingleton.singleton.XPlayerData; + bool flag7 = xplayerData.IsSystemOpened(uint.Parse(cmd.param1)); + if (flag7) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.GetReward: + { + bool getReward = XSingleton.singleton.GetReward; + if (getReward) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.Move: + { + bool moved = XSingleton.singleton.Moved; + if (moved) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.ComposeFashion: + { + bool fashionCompose = XSingleton.singleton.FashionCompose; + if (fashionCompose) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.ReinforceItem: + { + bool reinforceItem = XSingleton.singleton.ReinforceItem; + if (reinforceItem) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.EnhanceItem: + { + bool enhanceItem = XSingleton.singleton.EnhanceItem; + if (enhanceItem) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.ChangeProf: + { + bool switchProf = XSingleton.singleton.SwitchProf; + if (switchProf) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.HasTeam: + { + bool hasTeam = XSingleton.singleton.HasTeam; + if (hasTeam) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.Smelting: + { + bool smelting = XSingleton.singleton.Smelting; + if (smelting) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.SelectView: + { + bool selectView = XSingleton.singleton.SelectView; + if (selectView) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.SelectSkipTutorial: + { + bool selectSkipTutorial = XSingleton.singleton.SelectSkipTutorial; + if (selectSkipTutorial) + { + flag3 = true; + } + break; + } + } + bool flag8 = flag3; + result = flag8; + } + } + return result; + } + + private bool IsSkip(XTutorialCmd cmd) + { + string skipCondition = cmd.skipCondition; + bool flag = string.IsNullOrEmpty(skipCondition); + bool result; + if (flag) + { + result = false; + } + else + { + XSkillTreeDocument specificDocument = XDocuments.GetSpecificDocument(XSkillTreeDocument.uuID); + bool flag2 = false; + string text = skipCondition; + uint num = PrivateImplementationDetails.ComputeStringHash(text); + if (num <= 2100011009u) + { + if (num <= 985216048u) + { + if (num != 153474289u) + { + if (num != 461464819u) + { + if (num == 985216048u) + { + if (text == "MenuBtnInState2") + { + flag2 = !DlgBase.singleton.MenuSwitchBtnState; + } + } + } + else if (text == "ModalDlg") + { + flag2 = !DlgBase.singleton.IsVisible(); + } + } + else if (text == "NoLearnSkill") + { + bool flag3 = cmd.skipParam2 == null || cmd.skipParam3 == null; + if (flag3) + { + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "TutorialId:", + cmd.TutorialID, + " Error\ntag:", + cmd.tag, + " Command:LearnSkill Param Num Error" + }), null, null, null, null, null); + } + flag2 = specificDocument.isTutorialNeed(int.Parse(cmd.skipParam2), int.Parse(cmd.skipParam3)); + } + } + else if (num <= 2057789062u) + { + if (num != 1035548905u) + { + if (num == 2057789062u) + { + if (text == "LearnSkill") + { + bool flag4 = cmd.skipParam2 == null || cmd.skipParam3 == null; + if (flag4) + { + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "TutorialId:", + cmd.TutorialID, + " Error\ntag:", + cmd.tag, + " Command:LearnSkill Param Num Error" + }), null, null, null, null, null); + } + flag2 = !specificDocument.isTutorialNeed(int.Parse(cmd.skipParam2), int.Parse(cmd.skipParam3)); + } + } + } + else if (text == "MenuBtnInState1") + { + flag2 = DlgBase.singleton.MenuSwitchBtnState; + } + } + else if (num != 2090134647u) + { + if (num == 2100011009u) + { + if (text == "HasTaskTab") + { + flag2 = DlgBase.singleton._TaskNaviHandler._TaskSwitchBtnState; + } + } + } + else if (text == "SelectSight2.5D") + { + XOptionsDocument specificDocument2 = XDocuments.GetSpecificDocument(XOptionsDocument.uuID); + flag2 = (specificDocument2.GetValue(XOptionsDefine.OD_VIEW) == XFastEnumIntEqualityComparer.ToInt(XOperationMode.X25D)); + } + } + else if (num <= 2995591070u) + { + if (num != 2352948218u) + { + if (num != 2805484350u) + { + if (num == 2995591070u) + { + if (text == "InTeamTab") + { + flag2 = !DlgBase.singleton._TaskNaviHandler.IsShowingTaskTab; + } + } + } + else if (text == "PPTLess") + { + bool flag5 = cmd.skipParam2 == null; + if (flag5) + { + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "TutorialId:", + cmd.TutorialID, + " Error\ntag:", + cmd.tag, + " Command:PPTLess Param Num Error" + }), null, null, null, null, null); + } + flag2 = (XSingleton.singleton.XPlayerData.GetAttr(XAttributeDefine.XAttr_POWER_POINT_Total) < (double)int.Parse(cmd.skipParam2)); + } + } + else if (text == "InTaskTab") + { + flag2 = DlgBase.singleton._TaskNaviHandler.IsShowingTaskTab; + } + } + else if (num <= 3972437787u) + { + if (num != 3566417125u) + { + if (num == 3972437787u) + { + if (text == "RadioNoCanOpen") + { + XRadioDocument specificDocument3 = XDocuments.GetSpecificDocument(XRadioDocument.uuID); + XOptionsDocument specificDocument4 = XDocuments.GetSpecificDocument(XOptionsDocument.uuID); + flag2 = (specificDocument3.roomState == XRadioDocument.BigRoomState.InRoom || specificDocument4.GetValue(XOptionsDefine.OD_RADIO) == 0); + } + } + } + else if (text == "CurSkillNoLearn") + { + flag2 = !specificDocument.CheckLevelUpButton(); + } + } + else if (num != 4122175948u) + { + if (num == 4247367664u) + { + if (text == "Chapter1Star8Box") + { + flag2 = XSingleton.singleton.HasChapterBoxFetched(1, 0); + } + } + } + else if (text == "ProfessionNo1Turn") + { + flag2 = (XFastEnumIntEqualityComparer.ToInt(XSingleton.singleton.XPlayerData.Profession) < 10); + } + result = flag2; + } + return result; + } + + public void ResetRelativeFlag() + { + XSingleton.singleton.SkillLevelup = false; + XSingleton.singleton.SkillBind = false; + XSingleton.singleton.UseItem = false; + XSingleton.singleton.GetReward = false; + XSingleton.singleton.FashionCompose = false; + XSingleton.singleton.ReinforceItem = false; + XSingleton.singleton.EnhanceItem = false; + XSingleton.singleton.SwitchProf = false; + XSingleton.singleton.MeetEnemy = false; + XSingleton.singleton.HasTeam = false; + XSingleton.singleton.Smelting = false; + XSingleton.singleton.HitDownOnGround = false; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs.meta new file mode 100644 index 00000000..b2d377c1 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0755b35cdae19cd42b9f5c13c230be66 +timeCreated: 1611402967 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdFinishCondition.cs b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdFinishCondition.cs new file mode 100644 index 00000000..f4e9af5d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdFinishCondition.cs @@ -0,0 +1,27 @@ +using System; + +namespace XMainClient +{ + internal enum XTutorialCmdFinishCondition + { + No_Condition, + Click, + Time, + TalkingNpc, + WorldMap, + SkillLevelup, + SkillBind, + UseItem, + SysOpened, + GetReward, + Move, + ComposeFashion, + ReinforceItem, + EnhanceItem, + ChangeProf, + HasTeam, + Smelting, + SelectView, + SelectSkipTutorial + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdFinishCondition.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdFinishCondition.cs.meta new file mode 100644 index 00000000..6de6b04d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdFinishCondition.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 33d5bfe80659d8a48b0a41883a091258 +timeCreated: 1611403553 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdParser.cs b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdParser.cs new file mode 100644 index 00000000..1c71d0fb --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdParser.cs @@ -0,0 +1,962 @@ +using System; +using System.Collections.Generic; +using System.IO; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XTutorialCmdParser + { + private XTutorialCmd _parseTmpCmd; + + private string[] _validateCmd = new string[] + { + "forceclick", + "newsys", + "exec", + "forceslide", + "noforceclick", + "noforceslide", + "forcedoubleclick", + "puretext", + "genericclick", + "cutscene", + "directsys", + "movetutorial", + "forceskill", + "overlay", + "showprefab", + "notewindow", + "hideskills", + "showskills", + "showbutton", + "clickentity", + "empty" + }; + + public bool Parse(string file, int initStep, ref Queue cmdQueue, int execStep) + { + Stream stream = XSingleton.singleton.ReadText(file, ".txt", true); + StreamReader streamReader = new StreamReader(stream); + string text = streamReader.ReadLine(); + int num = 1; + int num2 = 0; + XTutorialCmd xtutorialCmd = null; + bool flag = execStep <= 0; + for (;;) + { + text = streamReader.ReadLine(); + num++; + bool flag2 = text.StartsWith("end tutorial"); + if (flag2) + { + break; + } + bool flag3 = text.Length == 0; + if (!flag3) + { + bool flag4 = text.StartsWith("--"); + if (!flag4) + { + string[] array = text.Split(XGlobalConfig.TabSeparator, StringSplitOptions.RemoveEmptyEntries); + bool flag5 = false; + bool flag6 = text.StartsWith("step"); + if (flag6) + { + num2++; + bool flag7 = num2 <= initStep; + if (flag7) + { + continue; + } + this._parseTmpCmd = new XTutorialCmd(); + this._parseTmpCmd.mainTutorialBit = execStep; + bool flag8 = flag; + if (flag8) + { + this._parseTmpCmd.step = num2; + } + else + { + this._parseTmpCmd.step = -1; + } + bool flag9 = array.Length > 1; + if (flag9) + { + this._parseTmpCmd.tag = array[1]; + } + else + { + this._parseTmpCmd.tag = "NULL"; + } + this._parseTmpCmd.conditions = new List(); + this._parseTmpCmd.condParams = new List(); + this._parseTmpCmd.endParam = new List(); + this._parseTmpCmd.endcondition = XTutorialCmdFinishCondition.No_Condition; + this._parseTmpCmd.state = XCmdState.Cmd_In_Queue; + this._parseTmpCmd.bLastCmdInQueue = false; + this._parseTmpCmd.isOutError = true; + this._parseTmpCmd.TutorialID = execStep; + this._parseTmpCmd.isCanDestroyOverlay = true; + flag5 = true; + } + else + { + bool flag10 = text.StartsWith("scond"); + if (flag10) + { + bool flag11 = this._parseTmpCmd != null; + if (flag11) + { + bool flag12 = array.Length > 1; + if (flag12) + { + this._parseTmpCmd.conditions.Add(this.Str2Condition(array[1])); + } + bool flag13 = array.Length > 2; + if (flag13) + { + this._parseTmpCmd.condParams.Add(array[2]); + } + else + { + this._parseTmpCmd.condParams.Add("null"); + } + } + flag5 = true; + } + else + { + bool flag14 = text.StartsWith("econd"); + if (flag14) + { + bool flag15 = this._parseTmpCmd != null; + if (flag15) + { + bool flag16 = array.Length > 1; + if (flag16) + { + this._parseTmpCmd.endcondition = this.Str2EndCondition(array[1]); + } + bool flag17 = array.Length > 2; + if (flag17) + { + this._parseTmpCmd.endParam.Add(array[2]); + } + } + flag5 = true; + } + else + { + bool flag18 = text.StartsWith("text"); + if (flag18) + { + bool flag19 = this._parseTmpCmd != null; + if (flag19) + { + bool flag20 = array.Length > 1; + if (flag20) + { + this._parseTmpCmd.text = array[1]; + } + bool flag21 = array.Length > 3; + if (flag21) + { + this._parseTmpCmd.textPos = new Vector3((float)int.Parse(array[2]), (float)int.Parse(array[3])); + } + else + { + bool flag22 = array.Length > 2; + if (flag22) + { + this._parseTmpCmd.textPos = new Vector3((float)int.Parse(array[2]), 0f); + } + } + } + flag5 = true; + } + else + { + bool flag23 = text.StartsWith("internaldelay"); + if (flag23) + { + bool flag24 = this._parseTmpCmd != null; + if (flag24) + { + bool flag25 = array.Length > 1; + if (flag25) + { + this._parseTmpCmd.interalDelay = float.Parse(array[1]); + } + } + flag5 = true; + } + else + { + bool flag26 = text.StartsWith("ailin"); + if (flag26) + { + bool flag27 = this._parseTmpCmd != null; + if (flag27) + { + bool flag28 = array.Length > 1; + if (flag28) + { + this._parseTmpCmd.ailinText = array[1]; + } + bool flag29 = array.Length > 2; + if (flag29) + { + this._parseTmpCmd.ailinPos = int.Parse(array[2]); + } + bool flag30 = array.Length > 3; + if (flag30) + { + this._parseTmpCmd.ailinText2 = array[3]; + } + } + flag5 = true; + } + else + { + bool flag31 = text.StartsWith("buttomtext"); + if (flag31) + { + bool flag32 = this._parseTmpCmd != null; + if (flag32) + { + bool flag33 = array.Length > 1; + if (flag33) + { + this._parseTmpCmd.buttomtext = array[1]; + } + } + flag5 = true; + } + else + { + bool flag34 = text.StartsWith("pause"); + if (flag34) + { + bool flag35 = this._parseTmpCmd != null; + if (flag35) + { + this._parseTmpCmd.pause = true; + } + flag5 = true; + } + else + { + bool flag36 = text.StartsWith("audio"); + if (flag36) + { + bool flag37 = this._parseTmpCmd != null; + if (flag37) + { + bool flag38 = array.Length > 1; + if (flag38) + { + this._parseTmpCmd.audio = array[1]; + } + } + flag5 = true; + } + else + { + bool flag39 = text.StartsWith("skip"); + if (flag39) + { + bool flag40 = this._parseTmpCmd != null; + if (flag40) + { + bool flag41 = array.Length > 1; + if (flag41) + { + this._parseTmpCmd.skipCondition = array[1]; + } + bool flag42 = array.Length > 2; + if (flag42) + { + this._parseTmpCmd.skipParam1 = array[2]; + } + bool flag43 = array.Length > 3; + if (flag43) + { + this._parseTmpCmd.skipParam2 = array[3]; + } + bool flag44 = array.Length > 4; + if (flag44) + { + this._parseTmpCmd.skipParam3 = array[4]; + } + } + flag5 = true; + } + else + { + bool flag45 = text.StartsWith("scroll"); + if (flag45) + { + bool flag46 = this._parseTmpCmd != null; + if (flag46) + { + bool flag47 = array.Length > 1; + if (flag47) + { + this._parseTmpCmd.scroll = array[1]; + } + bool flag48 = array.Length > 2; + if (flag48) + { + this._parseTmpCmd.scrollPos = int.Parse(array[2]); + } + } + flag5 = true; + } + else + { + bool flag49 = text.StartsWith("function"); + if (flag49) + { + bool flag50 = this._parseTmpCmd != null; + if (flag50) + { + bool flag51 = array.Length > 1; + if (flag51) + { + this._parseTmpCmd.function = array[1]; + } + bool flag52 = array.Length > 2; + if (flag52) + { + this._parseTmpCmd.functionparam1 = array[2]; + } + } + flag5 = true; + } + else + { + bool flag53 = text.StartsWith("nodestroyoverlay"); + if (flag53) + { + this._parseTmpCmd.isCanDestroyOverlay = false; + flag5 = true; + } + else + { + bool flag54 = this._parseTmpCmd != null; + if (flag54) + { + for (int i = 0; i < this._validateCmd.Length; i++) + { + bool flag55 = array[0] == this._validateCmd[i]; + if (flag55) + { + this._parseTmpCmd.cmd = array[0]; + bool flag56 = array.Length > 1; + if (flag56) + { + this._parseTmpCmd.param1 = array[1]; + } + bool flag57 = array.Length > 2; + if (flag57) + { + this._parseTmpCmd.param2 = array[2]; + } + bool flag58 = array.Length > 3; + if (flag58) + { + this._parseTmpCmd.param3 = array[3]; + } + bool flag59 = array.Length > 4; + if (flag59) + { + this._parseTmpCmd.param4 = array[4]; + } + bool flag60 = array.Length > 5; + if (flag60) + { + this._parseTmpCmd.param5 = array[5]; + } + bool flag61 = array.Length > 6; + if (flag61) + { + this._parseTmpCmd.param6 = array[6]; + } + cmdQueue.Enqueue(this._parseTmpCmd); + xtutorialCmd = this._parseTmpCmd; + flag5 = true; + break; + } + } + } + else + { + flag5 = true; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + bool flag62 = !flag5; + if (flag62) + { + goto Block_63; + } + } + } + } + bool flag63 = xtutorialCmd != null; + if (flag63) + { + xtutorialCmd.bLastCmdInQueue = true; + xtutorialCmd.TutorialID = execStep; + bool flag64 = !flag; + if (flag64) + { + xtutorialCmd.step = execStep; + } + } + XSingleton.singleton.ClearStream(stream); + return true; + Block_63: + XSingleton.singleton.AddErrorLog(file, "Tutorial Format Error at line ", num.ToString(), " !", null, null); + XSingleton.singleton.ClearStream(stream); + return false; + } + + public bool Parse(string file, ref List cmdList, ref XBetterDictionary _SysTutorial) + { + XTutorialMainCmd xtutorialMainCmd = new XTutorialMainCmd(); + Stream stream = XSingleton.singleton.ReadText(file, ".txt", true); + StreamReader streamReader = new StreamReader(stream); + string text = streamReader.ReadLine(); + int num = 1; + for (;;) + { + text = streamReader.ReadLine(); + num++; + bool flag = text.StartsWith("end tutorial"); + if (flag) + { + break; + } + bool flag2 = text.Length == 0; + if (!flag2) + { + bool flag3 = text.StartsWith("--"); + if (!flag3) + { + string[] array = text.Split(XGlobalConfig.TabSeparator, StringSplitOptions.RemoveEmptyEntries); + bool flag4 = false; + bool flag5 = text.StartsWith("tutorial"); + if (flag5) + { + int savebit = int.Parse(array[1]); + xtutorialMainCmd = new XTutorialMainCmd(); + xtutorialMainCmd.savebit = savebit; + bool flag6 = array.Length > 2; + if (flag6) + { + xtutorialMainCmd.tag = array[2]; + } + else + { + xtutorialMainCmd.tag = "NULL"; + } + bool flag7 = array.Length > 3; + if (flag7) + { + xtutorialMainCmd.isMust = (array[3] == "must"); + } + else + { + xtutorialMainCmd.isMust = false; + } + xtutorialMainCmd.conditions = new List(); + xtutorialMainCmd.condParams = new List(); + flag4 = true; + } + else + { + bool flag8 = text.StartsWith("scond"); + if (flag8) + { + bool flag9 = xtutorialMainCmd != null; + if (flag9) + { + bool flag10 = array.Length > 1; + if (flag10) + { + XTutorialCmdExecuteCondition xtutorialCmdExecuteCondition = this.Str2Condition(array[1]); + xtutorialMainCmd.conditions.Add(xtutorialCmdExecuteCondition); + bool flag11 = array.Length > 2; + if (flag11) + { + xtutorialMainCmd.condParams.Add(array[2]); + bool flag12 = xtutorialCmdExecuteCondition == XTutorialCmdExecuteCondition.Sys_Notify; + if (flag12) + { + bool flag13 = array.Length > 3 && int.Parse(array[3]) > 0; + if (!flag13) + { + _SysTutorial.Add(uint.Parse(array[2]), xtutorialMainCmd); + } + } + } + else + { + xtutorialMainCmd.condParams.Add(""); + } + } + } + flag4 = true; + } + else + { + bool flag14 = text.StartsWith("exec"); + if (flag14) + { + bool flag15 = xtutorialMainCmd != null; + if (flag15) + { + xtutorialMainCmd.subTutorial = array[1]; + cmdList.Add(xtutorialMainCmd); + } + flag4 = true; + } + } + } + bool flag16 = !flag4; + if (flag16) + { + goto Block_16; + } + } + } + } + XSingleton.singleton.ClearStream(stream); + return true; + Block_16: + XSingleton.singleton.AddLog(file, "Tutorial Format Error at line ", num.ToString(), " !", null, null, XDebugColor.XDebug_None); + XSingleton.singleton.ClearStream(stream); + return false; + } + + private XTutorialCmdExecuteCondition Str2Condition(string strCondition) + { + bool flag = strCondition == "playerlevel"; + XTutorialCmdExecuteCondition result; + if (flag) + { + result = XTutorialCmdExecuteCondition.Player_Level; + } + else + { + bool flag2 = strCondition == "afterlevel"; + if (flag2) + { + result = XTutorialCmdExecuteCondition.After_Level; + } + else + { + bool flag3 = strCondition == "inlevel"; + if (flag3) + { + result = XTutorialCmdExecuteCondition.In_Level; + } + else + { + bool flag4 = strCondition == "musou"; + if (flag4) + { + result = XTutorialCmdExecuteCondition.Musou_Above; + } + else + { + bool flag5 = strCondition == "castskill"; + if (flag5) + { + result = XTutorialCmdExecuteCondition.Cast_Skill; + } + else + { + bool flag6 = strCondition == "exstring"; + if (flag6) + { + result = XTutorialCmdExecuteCondition.External_String; + } + else + { + bool flag7 = strCondition == "TalkingNpc"; + if (flag7) + { + result = XTutorialCmdExecuteCondition.Talk_Npc; + } + else + { + bool flag8 = strCondition == "accepttask"; + if (flag8) + { + result = XTutorialCmdExecuteCondition.Can_Accept_Task; + } + else + { + bool flag9 = strCondition == "dotaskbattle"; + if (flag9) + { + result = XTutorialCmdExecuteCondition.Task_Battle; + } + else + { + bool flag10 = strCondition == "taskscenefinished"; + if (flag10) + { + result = XTutorialCmdExecuteCondition.Task_Scene_Finish; + } + else + { + bool flag11 = strCondition == "taskover"; + if (flag11) + { + result = XTutorialCmdExecuteCondition.Task_Over; + } + else + { + bool flag12 = strCondition == "finishtask"; + if (flag12) + { + result = XTutorialCmdExecuteCondition.Can_Finish_Task; + } + else + { + bool flag13 = strCondition == "delay"; + if (flag13) + { + result = XTutorialCmdExecuteCondition.Time_Delay; + } + else + { + bool flag14 = strCondition == "SysNotify"; + if (flag14) + { + result = XTutorialCmdExecuteCondition.Sys_Notify; + } + else + { + bool flag15 = strCondition == "meetenemy"; + if (flag15) + { + result = XTutorialCmdExecuteCondition.Meet_Enemy; + } + else + { + bool flag16 = strCondition == "hastarget"; + if (flag16) + { + result = XTutorialCmdExecuteCondition.Has_Target; + } + else + { + bool flag17 = strCondition == "getfocus"; + if (flag17) + { + result = XTutorialCmdExecuteCondition.Get_Focused; + } + else + { + bool flag18 = strCondition == "artskill"; + if (flag18) + { + result = XTutorialCmdExecuteCondition.Art_Skill; + } + else + { + bool flag19 = strCondition == "superarmor0"; + if (flag19) + { + result = XTutorialCmdExecuteCondition.No_SuperAmor; + } + else + { + bool flag20 = strCondition == "cutsceneover"; + if (flag20) + { + result = XTutorialCmdExecuteCondition.Cutscene_Over; + } + else + { + bool flag21 = strCondition == "bossexist"; + if (flag21) + { + result = XTutorialCmdExecuteCondition.Boss_Exist; + } + else + { + bool flag22 = strCondition == "enemyonground"; + if (flag22) + { + result = XTutorialCmdExecuteCondition.Enemy_OnGround; + } + else + { + bool flag23 = strCondition == "nopromote"; + if (flag23) + { + result = XTutorialCmdExecuteCondition.No_Promote; + } + else + { + bool flag24 = strCondition == "team2"; + if (flag24) + { + result = XTutorialCmdExecuteCondition.Team2; + } + else + { + bool flag25 = strCondition == "MainUI"; + if (flag25) + { + result = XTutorialCmdExecuteCondition.MainUI; + } + else + { + bool flag26 = strCondition == "item"; + if (flag26) + { + result = XTutorialCmdExecuteCondition.Has_Item; + } + else + { + bool flag27 = strCondition == "hasbody"; + if (flag27) + { + result = XTutorialCmdExecuteCondition.Has_Body; + } + else + { + bool flag28 = strCondition == "nostackui"; + if (flag28) + { + result = XTutorialCmdExecuteCondition.No_Stackui; + } + else + { + bool flag29 = strCondition == "activityopen"; + if (flag29) + { + result = XTutorialCmdExecuteCondition.Activity_Open; + } + else + { + bool flag30 = strCondition == "dragoncrusadeopen"; + if (flag30) + { + result = XTutorialCmdExecuteCondition.Dragon_Crusade_Open; + } + else + { + bool flag31 = strCondition == "battleNPCtalkend"; + if (flag31) + { + result = XTutorialCmdExecuteCondition.Battle_NPC_Talk_End; + } + else + { + result = XTutorialCmdExecuteCondition.No_Condition; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return result; + } + + private XTutorialCmdFinishCondition Str2EndCondition(string strCondition) + { + bool flag = strCondition == "click"; + XTutorialCmdFinishCondition result; + if (flag) + { + result = XTutorialCmdFinishCondition.Click; + } + else + { + bool flag2 = strCondition == "time"; + if (flag2) + { + result = XTutorialCmdFinishCondition.Time; + } + else + { + bool flag3 = strCondition == "TalkingNpc"; + if (flag3) + { + result = XTutorialCmdFinishCondition.TalkingNpc; + } + else + { + bool flag4 = strCondition == "WorldMapShow"; + if (flag4) + { + result = XTutorialCmdFinishCondition.WorldMap; + } + else + { + bool flag5 = strCondition == "SkillLevelup"; + if (flag5) + { + result = XTutorialCmdFinishCondition.SkillLevelup; + } + else + { + bool flag6 = strCondition == "SkillBind"; + if (flag6) + { + result = XTutorialCmdFinishCondition.SkillBind; + } + else + { + bool flag7 = strCondition == "UseItem"; + if (flag7) + { + result = XTutorialCmdFinishCondition.UseItem; + } + else + { + bool flag8 = strCondition == "SysOpened"; + if (flag8) + { + result = XTutorialCmdFinishCondition.SysOpened; + } + else + { + bool flag9 = strCondition == "GetReward"; + if (flag9) + { + result = XTutorialCmdFinishCondition.GetReward; + } + else + { + bool flag10 = strCondition == "Move"; + if (flag10) + { + result = XTutorialCmdFinishCondition.Move; + } + else + { + bool flag11 = strCondition == "ComposeFashion"; + if (flag11) + { + result = XTutorialCmdFinishCondition.ComposeFashion; + } + else + { + bool flag12 = strCondition == "EnhanceItem"; + if (flag12) + { + result = XTutorialCmdFinishCondition.EnhanceItem; + } + else + { + bool flag13 = strCondition == "ReinforceItem"; + if (flag13) + { + result = XTutorialCmdFinishCondition.ReinforceItem; + } + else + { + bool flag14 = strCondition == "ChooseProf"; + if (flag14) + { + result = XTutorialCmdFinishCondition.ChangeProf; + } + else + { + bool flag15 = strCondition == "HasTeam"; + if (flag15) + { + result = XTutorialCmdFinishCondition.HasTeam; + } + else + { + bool flag16 = strCondition == "Smelting"; + if (flag16) + { + result = XTutorialCmdFinishCondition.Smelting; + } + else + { + bool flag17 = strCondition == "SelectView"; + if (flag17) + { + result = XTutorialCmdFinishCondition.SelectView; + } + else + { + bool flag18 = strCondition == "SelectSkipTutorial"; + if (flag18) + { + result = XTutorialCmdFinishCondition.SelectSkipTutorial; + } + else + { + result = XTutorialCmdFinishCondition.No_Condition; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return result; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdParser.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdParser.cs.meta new file mode 100644 index 00000000..e7d54d10 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdParser.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 30555c238eaed904f8fce1385df8cad8 +timeCreated: 1611403521 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialHelper.cs b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialHelper.cs new file mode 100644 index 00000000..6e174fa9 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialHelper.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XTutorialHelper : XSingleton + { + protected List _newOpenedSystem; + + public bool SkillLevelup; + + public bool SkillBind; + + public bool UseItem; + + public bool GetReward; + + public bool Moved; + + public bool ArtSkillOver; + + public bool MeetEnemy; + + public bool HasBoss; + + public bool HasTarget; + + public bool FashionCompose; + + public bool ReinforceItem; + + public bool EnhanceItem; + + public bool SwitchProf; + + public bool Smelting; + + public bool DragonCrusadeOpen; + + public bool HasTeam; + + public bool HitDownOnGround; + + public bool SelectView; + + public bool SelectSkipTutorial; + + public bool ActivityOpen; + + public bool BattleNPCTalkEnd; + + public override bool Init() + { + this._newOpenedSystem = new List(); + this.SkillLevelup = false; + this.SkillBind = false; + this.UseItem = false; + this.GetReward = false; + this.Moved = false; + this.MeetEnemy = false; + this.HasTarget = false; + this.ArtSkillOver = false; + this.HasBoss = false; + this.FashionCompose = false; + this.ReinforceItem = false; + this.EnhanceItem = false; + this.SwitchProf = false; + this.HasTeam = false; + this.Smelting = false; + this.ActivityOpen = false; + this.HitDownOnGround = false; + this.DragonCrusadeOpen = false; + this.BattleNPCTalkEnd = false; + this.SelectView = false; + this.SelectSkipTutorial = false; + return true; + } + + public void NextCmdClear() + { + XSingleton.singleton.BattleNPCTalkEnd = false; + } + + public override void Uninit() + { + this._newOpenedSystem.Clear(); + } + + public void AddNewOpenSystem(uint sysID) + { + this._newOpenedSystem.Add(sysID); + } + + public bool IsSysOpend(uint SysID) + { + for (int i = 0; i < this._newOpenedSystem.Count; i++) + { + bool flag = this._newOpenedSystem[i] == SysID; + if (flag) + { + return true; + } + } + return false; + } + + public static Vector2 BaseScreenPos2Real(Vector2 basePos) + { + float num = basePos.x / (float)XSingleton.singleton.Base_UI_Width * (float)Screen.width; + float num2 = basePos.y / (float)XSingleton.singleton.Base_UI_Height * (float)Screen.height; + return new Vector2(num, num2); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialHelper.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialHelper.cs.meta new file mode 100644 index 00000000..320ef5a3 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialHelper.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 500f1b3cad70e88488efa8ec4d272793 +timeCreated: 1611403702 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMainCmd.cs b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMainCmd.cs new file mode 100644 index 00000000..c187b24e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMainCmd.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +namespace XMainClient +{ + internal class XTutorialMainCmd + { + public int savebit; + + public string tag; + + public bool isMust; + + public List conditions; + + public List condParams; + + public string subTutorial; + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMainCmd.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMainCmd.cs.meta new file mode 100644 index 00000000..4ce08531 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMainCmd.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1bacd2064c5883946b81f72438ebc11a +timeCreated: 1611403317 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMgr.cs b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMgr.cs new file mode 100644 index 00000000..02e6baa2 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMgr.cs @@ -0,0 +1,489 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient +{ + public class XTutorialMgr : XSingleton, IXTutorial, IXInterface + { + public bool InTutorial + { + get + { + return this._currentCmd != null && this._currentCmd.state == XCmdState.Cmd_In_Process && this._currentCmd.cmd != "noforceclick"; + } + } + + public bool NeedTutorail { get; set; } + + public bool Exculsive { get; set; } + + public bool NoforceClick { get; set; } + + public bool ExculsiveOnGeneric { get; set; } + + public bool ExculsiveOnEntity { get; set; } + + public bool Deprecated { get; set; } + + private XTutorialCmdParser _parser; + + private XTutorialCmdExecutor _executor; + + private List _subTutorials; + + private Queue _subQueue; + + private XTutorialCmd _currentCmd; + + private static readonly uint TUTORIAL_CELL_MAX = 16u; + + public byte[] TutorialBitsArray = new byte[XTutorialMgr.TUTORIAL_CELL_MAX]; + + public List _externalString = new List(); + + private string _currentSubTutorial; + + private XBetterDictionary _SysIdToTutorial = new XBetterDictionary(0); + + private Dictionary SubTutorialExecution = new Dictionary(); + + private float _LastStartTutorial = 0f; + + public XTutorialMgr() + { + this.Exculsive = false; + this.NeedTutorail = false; + } + + public override bool Init() + { + return true; + } + + public override void Uninit() + { + this._externalString.Clear(); + this.SubTutorialExecution.Clear(); + bool flag = this._subTutorials != null; + if (flag) + { + this._subTutorials.Clear(); + } + bool flag2 = this._subQueue != null; + if (flag2) + { + this._subQueue.Clear(); + } + this._currentCmd = null; + this.NeedTutorail = false; + } + + public void OnLeaveScene() + { + bool flag = this._currentCmd != null && this._currentCmd.state == XCmdState.Cmd_In_Process; + if (flag) + { + this._executor.OnCmdFinish(ref this._currentCmd); + } + } + + public void Reset(byte[] tutorialBitsArray) + { + XSingleton.singleton.AttachInterface(XSingleton.singleton.XHash("XTutorial"), this); + this.Reset(); + this._parser = new XTutorialCmdParser(); + this._executor = new XTutorialCmdExecutor(); + this._subTutorials = new List(); + string file = "Table/Tutorial/TutorialEntrance"; + this._parser.Parse(file, ref this._subTutorials, ref this._SysIdToTutorial); + this.NeedTutorail = true; + int num = 0; + while ((long)num < (long)((ulong)XTutorialMgr.TUTORIAL_CELL_MAX)) + { + bool flag = tutorialBitsArray != null && tutorialBitsArray.Length > num; + if (flag) + { + this.TutorialBitsArray[num] = tutorialBitsArray[num]; + } + else + { + this.TutorialBitsArray[num] = 0; + } + num++; + } + XSingleton.singleton.Init(); + this.SubTutorialExecution.Clear(); + } + + private bool TutorialFinished(int bit) + { + bit--; + int num = bit % 8; + int num2 = bit / 8; + return ((int)this.TutorialBitsArray[num2] & 1 << num) > 0; + } + + protected void Reset() + { + this._currentCmd = null; + this._externalString.Clear(); + bool flag = this._subQueue != null; + if (flag) + { + this._subQueue.Clear(); + } + this.Exculsive = false; + this.NeedTutorail = false; + this.NoforceClick = false; + this.ExculsiveOnGeneric = false; + this._LastStartTutorial = 0f; + } + + public void NewSubQueue(string script, int savebit) + { + bool flag = this._subQueue == null; + if (flag) + { + this._subQueue = new Queue(); + } + this._subQueue.Clear(); + this._parser.Parse(script, 0, ref this._subQueue, savebit); + } + + public void AddSubQueue(string script, int savebit) + { + Queue queue = new Queue(); + this._parser.Parse(script, 0, ref queue, savebit); + bool flag = this._subQueue == null; + if (flag) + { + this._subQueue = new Queue(); + } + while (queue.Count > 0) + { + this._subQueue.Enqueue(queue.Dequeue()); + } + } + + protected bool SubTutorialExecuted(int id) + { + bool flag = this.SubTutorialExecution.ContainsKey(id); + return flag && this.SubTutorialExecution[id]; + } + + protected void SetSubTutorialExecution(int id) + { + bool flag = this.SubTutorialExecution.ContainsKey(id); + if (flag) + { + this.SubTutorialExecution[id] = true; + } + else + { + this.SubTutorialExecution.Add(id, true); + } + } + + private bool LookupNewTutorial() + { + for (int i = 0; i < this._subTutorials.Count; i++) + { + bool flag = this.TutorialFinished(this._subTutorials[i].savebit); + if (!flag) + { + bool flag2 = this.SubTutorialExecuted(this._subTutorials[i].savebit); + if (!flag2) + { + bool flag3 = this._executor.CanTutorialExecute(this._subTutorials[i]); + if (flag3) + { + this.SetSubTutorialExecution(this._subTutorials[i].savebit); + XOptionsDocument specificDocument = XDocuments.GetSpecificDocument(XOptionsDocument.uuID); + bool flag4 = specificDocument.GetValue(XOptionsDefine.OD_SKIP_TUTORIAL) == 1 && !this._subTutorials[i].isMust; + if (!flag4) + { + string script = "Table/Tutorial/" + this._subTutorials[i].subTutorial; + bool flag5 = Time.time - this._LastStartTutorial > 1f; + if (flag5) + { + bool flag6 = this._currentCmd != null; + if (flag6) + { + this.OnCmdFinished(); + } + bool flag7 = this._currentCmd != null && this._currentCmd.state == XCmdState.Cmd_In_Queue; + if (flag7) + { + this._currentCmd.state = XCmdState.Cmd_Finished; + } + this.NewSubQueue(script, this._subTutorials[i].savebit); + bool flag8 = this._subQueue != null && this._subQueue.Count > 0; + if (flag8) + { + this._currentCmd = this._subQueue.Dequeue(); + this._currentSubTutorial = this._subTutorials[i].subTutorial; + XSingleton.singleton.AddLog(string.Concat(new object[] + { + this._subTutorials[i].savebit, + ": ", + this._currentSubTutorial, + " start !" + }), null, null, null, null, null, XDebugColor.XDebug_None); + } + } + else + { + this.AddSubQueue(script, this._subTutorials[i].savebit); + XSingleton.singleton.AddLog(string.Concat(new object[] + { + this._subTutorials[i].savebit, + ": ", + this._subTutorials[i].subTutorial, + " append !" + }), null, null, null, null, null, XDebugColor.XDebug_None); + } + this._LastStartTutorial = Time.time; + return true; + } + XSingleton.singleton.AddLog(string.Concat(new object[] + { + this._subTutorials[i].savebit, + ": ", + this._subTutorials[i].subTutorial, + " skip" + }), null, null, null, null, null, XDebugColor.XDebug_None); + this.UpdateTutorialState(this._subTutorials[i].savebit); + } + } + } + } + return false; + } + + private XTutorialCmd FetchNewCmd() + { + XTutorialCmd result = null; + bool flag = this._subQueue != null && this._subQueue.Count > 0; + if (flag) + { + result = this._subQueue.Dequeue(); + } + XSingleton.singleton.NextCmdClear(); + return result; + } + + public bool IsNextCmdOverlay() + { + bool flag = this._subQueue == null || this._subQueue.Count == 0; + bool result; + if (flag) + { + result = false; + } + else + { + XTutorialCmd xtutorialCmd = this._subQueue.Peek(); + bool flag2 = xtutorialCmd != null && xtutorialCmd.cmd == "forceclick"; + result = flag2; + } + return result; + } + + public void SkipCurrentTutorial(bool isAll = false) + { + for (;;) + { + this.OnCmdFinished(); + this._currentCmd = this.FetchNewCmd(); + bool flag = this._currentCmd == null; + if (flag) + { + break; + } + bool bLastCmdInQueue = this._currentCmd.bLastCmdInQueue; + if (bLastCmdInQueue) + { + this.UpdateTutorialState(this._currentCmd.step); + bool flag2 = !isAll; + if (flag2) + { + goto Block_3; + } + } + } + return; + Block_3: + XSingleton.singleton.AddLog("Skip Current Tutorial:" + this._currentCmd.step, null, null, null, null, null, XDebugColor.XDebug_None); + this._currentCmd = this.FetchNewCmd(); + } + + public void CloseAllTutorial() + { + int num = 1; + while ((long)num < (long)((ulong)(8u * XTutorialMgr.TUTORIAL_CELL_MAX))) + { + this.UpdateTutorialState(num); + num++; + } + } + + public void ReExecuteCurrentCmd() + { + bool flag = this._currentCmd != null && this._currentCmd.state == XCmdState.Cmd_In_Process; + if (flag) + { + this._currentCmd.state = XCmdState.Cmd_In_Queue; + bool flag2 = this._executor.CanCmdExecute(this._currentCmd); + if (flag2) + { + this._executor.ExecuteCmd(ref this._currentCmd); + } + } + } + + public void Update() + { + bool flag = XSingleton.singleton.XConnect.GetSocketState() == SocketState.State_Closed; + if (flag) + { + bool flag2 = this._currentSubTutorial != "NewbieLevel"; + if (flag2) + { + this.SkipCurrentTutorial(false); + return; + } + } + bool flag3 = this.LookupNewTutorial(); + if (!flag3) + { + bool flag4 = this._currentCmd == null || this._currentCmd.state == XCmdState.Cmd_Finished; + if (flag4) + { + this._currentCmd = this.FetchNewCmd(); + } + } + bool flag5 = this._currentCmd != null && this._executor.CanCmdExecute(this._currentCmd); + if (flag5) + { + this._executor.ExecuteCmd(ref this._currentCmd); + } + bool flag6 = this._currentCmd != null && this._currentCmd.state == XCmdState.Cmd_In_Process; + if (flag6) + { + this._executor.UpdateCmd(ref this._currentCmd); + } + } + + public void OnTutorialClicked() + { + bool flag = this._currentCmd.endcondition == XTutorialCmdFinishCondition.No_Condition; + if (flag) + { + this.OnCmdFinished(); + } + } + + protected void UpdateTutorialState(int bit) + { + PtcC2G_UpdateTutorial ptcC2G_UpdateTutorial = new PtcC2G_UpdateTutorial(); + ptcC2G_UpdateTutorial.Data.tutorialID = (uint)bit; + XSingleton.singleton.Send(ptcC2G_UpdateTutorial); + bit--; + int num = bit % 8; + int num2 = bit / 8; + byte[] tutorialBitsArray = this.TutorialBitsArray; + int num3 = num2; + tutorialBitsArray[num3] |= (byte)(1 << num); + } + + public void OnCmdFinished() + { + bool flag = this._currentCmd != null && this._executor != null && this._currentCmd.state == XCmdState.Cmd_In_Process; + if (flag) + { + this._executor.OnCmdFinish(ref this._currentCmd); + XSingleton.singleton.AddLog("t step finished ", this._currentCmd.step.ToString(), ":", this._currentCmd.tag, null, null, XDebugColor.XDebug_None); + bool flag2 = this._currentCmd.step != -1; + if (flag2) + { + this.UpdateTutorialState(this._currentCmd.step); + } + } + } + + public void StopTutorial() + { + bool flag = this._currentCmd != null && this._executor != null && this._currentCmd.state == XCmdState.Cmd_In_Process; + if (flag) + { + this._executor.StopCmd(); + } + this.NeedTutorail = false; + XSingleton.singleton.DetachInterface(XSingleton.singleton.XHash("XTutorial")); + } + + public void SetExternalString(string str) + { + this._externalString.Add(str); + } + + public bool QueryExternalString(string str, bool autoRemove) + { + bool flag = false; + foreach (string a in this._externalString) + { + bool flag2 = a == str; + if (flag2) + { + flag = true; + } + } + bool flag3 = flag && autoRemove; + if (flag3) + { + this._externalString.Remove(str); + } + return flag; + } + + public bool IsImmediatelyOpenSystem(uint sysID) + { + XOptionsDocument specificDocument = XDocuments.GetSpecificDocument(XOptionsDocument.uuID); + XTutorialMainCmd xtutorialMainCmd; + bool flag = this._SysIdToTutorial.TryGetValue(sysID, out xtutorialMainCmd); + if (flag) + { + byte b = this.TutorialBitsArray[xtutorialMainCmd.savebit / 8]; + int num = xtutorialMainCmd.savebit % 8; + bool flag2 = ((int)b & 1 << num) != 0; + if (flag2) + { + return true; + } + bool flag3 = specificDocument.GetValue(XOptionsDefine.OD_SKIP_TUTORIAL) == 0 || xtutorialMainCmd.isMust; + if (flag3) + { + return false; + } + } + return true; + } + + public int GetCurrentCmdStep() + { + bool flag = this._currentCmd == null || this._currentCmd.state == XCmdState.Cmd_Finished; + int result; + if (flag) + { + result = 0; + } + else + { + result = this._currentCmd.mainTutorialBit; + } + return result; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMgr.cs.meta b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMgr.cs.meta new file mode 100644 index 00000000..fccb8c66 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialMgr.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f2b6b5df12255074ab867ca653e20874 +timeCreated: 1611404844 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: -- cgit v1.1-26-g67d0