Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MANW_BannerDialog.c
Go to the documentation of this file.
2{
4
5 const string LINK_ITEM = "Link_MakeArma";
6 const string LINK_FALLBACK = "https://www.makearmanotwar.com";
7
8 protected string m_sButtonLink;
9
10 //------------------------------------------------------------------------------------------------
12 {
13 super.OnMenuOpen(preset);
14
17
18 TextWidget title = TextWidget.Cast(m_wRoot.FindAnyWidget("Title"));
19 TextWidget imgText = TextWidget.Cast(m_wRoot.FindAnyWidget("Text2"));
20 ImageWidget imgBackground = ImageWidget.Cast(m_wRoot.FindAnyWidget("m_wBackground"));
21 ImageWidget imgForeground = ImageWidget.Cast(m_wRoot.FindAnyWidget("MainObject"));
22 TextWidget description = TextWidget.Cast(m_wRoot.FindAnyWidget("m_wDescription"));
23 Widget descriptionSize = m_wRoot.FindAnyWidget("BannerDescription");
24
25 PopupFeedItem popupItem = GetGame().GetBackendApi().GetPopupItem(0);
26
27 title.SetText(popupItem.HeaderText());
28 imgText.SetText(popupItem.ImageText());
29
30 //imgBackground.LoadImageTexture(0, popupItem.BackgroundImagePath());
31 //imgForeground.LoadImageTexture(0, popupItem.ImagePath());
32
33 if (!popupItem.FooterText().IsEmpty() || popupItem.FooterText() != " ")
34 {
35 string url = GetGame().GetBackendApi().GetLinkItem(LINK_ITEM);
36 if (url.IsEmpty())
37 url = LINK_FALLBACK;
38
39 description.SetTextFormat(popupItem.FooterText(), url);
40 descriptionSize.SetVisible(true);
41 }
42
44 m_Confirm.SetLabel(popupItem.ActionButtonText());
46
47 m_sButtonLink = popupItem.ActionButtonURL();
48 }
49
50 //----------------------------------------------------------------------------------------
51 override void OnConfirm()
52 {
53 super.OnConfirm();
54
55 string url = m_sButtonLink;
56 if (url.IsEmpty())
57 {
58 url = GetGame().GetBackendApi().GetLinkItem(LINK_ITEM);
59 if (url.IsEmpty())
60 url = LINK_FALLBACK;
61 }
62
63 GetGame().GetPlatformService().OpenBrowser(url);
64 }
65
66 //------------------------------------------------------------------------------------------------
67 protected void OnCommStatusCheckFinished(SCR_ECommStatus status, float responseTime, float lastSuccessTime, float lastFailTime)
68 {
70 }
71}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_ECommStatus
This class may become obsolete on BackendAPI update.
Popup Feed data structure.
SCR_InputButtonComponent FindButton(string tag)
Returns a button with given tag.
void OnCommStatusCheckFinished(SCR_ECommStatus status, float responseTime, float lastSuccessTime, float lastFailTime)
SCR_InputButtonComponent m_Confirm
override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
static ScriptInvokerCommStatus GetOnCommStatusCheckFinished()