Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_InventoryItemHintUIInfo.c
Go to the documentation of this file.
7
9class 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 protected SCR_InventorySlotUI m_LastFocusedSlot;
18
19 //------------------------------------------------------------------------------------------------
24 bool CanBeShown(InventoryItemComponent item, SCR_InventorySlotUI focusedSlot)
25 {
26 m_LastFocusedSlot = focusedSlot;
27
28 //~ Make sure it is not shown if stored in arsenal
29 if (m_bHideInArsenal && SCR_ArsenalInventorySlotUI.Cast(focusedSlot))
30 return false;
31
32 switch (m_eShowWithInputDevice)
33 {
35 return true;
36 case SCR_EInventoryHintInputDevice.KEYBOARD_MOUSE_ONLY:
37 return GetGame().GetInputManager().IsUsingMouseAndKeyboard();
38 case SCR_EInventoryHintInputDevice.GAMEPAD_ONLY:
39 return !GetGame().GetInputManager().IsUsingMouseAndKeyboard();
40 }
41
42 return true;
43 }
44
45 //------------------------------------------------------------------------------------------------
46 override bool SetIconTo(ImageWidget imageWidget)
47 {
48 if (!imageWidget)
49 return false;
50
51 if (!super.SetIconTo(imageWidget))
52 {
53 imageWidget.SetOpacity(0);
54 return false;
55 }
56
57 imageWidget.SetColor(GetColor());
58 return true;
59 }
60
61 //------------------------------------------------------------------------------------------------
66 bool SetItemHintNameTo(InventoryItemComponent item, TextWidget textWidget)
67 {
68 if (!textWidget)
69 return false;
70
71 textWidget.SetText(GetItemHintName(item));
72 return true;
73 }
74
75 //------------------------------------------------------------------------------------------------
77 string GetItemHintName(InventoryItemComponent item)
78 {
79 return GetName();
80 }
81}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
bool CanBeShown(notnull SCR_EditorContentBrowserSaveStateDataUI tab)
Check if the given tab can be shown.
SCR_EInventoryHintInputDevice
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_FieldOfViewSettings Attribute
@ ANY
Will list all servers regardless platform compatibility.
Definition EnScript.c:8