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_ToggleLocalEditorNightModeToolbarAction.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_BaseContainerCustomTitleUIInfo
(
"m_Info"
)]
2
class
SCR_ToggleLocalEditorNightModeToolbarAction
:
SCR_BaseToggleToolbarAction
3
{
4
protected
SCR_NightModeGameModeComponent
m_NightModeComponent
;
5
6
//------------------------------------------------------------------------------------------------
7
protected
void
OnLocalEditorNightModeEnabledChanged
(
bool
state)
8
{
9
Toggle
(state, state)
10
}
11
12
//------------------------------------------------------------------------------------------------
13
override
bool
IsServer
()
14
{
15
return
false
;
16
}
17
18
//------------------------------------------------------------------------------------------------
19
override
bool
CanBeShown
(
SCR_EditableEntityComponent
hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities,
vector
cursorWorldPosition,
int
flags
)
20
{
21
if
(!
m_NightModeComponent
)
22
{
23
BaseGameMode gameMode =
GetGame
().GetGameMode();
24
if
(!gameMode)
25
return
false
;
26
27
m_NightModeComponent
= SCR_NightModeGameModeComponent.Cast(gameMode.FindComponent(SCR_NightModeGameModeComponent));
28
}
29
30
SCR_EditorManagerEntity
editorManager =
SCR_EditorManagerEntity
.GetInstance();
31
if
(!editorManager || editorManager.IsLimited())
32
return
false
;
33
34
return
m_NightModeComponent
&&
m_NightModeComponent
.CanEnableNightMode() && !
m_NightModeComponent
.IsGlobalNightModeEnabled();
35
}
36
37
//------------------------------------------------------------------------------------------------
38
override
bool
CanBePerformed
(
SCR_EditableEntityComponent
hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities,
vector
cursorWorldPosition,
int
flags
)
39
{
40
return
true
;
41
}
42
43
//------------------------------------------------------------------------------------------------
44
override
void
Perform
(
SCR_EditableEntityComponent
hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities,
vector
cursorWorldPosition,
int
flags
,
int
param = -1)
45
{
46
SCR_EditorManagerEntity
editorManager =
SCR_EditorManagerEntity
.GetInstance();
47
if
(!editorManager || editorManager.IsLimited())
48
return
;
49
50
//~ Toggle Local Editor Nightmode
51
m_NightModeComponent
.EnableLocalEditorNightMode(!
m_NightModeComponent
.IsLocalEditorNightModeEnabled(),
false
);
52
}
53
54
//------------------------------------------------------------------------------------------------
55
override
void
Track
()
56
{
57
if
(!
m_NightModeComponent
)
58
{
59
BaseGameMode gameMode =
GetGame
().GetGameMode();
60
if
(!gameMode)
61
return
;
62
63
m_NightModeComponent
= SCR_NightModeGameModeComponent.Cast(gameMode.FindComponent(SCR_NightModeGameModeComponent));
64
65
if
(!
m_NightModeComponent
)
66
return
;
67
}
68
69
m_NightModeComponent
.GetOnLocalEditorNightModeEnabledChanged().Insert(
OnLocalEditorNightModeEnabledChanged
);
70
OnLocalEditorNightModeEnabledChanged
(
m_NightModeComponent
.IsLocalEditorNightModeEnabled());
71
}
72
73
//------------------------------------------------------------------------------------------------
74
override
void
Untrack
()
75
{
76
if
(!
m_NightModeComponent
)
77
return
;
78
79
m_NightModeComponent
.GetOnLocalEditorNightModeEnabledChanged().Remove(
OnLocalEditorNightModeEnabledChanged
);
80
}
81
}
flags
SCR_EAIThreatSectorFlags flags
Definition
AIControlComponentSerializer.c:16
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_BaseContainerCustomTitleUIInfo
class SCR_ArsenalGameModeUIDataHolder SCR_BaseContainerCustomTitleUIInfo("m_UIInfo")
Definition
SCR_ArsenalManagerComponent.c:1752
SCR_EditorManagerEntity
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
Definition
SCR_EditorManagerEntity.c:2211
Toggle
void Toggle()
Toggle hint. Hide it if it's shown, and open it again if it's hidden.
Definition
SCR_HintManagerComponent.c:219
SCR_BaseToggleToolbarAction
Definition
SCR_BaseToggleToolbarAction.c:4
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
SCR_ToggleLocalEditorNightModeToolbarAction
Definition
SCR_ToggleLocalEditorNightModeToolbarAction.c:3
SCR_ToggleLocalEditorNightModeToolbarAction::Untrack
override void Untrack()
Definition
SCR_ToggleLocalEditorNightModeToolbarAction.c:74
SCR_ToggleLocalEditorNightModeToolbarAction::CanBePerformed
override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags)
Definition
SCR_ToggleLocalEditorNightModeToolbarAction.c:38
SCR_ToggleLocalEditorNightModeToolbarAction::IsServer
override bool IsServer()
Definition
SCR_ToggleLocalEditorNightModeToolbarAction.c:13
SCR_ToggleLocalEditorNightModeToolbarAction::OnLocalEditorNightModeEnabledChanged
void OnLocalEditorNightModeEnabledChanged(bool state)
Definition
SCR_ToggleLocalEditorNightModeToolbarAction.c:7
SCR_ToggleLocalEditorNightModeToolbarAction::m_NightModeComponent
SCR_NightModeGameModeComponent m_NightModeComponent
Definition
SCR_ToggleLocalEditorNightModeToolbarAction.c:4
SCR_ToggleLocalEditorNightModeToolbarAction::Track
override void Track()
Definition
SCR_ToggleLocalEditorNightModeToolbarAction.c:55
SCR_ToggleLocalEditorNightModeToolbarAction::CanBeShown
override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags)
Definition
SCR_ToggleLocalEditorNightModeToolbarAction.c:19
SCR_ToggleLocalEditorNightModeToolbarAction::Perform
override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags, int param=-1)
Definition
SCR_ToggleLocalEditorNightModeToolbarAction.c:44
vector
Definition
vector.c:13
scripts
Game
Editor
Containers
Actions
ToolbarActions
SCR_ToggleLocalEditorNightModeToolbarAction.c
Generated by
1.17.0