Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_FieldManualPiece_ImageGallery.c
Go to the documentation of this file.
1 [BaseContainerProps(), SCR_BaseContainerStaticTitleField(customTitle: "Images Gallery")]
3 {
4  [Attribute(defvalue: SCR_Enum.GetDefault(SCR_EFieldManual_ImageGalleryType.GALLERY_HORIZONTAL), uiwidget: UIWidgets.ComboBox, enums: SCR_Enum.GetList(SCR_EFieldManual_ImageGalleryType))]
5  protected SCR_EFieldManual_ImageGalleryType m_eType;
6 
7  [Attribute()]
8  protected string m_sText;
9 
10  [Attribute()]
11  protected ref array<ref SCR_FieldManual_ImageData> m_aImages;
12 
13  [Attribute(defvalue: "{68553AA626CD1A40}UI/layouts/Menus/FieldManual/Pieces/FieldManual_Piece_ImageGallery.layout", uiwidget: UIWidgets.EditBoxWithButton, params: "layout")]
14  protected ResourceName m_Layout;
15 
16  protected SCR_FieldManual_ImageGalleryComponent m_ImageGalleryComponent;
17 
18  //------------------------------------------------------------------------------------------------
19  override void CreateWidget(notnull Widget parent)
20  {
21  WorkspaceWidget workspace = GetGame().GetWorkspace();
22 
23  Widget createdWidget = workspace.CreateWidgets(m_Layout, parent);
24  if (!createdWidget)
25  {
26  Print("could not create Image Gallery widget | " + FilePath.StripPath(__FILE__) + ":" + __LINE__, LogLevel.WARNING);
27  return;
28  }
29 
30  m_ImageGalleryComponent = SCR_FieldManual_ImageGalleryComponent.Cast(createdWidget.FindHandler(SCR_FieldManual_ImageGalleryComponent));
31  if (!m_ImageGalleryComponent)
32  return;
33 
34  m_ImageGalleryComponent.Init(m_eType, m_sText, m_aImages);
36  GetGame().OnInputDeviceIsGamepadInvoker().Insert(m_ImageGalleryComponent.Rebuild);
37  }
38 
39  //------------------------------------------------------------------------------------------------
40  // constructor
42  {
43  if (!m_aImages) // can be config-provided
44  m_aImages = {};
45  }
46 
47  //------------------------------------------------------------------------------------------------
48  // destructor
50  {
51  if (m_ImageGalleryComponent && GetGame().OnInputDeviceIsGamepadInvoker())
52  GetGame().OnInputDeviceIsGamepadInvoker().Remove(m_ImageGalleryComponent.Rebuild);
53  }
54 }
SCR_Enum
Definition: SCR_Enum.c:1
SCR_BaseContainerStaticTitleField
Attribute to manually set a static title.
Definition: Attributes.c:10
SCR_FieldManualPiece
Definition: SCR_FieldManualPiece.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
m_Layout
ResourceName m_Layout
Definition: SCR_ActionsToolbarEditorUIComponent.c:6
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_eType
protected SCR_ECampaignBaseType m_eType
Definition: SCR_CampaignMilitaryBaseComponent.c:59
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
OnInputDeviceIsGamepadInvoker
ScriptInvoker OnInputDeviceIsGamepadInvoker()
Definition: game.c:246
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468
m_sText
class SCR_BaseEditorAttribute m_sText