Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ContentBrowserDetails_SaveOverviewSubMenu.c
Go to the documentation of this file.
2{
3 protected const string DELETE_PUBLISHED_BUTTON = "m_DeletePublishedButton";
4
6
7 protected SCR_ModularButtonComponent m_DeletePublishedButton;
8
10
11 //------------------------------------------------------------------------------------------------
12 // Override
13 //------------------------------------------------------------------------------------------------
14
15 //------------------------------------------------------------------------------------------------
16 override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
17 {
18 super.OnTabCreate(menuRoot, buttonsLayout, index);
19
20 // Setup UI - can be as part of generated widget class
21 Widget deletePublishedButton = menuRoot.FindAnyWidget(DELETE_PUBLISHED_BUTTON);
22 if (deletePublishedButton)
23 {
24 m_DeletePublishedButton = SCR_ModularButtonComponent.Cast(deletePublishedButton.FindHandler(SCR_ModularButtonComponent));
26 }
27 }
28
29 //------------------------------------------------------------------------------------------------
31 {
33 super.SetWorkshopItem(item);
34
35 bool canDelete = m_SaveItem.IsAuthor();
36
38 m_DeletePublishedButton.SetVisible(canDelete);
39 }
40
41 //------------------------------------------------------------------------------------------------
42 override bool Play(MissionWorkshopItem scenario)
43 {
44 string id = m_SaveItem.Id();
45 /*
46 string fileName = GetGame().GetSaveManager().FindFileNameById(id);
47 if (!fileName)
48 {
49 Print("Save to play was not found", LogLevel.WARNING);
50 return;
51 }
52
53 GetGame().GetSaveManager().SetFileNameToLoad(fileName);
54 super.Play(scenario);*/
55
56 return false;
57 }
58
59 //------------------------------------------------------------------------------------------------
60 override bool Continue(MissionWorkshopItem scenario)
61 {
62 return Play(scenario);
63 }
64
65 //------------------------------------------------------------------------------------------------
66 override protected void UpdateScenarioLines()
67 {
68 if (!m_Item)
69 return;
70
72 {
73 if (!scenarioLine)
74 continue;
75
76 // Show favorites and mouse buttons only when downloaded
77 scenarioLine.NotifyScenarioUpdate(m_Item.GetOffline());
78 }
79 }
80
81 //------------------------------------------------------------------------------------------------
82 override protected void CreateLines(array<MissionWorkshopItem> scenarios, Widget parent)
83 {
84 Widget w = GetGame().GetWorkspace().CreateWidgets(m_sLinesLayout, parent);
85
87 if (!comp)
88 return;
89
91 //m_aScenarioLines.Insert(comp);
92
93 comp.GetOnFavorite().Insert(OnLineFavorite);
94 comp.GetOnMouseInteractionButtonClicked().Insert(OnInteractionButtonPressed);
95 comp.GetOnFocus().Insert(OnLineFocus);
96 comp.GetOnFocusLost().Insert(OnLineFocusLost);
97 comp.GetOnMouseEnter().Insert(OnLineMouseEnter);
98 }
99
100 //------------------------------------------------------------------------------------------------
101 override void UpdateSidePanel()
102 {
103 super.UpdateSidePanel();
104
105 m_Widgets.m_wAddonDetailsPanel.SetVisible(true);
106 m_Widgets.m_wScenarioDetailsPanel.SetVisible(false);
107 }
108
109 //------------------------------------------------------------------------------------------------
110 // Custom
111 //------------------------------------------------------------------------------------------------
112
113 //------------------------------------------------------------------------------------------------
115 protected void OnDeletePublishedClick()
116 {
118 dialog.m_OnConfirm.Insert(DeletePublished);
119 }
120
121 //------------------------------------------------------------------------------------------------
123 {
124 /*SCR_SaveWorkshopManager saveWorkshopManager = SCR_SaveWorkshopManager.GetInstance();
125 saveWorkshopManager.GetDeletePublishedCallback().SetOnSuccess(OnDeletePublishedResponse);
126 saveWorkshopManager.GetDeletePublishedCallback().SetOnError(OnDeletePublishedError);
127 saveWorkshopManager.DeletePublishedSave(m_SaveItem);
128
129 m_LoadingOverlay = SCR_LoadingOverlayDialog.Create();*/
130 }
131
132 //------------------------------------------------------------------------------------------------
134 {
136 m_LoadingOverlay.Close();
137
138 if (m_OnItemDeleted)
139 m_OnItemDeleted.Invoke(m_Item.GetWorkshopItem());
140
141 GetGame().GetMenuManager().CloseMenuByPreset(ChimeraMenuPreset.ContentBrowserDetailsMenuSave);
142 }
143
144 //------------------------------------------------------------------------------------------------
145 protected void OnDeletePublishedError()
146 {
148 m_LoadingOverlay.Close();
149
150 SCR_CommonDialogs.CreateRequestErrorDialog();
151 }
152
153 //------------------------------------------------------------------------------------------------
161}
ChimeraMenuPreset
Menu presets.
ArmaReforgerScripted GetGame()
Definition game.c:1398
ScriptInvokerBase< ScriptInvokerSCRWorkshopItemMethod > ScriptInvokerWorkshopItem
ref array< SCR_ContentBrowser_ScenarioLineComponent > m_aScenarioLines
void OnLineFavorite(SCR_BrowserListMenuEntryComponent entry, bool favorite)
void OnInteractionButtonPressed(string action)
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
static SCR_ContentBrowser_ScenarioLineComponent FindComponent(Widget w)
override void OnLineFocus(SCR_ScriptedWidgetComponent entry)
override void OnLineMouseEnter(SCR_ScriptedWidgetComponent entry)
override void OnLineFocusLost(SCR_ScriptedWidgetComponent entry)
ref SCR_ContentBrowserDetails_OverviewSubMenuWidgets m_Widgets
void CreateLines(array< MissionWorkshopItem > scenarios, Widget parent)
override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
void OnDeletePublishedClick()
Use for deleting published save from workshop.
static SCR_ConfigurableDialogUi CreateDialog(string presetName)
WorkshopItem GetWorkshopItem()
Use these only if absoulutely necessary to intarract with game API.
bool Play()
Start playing the animation. Call 'Prepare' first if you need to change the setup of a component!