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_ImagePickerComponent.c
Go to the documentation of this file.
1
void
ScriptInvokerImagePickerComponentMethod
(
SCR_ImagePickerComponent
picker);
2
typedef
func
ScriptInvokerImagePickerComponentMethod
;
3
typedef
ScriptInvokerBase<ScriptInvokerImagePickerComponentMethod>
ScriptInvokerImagePickerComponent
;
4
5
/*
6
void ScriptInvokerImagePicker(vector v);
7
typedef func ScriptInvokerVectorMethod;
8
typedef ScriptInvokerBase<ScriptInvokerVectorMethod> ScriptInvokerVector;
9
*/
10
14
class
SCR_ImagePickerComponent
:
SCR_ChangeableComponentBase
15
{
16
protected
const
string
TESTING_IMAGE
=
"{A6D83FD56C68EB77}UI/Textures/MissionLoadingScreens/campaignMP_UI.edds"
;
17
18
[
Attribute
(
"Image"
,
desc
:
"Name of widget for displaying picked"
)]
19
protected
string
m_sImageName
;
20
21
protected
ResourceName
m_sResourcePath
;
22
23
protected
TextWidget
m_wImageSourceText
;
24
protected
SCR_ModularButtonComponent
m_PickerButton
;
25
26
protected
ref
ScriptInvokerImagePickerComponent
m_OnPickerButtonClicked
;
27
protected
ref ScriptInvokerBase<ScriptInvokerStringMethod>
m_OnResourcePicked
;
28
29
//-------------------------------------------------------------------------------------------
30
// Override
31
//-------------------------------------------------------------------------------------------
32
33
//-------------------------------------------------------------------------------------------
34
override
void
HandlerAttached
(
Widget
w)
35
{
36
super.HandlerAttached(w);
37
38
// Setup
39
m_wImageSourceText
=
TextWidget
.Cast(w.FindAnyWidget(
"ImageText"
));
40
Widget
pickerButton = w.FindAnyWidget(
"PickerButton"
);
41
m_PickerButton
= SCR_ModularButtonComponent.Cast(pickerButton.FindHandler(SCR_ModularButtonComponent));
42
43
m_PickerButton
.m_OnClicked.Insert(
OnPickerButtonClicked
);
44
}
45
46
//-------------------------------------------------------------------------------------------
48
protected
void
OnPickerButtonClicked
(SCR_ModularButtonComponent button)
49
{
50
if
(
m_sResourcePath
.IsEmpty())
51
CaptureImage
();
52
else
53
RemoveImage
();
54
55
if
(
m_OnPickerButtonClicked
)
56
m_OnPickerButtonClicked
.Invoke(
this
);
57
}
58
59
//-------------------------------------------------------------------------------------------
60
void
CaptureImage
()
61
{
62
SCR_EditorManagerEntity
.GetInstance().SetCurrentMode(
EEditorMode
.PHOTO_SAVE);
63
64
// TODO: Send out image capture to hide dialog
65
}
66
67
//-------------------------------------------------------------------------------------------
68
void
SetImage
(
string
image)
69
{
70
m_sResourcePath
= image;
71
m_wImageSourceText
.SetText(image);
72
73
if
(
m_OnResourcePicked
)
74
m_OnResourcePicked
.Invoke(image);
75
}
76
77
//-------------------------------------------------------------------------------------------
78
void
RemoveImage
()
79
{
80
m_sResourcePath
=
""
;
81
m_wImageSourceText
.SetText(
""
);
82
83
if
(
m_OnResourcePicked
)
84
m_OnResourcePicked
.Invoke(
""
);
85
}
86
87
//-------------------------------------------------------------------------------------------
88
ResourceName
GetResourcePath
()
89
{
90
return
m_sResourcePath
;
91
}
92
93
//-------------------------------------------------------------------------------------------
94
ScriptInvokerImagePickerComponent
GetOnPickerButtonClick
()
95
{
96
if
(!
m_OnPickerButtonClicked
)
97
m_OnPickerButtonClicked
=
new
ScriptInvokerImagePickerComponent
();
98
99
return
m_OnPickerButtonClicked
;
100
}
101
102
//-------------------------------------------------------------------------------------------
103
ScriptInvokerBase<ScriptInvokerStringMethod>
GetOnResourcePicked
()
104
{
105
if
(!
m_OnResourcePicked
)
106
m_OnResourcePicked
=
new
ScriptInvokerBase<ScriptInvokerStringMethod>();
107
108
return
m_OnResourcePicked
;
109
}
110
}
func
func
Definition
SCR_AIThreatSystem.c:6
SCR_EditorManagerEntity
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
Definition
SCR_EditorManagerEntity.c:2211
ScriptInvokerImagePickerComponentMethod
func ScriptInvokerImagePickerComponentMethod
Definition
SCR_ImagePickerComponent.c:2
ScriptInvokerImagePickerComponent
ScriptInvokerBase< ScriptInvokerImagePickerComponentMethod > ScriptInvokerImagePickerComponent
Definition
SCR_ImagePickerComponent.c:3
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
ResourceName
Definition
ResourceName.c:13
SCR_ChangeableComponentBase
Base class for all widgets that can change their internal state as editbox or spinbox.
Definition
SCR_ChangeableComponentBase.c:5
SCR_ImagePickerComponent
Definition
SCR_ImagePickerComponent.c:15
SCR_ImagePickerComponent::m_OnResourcePicked
ref ScriptInvokerBase< ScriptInvokerStringMethod > m_OnResourcePicked
Definition
SCR_ImagePickerComponent.c:27
SCR_ImagePickerComponent::TESTING_IMAGE
const string TESTING_IMAGE
Definition
SCR_ImagePickerComponent.c:16
SCR_ImagePickerComponent::m_wImageSourceText
TextWidget m_wImageSourceText
Definition
SCR_ImagePickerComponent.c:23
SCR_ImagePickerComponent::RemoveImage
void RemoveImage()
Definition
SCR_ImagePickerComponent.c:78
SCR_ImagePickerComponent::m_PickerButton
SCR_ModularButtonComponent m_PickerButton
Definition
SCR_ImagePickerComponent.c:24
SCR_ImagePickerComponent::SetImage
void SetImage(string image)
Definition
SCR_ImagePickerComponent.c:68
SCR_ImagePickerComponent::m_OnPickerButtonClicked
ref ScriptInvokerImagePickerComponent m_OnPickerButtonClicked
Definition
SCR_ImagePickerComponent.c:26
SCR_ImagePickerComponent::OnPickerButtonClicked
void OnPickerButtonClicked(SCR_ModularButtonComponent button)
Solve interaction: Open image capture or delete current.
Definition
SCR_ImagePickerComponent.c:48
SCR_ImagePickerComponent::m_sResourcePath
ResourceName m_sResourcePath
Definition
SCR_ImagePickerComponent.c:21
SCR_ImagePickerComponent::GetOnResourcePicked
ScriptInvokerBase< ScriptInvokerStringMethod > GetOnResourcePicked()
Definition
SCR_ImagePickerComponent.c:103
SCR_ImagePickerComponent::CaptureImage
void CaptureImage()
Definition
SCR_ImagePickerComponent.c:60
SCR_ImagePickerComponent::m_sImageName
string m_sImageName
Definition
SCR_ImagePickerComponent.c:19
SCR_ImagePickerComponent::GetResourcePath
ResourceName GetResourcePath()
Definition
SCR_ImagePickerComponent.c:88
SCR_ImagePickerComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_ImagePickerComponent.c:34
SCR_ImagePickerComponent::GetOnPickerButtonClick
ScriptInvokerImagePickerComponent GetOnPickerButtonClick()
Definition
SCR_ImagePickerComponent.c:94
TextWidget
Definition
TextWidget.c:16
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EEditorMode
EEditorMode
Editor mode that defines overall functionality.
Definition
EEditorMode.c:6
scripts
Game
UI
Menu
ConfigurableWidgetEntries
SCR_ImagePickerComponent.c
Generated by
1.17.0