summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs178
1 files changed, 178 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs b/Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs
new file mode 100644
index 00000000..db19b914
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs
@@ -0,0 +1,178 @@
+using System;
+using System.Collections.Generic;
+using KKSG;
+using MiniJSON;
+using UnityEngine;
+using XMainClient.UI;
+using XMainClient.UI.UICommon;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class X3DTouchMgr : XSingleton<X3DTouchMgr>
+ {
+ private float _last_touch_time = 0f;
+
+ private float _pointx = 0f;
+
+ private float _pointy = 0f;
+
+ public void OnProcess3DTouch(string msg = "")
+ {
+ bool flag = Time.time - this._last_touch_time < 1f;
+ if (!flag)
+ {
+ this._last_touch_time = Time.time;
+ bool flag2 = XSingleton<XChatIFlyMgr>.singleton.IsRecording() || XSingleton<XChatApolloMgr>.singleton.IsInRecordingState;
+ if (!flag2)
+ {
+ bool flag3 = !XSingleton<XGameSysMgr>.singleton.IsSystemOpened(XSysDefine.XSys_Photo);
+ if (!flag3)
+ {
+ XSingleton<XDebug>.singleton.AddLog("The dict: ", msg, null, null, null, null, XDebugColor.XDebug_None);
+ bool flag4 = !string.IsNullOrEmpty(msg);
+ if (flag4)
+ {
+ Dictionary<string, object> dictionary = Json.Deserialize(msg) as Dictionary<string, object>;
+ bool flag5 = dictionary != null && dictionary.ContainsKey("data");
+ if (flag5)
+ {
+ Dictionary<string, object> dictionary2 = dictionary["data"] as Dictionary<string, object>;
+ bool flag6 = dictionary2 != null;
+ if (flag6)
+ {
+ bool flag7 = dictionary2.ContainsKey("index_x") && dictionary2["index_x"] != null;
+ if (flag7)
+ {
+ string s = dictionary2["index_x"].ToString();
+ float.TryParse(s, out this._pointx);
+ }
+ bool flag8 = dictionary2.ContainsKey("index_y") && dictionary2["index_y"] != null;
+ if (flag8)
+ {
+ string s2 = dictionary2["index_y"].ToString();
+ float.TryParse(s2, out this._pointy);
+ }
+ float num = 2f;
+ bool flag9 = Screen.height == 1080 && Screen.width == 1920;
+ if (flag9)
+ {
+ num = 2.6f;
+ }
+ this._pointx *= num;
+ this._pointy = (float)Screen.height - this._pointy * num;
+ }
+ }
+ }
+ XSingleton<XDebug>.singleton.AddLog("Process 3d touch", null, null, null, null, null, XDebugColor.XDebug_None);
+ bool flag10 = XSingleton<XSceneMgr>.singleton.IsPVPScene() || XSingleton<XSceneMgr>.singleton.IsPVEScene();
+ if (flag10)
+ {
+ bool flag11 = XSingleton<XScene>.singleton.GameCamera != null && XSingleton<XEntityMgr>.singleton.Player != null;
+ if (flag11)
+ {
+ Vector2 vector;
+ vector= new Vector3(this._pointx, this._pointy);
+ XSingleton<XDebug>.singleton.AddLog("Touch screen pos: ", vector.x.ToString(), ", y:", vector.y.ToString(), null, null, XDebugColor.XDebug_None);
+ XSingleton<XDebug>.singleton.AddLog("Is touch on ui: ", XTouch.PointOnUI(vector).ToString(), null, null, null, null, XDebugColor.XDebug_None);
+ bool flag12 = !XTouch.PointOnUI(vector);
+ if (flag12)
+ {
+ bool flag13 = XSingleton<XVirtualTab>.singleton.Feeding && vector.x <= (float)(Screen.width / 2);
+ if (!flag13)
+ {
+ bool flag14 = XSingleton<XScene>.singleton.GameCamera.BackToPlayer();
+ bool flag15 = !flag14;
+ if (flag15)
+ {
+ XSingleton<UiUtility>.singleton.ShowSystemTip(XSingleton<XStringTable>.singleton.GetString("ERR_CAMERA_ROT"), "fece00");
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ SceneType sceneType = XSingleton<XScene>.singleton.SceneType;
+ if (sceneType <= SceneType.SCENE_GUILD_HALL)
+ {
+ if (sceneType != SceneType.SCENE_HALL && sceneType != SceneType.SCENE_GUILD_HALL)
+ {
+ goto IL_348;
+ }
+ }
+ else if (sceneType != SceneType.SCENE_FAMILYGARDEN && sceneType != SceneType.SCENE_LEISURE)
+ {
+ goto IL_348;
+ }
+ this.OnProcessScreenShot(msg);
+ IL_348:;
+ }
+ }
+ }
+ }
+ }
+
+ private void OnProcessScreenShot(string msg)
+ {
+ bool flag = XSingleton<XVirtualTab>.singleton.Feeding && this._pointx <= (float)(Screen.width / 2);
+ if (!flag)
+ {
+ bool flag2 = DlgBase<GuildTerritoryMainDlg, GuildTerritoryMainBehaviour>.singleton.IsLoaded() && DlgBase<GuildTerritoryMainDlg, GuildTerritoryMainBehaviour>.singleton.IsVisible();
+ if (!flag2)
+ {
+ bool flag3 = DlgBase<SuperRiskDlg, SuperRiskDlgBehaviour>.singleton.IsLoaded() && DlgBase<SuperRiskDlg, SuperRiskDlgBehaviour>.singleton.IsVisible();
+ if (!flag3)
+ {
+ bool flag4 = DlgBase<DungeonSelect, DungeonSelectBehaviour>.singleton.IsLoaded() && DlgBase<DungeonSelect, DungeonSelectBehaviour>.singleton.IsVisible();
+ if (!flag4)
+ {
+ bool flag5 = DlgBase<XTeamView, TabDlgBehaviour>.singleton.IsLoaded() && DlgBase<XTeamView, TabDlgBehaviour>.singleton.IsVisible();
+ if (!flag5)
+ {
+ bool flag6 = DlgBase<SevenLoginDlg, SevenLoginBehaviour>.singleton.IsLoaded() && DlgBase<SevenLoginDlg, SevenLoginBehaviour>.singleton.IsVisible();
+ if (flag6)
+ {
+ DlgBase<SevenLoginDlg, SevenLoginBehaviour>.singleton.SetVisible(false, true);
+ }
+ bool flag7 = DlgBase<XOptionsView, XOptionsBehaviour>.singleton.IsLoaded() && DlgBase<XOptionsView, XOptionsBehaviour>.singleton.IsVisible();
+ if (flag7)
+ {
+ DlgBase<XOptionsView, XOptionsBehaviour>.singleton.SetVisible(false, true);
+ }
+ bool flag8 = DlgBase<TitleDlg, TitleDlgBehaviour>.singleton.IsLoaded() && DlgBase<TitleDlg, TitleDlgBehaviour>.singleton.IsVisible();
+ if (flag8)
+ {
+ DlgBase<TitleDlg, TitleDlgBehaviour>.singleton.SetVisibleWithAnimation(false, null);
+ }
+ bool flag9 = DlgBase<CarnivalDlg, CarnivalBehavior>.singleton.IsLoaded() && DlgBase<CarnivalDlg, CarnivalBehavior>.singleton.IsVisible();
+ if (flag9)
+ {
+ DlgBase<CarnivalDlg, CarnivalBehavior>.singleton.SetVisible(false, true);
+ }
+ bool flag10 = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsLoaded() && DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsVisible() && DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.fakeShow;
+ if (flag10)
+ {
+ DlgBase<ScreenShotShareView, ScreenShotShareBehaviour>.singleton.SetVisible(true, true);
+ DlgBase<ScreenShotShareView, ScreenShotShareBehaviour>.singleton.ShowMainView();
+ }
+ else
+ {
+ bool flag11 = DlgBase<ScreenShotShareView, ScreenShotShareBehaviour>.singleton.IsInReadyScreenShowView();
+ if (flag11)
+ {
+ DlgBase<ScreenShotShareView, ScreenShotShareBehaviour>.singleton.IOS3DTouchScreenShot();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void OnCameraStraightForward()
+ {
+ }
+ }
+}