summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs
blob: db19b9149e5a2d2135e4c7aa0f6271a555d474ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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()
		{
		}
	}
}