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_VoteHintCondition.c
Go to the documentation of this file.
1
[
BaseContainerProps
(), SCR_BaseContainerHintCondition()]
2
class
SCR_VoteGameMasterCondition
:
SCR_BaseEditorHintCondition
3
{
4
[
Attribute
(
"0"
,
UIWidgets
.ComboBox,
"Type of tracked vote."
, enums: ParamEnumArray.FromEnum(
EVotingType
))]
5
protected
EVotingType
m_Type
;
6
7
[
Attribute
()]
8
protected
bool
m_bShowInPlayerList
;
9
10
//------------------------------------------------------------------------------------------------
11
protected
void
OnVotingStart
(
EVotingType
type
,
int
value)
12
{
13
if
(
type
==
m_Type
&&
IsPlayerListMenu
())
14
Activate
();
15
}
16
17
//------------------------------------------------------------------------------------------------
18
protected
void
OnVotingEnd
(
EVotingType
type
,
int
value,
int
winner)
19
{
20
if
(
type
==
m_Type
&&
IsPlayerListMenu
())
21
Deactivate
();
22
}
23
24
//------------------------------------------------------------------------------------------------
25
protected
void
OnVoteLocal
(
EVotingType
type
,
int
value)
26
{
27
if
(
type
==
m_Type
&&
IsPlayerListMenu
())
28
Deactivate
();
29
}
30
31
//------------------------------------------------------------------------------------------------
32
protected
void
OnPlayerListMenu
(
bool
isOpened)
33
{
34
if
(!isOpened)
35
return
;
36
37
SCR_VotingManagerComponent
votingManager =
SCR_VotingManagerComponent
.GetInstance();
38
if
(votingManager && votingManager.IsVoting(
m_Type
))
39
Activate
();
40
}
41
42
//------------------------------------------------------------------------------------------------
43
protected
bool
IsPlayerListMenu
()
44
{
45
if
(!
m_bShowInPlayerList
)
46
return
true
;
47
48
MenuManager
menuManager =
GetGame
().GetMenuManager();
49
return
!menuManager || menuManager.
FindMenuByPreset
(
ChimeraMenuPreset
.PlayerListMenu);
50
}
51
52
//------------------------------------------------------------------------------------------------
53
override
protected
void
OnInitCondition
(Managed owner)
54
{
55
SCR_VotingManagerComponent
votingManager =
SCR_VotingManagerComponent
.GetInstance();
56
if
(!votingManager)
57
return
;
58
59
votingManager.GetOnVotingStart().Insert(
OnVotingStart
);
60
votingManager.GetOnVotingEnd().Insert(
OnVotingEnd
);
61
votingManager.GetOnVoteLocal().Insert(
OnVoteLocal
);
62
votingManager.GetOnRemoveVoteLocal().Insert(
OnVotingStart
);
63
64
SCR_PlayerListMenu
.
GetOnPlayerListMenu
().Insert(
OnPlayerListMenu
);
65
}
66
67
//------------------------------------------------------------------------------------------------
68
override
protected
void
OnExitCondition
(Managed owner)
69
{
70
SCR_VotingManagerComponent
votingManager =
SCR_VotingManagerComponent
.GetInstance();
71
if
(!votingManager)
72
return
;
73
74
votingManager.GetOnVotingStart().Remove(
OnVotingStart
);
75
votingManager.GetOnVotingEnd().Remove(
OnVotingEnd
);
76
votingManager.GetOnVoteLocal().Remove(
OnVoteLocal
);
77
votingManager.GetOnRemoveVoteLocal().Remove(
OnVotingStart
);
78
79
SCR_PlayerListMenu
.
GetOnPlayerListMenu
().Remove(
OnPlayerListMenu
);
80
}
81
}
ChimeraMenuPreset
ChimeraMenuPreset
Menu presets.
Definition
ChimeraMenuBase.c:4
EVotingType
EVotingType
Definition
EVotingType.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
type
EDamageType type
Definition
SCR_DestructibleTreeV2.c:32
SCR_VotingManagerComponent
void SCR_VotingManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_VotingManagerComponent.c:1083
MenuManager
Definition
MenuManager.c:13
MenuManager::FindMenuByPreset
proto external MenuBase FindMenuByPreset(ScriptMenuPresetEnum preset)
Finds first menu/dialog with given preset index, or nullptr when there is no such menu opened.
SCR_BaseEditorHintCondition
Definition
SCR_BaseEditorHintCondition.c:3
SCR_BaseHintCondition::Activate
void Activate()
Definition
SCR_BaseHintCondition.c:11
SCR_BaseHintCondition::Deactivate
void Deactivate()
Definition
SCR_BaseHintCondition.c:29
SCR_PlayerListMenu
Definition
SCR_PlayerListMenu.c:40
SCR_PlayerListMenu::GetOnPlayerListMenu
static ScriptInvoker GetOnPlayerListMenu()
Definition
SCR_PlayerListMenu.c:106
SCR_VoteGameMasterCondition
Definition
SCR_VoteHintCondition.c:3
SCR_VoteGameMasterCondition::IsPlayerListMenu
bool IsPlayerListMenu()
Definition
SCR_VoteHintCondition.c:43
SCR_VoteGameMasterCondition::m_bShowInPlayerList
bool m_bShowInPlayerList
Definition
SCR_VoteHintCondition.c:8
SCR_VoteGameMasterCondition::OnPlayerListMenu
void OnPlayerListMenu(bool isOpened)
Definition
SCR_VoteHintCondition.c:32
SCR_VoteGameMasterCondition::OnVotingStart
void OnVotingStart(EVotingType type, int value)
Definition
SCR_VoteHintCondition.c:11
SCR_VoteGameMasterCondition::m_Type
EVotingType m_Type
Definition
SCR_VoteHintCondition.c:5
SCR_VoteGameMasterCondition::OnInitCondition
void OnInitCondition(Managed owner)
Definition
SCR_VoteHintCondition.c:53
SCR_VoteGameMasterCondition::OnVotingEnd
void OnVotingEnd(EVotingType type, int value, int winner)
Definition
SCR_VoteHintCondition.c:18
SCR_VoteGameMasterCondition::OnVoteLocal
void OnVoteLocal(EVotingType type, int value)
Definition
SCR_VoteHintCondition.c:25
SCR_VoteGameMasterCondition::OnExitCondition
void OnExitCondition(Managed owner)
Definition
SCR_VoteHintCondition.c:68
UIWidgets
Definition
attributes.c:40
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Components
Hints
HintConditions
SCR_VoteHintCondition.c
Generated by
1.17.0