File size: 6,429 Bytes
b6a38d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
-- ========== GENERATED BY XTemplate Editor (Alt-F3) DO NOT EDIT MANUALLY! ==========

PlaceObj('XTemplate', {
	__is_kind_of = "XWindow",
	group = "Common",
	id = "Showcase",
	recreate_after_save = true,
	save_in = "Common",
	PlaceObj('XTemplateWindow', {
		'__class', "XDialog",
		'Dock', "box",
	}, {
		PlaceObj('XTemplateLayer', {
			'layer', "Fade",
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "Close",
			'ActionShortcut', "Escape",
			'ActionGamepad', "ButtonB",
			'OnAction', function (self, host, source, ...)
				if host.context and host.context.quit_game and not Paltform.developer then
					CreateRealTimeThread(QuitGame)
				else
					host:Close()
				end
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "Prev",
			'ActionShortcut', "Backspace",
			'ActionGamepad', "Left",
			'OnAction', function (self, host, source, ...)
				host:CameraShowPrev()
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "Next",
			'ActionShortcut', "Space",
			'ActionGamepad', "Right",
			'OnAction', function (self, host, source, ...)
				host:CameraShowNext()
			end,
		}),
		PlaceObj('XTemplateFunc', {
			'name', "CameraShowPrev(self)",
			'func', function (self)
				if self.current_order > 1 then
					self:CameraShow(self.current_order - 1, 200)
				end
			end,
		}),
		PlaceObj('XTemplateFunc', {
			'name', "CameraShowNext(self)",
			'func', function (self)
				local context = self:GetContext()
				if self.current_order < #GetShowcaseCameras(context) then
					self:CameraShow(self.current_order + 1, 200)
				end
			end,
		}),
		PlaceObj('XTemplateFunc', {
			'name', "CameraShow(self, order, delay)",
			'func', function (self, order, delay)
				local context = self:GetContext()
				local cameras = GetShowcaseCameras(context)
				if #cameras == 0 then 
					return 
				end
				
				self:DeleteThread("SwitchCameraButtonThread")
				self:CreateThread("SwitchCameraButtonThread",function()
					Sleep(delay or -1)
					order = Clamp(order, 1, #cameras)
					local old_camera = cameras[self.current_order]
					self.current_order = order
					self:ResolveId("idPrevCamera"):SetEnabled(order > 1)
					self:ResolveId("idNextCamera"):SetEnabled(order < #cameras)
					local camera = cameras[order]
					SwitchToCamera(camera, old_camera, function()
						self:ResolveId("idTitle"):SetText(camera.display_name)
						self:ResolveId("idDescription"):SetText(camera.description)
						if camera.map ~= GetMapName() then
							ChangeMap(camera.map)
						end
					end)
				end)
			end,
		}),
		PlaceObj('XTemplateFunc', {
			'name', "OnDelete",
			'func', function (self, ...)
				local context = self:GetContext()
				local cameras = GetShowcaseCameras(context)
				local old_camera = cameras[self.current_order]
				CameraShowClose(old_camera)
				CloseDialog("Fade")
				if self.context and self.context.main_menu then
					CreateRealTimeThread(function()
						OpenPreGameMainMenu()
					end)
				end
			end,
		}),
		PlaceObj('XTemplateFunc', {
			'name', "Open",
			'func', function (self, ...)
				self.current_order=0
				XDialog.Open(self, ...)
			end,
		}),
		PlaceObj('XTemplateWindow', {
			'Dock', "bottom",
			'HAlign', "center",
			'LayoutMethod', "VOverlappingList",
		}, {
			PlaceObj('XTemplateWindow', {
				'__class', "XFrame",
				'Id', "idFrameDescription",
				'IdNode', false,
				'HAlign', "center",
				'MaxWidth', 800,
				'Image', "CommonAssets/UI/rollover_pad",
				'FrameBox', box(170, 10, 170, 10),
			}, {
				PlaceObj('XTemplateWindow', {
					'Dock', "bottom",
					'MaxWidth', 1200,
					'LayoutMethod', "HList",
					'LayoutHSpacing', 60,
				}),
				PlaceObj('XTemplateWindow', {
					'__class', "XText",
					'Id', "idDescription",
					'Padding', box(15, 15, 15, 15),
					'HAlign', "center",
					'VAlign', "bottom",
					'MaxWidth', 700,
					'FocusedBorderColor', RGBA(0, 203, 255, 255),
					'TextStyle', "UIShowcaseDescription",
					'Translate', true,
					'HideOnEmpty', true,
					'TextVAlign', "center",
				}),
				}),
			PlaceObj('XTemplateWindow', {
				'__class', "XFrame",
				'Id', "idFrameTitle",
				'IdNode', false,
				'HAlign', "center",
				'MinWidth', 800,
				'MaxWidth', 1200,
				'Image', "CommonAssets/UI/conversation_title_pad",
				'FrameBox', box(170, 10, 170, 10),
			}, {
				PlaceObj('XTemplateWindow', {
					'Dock', "bottom",
					'MinWidth', 800,
					'MaxWidth', 1200,
					'LayoutMethod', "HList",
					'LayoutHSpacing', 60,
				}, {
					PlaceObj('XTemplateWindow', {
						'__class', "XTextButton",
						'RolloverText', T(960397893118, --[[XTemplate Showcase RolloverText]] "Switch to Previous Camera"),
						'Id', "idPrevCamera",
						'Padding', box(50, 0, 0, 0),
						'HAlign', "left",
						'VAlign', "center",
						'Background', RGBA(0, 0, 0, 0),
						'OnPressEffect', "action",
						'OnPress', function (self, gamepad)
							local dlg = GetDialog(self)
							dlg:CameraShowPrev()
						end,
						'RolloverBackground', RGBA(0, 0, 0, 0),
						'PressedBackground', RGBA(0, 0, 0, 0),
						'TextStyle', "UIShowcaseButton",
						'Translate', true,
						'Text', T(903115540821, --[[XTemplate Showcase Text]] "Previous"),
					}),
					PlaceObj('XTemplateWindow', {
						'__class', "XText",
						'Id', "idTitle",
						'HAlign', "center",
						'VAlign', "center",
						'MinWidth', 400,
						'MaxWidth', 400,
						'FocusedBorderColor', RGBA(0, 203, 255, 255),
						'TextStyle', "UIShowcaseTitle",
						'Translate', true,
						'Text', T(979866910351, --[[XTemplate Showcase Text]] "Camera Name"),
						'TextHAlign', "center",
					}),
					PlaceObj('XTemplateWindow', {
						'__class', "XTextButton",
						'RolloverText', T(125695954743, --[[XTemplate Showcase RolloverText]] "Switch to Next Camera"),
						'Id', "idNextCamera",
						'Padding', box(-10, 0, 0, 0),
						'HAlign', "right",
						'VAlign', "center",
						'Background', RGBA(0, 0, 0, 0),
						'OnPressEffect', "action",
						'OnPress', function (self, gamepad)
							local dlg = GetDialog(self)
							dlg:CameraShowNext()
						end,
						'RolloverBackground', RGBA(0, 0, 0, 0),
						'PressedBackground', RGBA(0, 0, 0, 0),
						'TextStyle', "UIShowcaseButton",
						'Translate', true,
						'Text', T(239811146752, --[[XTemplate Showcase Text]] "Next"),
					}),
					}),
				}),
			}),
		PlaceObj('XTemplateCode', {
			'run', function (self, parent, context)
				parent:CameraShow(1, -1, context)
			end,
		}),
		}),
})