Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ContentBrowserTileComponent.c
Go to the documentation of this file.
1//#define WORKSHOP_DEBUG
2
6{
7 protected static int s_iTileWidth = 285;
8 protected static int s_iTileHeight = 224;
9
10 // Event Handlers
14
16
17 protected bool m_bFocused;
19
20 protected ref SCR_WorkshopItem m_Item;
21
22 protected SCR_WorkshopItemBackendImageComponent m_BackendImageComponent;
24
25 protected SCR_ERevisionAvailability m_eRevisionAvailability;
26
27 protected SCR_EWorkshopTileErrorState m_eErrorState;
28 protected SCR_EAddonPrimaryActionState m_ePrimaryActionState;
29
31
32 //------------------------------------------------------------------------------------------------
33 override void HandlerAttached(Widget w)
34 {
35 super.HandlerAttached(w);
36
37 if (!GetGame().InPlayMode())
38 return;
39
40 m_Widgets.Init(m_wRoot);
41
42 // Tile Size
43 s_iTileWidth = m_Widgets.m_wSizeLayoutMain.GetWidthOverride();
44 s_iTileHeight = m_Widgets.m_wSizeLayoutMain.GetHeightOverride();
45
46 m_Widgets.m_EnableAddonButtonComponent.m_OnToggled.Insert(OnEnableButtonToggled);
47 m_Widgets.m_FavouriteButtonComponent0.m_OnToggled.Insert(OnFavouriteButtonToggled);
48
49 Widget backendImage = m_wRoot.FindAnyWidget("m_BackendImage");
50 if (backendImage)
51 m_BackendImageComponent = SCR_WorkshopItemBackendImageComponent.Cast(backendImage.FindHandler(SCR_WorkshopItemBackendImageComponent));
52
54 m_Widgets.m_WarningOverlayComponent.GetOnWarningIconButtonClicked().Insert(OnWarningButtonClicked);
55
57 m_Widgets.m_MainActionButtonComponent0.m_OnClicked.Insert(OnMainActionButtonClicked);
58 m_Widgets.m_RepairActionButtonComponent0.m_OnClicked.Insert(OnRepairActionButtonClicked);
59
61 if (downloadManager)
62 {
63 downloadManager.m_OnNewDownload.Insert(OnAnyNewDownload);
64 downloadManager.m_OnDownloadFailed.Insert(OnAnyDownloadError);
65 downloadManager.m_OnDownloadCanceled.Insert(OnAnyDownloadCompleted);
66 downloadManager.m_OnDownloadComplete.Insert(OnAnyDownloadCompleted);
67 }
68 }
69
70 //------------------------------------------------------------------------------------------------
71 override void HandlerDeattached(Widget w)
72 {
74
76 if (downloadManager)
77 {
78 downloadManager.m_OnNewDownload.Remove(OnAnyNewDownload);
79 downloadManager.m_OnDownloadFailed.Remove(OnAnyDownloadError);
80 downloadManager.m_OnDownloadCanceled.Remove(OnAnyDownloadCompleted);
81 downloadManager.m_OnDownloadComplete.Remove(OnAnyDownloadCompleted);
82 }
83
85
86 if (m_Item)
87 {
88 m_Item.m_OnChanged.Remove(OnWorkshopItemChange);
89 m_Item.m_OnGetAsset.Remove(OnWorkshopItemChange);
90 m_Item.m_OnDependenciesLoaded.Remove(OnWorkshopItemChange);
91 }
92
93 super.HandlerDeattached(w);
94 }
95
96 //------------------------------------------------------------------------------------------------
97 override bool OnFocus(Widget w, int x, int y)
98 {
99 m_OnFocus.Invoke(this);
100 m_bFocused = true;
101
104 UpdateHeader();
105
106 // Tooltips
108
109 return super.OnFocus(w, x, y);
110 }
111
112 //------------------------------------------------------------------------------------------------
113 override bool OnFocusLost(Widget w, int x, int y)
114 {
115 m_OnFocusLost.Invoke(this);
116 m_bFocused = false;
117
120 UpdateHeader();
121
122 // Tooltips
124
125 return super.OnFocusLost(w, x, y);
126 }
127
128 // ---- Protected ----
129 //------------------------------------------------------------------------------------------------
130 protected void UpdateStateFlags()
131 {
132 if (!m_Item)
133 return;
134
136 WorkshopItem item = m_Item.GetWorkshopItem();
137 Revision itemRevision = item.GetActiveRevision();
138 EWorkshopItemProblem itemProblem = m_Item.GetHighestPriorityProblem();
139
140 // --- Revision Availability ---
141 m_eRevisionAvailability = SCR_ERevisionAvailability.ERA_UNKNOWN_AVAILABILITY;
142 if (item)
143 m_eRevisionAvailability = addonManager.ItemAvailability(item);
144
145 // --- Primary Action State ---
147
148 // --- Error State ---
149 if (m_Item.GetRestricted())
150 m_eErrorState = SCR_EWorkshopTileErrorState.RESTRICTED;
151 else if (m_eRevisionAvailability != SCR_ERevisionAvailability.ERA_AVAILABLE && m_eRevisionAvailability != SCR_ERevisionAvailability.ERA_UNKNOWN_AVAILABILITY)
152 m_eErrorState = SCR_EWorkshopTileErrorState.REVISION_AVAILABILITY_ISSUE;
153 else if (itemProblem == EWorkshopItemProblem.DEPENDENCY_MISSING || itemProblem == EWorkshopItemProblem.DEPENDENCY_DISABLED)
154 m_eErrorState = SCR_EWorkshopTileErrorState.DEPENDENCIES_ISSUE;
155 else if (item && (item.IsUnlisted() && (item.IsAuthor() || item.IsContributor())))
156 m_eErrorState = SCR_EWorkshopTileErrorState.UNLISTED;
157 else if (itemRevision && itemRevision.IsCorrupted())
158 m_eErrorState = SCR_EWorkshopTileErrorState.DAMAGED;
159 else
160 m_eErrorState = SCR_EWorkshopTileErrorState.NONE;
161 }
162
163 //------------------------------------------------------------------------------------------------
164 protected void UpdateNames()
165 {
166 m_Widgets.m_wAddonName.SetText(m_Item.GetName());
167 m_Widgets.m_wAddonAuthor.SetText(m_Item.GetAuthorName());
168 }
169
170 //------------------------------------------------------------------------------------------------
171 protected void UpdateNamesScrolling()
172 {
173 if (m_bFocused)
174 {
175 if (!m_Widgets.m_FrameNameComponent.GetContentFitX())
176 m_Widgets.m_FrameNameComponent.AnimationStart();
177
178 if (!m_Widgets.m_FrameAuthorComponent.GetContentFitX())
179 m_Widgets.m_FrameAuthorComponent.AnimationStart();
180 }
181 else
182 {
183 m_Widgets.m_FrameNameComponent.AnimationStop();
184 m_Widgets.m_FrameNameComponent.ResetPosition();
185
186 m_Widgets.m_FrameAuthorComponent.AnimationStop();
187 m_Widgets.m_FrameAuthorComponent.ResetPosition();
188 }
189
190 // TODO: additional authors
191 }
192
193 //------------------------------------------------------------------------------------------------
194 protected void UpdateRating()
195 {
196 m_Widgets.m_wRating.SetVisible(m_eErrorState != SCR_EWorkshopTileErrorState.RESTRICTED);
197 if (!m_Widgets.m_wRating.IsVisible())
198 return;
199
200 m_Widgets.m_RatingComponent1.SetTitle(UIConstants.FormatUnitPercentage(SCR_WorkshopUiCommon.GetRatingPercentage(m_Item.GetAverageRating())));
201 }
202
203 //------------------------------------------------------------------------------------------------
204 protected void UpdateImage()
205 {
207 return;
208
209 m_BackendImageComponent.SetWorkshopItemAndImage(m_Item, m_Item.GetThumbnail());
210 }
211
212 //------------------------------------------------------------------------------------------------
214 {
215 if (!m_Item)
216 return;
217
218 int nDependencies = m_Item.GetLatestDependencies().Count();
220
221 // Displays
222 m_Widgets.m_wDependent.SetVisible(nDependent > 0);
223 m_Widgets.m_wDependencies.SetVisible(nDependencies > 0);
224
225 m_Widgets.m_DependentComponent1.SetTitle(Math.ClampInt(nDependent, 0, SCR_WorkshopUiCommon.MAX_DEPENDENCIES_SHOWN).ToString());
226 m_Widgets.m_DependenciesComponent1.SetTitle(Math.ClampInt(nDependencies, 0, SCR_WorkshopUiCommon.MAX_DEPENDENCIES_SHOWN).ToString());
227
229 }
230
231 //------------------------------------------------------------------------------------------------
233 {
234 float progress;
235
236 if (m_Item && m_ePrimaryActionState == SCR_EAddonPrimaryActionState.DOWNLOADING)
238
239 m_Widgets.m_wDownloadProgressBar.SetCurrent(progress);
240 m_Widgets.m_wDownloadProgressBarOverlay.SetVisible(progress > 0);
241 }
242
243 //------------------------------------------------------------------------------------------------
244 protected void UpdateFavouriteButton()
245 {
246 if (!m_Item)
247 return;
248
249 m_Widgets.m_FavouriteButtonComponent0.SetToggled(m_Item.GetFavourite(), false);
250 m_Widgets.m_FavouriteButtonComponent0.SetVisible((m_bFocused || m_Item.GetFavourite()) && m_eErrorState != SCR_EWorkshopTileErrorState.RESTRICTED);
251 }
252
253 //------------------------------------------------------------------------------------------------
254 protected void ShowBackendEnv()
255 {
256 WorkshopItem item = m_Item.GetWorkshopItem();
257 if (!item)
258 {
259 m_Widgets.m_wBackendSource.SetVisible(false);
260 return;
261 }
262
263 string gameEnv = GetGame().GetBackendApi().GetBackendEnv();
264 string modEnv = m_Item.GetWorkshopItem().GetBackendEnv();
265
266 bool display = (modEnv != "local") && (modEnv != "ask") && (modEnv != "invalid");
267 bool envMatch = gameEnv == modEnv;
268
269 m_Widgets.m_wBackendSource.SetVisible(display && !envMatch);
270 if (!display)
271 return;
272
273 m_Widgets.m_BackendSourceComponent1.SetTitle(modEnv);
274
275 if (envMatch)
276 m_Widgets.m_BackendSourceComponent0.SetIconColor(UIColors.CONFIRM);
277 else
278 m_Widgets.m_BackendSourceComponent0.SetIconColor(UIColors.WARNING);
279 }
280
281 //------------------------------------------------------------------------------------------------
282 protected void UpdateWarningOverlay()
283 {
284 // No error, hide
285 if (!m_Item || m_eErrorState == SCR_EWorkshopTileErrorState.NONE)
286 {
287 m_Widgets.m_WarningOverlayComponent.SetWarningVisible(false);
288 m_Widgets.m_WarningOverlayComponent.SetBlurUnderneath(false);
289
291 m_BackendImageComponent.SetImageSaturation(UIConstants.ENABLED_WIDGET_SATURATION);
292
293 return;
294 }
295
296 // Errors, show and desaturate the image
297 m_Widgets.m_WarningOverlayComponent.SetWarningVisible(true);
298 m_Widgets.m_WarningOverlayComponent.SetBlurUnderneath(m_eErrorState == SCR_EWorkshopTileErrorState.RESTRICTED);
299
301 m_BackendImageComponent.SetImageSaturation(UIConstants.DISABLED_WIDGET_SATURATION);
302
303 // Update Message
304 switch (m_eErrorState)
305 {
306 case SCR_EWorkshopTileErrorState.RESTRICTED:
307 {
308 m_Widgets.m_WarningOverlayComponent.SetWarning(SCR_WorkshopUiCommon.GetRestrictedAddonStateText(m_Item), SCR_WorkshopUiCommon.ICON_REPORTED);
309 m_Widgets.m_WarningOverlayComponent.ResetWarningColor();
310 break;
311 }
312
313 case SCR_EWorkshopTileErrorState.DEPENDENCIES_ISSUE:
314 {
315 m_Widgets.m_WarningOverlayComponent.SetWarning(SCR_WorkshopUiCommon.MESSAGE_DEPENDENCIES_MISSING, SCR_WorkshopUiCommon.ICON_DEPENDENCIES);
316 m_Widgets.m_WarningOverlayComponent.ResetWarningColor();
317 break;
318 }
319
320 case SCR_EWorkshopTileErrorState.REVISION_AVAILABILITY_ISSUE:
321 {
322 m_Widgets.m_WarningOverlayComponent.SetWarning(
325 );
326 m_Widgets.m_WarningOverlayComponent.ResetWarningColor();
327 break;
328 }
329
330 case SCR_EWorkshopTileErrorState.UNLISTED:
331 {
332 m_Widgets.m_WarningOverlayComponent.SetWarning("#AR-Player_Groups_Private", "flag-2", "{E23427CAC80DA8B7}UI/Textures/Icons/icons_mapMarkersUI.imageset");
333
334 Color color = Color.FromInt(UIColors.NEUTRAL_ACTIVE_STANDBY.PackToInt());
335 m_Widgets.m_WarningOverlayComponent.SetWarningColor(color, color);
336 break;
337 }
338
339 case SCR_EWorkshopTileErrorState.DAMAGED:
340 {
341 m_Widgets.m_WarningOverlayComponent.SetWarning(SCR_WorkshopUiCommon.MESSAGE_CORRUPTED, SCR_WorkshopUiCommon.ICON_REPAIR);
342 m_Widgets.m_WarningOverlayComponent.ResetWarningColor();
343 break;
344 }
345 }
346 }
347
348 //------------------------------------------------------------------------------------------------
349 protected void UpdateHeader()
350 {
351 if (!m_Item)
352 return;
353
354 m_Widgets.m_wRepairActionButton.SetVisible(m_bFocused && m_eErrorState == SCR_EWorkshopTileErrorState.DAMAGED);
355
356 m_Widgets.m_wMainActionButton.SetVisible(
357 (m_bFocused || m_ePrimaryActionState != SCR_EAddonPrimaryActionState.DOWNLOAD) &&
358 m_ePrimaryActionState != SCR_EAddonPrimaryActionState.DOWNLOADED &&
359 m_eErrorState != SCR_EWorkshopTileErrorState.RESTRICTED
360 );
361
362 if (!m_Widgets.m_wMainActionButton.IsVisible())
363 return;
364
366
367 SCR_ButtonEffectColor iconColorEffect = SCR_ButtonEffectColor.Cast(m_Widgets.m_MainActionButtonComponent0.FindEffect(SCR_ListEntryHelper.EFFECT_ICON_COLOR));
368 if (!iconColorEffect)
369 return;
370
371 SCR_ButtonEffectColor messageColorEffect = SCR_ButtonEffectColor.Cast(m_Widgets.m_MainActionButtonComponent0.FindEffect(SCR_ListEntryHelper.EFFECT_MESSAGE_COLOR));
372 if (!messageColorEffect)
373 return;
374
375 string icon;
376 string message;
377 Color iconColor;
378 Color messageColor;
379
381
382 m_Widgets.m_wMainActionButton.SetVisible(m_Item.GetSizeBytes() > 0);
383
384 if (iconColor)
385 iconColorEffect.m_cDefault = iconColor;
386
387 if (messageColor)
388 messageColorEffect.m_cDefault = messageColor;
389
390 m_Widgets.m_MainActionButtonComponent0.InvokeAllEnabledEffects(true);
391
392 m_Widgets.m_MainActionButtonComponent1.SetImage(icon);
393
394 m_Widgets.m_wMainActionText.SetText(message);
395 }
396
397 //------------------------------------------------------------------------------------------------
398 protected void UpdateMANWVisuals()
399 {
400 if (!m_Item.GetWorkshopItem())
401 {
402 m_Widgets.m_wMANWLogo.SetVisible(false);
403 return;
404 }
405
406 m_Widgets.m_ManwAwardComponent.UpdateAwards(m_Item);
407
408 array<WorkshopTag> items = {};
409 m_Item.GetWorkshopItem().GetTags(items);
410 foreach(WorkshopTag item: items)
411 {
412 if (item.Name() == "MANW_2025")
413 {
414 m_Widgets.m_wMANWLogo.SetVisible(true);
415 return;
416 }
417 }
418
419 m_Widgets.m_wMANWLogo.SetVisible(false);
420 }
421
422 //------------------------------------------------------------------------------------------------
423 protected void UpdateAllWidgets()
424 {
425 // Tile visibility
426 if (!m_Item)
427 {
428 m_wRoot.SetVisible(false);
429 return;
430 }
431
432 m_wRoot.SetVisible(true);
433
434 // Check states and update dynamic elements
436
437 // Update static elements
438 UpdateNames();
440 UpdateRating();
441 UpdateImage();
446
449
450 // Show type
451 bool isSave = m_Item.IsWorldSave();
452
453 m_Widgets.m_wItemTypeImage.SetVisible(isSave);
454 m_Widgets.m_wItemTypeShadow.SetVisible(isSave);
455
456 if (isSave)
457 {
458 const string imageType = "save-published"; // TODO: check for good const usage
459
460 m_Widgets.m_wItemTypeImage.LoadImageFromSet(0, UIConstants.ICONS_IMAGE_SET, imageType);
461 m_Widgets.m_wItemTypeShadow.LoadImageFromSet(0, UIConstants.ICONS_GLOW_IMAGE_SET, imageType);
462 }
463
464 }
465
466 //------------------------------------------------------------------------------------------------
467 protected void HandleDownloadChanges()
468 {
470
473 UpdateHeader();
474
475 if (m_Item && m_ePrimaryActionState == SCR_EAddonPrimaryActionState.DOWNLOADING)
477 else
479
480 m_OnChange.Invoke(this);
481 }
482
483//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
484// Each tile does it's own callqueue, so there's going to be many! Desyncronized with other UIs that might show download progress, like the top right button
485
486 //------------------------------------------------------------------------------------------------
487 protected void StartContinuousUpdate()
488 {
490 return;
491
492 GetGame().GetCallqueue().CallLater(ContinuousUpdate, SCR_WorkshopUiCommon.CONTINUOUS_UPDATE_DELAY, true);
493
495 }
496
497 //------------------------------------------------------------------------------------------------
498 protected void StopContinuousUpdate()
499 {
501 GetGame().GetCallqueue().Remove(ContinuousUpdate);
502
504 }
505
506 //------------------------------------------------------------------------------------------------
507 protected void ContinuousUpdate()
508 {
509 if (!m_Item || m_ePrimaryActionState != SCR_EAddonPrimaryActionState.DOWNLOADING)
510 {
512 return;
513 }
514
515 if (!m_Item.GetWorkshopItem().GetDownloadingRevision())
516 return;
517
519 UpdateHeader();
520 }
521
522//---- REFACTOR NOTE END ----
523
524 //------------------------------------------------------------------------------------------------
525 protected void OnEnableButtonToggled(SCR_ModularButtonComponent comp)
526 {
528 }
529
530 //------------------------------------------------------------------------------------------------
531 protected void OnFavouriteButtonToggled(SCR_ModularButtonComponent comp, bool toggled)
532 {
533 if (!m_Item)
534 return;
535
536 m_Item.SetFavourite(toggled);
537 }
538
539 //------------------------------------------------------------------------------------------------
544
545 //------------------------------------------------------------------------------------------------
546 protected void OnMainActionButtonClicked(SCR_ModularButtonComponent comp)
547 {
549 }
550
551 //------------------------------------------------------------------------------------------------
552 protected void OnRepairActionButtonClicked(SCR_ModularButtonComponent comp)
553 {
554 if (!m_Item || m_Item.GetRestricted())
555 return;
556
557 SCR_ValidateRepair_Dialog dialogValidator = SCR_CommonDialogs.CreateValidateRepairDialog();
558 dialogValidator.LoadAddon(m_Item);
559 }
560
561 //------------------------------------------------------------------------------------------------
562 protected void OnWorkshopItemChange()
563 {
565 }
566
567 // --- Any downloads ---
568 // We need to update the progress bar and main action display if we start downloading this item or any of it's dependencies
569 //------------------------------------------------------------------------------------------------
574
575 //------------------------------------------------------------------------------------------------
580
581 //------------------------------------------------------------------------------------------------
586
587//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
588// Overreliance on hardcoded strings and static methods in tooltips
589
590 // ---- Tooltips ----
591 //------------------------------------------------------------------------------------------------
593 {
594 m_Tooltip = tooltip;
595
599 }
600
601 //------------------------------------------------------------------------------------------------
603 {
604 if (!m_Item || !m_Tooltip || !m_Tooltip.GetContentRoot())
605 return;
606
608 if (!comp)
609 return;
610
611 if (m_Tooltip.IsValid("Dependent", m_Widgets.m_wDependent))
613 else if (m_Tooltip.IsValid("Dependencies", m_Widgets.m_wDependencies))
614 comp.Init(m_Item.GetLatestDependencies());
615 }
616
617 //------------------------------------------------------------------------------------------------
618 protected void UpdateHeaderTooltip()
619 {
620 if (!m_Tooltip || !m_Tooltip.GetContent() || !m_Tooltip.IsValid("MainAction", m_Widgets.m_wMainActionButton))
621 return;
622
624 }
625
626 //------------------------------------------------------------------------------------------------
628 {
629 if (!m_Item || !m_Tooltip || !m_Tooltip.GetContent() || !m_Tooltip.IsValid("Enable", m_Widgets.m_wEnableAddonButton))
630 return;
631
632 if (m_Item.GetEnabled())
633 m_Tooltip.GetContent().SetMessage(SCR_WorkshopUiCommon.LABEL_DISABLE);
634 else
635 m_Tooltip.GetContent().SetMessage(SCR_WorkshopUiCommon.LABEL_ENABLE);
636 }
637
638//---- REFACTOR NOTE END ----
639
640 // ---- Public ----
641 //------------------------------------------------------------------------------------------------
644 {
645 // Unregister from previous item
646 if (m_Item)
647 {
648 m_Item.m_OnChanged.Remove(OnWorkshopItemChange);
649 m_Item.m_OnGetAsset.Remove(OnWorkshopItemChange);
650 m_Item.m_OnDependenciesLoaded.Remove(OnWorkshopItemChange);
651 m_Item = null; // Release the old item
652 }
653
654 if (workshopItem)
655 {
656 m_Item = workshopItem;
657 m_Item.m_OnChanged.Insert(OnWorkshopItemChange);
658 m_Item.m_OnGetAsset.Insert(OnWorkshopItemChange);
659 m_Item.m_OnDependenciesLoaded.Insert(OnWorkshopItemChange);
660 }
661
663
664 // Since we reuse these tiles, when we assign a new workshop item we should not animate the effects, but we must force them into the correct value
665 m_Widgets.m_EnableAddonButtonComponent.InvokeAllEnabledEffects(true);
666 }
667
668 //------------------------------------------------------------------------------------------------
670 {
671 return m_Item;
672 }
673
674 //------------------------------------------------------------------------------------------------
679
680 //------------------------------------------------------------------------------------------------
685
686 //------------------------------------------------------------------------------------------------
691
692 //------------------------------------------------------------------------------------------------
697
698 //------------------------------------------------------------------------------------------------
699 static int GetTileWidth()
700 {
701 return s_iTileWidth;
702 }
703
704 //------------------------------------------------------------------------------------------------
705 static int GetTileHeight()
706 {
707 return s_iTileHeight;
708 }
709}
710
711// Displayed in the warning overlay
712enum SCR_EWorkshopTileErrorState
713{
718 UNLISTED,
719 DAMAGED
720}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AddonLineBaseComponent REVISION_AVAILABILITY_ISSUE
enum SCR_EConsumableType DAMAGED
SCR_ContentBrowserTileComponent DEPENDENCIES_ISSUE
SCR_ContentBrowserTileComponent UNLISTED
The asset doesn't appear when browsing workshop or search results but anyone that knows it's GUID can...
SCR_ContentBrowserTileComponent RESTRICTED
ScriptInvokerBase< ScriptInvokerScriptedWidgetComponentMethod > ScriptInvokerScriptedWidgetComponent
EWorkshopItemProblem
Definition Color.c:13
Definition Math.c:13
static SCR_ERevisionAvailability ItemAvailability(notnull WorkshopItem item)
static SCR_AddonManager GetInstance()
Effect which colorizes a widget with given name.
static SCR_ContentBrowser_AddonsTooltipComponent FindComponent(notnull Widget w)
void OnFavouriteButtonToggled(SCR_ModularButtonComponent comp, bool toggled)
void OnMainActionButtonClicked(SCR_ModularButtonComponent comp)
void OnRepairActionButtonClicked(SCR_ModularButtonComponent comp)
void OnAnyNewDownload(SCR_WorkshopItem item, SCR_WorkshopItemActionDownload action)
ScriptInvokerScriptedWidgetComponent GetOnFocusLost()
ref ScriptInvokerScriptedWidgetComponent m_OnChange
SCR_EAddonPrimaryActionState m_ePrimaryActionState
override bool OnFocus(Widget w, int x, int y)
void OnEnableButtonToggled(SCR_ModularButtonComponent comp)
ScriptInvokerScriptedWidgetComponent GetOnFocus()
void OnTooltipShow(SCR_ScriptedWidgetTooltip tooltip)
override bool OnFocusLost(Widget w, int x, int y)
SCR_WorkshopItemBackendImageComponent m_BackendImageComponent
ref ScriptInvokerScriptedWidgetComponent m_OnFocus
void OnAnyDownloadCompleted(SCR_WorkshopItemActionDownload action)
ref ScriptInvokerScriptedWidgetComponent m_OnFocusLost
void SetWorkshopItem(SCR_WorkshopItem workshopItem)
If a null pointer is passed, tile becomes hidden.
void OnWarningButtonClicked(ScriptInvokerScriptedWidgetComponent comp)
ref SCR_WorkshopDownloadSequence m_DownloadRequest
ScriptInvokerScriptedWidgetComponent GetOnChange()
static SCR_ContentBrowserTileComponent FindComponent(notnull Widget w)
void OnAnyDownloadError(SCR_WorkshopItemActionDownload action, int reason)
ref ScriptInvokerBase< ScriptInvoker_DownloadManagerActionError > m_OnDownloadFailed
static SCR_DownloadManager GetInstance()
ref ScriptInvoker m_OnNewDownload
ref ScriptInvokerBase< ScriptInvoker_DownloadManagerAction > m_OnDownloadComplete
static float GetItemDownloadActionsProgress(SCR_WorkshopItem item)
Returns overall download progress for all actions of a workshop item.
ref ScriptInvokerBase< ScriptInvoker_DownloadManagerAction > m_OnDownloadCanceled
static ScriptInvokerTooltip GetOnTooltipShow()
void LoadAddon(notnull SCR_WorkshopItem item)
static void UpdateEnableAddonToggleButton(SCR_ModularButtonComponent button, SCR_WorkshopItem item, SCR_EAddonPrimaryActionState state, bool alwaysShowWhenDownloaded=true)
static int GetRatingPercentage(float rating)
static string GetRevisionAvailabilityErrorMessage(WorkshopItem item)
static string GetRevisionAvailabilityErrorTexture(WorkshopItem item)
static void OnEnableAddonToggleButton(SCR_WorkshopItem item, SCR_ModularButtonComponent buttonComp)
static void ExecutePrimaryAction(notnull SCR_WorkshopItem item, out SCR_WorkshopDownloadSequence dlRequest, Revision revision=null)
static array< ref SCR_WorkshopItem > GetDownloadedDependentAddons(notnull SCR_WorkshopItem item)
static SCR_EAddonPrimaryActionState GetPrimaryActionState(notnull SCR_WorkshopItem item)
static string GetRestrictedAddonStateText(SCR_WorkshopItem item)
Returns string such as "Banned" or "Reported" for a restricted item. Otherwise returns empty string.
static void GetPrimaryActionLook(SCR_EAddonPrimaryActionState state, SCR_ERevisionAvailability availability, SCR_WorkshopItem item, out string icon, out Color iconColor, out string message, out Color messageColor)
static string GetPrimaryActionTooltipMessage(SCR_EAddonPrimaryActionState state, SCR_WorkshopItem item)
Workshop Item instance.
@ NONE
When Shape is created and not initialized yet.
Definition ShapeType.c:15