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_ContentEntryComponent.c
Go to the documentation of this file.
1
2
// Base for Mods & Scenario entries
3
4
//------------------------------------------------------------------------------------------------
5
class
SCR_ContentEntryComponent
:
SCR_ButtonBaseComponent
6
{
7
//const string WIDGET_ = "";
8
const
string
WIDGET_IMAGE_THUMBNAIL =
"ImgThumbnail"
;
9
const
string
WIDGET_TEXT_LABEL =
"TxtLabel"
;
10
const
string
WIDGET_TEXT_DESCRIPTION =
"TxtDescription"
;
11
const
string
WIDGET_BTN_DOWNLOAD =
"BtnDownload"
;
12
13
// Widgets
14
protected
ImageWidget
m_wImgThumbnail
;
15
protected
TextWidget
m_wTxtLabel
;
16
protected
TextWidget
m_wTxtDescription
;
17
18
//------------------------------------------------------------------------------------------------
19
override
void
HandlerAttached
(
Widget
w)
20
{
21
super.HandlerAttached(w);
22
23
// Get widgets
24
m_wImgThumbnail
=
ImageWidget
.Cast(w.FindAnyWidget(WIDGET_IMAGE_THUMBNAIL));
25
m_wTxtLabel
=
TextWidget
.Cast(w.FindAnyWidget(WIDGET_TEXT_LABEL));
26
m_wTxtDescription
=
TextWidget
.Cast(w.FindAnyWidget(WIDGET_TEXT_DESCRIPTION));
27
}
28
29
//------------------------------------------------------------------------------------------------
31
protected
void
SetTextSafe
(
TextWidget
txt,
string
str)
32
{
33
if
(txt)
34
txt.SetText(str);
35
}
36
37
//------------------------------------------------------------------------------------------------
38
void
SetLabelText
(
string
str) {
SetTextSafe
(
m_wTxtLabel
, str); }
39
40
//------------------------------------------------------------------------------------------------
41
void
SetDescriptionText
(
string
str) {
SetTextSafe
(
m_wTxtDescription
, str); }
42
43
//------------------------------------------------------------------------------------------------
44
void
SetThumbnail
(
ResourceName
image)
45
{
46
if
(image.IsEmpty())
47
return
;
48
49
if
(
m_wImgThumbnail
)
50
{
51
m_wImgThumbnail
.LoadImageTexture(0, image,
false
,
true
);
52
int
sx, sy;
53
m_wImgThumbnail
.GetImageSize(0, sx, sy);
54
m_wImgThumbnail
.SetSize(sx, sy);
55
}
56
}
57
58
59
};
ImageWidget
Definition
ImageWidget.c:13
ResourceName
Definition
ResourceName.c:13
SCR_ButtonBaseComponent
Base class for any button, regardless its own content.
Definition
SCR_ButtonBaseComponent.c:7
SCR_ContentEntryComponent
Base component for widgets displaying content data.
Definition
SCR_ContentEntryComponent.c:6
SCR_ContentEntryComponent::SetThumbnail
void SetThumbnail(ResourceName image)
Definition
SCR_ContentEntryComponent.c:44
SCR_ContentEntryComponent::SetTextSafe
void SetTextSafe(TextWidget txt, string str)
Just simple on line text setting.
Definition
SCR_ContentEntryComponent.c:31
SCR_ContentEntryComponent::SetDescriptionText
void SetDescriptionText(string str)
Definition
SCR_ContentEntryComponent.c:41
SCR_ContentEntryComponent::SetLabelText
void SetLabelText(string str)
Definition
SCR_ContentEntryComponent.c:38
SCR_ContentEntryComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_ContentEntryComponent.c:19
SCR_ContentEntryComponent::m_wTxtLabel
TextWidget m_wTxtLabel
Definition
SCR_ContentEntryComponent.c:15
SCR_ContentEntryComponent::m_wImgThumbnail
ImageWidget m_wImgThumbnail
Definition
SCR_ContentEntryComponent.c:14
SCR_ContentEntryComponent::m_wTxtDescription
TextWidget m_wTxtDescription
Definition
SCR_ContentEntryComponent.c:16
TextWidget
Definition
TextWidget.c:16
Widget
Definition
Widget.c:13
scripts
Game
UI
Menu
ContentBrowser
Deprecated
SCR_ContentEntryComponent.c
Generated by
1.17.0