Arma Reforger Explorer
1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Main Page
Modules
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Typedefs
c
f
l
m
o
p
r
s
t
Enumerations
a
b
c
d
e
f
g
i
k
l
m
p
r
s
u
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
Examples
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
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
}
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
SCR_BaseGameMode
Definition:
SCR_BaseGameMode.c:137
GetGame
ArmaReforgerScripted GetGame()
Definition:
game.c:1424
~SCR_FuelInventoryItemComponent
void ~SCR_FuelInventoryItemComponent()
Definition:
SCR_FuelInventoryItemComponent.c:52
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition:
SCR_RespawnBriefingComponent.c:17
InventoryItemComponentClass
Definition:
InventoryItemComponentClass.c:12
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition:
SCR_BaseGameModeComponent.c:15
OnFuelAmountChanged
protected void OnFuelAmountChanged(float newFuelValue)
Definition:
SCR_FuelInventoryItemComponent.c:45
Attribute
SCR_FuelInventoryItemComponentClass InventoryItemComponentClass Attribute("1", desc:"Weight of fuel per liter to update the inventory weight", params:"0 inf", category:"Fuel")
Definition:
SCR_FuelInventoryItemComponent.c:8
DelayedInit
protected void DelayedInit()
Definition:
SCR_FuelInventoryItemComponent.c:32
m_FuelManager
protected FuelManagerComponent m_FuelManager
Definition:
SCR_VehicleDamageManagerComponent.c:215
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition:
SCR_FuelNode.c:128
InventoryItemComponent
Definition:
InventoryItemComponent.c:12
SCR_FuelManagerComponent
void SCR_FuelManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition:
SCR_FuelManagerComponent.c:475
SCR_Global
Definition:
Functions.c:6
params
Configs ServerBrowser KickDialogs params
Definition:
SCR_NotificationSenderComponent.c:24
SCR_FuelInventoryItemComponentClass
Definition:
SCR_FuelInventoryItemComponent.c:2
category
params category
Definition:
SCR_VehicleDamageManagerComponent.c:180
scripts_Arma_Reforger_v1.1.0.42
scripts
Game
Inventory
SCR_FuelInventoryItemComponent.c
Generated by
1.8.17