Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_InventoryItemHintUIInfo.c
Go to the documentation of this file.
2 {
3  ANY = 0,
6 }
7 
9 class SCR_InventoryItemHintUIInfo : SCR_ColorUIInfo
10 {
11  [Attribute(SCR_EInventoryHintInputDevice.ANY.ToString(), desc: "Show hint depending on input device", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(SCR_EInventoryHintInputDevice))]
12  protected SCR_EInventoryHintInputDevice m_eShowWithInputDevice;
13 
14  [Attribute("0", desc: "If true than will never show this hint when item is in arsenal")]
15  protected bool m_bHideInArsenal;
16 
17  //------------------------------------------------------------------------------------------------
23  {
24  //~ Make sure it is not shown if stored in arsenal
25  if (m_bHideInArsenal && SCR_ArsenalInventorySlotUI.Cast(focusedSlot))
26  return false;
27 
28  switch (m_eShowWithInputDevice)
29  {
31  return true;
32  case SCR_EInventoryHintInputDevice.KEYBOARD_MOUSE_ONLY:
33  return GetGame().GetInputManager().IsUsingMouseAndKeyboard();
34  case SCR_EInventoryHintInputDevice.GAMEPAD_ONLY:
35  return !GetGame().GetInputManager().IsUsingMouseAndKeyboard();
36  }
37 
38  return true;
39  }
40 
41  //------------------------------------------------------------------------------------------------
42  override bool SetIconTo(ImageWidget imageWidget)
43  {
44  if (!imageWidget)
45  return false;
46 
47  if (!super.SetIconTo(imageWidget))
48  {
49  imageWidget.SetOpacity(0);
50  return false;
51  }
52 
53  imageWidget.SetColor(GetColor());
54  return true;
55  }
56 
57  //------------------------------------------------------------------------------------------------
62  bool SetItemHintNameTo(InventoryItemComponent item, TextWidget textWidget)
63  {
64  if (!textWidget)
65  return false;
66 
67  textWidget.SetText(GetItemHintName(item));
68  return true;
69  }
70 
71  //------------------------------------------------------------------------------------------------
73  string GetItemHintName(InventoryItemComponent item)
74  {
75  return GetName();
76  }
77 }
SCR_ColorUIInfo
Definition: SCR_ColorUIInfo.c:2
GetName
string GetName()
Definition: SCR_ScenarioFrameworkLayerBase.c:85
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_ArsenalInventorySlotUI
Definition: SCR_ArsenalInventorySlotUI.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
GAMEPAD_ONLY
@ GAMEPAD_ONLY
Definition: SCR_InventoryItemHintUIInfo.c:5
Attribute
typedef Attribute
Post-process effect of scripted camera.
CanBeShown
bool CanBeShown(notnull SCR_EditorContentBrowserSaveStateDataUI tab)
Check if the given tab can be shown.
Definition: SCR_CampaignBuildingEditorComponent.c:326
KEYBOARD_MOUSE_ONLY
@ KEYBOARD_MOUSE_ONLY
Definition: SCR_InventoryItemHintUIInfo.c:4
SCR_EInventoryHintInputDevice
SCR_EInventoryHintInputDevice
Definition: SCR_InventoryItemHintUIInfo.c:1
InventoryItemComponent
Definition: InventoryItemComponent.c:12
GetColor
Color GetColor()
Definition: SCR_EditableCommentComponent.c:52
ANY
@ ANY
Definition: SCR_InventoryItemHintUIInfo.c:3
SCR_InventorySlotUI
Definition: SCR_InventorySlotUI.c:27
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