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_FactionCommanderWithdrawUserAction.c
Go to the documentation of this file.
1
class
SCR_FactionCommanderWithdrawUserAction
:
SCR_FactionCommanderVolunteerUserAction
2
{
3
//------------------------------------------------------------------------------------------------
4
override
bool
CanBeShownScript(
IEntity
user)
5
{
6
if
(!
m_VotingManager
|| !
m_SignupComponent
)
7
return
false
;
8
9
SCR_Faction
playerFaction =
SCR_Faction
.Cast(
SCR_FactionManager
.SGetLocalPlayerFaction());
10
11
if
(!playerFaction)
12
return
false
;
13
14
int
playerId =
GetGame
().GetPlayerManager().GetPlayerIdFromControlledEntity(user);
15
16
if
(playerFaction.
GetCommanderId
() != playerId)
17
return
false
;
18
19
return
m_SignupComponent
.IsControlledByFaction(playerFaction);
20
}
21
22
//------------------------------------------------------------------------------------------------
23
override
bool
CanBePerformedScript(
IEntity
user)
24
{
25
return
true
;
26
}
27
28
//------------------------------------------------------------------------------------------------
29
override
void
PerformAction
(
IEntity
pOwnerEntity,
IEntity
pUserEntity)
30
{
31
if
(!
m_VotingManager
)
32
return
;
33
34
PlayerController pc =
GetGame
().GetPlayerController();
35
36
if
(!pc)
37
return
;
38
39
SCR_VoterComponent comp = SCR_VoterComponent.Cast(pc.FindComponent(SCR_VoterComponent));
40
41
if
(!comp)
42
return
;
43
44
comp.Vote(
EVotingType
.COMMANDER_WITHDRAW, pc.GetPlayerId());
45
}
46
}
EVotingType
EVotingType
Definition
EVotingType.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition
SCR_FactionManager.c:498
IEntity
Definition
IEntity.c:13
SCR_FactionCommanderVolunteerUserAction
Definition
SCR_FactionCommanderVolunteerUserAction.c:2
SCR_FactionCommanderVolunteerUserAction::m_SignupComponent
SCR_FactionCommanderSignupComponent m_SignupComponent
Definition
SCR_FactionCommanderVolunteerUserAction.c:7
SCR_FactionCommanderVolunteerUserAction::m_VotingManager
SCR_VotingManagerComponent m_VotingManager
Definition
SCR_FactionCommanderVolunteerUserAction.c:6
SCR_FactionCommanderWithdrawUserAction
Definition
SCR_FactionCommanderWithdrawUserAction.c:2
SCR_Faction
Definition
SCR_Faction.c:6
SCR_Faction::GetCommanderId
int GetCommanderId()
Definition
SCR_Faction.c:899
PerformAction
@ PerformAction
Definition
EUserActionEvent.c:15
scripts
Game
FactionCommander
UserActions
SCR_FactionCommanderWithdrawUserAction.c
Generated by
1.17.0