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_EquipGadgetAction.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
3
class
SCR_EquipGadgetAction
:
SCR_InventoryAction
4
{
5
[
Attribute
(
"#AR-Inventory_NoSlot"
,
desc
:
"Invalid reason no free slot"
)]
6
protected
LocalizedString
m_sInvalid_NoFreeSlot
;
7
8
#ifndef DISABLE_INVENTORY
9
//------------------------------------------------------------------------------------------------
10
override
bool
CanBePerformedScript
(
IEntity
user)
11
{
12
ChimeraCharacter
character =
ChimeraCharacter
.Cast(user);
13
if
(!character)
14
return
false
;
15
16
CharacterControllerComponent controller = character.GetCharacterController();
17
if
(!controller)
18
return
false
;
19
20
SCR_InventoryStorageManagerComponent inventoryStorageManager = SCR_InventoryStorageManagerComponent.Cast(controller.GetInventoryStorageManager());
21
if
(!inventoryStorageManager)
22
return
false
;
23
24
SCR_HandSlotStorageComponent storageComp = SCR_HandSlotStorageComponent.Cast(inventoryStorageManager.FindStorageForItem(
GetOwner
(),
EStoragePurpose
.PURPOSE_EQUIPMENT_ATTACHMENT));
25
if
(!storageComp)
26
{
27
switch
(inventoryStorageManager.GetReturnCode())
28
{
29
case
EInventoryRetCode.RETCODE_ITEM_TOO_BIG:
30
{
31
SetCannotPerformReason
(
SREASON_TOO_BIG
);
32
break
;
33
}
34
35
case
EInventoryRetCode.RETCODE_ITEM_TOO_BIG:
36
{
37
SetCannotPerformReason
(
SREASON_TOO_HEAVY
);
38
break
;
39
}
40
41
default
:
42
{
43
SetCannotPerformReason
(
m_sInvalid_NoFreeSlot
);
44
}
45
}
46
return
false
;
47
}
48
49
return
true
;
50
}
51
52
//------------------------------------------------------------------------------------------------
53
override
protected
void
PerformActionInternal
(SCR_InventoryStorageManagerComponent manager,
IEntity
pOwnerEntity,
IEntity
pUserEntity)
54
{
55
if
(
CanBePerformedScript
(pUserEntity))
56
manager.EquipGadget( pOwnerEntity );
57
}
58
#endif
59
};
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
BaseUserAction::SetCannotPerformReason
void SetCannotPerformReason(string reason)
Definition
BaseUserAction.c:21
BaseUserAction::GetOwner
proto external IEntity GetOwner()
Returns the parent entity of this action.
ChimeraCharacter
Definition
ChimeraCharacter.c:13
IEntity
Definition
IEntity.c:13
LocalizedString
Definition
LocalizedString.c:22
SCR_EquipGadgetAction
modded version for to be used with the inventory 2.0
Definition
SCR_EquipGadgetAction.c:4
SCR_EquipGadgetAction::PerformActionInternal
void PerformActionInternal(SCR_InventoryStorageManagerComponent manager, IEntity pOwnerEntity, IEntity pUserEntity)
Definition
SCR_EquipGadgetAction.c:53
SCR_EquipGadgetAction::CanBePerformedScript
override bool CanBePerformedScript(IEntity user)
Definition
SCR_EquipGadgetAction.c:10
SCR_EquipGadgetAction::m_sInvalid_NoFreeSlot
LocalizedString m_sInvalid_NoFreeSlot
Definition
SCR_EquipGadgetAction.c:6
SCR_InventoryAction
modded version for to be used with the inventory 2.0
Definition
SCR_InventoryAction.c:4
SCR_InventoryAction::SREASON_TOO_BIG
const string SREASON_TOO_BIG
Definition
SCR_InventoryAction.c:7
SCR_InventoryAction::SREASON_TOO_HEAVY
const string SREASON_TOO_HEAVY
Definition
SCR_InventoryAction.c:8
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EStoragePurpose
EStoragePurpose
Definition
EStoragePurpose.c:13
scripts
Game
UserActions
SCR_EquipGadgetAction.c
Generated by
1.17.0