Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_MANW_Banner.c
Go to the documentation of this file.
1
class
SCR_MANW_Banner
:
SCR_ScriptedWidgetComponent
2
{
3
protected
const
string
NAME_BUTTON
=
"m_wBannerButtonMain"
;
4
protected
const
string
NAME_TEXT
=
"BannerText"
;
5
protected
const
int
IMAGES_COUNT
= 2;
6
7
protected
int
m_iImagesReadyCount
;
8
9
protected
Widget
m_wBannerButtonMain
;
10
11
protected
ref
BackendCallback
m_Callback
;
12
13
//------------------------------------------------------------------------------------------------
14
override
void
HandlerAttached
(
Widget
w)
15
{
16
super.HandlerAttached(w);
17
18
m_wRoot
.SetVisible(
false
);
19
20
SCR_ServicesStatusHelper
.
RefreshPing
();
21
SCR_ServicesStatusHelper
.
GetOnCommStatusCheckFinished
().Insert(
OnCommStatusCheckFinished
);
22
}
23
24
//------------------------------------------------------------------------------------------------
25
protected
void
Init
()
26
{
27
if
(
GetGame
().GetBackendApi().GetPopupCount() < 1)
28
return
;
29
30
PopupFeedItem
popupItem =
GetGame
().GetBackendApi().GetPopupItem(0);
31
if
(!popupItem)
32
return
;
33
34
m_wRoot
.SetVisible(
true
);
35
36
TextWidget
textTitle =
TextWidget
.Cast(
m_wRoot
.FindAnyWidget(
NAME_TEXT
));
37
textTitle.SetText(popupItem.BannerText());
38
39
//ImageWidget imgTitle = ImageWidget.Cast(m_wRoot.FindAnyWidget("BG"));
40
//imgTitle.LoadImageTexture(0, popupItem.BackgroundImagePath());
41
42
m_wBannerButtonMain
=
m_wRoot
.FindAnyWidget(
NAME_BUTTON
);
43
}
44
45
//------------------------------------------------------------------------------------------------
46
override
bool
OnClick
(
Widget
w,
int
x,
int
y,
int
button)
47
{
48
bool
result = super.OnClick(w, x, y, button);
49
50
if
(w !=
m_wBannerButtonMain
)
51
return
result;
52
53
SCR_MANW_Dialogs
.
CreateBannerDialog
();
54
55
return
result;
56
}
57
58
//------------------------------------------------------------------------------------------------
59
protected
void
OnPopupReady
()
60
{
61
m_iImagesReadyCount
++;
62
if
(
m_iImagesReadyCount
<
IMAGES_COUNT
)
63
return
;
64
65
GetGame
().GetCallqueue().Call(
Init
);
66
}
67
68
//------------------------------------------------------------------------------------------------
69
protected
void
OnCommStatusCheckFinished
(
SCR_ECommStatus
status,
float
responseTime,
float
lastSuccessTime,
float
lastFailTime)
70
{
71
if
(!
m_wRoot
.IsVisible() &&
SCR_ServicesStatusHelper
.
IsBackendConnectionAvailable
())
72
{
73
Init
();
74
75
//m_Callback = new BackendCallback();
76
//GetGame().GetBackendApi().OnPopupReady(m_Callback);
77
//m_Callback.SetOnSuccess(OnPopupReady);
78
}
79
}
80
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
SCR_ECommStatus
SCR_ECommStatus
This class may become obsolete on BackendAPI update.
Definition
SCR_ServicesStatusHelper.c:3
BackendCallback
Definition
Backend_Storage.c:5
PopupFeedItem
Popup Feed data structure.
Definition
PopupFeedItem.c:14
SCR_MANW_Banner
Definition
SCR_MANW_Banner.c:2
SCR_MANW_Banner::OnPopupReady
void OnPopupReady()
Definition
SCR_MANW_Banner.c:59
SCR_MANW_Banner::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_MANW_Banner.c:14
SCR_MANW_Banner::m_Callback
ref BackendCallback m_Callback
Definition
SCR_MANW_Banner.c:11
SCR_MANW_Banner::m_iImagesReadyCount
int m_iImagesReadyCount
Definition
SCR_MANW_Banner.c:7
SCR_MANW_Banner::OnClick
override bool OnClick(Widget w, int x, int y, int button)
Definition
SCR_MANW_Banner.c:46
SCR_MANW_Banner::m_wBannerButtonMain
Widget m_wBannerButtonMain
Definition
SCR_MANW_Banner.c:9
SCR_MANW_Banner::OnCommStatusCheckFinished
void OnCommStatusCheckFinished(SCR_ECommStatus status, float responseTime, float lastSuccessTime, float lastFailTime)
Definition
SCR_MANW_Banner.c:69
SCR_MANW_Banner::IMAGES_COUNT
const int IMAGES_COUNT
Definition
SCR_MANW_Banner.c:5
SCR_MANW_Banner::NAME_BUTTON
const string NAME_BUTTON
Definition
SCR_MANW_Banner.c:3
SCR_MANW_Banner::Init
void Init()
Definition
SCR_MANW_Banner.c:25
SCR_MANW_Banner::NAME_TEXT
const string NAME_TEXT
Definition
SCR_MANW_Banner.c:4
SCR_MANW_Dialogs
Definition
SCR_MANW_Dialogs.c:2
SCR_MANW_Dialogs::CreateBannerDialog
static void CreateBannerDialog()
Definition
SCR_MANW_Dialogs.c:7
SCR_ScriptedWidgetComponent
Definition
SCR_ScriptedWidgetComponent.c:8
SCR_ScriptedWidgetComponent::m_wRoot
Widget m_wRoot
Definition
SCR_ScriptedWidgetComponent.c:9
SCR_ServicesStatusHelper
Definition
SCR_ServicesStatusHelper.c:16
SCR_ServicesStatusHelper::IsBackendConnectionAvailable
static bool IsBackendConnectionAvailable()
Definition
SCR_ServicesStatusHelper.c:413
SCR_ServicesStatusHelper::GetOnCommStatusCheckFinished
static ScriptInvokerCommStatus GetOnCommStatusCheckFinished()
Definition
SCR_ServicesStatusHelper.c:422
SCR_ServicesStatusHelper::RefreshPing
static void RefreshPing()
Definition
SCR_ServicesStatusHelper.c:94
TextWidget
Definition
TextWidget.c:16
Widget
Definition
Widget.c:13
scripts
Game
UI
MANW2025
SCR_MANW_Banner.c
Generated by
1.17.0