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_BrowserLinkComponent.c
Go to the documentation of this file.
1
class
SCR_BrowserLinkComponent
:
ScriptedWidgetComponent
2
{
3
[
Attribute
(
"Link_Bohemia"
)]
4
protected
string
m_sAddress
;
5
6
[
Attribute
(
"false"
)]
7
protected
bool
m_bIsURL
;
8
9
protected
SCR_ButtonBaseComponent
m_Button
;
10
11
//------------------------------------------------------------------------------------------------
12
override
void
HandlerAttached
(
Widget
w)
13
{
14
super.HandlerAttached(w);
15
16
m_Button
=
SCR_ButtonBaseComponent
.Cast(w.FindHandler(
SCR_ButtonBaseComponent
));
17
if
(
m_Button
)
18
{
19
SCR_ServicesStatusHelper
.
RefreshPing
();
20
SCR_ServicesStatusHelper
.
GetOnCommStatusCheckFinished
().Insert(
OnCommStatusCheckFinished
);
21
22
m_Button
.SetEnabled(
SCR_ServicesStatusHelper
.
IsBackendConnectionAvailable
());
23
}
24
}
25
26
//------------------------------------------------------------------------------------------------
27
override
void
HandlerDeattached
(
Widget
w)
28
{
29
super.HandlerDeattached(w);
30
}
31
32
//------------------------------------------------------------------------------------------------
33
override
bool
OnClick
(
Widget
w,
int
x,
int
y,
int
button)
34
{
35
return
OpenBrowser
();
36
}
37
38
//------------------------------------------------------------------------------------------------
39
protected
void
OnCommStatusCheckFinished
(
SCR_ECommStatus
status,
float
responseTime,
float
lastSuccessTime,
float
lastFailTime)
40
{
41
if
(
m_Button
)
42
m_Button
.SetEnabled(
SCR_ServicesStatusHelper
.
IsBackendConnectionAvailable
());
43
}
44
45
//------------------------------------------------------------------------------------------------
46
bool
OpenBrowser
()
47
{
48
PlatformService
ps =
GetGame
().GetPlatformService();
49
50
if
(!ps)
51
return
false
;
52
53
BackendApi
backendAPI =
GetGame
().GetBackendApi();
54
string
url = backendAPI.GetLinkItem(
m_sAddress
);
55
56
if
(
m_bIsURL
)
57
ps.OpenBrowser(
m_sAddress
);
58
else
59
ps.OpenBrowser(url);
60
61
return
true
;
62
}
63
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
SCR_ECommStatus
SCR_ECommStatus
This class may become obsolete on BackendAPI update.
Definition
SCR_ServicesStatusHelper.c:3
BackendApi
Backend Api instance.
Definition
BackendApi.c:14
PlatformService
Definition
PlatformService.c:2
SCR_BrowserLinkComponent
Definition
SCR_BrowserLinkComponent.c:2
SCR_BrowserLinkComponent::HandlerDeattached
override void HandlerDeattached(Widget w)
Definition
SCR_BrowserLinkComponent.c:27
SCR_BrowserLinkComponent::m_sAddress
string m_sAddress
Definition
SCR_BrowserLinkComponent.c:4
SCR_BrowserLinkComponent::OnClick
override bool OnClick(Widget w, int x, int y, int button)
Definition
SCR_BrowserLinkComponent.c:33
SCR_BrowserLinkComponent::m_Button
SCR_ButtonBaseComponent m_Button
Definition
SCR_BrowserLinkComponent.c:9
SCR_BrowserLinkComponent::OpenBrowser
bool OpenBrowser()
Definition
SCR_BrowserLinkComponent.c:46
SCR_BrowserLinkComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_BrowserLinkComponent.c:12
SCR_BrowserLinkComponent::m_bIsURL
bool m_bIsURL
Definition
SCR_BrowserLinkComponent.c:7
SCR_BrowserLinkComponent::OnCommStatusCheckFinished
void OnCommStatusCheckFinished(SCR_ECommStatus status, float responseTime, float lastSuccessTime, float lastFailTime)
Definition
SCR_BrowserLinkComponent.c:39
SCR_ButtonBaseComponent
Base class for any button, regardless its own content.
Definition
SCR_ButtonBaseComponent.c:7
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
ScriptedWidgetComponent
Definition
ScriptedWidgetComponent.c:13
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
Components
SCR_BrowserLinkComponent.c
Generated by
1.17.0