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_QuickslotBaseContainer.c
Go to the documentation of this file.
1
2
3
class
SCR_QuickslotBaseContainer
4
{
5
protected
static
const
string
COMMAND_OUTLINE_WIDGET_NAME
=
"CommandOutline"
;
6
7
//------------------------------------------------------------------------------------------------
9
void
ActivateContainer
();
10
11
//------------------------------------------------------------------------------------------------
14
void
HandleVisualization
(
ImageWidget
iconImage,
RenderTargetWidget
renderTarget,
RichTextWidget
text,
TextWidget
quickslotNumber);
15
16
//------------------------------------------------------------------------------------------------
18
bool
IsQuickslotActionAvailable
();
19
}
20
21
class
SCR_QuickslotEntityContainer
:
SCR_QuickslotBaseContainer
22
{
23
protected
IEntity
m_Entity
;
24
25
//------------------------------------------------------------------------------------------------
27
void
SetEntity
(
IEntity
entity)
28
{
29
m_Entity
= entity;
30
}
31
32
//------------------------------------------------------------------------------------------------
34
IEntity
GetEntity
()
35
{
36
return
m_Entity
;
37
}
38
39
//------------------------------------------------------------------------------------------------
41
void
SCR_QuickslotEntityContainer
(
IEntity
entity)
42
{
43
m_Entity
= entity;
44
}
45
46
//------------------------------------------------------------------------------------------------
48
void
ActivateContainer
(
SCR_InventorySlotUI
slotUI,
ChimeraCharacter
playerCharacter)
49
{
50
slotUI.
UseItem
(playerCharacter,
SCR_EUseContext
.FROM_QUICKSLOT);
51
}
52
53
//------------------------------------------------------------------------------------------------
55
override
void
HandleVisualization
(
ImageWidget
iconImage,
RenderTargetWidget
renderTarget,
RichTextWidget
text,
TextWidget
quickslotNumber)
56
{
57
iconImage.SetVisible(
false
);
58
renderTarget.SetVisible(
true
);
59
text.SetVisible(
false
);
60
quickslotNumber.SetVisible(
false
);
61
62
Widget
commandOutline = iconImage.GetParent().FindAnyWidget(COMMAND_OUTLINE_WIDGET_NAME);
63
if
(commandOutline)
64
commandOutline.SetVisible(
false
);
65
}
66
67
//------------------------------------------------------------------------------------------------
68
override
bool
IsQuickslotActionAvailable
()
69
{
70
if
(!
m_Entity
)
71
return
false
;
72
73
return
true
;
74
}
75
}
76
77
class
SCR_QuickslotCommandContainer
:
SCR_QuickslotBaseContainer
78
{
79
protected
string
m_sCommandName
;
80
81
//------------------------------------------------------------------------------------------------
83
void
SetCommandName
(
string
name)
84
{
85
m_sCommandName
= name;
86
}
87
88
//------------------------------------------------------------------------------------------------
90
string
GetCommandName
()
91
{
92
return
m_sCommandName
;
93
}
94
95
//------------------------------------------------------------------------------------------------
97
override
void
ActivateContainer
()
98
{
99
PlayerController playerController =
GetGame
().GetPlayerController();
100
if
(!playerController)
101
return
;
102
103
SCR_PlayerControllerCommandingComponent commandingComp = SCR_PlayerControllerCommandingComponent.Cast(playerController.FindComponent(SCR_PlayerControllerCommandingComponent));
104
if
(!commandingComp)
105
return
;
106
107
commandingComp.PrepareExecuteCommand(
m_sCommandName
);
108
}
109
110
//------------------------------------------------------------------------------------------------
112
override
void
HandleVisualization
(
ImageWidget
iconImage,
RenderTargetWidget
renderTarget,
RichTextWidget
text,
TextWidget
quickslotNumber)
113
{
114
//hide unused widgets which we do not want to use for command quickslot visualization
115
iconImage.SetVisible(
true
);
116
iconImage.SetColor(GUIColors.ENABLED);
117
renderTarget.SetVisible(
false
);
118
quickslotNumber.SetOpacity(0);
119
120
Widget
commandOutline = iconImage.GetParent().FindAnyWidget(
COMMAND_OUTLINE_WIDGET_NAME
);
121
if
(commandOutline)
122
commandOutline.SetVisible(
true
);
123
124
SCR_CommandingManagerComponent
commandingManager =
SCR_CommandingManagerComponent
.GetInstance();
125
if
(!commandingManager)
126
return
;
127
128
SCR_BaseRadialCommand
command = commandingManager.FindCommand(
m_sCommandName
);
129
if
(!command)
130
return
;
131
132
iconImage.LoadImageFromSet(0, command.
GetIconImageset
(), command.
GetIconName
());
133
}
134
135
//------------------------------------------------------------------------------------------------
137
void
SCR_QuickslotCommandContainer
(
string
name)
138
{
139
m_sCommandName
= name;
140
}
141
142
//------------------------------------------------------------------------------------------------
143
override
bool
IsQuickslotActionAvailable
()
144
{
145
return
!
m_sCommandName
.IsEmpty();
146
}
147
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
m_Entity
enum EAITargetInfoCategory m_Entity
SCR_CommandingManagerComponent
void SCR_CommandingManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_CommandingManagerComponent.c:46
SCR_EUseContext
SCR_EUseContext
Definition
SCR_EUseContext.c:2
SCR_QuickslotEntityContainer
void SCR_QuickslotEntityContainer(IEntity entity)
Definition
SCR_QuickslotBaseContainer.c:41
SetEntity
void SetEntity(IEntity entity)
Definition
SCR_QuickslotBaseContainer.c:27
ChimeraCharacter
Definition
ChimeraCharacter.c:13
IEntity
Definition
IEntity.c:13
ImageWidget
Definition
ImageWidget.c:13
RenderTargetWidget
Definition
RenderTargetWidget.c:13
RichTextWidget
Definition
RichTextWidget.c:13
SCR_BaseRadialCommand
Definition
SCR_BaseRadialCommand.c:3
SCR_BaseRadialCommand::GetIconName
string GetIconName()
Definition
SCR_BaseRadialCommand.c:43
SCR_BaseRadialCommand::GetIconImageset
ResourceName GetIconImageset()
Definition
SCR_BaseRadialCommand.c:57
SCR_InventorySlotUI
Definition
SCR_InventorySlotUI.c:26
SCR_InventorySlotUI::UseItem
void UseItem(IEntity player, SCR_EUseContext context)
Definition
SCR_InventorySlotUI.c:784
SCR_QuickslotBaseContainer
SCR_QuickslotBaseContainer is intended to be used for quickslots, to allow quickslotting of non-item ...
Definition
SCR_QuickslotBaseContainer.c:4
SCR_QuickslotBaseContainer::ActivateContainer
void ActivateContainer()
Gets called when the quickslot with this container is activated.
SCR_QuickslotBaseContainer::HandleVisualization
void HandleVisualization(ImageWidget iconImage, RenderTargetWidget renderTarget, RichTextWidget text, TextWidget quickslotNumber)
SCR_QuickslotBaseContainer::COMMAND_OUTLINE_WIDGET_NAME
static const string COMMAND_OUTLINE_WIDGET_NAME
Definition
SCR_QuickslotBaseContainer.c:5
SCR_QuickslotBaseContainer::IsQuickslotActionAvailable
bool IsQuickslotActionAvailable()
returns true if the containers action can be performed
SCR_QuickslotCommandContainer::IsQuickslotActionAvailable
override bool IsQuickslotActionAvailable()
Definition
SCR_QuickslotBaseContainer.c:143
SCR_QuickslotCommandContainer::GetCommandName
string GetCommandName()
Definition
SCR_QuickslotBaseContainer.c:90
SCR_QuickslotCommandContainer::ActivateContainer
override void ActivateContainer()
Definition
SCR_QuickslotBaseContainer.c:97
SCR_QuickslotCommandContainer::SCR_QuickslotCommandContainer
void SCR_QuickslotCommandContainer(string name)
Definition
SCR_QuickslotBaseContainer.c:137
SCR_QuickslotCommandContainer::SetCommandName
void SetCommandName(string name)
Definition
SCR_QuickslotBaseContainer.c:83
SCR_QuickslotCommandContainer::HandleVisualization
override void HandleVisualization(ImageWidget iconImage, RenderTargetWidget renderTarget, RichTextWidget text, TextWidget quickslotNumber)
Definition
SCR_QuickslotBaseContainer.c:112
SCR_QuickslotCommandContainer::m_sCommandName
string m_sCommandName
Definition
SCR_QuickslotBaseContainer.c:79
TextWidget
Definition
TextWidget.c:16
Widget
Definition
Widget.c:13
GetEntity
IEntity GetEntity()
Definition
SCR_QuickslotBaseContainer.c:34
scripts
Game
Inventory
SCR_QuickslotBaseContainer.c
Generated by
1.17.0