TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ UIModPackItem()

Terraria.ModLoader.UI.UIModPackItem.UIModPackItem ( string name,
string[] mods,
bool legacy,
IEnumerable< LocalMod > localMods )
inline

Definition at line 68 of file UIModPackItem.cs.

69 {
70 //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
71 //IL_00da: Unknown result type (might be due to invalid IL or missing references)
72 //IL_00df: Unknown result type (might be due to invalid IL or missing references)
73 //IL_01cc: Unknown result type (might be due to invalid IL or missing references)
74 //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
75 //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
76 //IL_01dc: Unknown result type (might be due to invalid IL or missing references)
77 //IL_01e0: Unknown result type (might be due to invalid IL or missing references)
78 //IL_01e6: Unknown result type (might be due to invalid IL or missing references)
79 //IL_01ea: Unknown result type (might be due to invalid IL or missing references)
80 //IL_01f0: Unknown result type (might be due to invalid IL or missing references)
81 //IL_028d: Unknown result type (might be due to invalid IL or missing references)
82 //IL_0293: Unknown result type (might be due to invalid IL or missing references)
83 //IL_0297: Unknown result type (might be due to invalid IL or missing references)
84 //IL_029d: Unknown result type (might be due to invalid IL or missing references)
85 //IL_02a1: Unknown result type (might be due to invalid IL or missing references)
86 //IL_02a7: Unknown result type (might be due to invalid IL or missing references)
87 //IL_02ab: Unknown result type (might be due to invalid IL or missing references)
88 //IL_02b1: Unknown result type (might be due to invalid IL or missing references)
89 //IL_0366: Unknown result type (might be due to invalid IL or missing references)
90 //IL_036c: Unknown result type (might be due to invalid IL or missing references)
91 //IL_0370: Unknown result type (might be due to invalid IL or missing references)
92 //IL_0376: Unknown result type (might be due to invalid IL or missing references)
93 //IL_037a: Unknown result type (might be due to invalid IL or missing references)
94 //IL_0380: Unknown result type (might be due to invalid IL or missing references)
95 //IL_0384: Unknown result type (might be due to invalid IL or missing references)
96 //IL_038a: Unknown result type (might be due to invalid IL or missing references)
97 //IL_043f: Unknown result type (might be due to invalid IL or missing references)
98 //IL_0445: Unknown result type (might be due to invalid IL or missing references)
99 //IL_0449: Unknown result type (might be due to invalid IL or missing references)
100 //IL_044f: Unknown result type (might be due to invalid IL or missing references)
101 //IL_0453: Unknown result type (might be due to invalid IL or missing references)
102 //IL_0459: Unknown result type (might be due to invalid IL or missing references)
103 //IL_045d: Unknown result type (might be due to invalid IL or missing references)
104 //IL_0463: Unknown result type (might be due to invalid IL or missing references)
105 //IL_0518: Unknown result type (might be due to invalid IL or missing references)
106 //IL_051e: Unknown result type (might be due to invalid IL or missing references)
107 //IL_0522: Unknown result type (might be due to invalid IL or missing references)
108 //IL_0528: Unknown result type (might be due to invalid IL or missing references)
109 //IL_052c: Unknown result type (might be due to invalid IL or missing references)
110 //IL_0532: Unknown result type (might be due to invalid IL or missing references)
111 //IL_0536: Unknown result type (might be due to invalid IL or missing references)
112 //IL_053c: Unknown result type (might be due to invalid IL or missing references)
113 //IL_0647: Unknown result type (might be due to invalid IL or missing references)
114 //IL_064d: Unknown result type (might be due to invalid IL or missing references)
115 //IL_0651: Unknown result type (might be due to invalid IL or missing references)
116 //IL_0657: Unknown result type (might be due to invalid IL or missing references)
117 //IL_065b: Unknown result type (might be due to invalid IL or missing references)
118 //IL_0661: Unknown result type (might be due to invalid IL or missing references)
119 //IL_0665: Unknown result type (might be due to invalid IL or missing references)
120 //IL_066b: Unknown result type (might be due to invalid IL or missing references)
121 //IL_0720: Unknown result type (might be due to invalid IL or missing references)
122 //IL_0726: Unknown result type (might be due to invalid IL or missing references)
123 //IL_072a: Unknown result type (might be due to invalid IL or missing references)
124 //IL_0730: Unknown result type (might be due to invalid IL or missing references)
125 //IL_0734: Unknown result type (might be due to invalid IL or missing references)
126 //IL_073a: Unknown result type (might be due to invalid IL or missing references)
127 //IL_073e: Unknown result type (might be due to invalid IL or missing references)
128 //IL_0744: Unknown result type (might be due to invalid IL or missing references)
129 //IL_07f9: Unknown result type (might be due to invalid IL or missing references)
130 //IL_07ff: Unknown result type (might be due to invalid IL or missing references)
131 //IL_0803: Unknown result type (might be due to invalid IL or missing references)
132 //IL_0809: Unknown result type (might be due to invalid IL or missing references)
133 //IL_080d: Unknown result type (might be due to invalid IL or missing references)
134 //IL_0813: Unknown result type (might be due to invalid IL or missing references)
135 //IL_0817: Unknown result type (might be due to invalid IL or missing references)
136 //IL_081d: Unknown result type (might be due to invalid IL or missing references)
137 //IL_08ec: Unknown result type (might be due to invalid IL or missing references)
138 //IL_08f2: Unknown result type (might be due to invalid IL or missing references)
139 //IL_08f6: Unknown result type (might be due to invalid IL or missing references)
140 //IL_08fc: Unknown result type (might be due to invalid IL or missing references)
141 //IL_0900: Unknown result type (might be due to invalid IL or missing references)
142 //IL_0906: Unknown result type (might be due to invalid IL or missing references)
143 //IL_090a: Unknown result type (might be due to invalid IL or missing references)
144 //IL_0910: Unknown result type (might be due to invalid IL or missing references)
145 _legacy = legacy;
146 _filename = (_legacy ? name : Path.GetFileNameWithoutExtension(name));
147 _filepath = name;
148 _numModsEnabled = 0;
150 _mods = mods;
151 _numMods = mods.Length;
152 foreach (string mod in mods)
153 {
154 LocalMod localMod = localMods.SingleOrDefault((LocalMod m) => m.Name == mod);
155 if (localMod != null)
156 {
157 if (localMod.Enabled)
158 {
160 }
161 else
162 {
164 }
165 }
166 else
167 {
168 _missing.Add(mod);
169 }
170 }
171 BorderColor = new Color(89, 116, 213) * 0.7f;
172 _dividerTexture = UICommon.DividerTexture;
173 _innerPanelTexture = UICommon.InnerPanelTexture;
174 Height.Pixels = (_legacy ? 126 : 210);
175 Width.Percent = 1f;
176 SetPadding(6f);
178 {
179 Left =
180 {
181 Pixels = 10f
182 },
183 Top =
184 {
185 Pixels = 5f
186 }
187 };
190 {
191 Width =
192 {
193 Pixels = 100f
194 },
195 Height =
196 {
197 Pixels = 36f
198 },
199 Left =
200 {
201 Pixels = 407f
202 },
203 Top =
204 {
205 Pixels = 40f
206 }
207 }.WithFadedMouseOver();
208 viewListButton.PaddingTop -= 2f;
209 viewListButton.PaddingBottom -= 2f;
210 viewListButton.OnLeftClick += ViewListInfo;
212 _enableListButton = new UIAutoScaleTextTextPanel<string>(Language.GetTextValue("tModLoader.ModPackEnableThisList"))
213 {
214 Width =
215 {
216 Pixels = 151f
217 },
218 Height =
219 {
220 Pixels = 36f
221 },
222 Left =
223 {
224 Pixels = 248f
225 },
226 Top =
227 {
228 Pixels = 40f
229 }
230 }.WithFadedMouseOver();
231 _enableListButton.PaddingTop -= 2f;
232 _enableListButton.PaddingBottom -= 2f;
233 _enableListButton.OnLeftClick += EnableList;
235 _enableListOnlyButton = new UIAutoScaleTextTextPanel<string>(Language.GetTextValue("tModLoader.ModPackEnableOnlyThisList"))
236 {
237 Width =
238 {
239 Pixels = 190f
240 },
241 Height =
242 {
243 Pixels = 36f
244 },
245 Left =
246 {
247 Pixels = 50f
248 },
249 Top =
250 {
251 Pixels = 40f
252 }
253 }.WithFadedMouseOver();
254 _enableListOnlyButton.PaddingTop -= 2f;
255 _enableListOnlyButton.PaddingBottom -= 2f;
256 _enableListOnlyButton.OnLeftClick += EnabledListOnly;
258 _viewInModBrowserButton = new UIAutoScaleTextTextPanel<string>(Language.GetTextValue("tModLoader.ModPackViewModsInModBrowser"))
259 {
260 Width =
261 {
262 Pixels = 246f
263 },
264 Height =
265 {
266 Pixels = 36f
267 },
268 Left =
269 {
270 Pixels = 50f
271 },
272 Top =
273 {
274 Pixels = 80f
275 }
276 }.WithFadedMouseOver();
277 _viewInModBrowserButton.PaddingTop -= 2f;
278 _viewInModBrowserButton.PaddingBottom -= 2f;
279 _viewInModBrowserButton.OnLeftClick += DownloadMissingMods;
281 _updateListWithEnabledButton = new UIAutoScaleTextTextPanel<string>(Language.GetTextValue("tModLoader.ModPackUpdateListWithEnabled"))
282 {
283 Width =
284 {
285 Pixels = 225f
286 },
287 Height =
288 {
289 Pixels = 36f
290 },
291 Left =
292 {
293 Pixels = 304f
294 },
295 Top =
296 {
297 Pixels = 80f
298 }
299 }.WithFadedMouseOver();
300 _updateListWithEnabledButton.PaddingTop -= 2f;
301 _updateListWithEnabledButton.PaddingBottom -= 2f;
302 _updateListWithEnabledButton.OnLeftClick += UpdateModPack;
304 _deleteButton = new UIImageButton(Main.Assets.Request<Texture2D>("Images/UI/ButtonDelete"))
305 {
306 Top =
307 {
308 Pixels = 40f
309 }
310 };
311 _deleteButton.OnLeftClick += DeleteButtonClick;
313 if (!_legacy)
314 {
316 {
317 Width =
318 {
319 Pixels = 225f
320 },
321 Height =
322 {
323 Pixels = 36f
324 },
325 Left =
326 {
327 Pixels = 50f
328 },
329 Top =
330 {
331 Pixels = 120f
332 }
333 }.WithFadedMouseOver();
334 _importFromPackLocalButton.PaddingTop -= 2f;
335 _importFromPackLocalButton.PaddingBottom -= 2f;
336 _importFromPackLocalButton.OnLeftClick += ImportModPackLocal;
339 {
340 Width =
341 {
342 Pixels = 225f
343 },
344 Height =
345 {
346 Pixels = 36f
347 },
348 Left =
349 {
350 Pixels = 280f
351 },
352 Top =
353 {
354 Pixels = 120f
355 }
356 }.WithFadedMouseOver();
357 _removePackLocalButton.PaddingTop -= 2f;
358 _removePackLocalButton.PaddingBottom -= 2f;
359 _removePackLocalButton.OnLeftClick += RemoveModPackLocal;
362 {
363 Width =
364 {
365 Pixels = 200f
366 },
367 Height =
368 {
369 Pixels = 36f
370 },
371 Left =
372 {
373 Pixels = 10f
374 },
375 Top =
376 {
377 Pixels = 160f
378 }
379 }.WithFadedMouseOver();
380 _exportPackInstanceButton.PaddingTop -= 2f;
381 _exportPackInstanceButton.PaddingBottom -= 2f;
382 _exportPackInstanceButton.OnLeftClick += ExportInstance;
384 if (Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), _filename)))
385 {
387 {
388 Width =
389 {
390 Pixels = 140f
391 },
392 Height =
393 {
394 Pixels = 36f
395 },
396 Left =
397 {
398 Pixels = 370f
399 },
400 Top =
401 {
402 Pixels = 160f
403 }
404 }.WithFadedMouseOver();
405 _removePackInstanceButton.PaddingTop -= 2f;
406 _removePackInstanceButton.PaddingBottom -= 2f;
407 _removePackInstanceButton.OnLeftClick += DeleteInstance;
409 }
410 }
411 }
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12
readonly List< string > _missing
readonly UIAutoScaleTextTextPanel< string > _enableListOnlyButton
void DeleteButtonClick(UIMouseEvent evt, UIElement listeningElement)
readonly UIAutoScaleTextTextPanel< string > _importFromPackLocalButton
static void EnableList(UIMouseEvent evt, UIElement listeningElement)
static void DownloadMissingMods(UIMouseEvent evt, UIElement listeningElement)
readonly UIAutoScaleTextTextPanel< string > _removePackLocalButton
readonly UIAutoScaleTextTextPanel< string > _removePackInstanceButton
readonly UIAutoScaleTextTextPanel< string > _updateListWithEnabledButton
readonly Asset< Texture2D > _innerPanelTexture
readonly UIImageButton _deleteButton
static void RemoveModPackLocal(UIMouseEvent evt, UIElement listeningElement)
static void ViewListInfo(UIMouseEvent evt, UIElement listeningElement)
static void UpdateModPack(UIMouseEvent evt, UIElement listeningElement)
static void ImportModPackLocal(UIMouseEvent evt, UIElement listeningElement)
readonly UIAutoScaleTextTextPanel< string > _enableListButton
static void ExportInstance(UIMouseEvent evt, UIElement listeningElement)
readonly UIAutoScaleTextTextPanel< string > _viewInModBrowserButton
readonly UIAutoScaleTextTextPanel< string > _exportPackInstanceButton
static void DeleteInstance(UIMouseEvent evt, UIElement listeningElement)
readonly Asset< Texture2D > _dividerTexture
static void EnabledListOnly(UIMouseEvent evt, UIElement listeningElement)
StyleDimension Height
Definition UIElement.cs:29
void Append(UIElement element)
Definition UIElement.cs:194
StyleDimension Left
Definition UIElement.cs:25
StyleDimension Width
Definition UIElement.cs:27
void SetPadding(float pixels)
Definition UIElement.cs:439
StyleDimension Top
Definition UIElement.cs:23

References Terraria.ModLoader.UI.UIModPackItem._deleteButton, Terraria.ModLoader.UI.UIModPackItem._dividerTexture, Terraria.ModLoader.UI.UIModPackItem._enableListButton, Terraria.ModLoader.UI.UIModPackItem._enableListOnlyButton, Terraria.ModLoader.UI.UIModPackItem._exportPackInstanceButton, Terraria.ModLoader.UI.UIModPackItem._filename, Terraria.ModLoader.UI.UIModPackItem._filepath, Terraria.ModLoader.UI.UIModPackItem._importFromPackLocalButton, Terraria.ModLoader.UI.UIModPackItem._innerPanelTexture, Terraria.ModLoader.UI.UIModPackItem._legacy, Terraria.ModLoader.UI.UIModPackItem._missing, Terraria.ModLoader.UI.UIModPackItem._modName, Terraria.ModLoader.UI.UIModPackItem._mods, Terraria.ModLoader.UI.UIModPackItem._numMods, Terraria.ModLoader.UI.UIModPackItem._numModsDisabled, Terraria.ModLoader.UI.UIModPackItem._numModsEnabled, Terraria.ModLoader.UI.UIModPackItem._removePackInstanceButton, Terraria.ModLoader.UI.UIModPackItem._removePackLocalButton, Terraria.ModLoader.UI.UIModPackItem._updateListWithEnabledButton, Terraria.ModLoader.UI.UIModPackItem._viewInModBrowserButton, Terraria.UI.UIElement.Append(), Terraria.Main.Assets, Terraria.GameContent.UI.Elements.UIPanel.BorderColor, Terraria.ModLoader.UI.UIModPackItem.DeleteButtonClick(), Terraria.ModLoader.UI.UIModPackItem.DeleteInstance(), Terraria.ModLoader.UI.UICommon.DividerTexture, Terraria.ModLoader.UI.UIModPackItem.DownloadMissingMods(), Terraria.ModLoader.UI.UIModPackItem.EnabledListOnly(), Terraria.ModLoader.UI.UIModPackItem.EnableList(), Terraria.ModLoader.UI.UIModPackItem.ExportInstance(), Terraria.Localization.Language.GetTextValue(), Terraria.UI.UIElement.Height, Terraria.ModLoader.UI.UIModPackItem.ImportModPackLocal(), Terraria.ModLoader.UI.UICommon.InnerPanelTexture, Terraria.UI.UIElement.Left, Terraria.ModLoader.UI.UIModPackItem.RemoveModPackLocal(), Terraria.UI.UIElement.SetPadding(), Terraria.UI.UIElement.Top, Terraria.ModLoader.UI.UIModPackItem.UpdateModPack(), Terraria.ModLoader.UI.UIModPackItem.ViewListInfo(), and Terraria.UI.UIElement.Width.

Referenced by Terraria.ModLoader.UI.UIModPackItem.DeleteButtonClick(), Terraria.ModLoader.UI.UIModPackItem.DeleteInstance(), Terraria.ModLoader.UI.UIModPackItem.DownloadMissingMods(), Terraria.ModLoader.UI.UIModPackItem.EnabledListOnly(), Terraria.ModLoader.UI.UIModPackItem.EnableList(), Terraria.ModLoader.UI.UIModPackItem.ImportModPackLocal(), Terraria.ModLoader.UI.UIModPackItem.PlayInstance(), Terraria.ModLoader.UI.UIModPackItem.RemoveModPackLocal(), Terraria.ModLoader.UI.UIModPackItem.UpdateModPack(), and Terraria.ModLoader.UI.UIModPackItem.ViewListInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: