File size: 7,507 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
225
226
227
228
229
230
231
232
233
234
235
-- ========== GENERATED BY XTemplate Editor (Alt-F3) DO NOT EDIT MANUALLY! ==========

PlaceObj('XTemplate', {
	group = "Zulu Dev",
	id = "ModEditorCheats",
	save_in = "GameGed",
	PlaceObj('XTemplateAction', {
		'ActionId', "General",
		'ActionTranslate', false,
		'ActionName', "General",
		'OnActionEffect', "popup",
		'OnAction', function (self, host, source, ...)
			local effect = self.OnActionEffect
			local param = self.OnActionParam
			if effect == "close" and host and host.window_state ~= "destroying" then
				host:Close(param ~= "" and param or nil, source, ...)
			elseif effect == "mode" and host then
				assert(IsKindOf(host, "XDialog"))
				host:SetMode(param)
			elseif effect == "back" and host then
				assert(IsKindOf(host, "XDialog"))
				SetBackDialogMode(host)
			elseif effect == "popup" then
				local actions_view = GetParentOfKind(source, "XActionsView")
				if actions_view then
					actions_view:PopupAction(self.ActionId, host, source)
				else
					XShortcutsTarget:OpenPopupMenu(self.ActionId, terminal.GetMousePos())
				end
			else
				--print(self.ActionId, "activated")
			end
		end,
	}, {
		PlaceObj('XTemplateAction', {
			'ActionId', "NewGameMod",
			'ActionTranslate', false,
			'ActionName', "New game (mod testing)",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatNewModGame", "normal")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "QuickstartMod",
			'ActionTranslate', false,
			'ActionName', "New game (mod testing) - quickstart",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatNewModGame", "quickstart")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "TestExploration",
			'ActionTranslate', false,
			'ActionName', "Place test mercs",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatTestExploration")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "Teleport",
			'ActionTranslate', false,
			'ActionName', "Enable teleport (toggle) Ctrl-T",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatEnable", "Teleport")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "Money",
			'ActionTranslate', false,
			'ActionName', "Add money",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatActivate", "CheatGetMoney")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "LevelUp",
			'ActionTranslate', false,
			'ActionName', "Level up selected merc",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatActivate", "CheatLevelUp")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "AddAmmo",
			'ActionTranslate', false,
			'ActionName', "Add all ammo",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatActivate", "CheatAddAmmo")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "AddMerc",
			'ActionTranslate', false,
			'ActionName', "Add merc",
			'OnActionEffect', "popup",
		}, {
			PlaceObj('XTemplateForEach', {
				'array', function (parent, context) return GetActionsHost(parent).mercs end,
				'__context', function (parent, context, item, i, n)
					return context
				end,
				'run_after', function (child, context, item, i, n, last)
					child.ActionId = item
					child.ActionName = item
					child.OnAction = function (self, host, source)
						host:Op("GedOpTriggerCheat", "root", "CheatAddMerc", item)
					end
				end,
			}, {
				PlaceObj('XTemplateAction', {
					'ActionTranslate', false,
				}),
				}),
			}),
		PlaceObj('XTemplateAction', {
			'ActionId', "AddItem",
			'ActionTranslate', false,
			'ActionName', "Add inventory item",
			'OnActionEffect', "popup",
		}, {
			PlaceObj('XTemplateForEach', {
				'array', function (parent, context) return GetActionsHost(parent).items end,
				'__context', function (parent, context, item, i, n)
					return context
				end,
				'run_after', function (child, context, item, i, n, last)
					child.ActionId = item
					child.ActionName = item
					child.OnAction = function (self, host, source)
						host:Op("GedOpTriggerCheat", "root", "CheatAddItem", item)
					end
				end,
			}, {
				PlaceObj('XTemplateAction', {
					'ActionTranslate', false,
				}),
				}),
			}),
		PlaceObj('XTemplateAction', {
			'ActionId', "FlyCameraToggle",
			'ActionTranslate', false,
			'ActionName', "Fly camera (toggle) Shift-C",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatToggleFlyCamera")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "IsolatedScreenshot",
			'ActionTranslate', false,
			'ActionName', "Isolated object screenshot (Ctrl-Alt-PrtScr)",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatIsolatedScreenshot")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "ResetMap",
			'ActionTranslate', false,
			'ActionName', "Reset to mod editor map",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatResetMap")
			end,
		}),
		}),
	PlaceObj('XTemplateAction', {
		'ActionId', "Combat",
		'ActionTranslate', false,
		'ActionName', "Combat",
		'OnActionEffect', "popup",
		'OnAction', function (self, host, source, ...)
			local effect = self.OnActionEffect
			local param = self.OnActionParam
			if effect == "close" and host and host.window_state ~= "destroying" then
				host:Close(param ~= "" and param or nil, source, ...)
			elseif effect == "mode" and host then
				assert(IsKindOf(host, "XDialog"))
				host:SetMode(param)
			elseif effect == "back" and host then
				assert(IsKindOf(host, "XDialog"))
				SetBackDialogMode(host)
			elseif effect == "popup" then
				local actions_view = GetParentOfKind(source, "XActionsView")
				if actions_view then
					actions_view:PopupAction(self.ActionId, host, source)
				else
					XShortcutsTarget:OpenPopupMenu(self.ActionId, terminal.GetMousePos())
				end
			else
				--print(self.ActionId, "activated")
			end
		end,
	}, {
		PlaceObj('XTemplateAction', {
			'ActionId', "GodMode",
			'ActionTranslate', false,
			'ActionName', "God mode (toggle)",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatEnable", "GodMode", "player1")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "InfiniteAP",
			'ActionTranslate', false,
			'ActionName', "Infinite AP (toggle)",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatEnable", "InfiniteAP", "player1")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "AlwaysHit",
			'ActionTranslate', false,
			'ActionName', "Always hit (toggle)",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatEnable", "AlwaysHit")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "AlwaysMiss",
			'ActionTranslate', false,
			'ActionName', "Always miss (toggle)",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatEnable", "AlwaysMiss")
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "SpawnEnemy",
			'ActionTranslate', false,
			'ActionName', "Spawn enemy",
			'OnAction', function (self, host, source, ...)
				host:Op("GedOpTriggerCheat", "root", "CheatSpawnEnemy")
			end,
		}),
		}),
})