Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ImagePickerComponent.c
Go to the documentation of this file.
3typedef ScriptInvokerBase<ScriptInvokerImagePickerComponentMethod> ScriptInvokerImagePickerComponent;
4
5/*
6void ScriptInvokerImagePicker(vector v);
7typedef func ScriptInvokerVectorMethod;
8typedef ScriptInvokerBase<ScriptInvokerVectorMethod> ScriptInvokerVector;
9*/
10
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
22
24 protected SCR_ModularButtonComponent m_PickerButton;
25
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())
52 else
54
56 m_OnPickerButtonClicked.Invoke(this);
57 }
58
59 //-------------------------------------------------------------------------------------------
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
74 m_OnResourcePicked.Invoke(image);
75 }
76
77 //-------------------------------------------------------------------------------------------
79 {
80 m_sResourcePath = "";
81 m_wImageSourceText.SetText("");
82
84 m_OnResourcePicked.Invoke("");
85 }
86
87 //-------------------------------------------------------------------------------------------
92
93 //-------------------------------------------------------------------------------------------
101
102 //-------------------------------------------------------------------------------------------
103 ScriptInvokerBase<ScriptInvokerStringMethod> GetOnResourcePicked()
104 {
106 m_OnResourcePicked = new ScriptInvokerBase<ScriptInvokerStringMethod>();
107
108 return m_OnResourcePicked;
109 }
110}
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
func ScriptInvokerImagePickerComponentMethod
ScriptInvokerBase< ScriptInvokerImagePickerComponentMethod > ScriptInvokerImagePickerComponent
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Base class for all widgets that can change their internal state as editbox or spinbox.
ref ScriptInvokerBase< ScriptInvokerStringMethod > m_OnResourcePicked
SCR_ModularButtonComponent m_PickerButton
ref ScriptInvokerImagePickerComponent m_OnPickerButtonClicked
void OnPickerButtonClicked(SCR_ModularButtonComponent button)
Solve interaction: Open image capture or delete current.
ScriptInvokerBase< ScriptInvokerStringMethod > GetOnResourcePicked()
override void HandlerAttached(Widget w)
ScriptInvokerImagePickerComponent GetOnPickerButtonClick()
SCR_FieldOfViewSettings Attribute
EEditorMode
Editor mode that defines overall functionality.
Definition EEditorMode.c:6