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_FuelInventoryItemComponent.c
Go to the documentation of this file.
1
[
ComponentEditorProps
(
category
:
"GameScripted/Misc"
, description:
""
)]
2
class
SCR_FuelInventoryItemComponentClass
:
InventoryItemComponentClass
3
{
4
}
5
6
class
SCR_FuelInventoryItemComponent :
InventoryItemComponent
7
{
8
[
Attribute
(
"1"
,
desc
:
"Weight of fuel per liter to update the inventory weight"
,
params
:
"0 inf"
,
category
:
"Fuel"
)]
9
protected
float
m_fFuelWeightPerLiter;
10
11
protected
SCR_FuelManagerComponent
m_FuelManager
;
12
13
//------------------------------------------------------------------------------------------------
14
// constructor
18
void
SCR_FuelInventoryItemComponent(
IEntityComponentSource
src,
IEntity
ent,
IEntity
parent)
19
{
20
if
(
SCR_Global
.
IsEditMode
())
21
return
;
22
23
SCR_BaseGameMode
gameMode =
SCR_BaseGameMode
.Cast(
GetGame
().
GetGameMode
());
24
if
((gameMode && !gameMode.
IsMaster
()) || (!gameMode &&
Replication
.IsClient()))
25
return
;
26
27
//~ Call a frame later so fuel manager can init correctly
28
GetGame
().GetCallqueue().CallLater(
DelayedInit
);
29
}
30
31
//------------------------------------------------------------------------------------------------
32
protected
void
DelayedInit
()
33
{
34
m_FuelManager
=
SCR_FuelManagerComponent
.Cast(
GetOwner
().
FindComponent
(
SCR_FuelManagerComponent
));
35
if
(
m_FuelManager
)
36
{
37
m_FuelManager
.GetOnFuelChanged().Insert(
OnFuelAmountChanged
);
38
OnFuelAmountChanged
(
m_FuelManager
.GetTotalFuel());
39
}
40
else
41
Debug
.Error2(
"SCR_FuelInventoryItemComponent"
,
"Fuel Inventory Item does not have a 'SCR_FuelManagerComponent'!"
);
42
}
43
44
//------------------------------------------------------------------------------------------------
45
protected
void
OnFuelAmountChanged
(
float
newFuelValue)
46
{
47
SetAdditionalWeight
(newFuelValue * m_fFuelWeightPerLiter);
48
}
49
50
//------------------------------------------------------------------------------------------------
51
// destructor
52
void
~SCR_FuelInventoryItemComponent
()
53
{
54
if
(
m_FuelManager
)
55
m_FuelManager
.GetOnFuelChanged().Remove(
OnFuelAmountChanged
);
56
}
57
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
ComponentEditorProps
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
Definition
SCR_AIGroupUtilityComponent.c:12
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition
SCR_BaseGameModeComponent.c:15
DelayedInit
override void DelayedInit(IEntity owner)
Definition
SCR_BaseItemSupportStationComponent.c:17
DelayedInit
override void DelayedInit()
Definition
SCR_CharacterIdentityBioGroupConfig.c:270
SetAdditionalWeight
override void SetAdditionalWeight()
Definition
SCR_CharacterIdentityBioGroupConfig.c:292
OnFuelAmountChanged
void OnFuelAmountChanged(float newFuelValue)
Definition
SCR_FuelInventoryItemComponent.c:45
~SCR_FuelInventoryItemComponent
void ~SCR_FuelInventoryItemComponent()
Definition
SCR_FuelInventoryItemComponent.c:52
SCR_FuelManagerComponent
void SCR_FuelManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_FuelManagerComponent.c:475
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
m_FuelManager
FuelManagerComponent m_FuelManager
Definition
SCR_VehicleDamageManagerComponent.c:336
Debug
Definition
Debug.c:13
GenericComponent::FindComponent
proto external GenericComponent FindComponent(typename typeName)
IEntityComponentSource
Definition
IEntityComponentSource.c:13
IEntity
Definition
IEntity.c:13
InventoryItemComponentClass
Definition
InventoryItemComponentClass.c:13
InventoryItemComponent
Definition
InventoryItemComponent.c:13
Replication
Main replication API.
Definition
Replication.c:14
SCR_BaseGameMode
Definition
SCR_BaseGameMode.c:139
SCR_BaseGameMode::IsMaster
sealed bool IsMaster()
Definition
SCR_BaseGameMode.c:367
SCR_FuelInventoryItemComponentClass
Definition
SCR_FuelInventoryItemComponent.c:3
SCR_Global
Definition
Functions.c:7
SCR_Global::IsEditMode
static bool IsEditMode()
Definition
Functions.c:1566
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Inventory
SCR_FuelInventoryItemComponent.c
Generated by
1.17.0