4 protected SCR_NightModeGameModeComponent m_NightModeComponent;
7 protected void OnLocalEditorNightModeEnabledChanged(
bool state)
13 override bool IsServer()
19 override bool CanBeShown(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags)
21 if (!m_NightModeComponent)
23 BaseGameMode gameMode =
GetGame().GetGameMode();
27 m_NightModeComponent = SCR_NightModeGameModeComponent.Cast(gameMode.FindComponent(SCR_NightModeGameModeComponent));
31 if (!editorManager || editorManager.IsLimited())
34 return m_NightModeComponent && m_NightModeComponent.CanEnableNightMode() && !m_NightModeComponent.IsGlobalNightModeEnabled();
38 override bool CanBePerformed(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags)
44 override void Perform(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags,
int param = -1)
47 if (!editorManager || editorManager.IsLimited())
51 m_NightModeComponent.EnableLocalEditorNightMode(!m_NightModeComponent.IsLocalEditorNightModeEnabled(),
false);
57 if (!m_NightModeComponent)
59 BaseGameMode gameMode =
GetGame().GetGameMode();
63 m_NightModeComponent = SCR_NightModeGameModeComponent.Cast(gameMode.FindComponent(SCR_NightModeGameModeComponent));
65 if (!m_NightModeComponent)
69 m_NightModeComponent.GetOnLocalEditorNightModeEnabledChanged().Insert(OnLocalEditorNightModeEnabledChanged);
70 OnLocalEditorNightModeEnabledChanged(m_NightModeComponent.IsLocalEditorNightModeEnabled());
74 override void Untrack()
76 if (!m_NightModeComponent)
79 m_NightModeComponent.GetOnLocalEditorNightModeEnabledChanged().Remove(OnLocalEditorNightModeEnabledChanged);