12 protected string m_sOpeningEditorMapSfx;
15 protected string m_sClosingEditorMapSfx;
17 protected ResourceName m_sMapConfigEditorPrefab;
21 protected bool m_bWasMapOpened;
22 protected bool m_bIsInit;
26 protected ref Color m_CameraIconColor = Color.White;
28 bool GetMapAvailable()
35 m_MapHandler = mapHandler;
39 ResourceName GetMapConfigPrefab()
41 return m_sMapConfigEditorPrefab;
46 ShowMap(!IsEditorMapOpen());
49 void ShowMap(
bool show)
57 if (show && GetManager().IsLimited())
64 if (gadgetManager && !gadgetManager.GetGadgetByType(EGadgetType.MAP))
73 m_MapHandler.ToggleMap(show, m_sMapConfigEditorPrefab);
77 void OnPlacingPreviewCreate()
79 if (IsEditorMapOpen())
85 protected bool IsEditorMapOpen()
89 return m_MapHandler.IsEditorMapOpen();
94 protected void OnLimitedChange(
bool isLimited)
97 if (isLimited && IsEditorMapOpen())
105 if (!menuComponent || !menuComponent.GetMenu())
109 return mapEditorComponent;
112 override void OnPostInit(IEntity owner)
116 super.OnPostInit(owner);
122 BaseGameMode gameMode =
GetGame().GetGameMode();
126 SCR_MapConfigComponent configComp = SCR_MapConfigComponent.Cast(gameMode.FindComponent(SCR_MapConfigComponent));
128 m_sMapConfigEditorPrefab = configComp.GetEditorMapConfig();
137 if (previewEntityComponent)
139 previewEntityComponent.GetOnPreviewCreate().Insert(OnPlacingPreviewCreate);
145 override void EOnDeactivate(IEntity owner)