4 protected InputManager m_InputManager;
12 protected ref Color m_CameraIconColor = Color.White;
13 protected Widget m_MapWidget;
15 protected ResourceName m_EditorMapConfigPrefab;
16 protected ref MapConfiguration m_MapConfigEditor;
17 protected bool m_bIsFirstTimeOpened =
true;
23 void ToggleMap(
bool show, ResourceName mapConfigPrefab)
25 if (mapConfigPrefab.IsEmpty())
39 m_EditorCamera.SetInputEnabled(!show);
43 protected void OnMapInit(MapConfiguration config)
45 if (IsConfigEditor(config))
47 m_MapWidget.SetVisible(
true);
52 protected void OnMapOpen(MapConfiguration config)
54 if (IsConfigEditor(config))
65 protected void OnMapClose(MapConfiguration config)
67 if (IsConfigEditor(config))
68 m_MapWidget.SetVisible(
false);
74 bool IsEditorMapOpen()
80 protected bool IsConfigEditor(MapConfiguration config)
93 cameraComponent.GetOnCameraCreate().Remove(OnEditorCameraCreate);
101 cameraComponent.GetOnCameraCreate().Insert(OnEditorCameraCreate);
102 OnEditorCameraCreate(cameraComponent.GetCamera());
105 SetCameraIconColor(newModeEntity.GetModeType());
110 protected void SetCameraIconColor(
EEditorMode mode)
117 m_CameraIconColor = modeUiInfo.GetModeColor();
118 else if (m_EditorCore.GetDefaultModeInfo(
EEditorMode.EDIT))
119 m_CameraIconColor = m_EditorCore.GetDefaultModeInfo(
EEditorMode.EDIT).GetModeColor();
128 m_EditorCamera = editorCamera;
131 m_EditorCamera.SetInputEnabled(!IsEditorMapOpen());
135 protected void OnMenuUpdate()
137 if (IsEditorMapOpen())
142 override void HandlerAttachedScripted(Widget w)
144 super.HandlerAttachedScripted(w);
168 if (!m_EditorMapManager)
173 m_EditorMapManager.SetMapHandler(
this);
174 m_EditorMapConfigPrefab = m_EditorMapManager.GetMapConfigPrefab();
178 GetMenu().GetOnMenuUpdate().Insert(OnMenuUpdate);
184 override void HandlerDeattached(Widget w)
189 super.HandlerDeattached(w);
191 if (IsEditorMapOpen())
192 ToggleMap(
false, m_EditorMapConfigPrefab);
195 GetMenu().GetOnMenuUpdate().Remove(OnMenuUpdate);