File size: 3,811 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
-- ========== GENERATED BY XTemplate Editor (Alt-F3) DO NOT EDIT MANUALLY! ==========

PlaceObj('XTemplate', {
	RequireActionSortKeys = true,
	group = "GedApps",
	id = "GedParticleEditor",
	save_in = "Ged",
	PlaceObj('XTemplateTemplate', {
		'__template', "PresetEditor",
	}, {
		PlaceObj('XTemplateFunc', {
			'name', "SetIsUIParticle",
			'func', function (self, ...)
				local params = pack_params(...)
				local value = params and params[1]
				self.is_ui_particle = value
				self:ActionsUpdated()
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "NewParam",
			'ActionSortKey', "2",
			'ActionTranslate', false,
			'ActionName', "New Param",
			'ActionIcon', "CommonAssets/UI/Ged/cog.tga",
			'ActionToolbar', "main",
			'OnAction', function (self, host, source, ...)
				if host.idPresets:GetSelection() then
					host:Op("GedOpListNewItemInClass", "SelectedPreset", host.idPresetContent:GetSelection() or 0, "ParticleParam", "ParticleSystemPreset")
				end
			end,
			'__condition', function (parent, context) return not config.ModdingToolsInUserMode end,
		}),
		PlaceObj('XTemplateCode', {
			'run', function (self, parent, context)
				local detail_levels = OptionsData.Options.Effects
				local detail_level_names = {"Low", "Medium", "High", "Ultra"}
				for name_idx, detail_name in ipairs(detail_level_names) do
					local idx = table.find(detail_levels, "value", detail_name)
					assert(idx)
					XAction:new({
						ActionId = "Preview" .. idx,
						ActionToolbar = "main",
						ActionName = "Preview " .. detail_levels[idx].value,
						ActionTranslate = false,
						ActionToolbarSplit = name_idx == #detail_level_names,
						ActionIcon = "CommonAssets/UI/Ged/preview-level-0" .. name_idx .. ".tga",
						ActionSortKey = "2",
						OnAction = function(self, host, win, toggled)
							host:Send("GedSetParticleEmitDetail", detail_levels[idx].value)
						end,
						ActionToggle = true,
						ActionToggled = function (self, host)
							return host.actions_toggled["Preview" .. detail_levels[idx].value]
						end,
					}, parent)
				end
			end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "TestUIParticle",
			'ActionSortKey', "2",
			'ActionTranslate', false,
			'ActionName', "Test UI Particle",
			'ActionIcon', "CommonAssets/UI/Ged/play.tga",
			'ActionToolbar', "main",
			'ActionToggle', true,
			'ActionToggled', function (self, host)
				return host.actions_toggled["TestUIParticle"]
			end,
			'ActionState', function (self, host)
				if host.is_ui_particle then
					return false
				end
				return "hidden"
			end,
			'OnAction', function (self, host, source, ...)
				host.actions_toggled["TestUIParticle"] = not host.actions_toggled["TestUIParticle"]
				host:Send("GedTestUIParticle", host.actions_toggled["TestUIParticle"])
			end,
			'__condition', function (parent, context) return not config.ModdingToolsInUserMode end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "GedResetAllParticleSystemInstances",
			'ActionSortKey', "2",
			'ActionTranslate', false,
			'ActionName', "Reset all particles",
			'ActionIcon', "CommonAssets/UI/Ged/view.tga",
			'ActionToolbar', "main",
			'OnAction', function (self, host, source, ...)
				host:Send("GedResetAllParticleSystemInstances")
			end,
			'__condition', function (parent, context) return not config.ModdingToolsInUserMode end,
		}),
		PlaceObj('XTemplateAction', {
			'ActionId', "Commit",
			'ActionSortKey', "2",
			'ActionTranslate', false,
			'ActionName', "Commit",
			'ActionIcon', "CommonAssets/UI/Ged/commit.tga",
			'ActionMenubar', "File",
			'ActionToolbar', "main",
			'OnAction', function (self, host, source, ...)
				host:Send("GedParticleSystemPresetCommit")
			end,
			'__condition', function (parent, context) return not config.ModdingToolsInUserMode end,
		}),
		}),
})