4 protected static const string ICON_NAME =
"compass";
7 protected string m_sPrefabResource;
10 override void SetWidgetNames()
18 override void InitPositionVectors()
29 protected void UpdateCompassEntity()
33 ChimeraCharacter player = ChimeraCharacter.Cast(
SCR_PlayerController.GetLocalControlledEntity());
34 if (!player || !player.GetCharacterController())
37 vector anglesCompass = vector.Zero;
38 anglesCompass[1] = player.GetCharacterController().GetInputContext().GetHeadingAngle() * Math.RAD2DEG;
43 if (m_CompassComp.GetMode() != EGadgetMode.IN_HAND)
44 m_CompassComp.SetMapMode();
47 float tick = System.GetFrameTimeS();
48 m_CompassComp.Update( tick );
52 BaseWorld previewWorld =
m_RTWorld.GetRef();
53 previewWorld.UpdateEntities();
57 protected void OnInputQuickBind(
float value, EActionTrigger reason)
63 protected override string GetPrefabResource()
65 return m_sPrefabResource;
69 override void SetVisible(
bool visible)
76 super.SetVisible(
false);
84 m_sPrefabResource = compassComp.GetMapPrefabResource();
86 super.SetVisible(visible);
91 ScriptCallQueue queue =
GetGame().GetCallqueue();
93 queue.CallLater(UpdateCompassEntity, 0,
true);
95 UpdateCompassEntity();
96 m_CompassComp.Init2DMapCompass();
101 ScriptCallQueue queue =
GetGame().GetCallqueue();
103 queue.Remove(UpdateCompassEntity);
105 super.SetVisible(visible);
118 GetGame().GetInputManager().AddActionListener(
"MapToolCompass", EActionTrigger.DOWN, OnInputQuickBind);
123 override void Update(
float timeSlice)
129 m_CompassComp.DragMapCompass();
132 WorkspaceWidget workspace = g_Game.GetWorkspace();