3 protected static const string ICON_NAME =
"watch";
5 protected SCR_WristwatchComponent m_WristwatchComp;
6 protected string m_sPrefabResource;
9 override void SetWidgetNames()
17 override void InitPositionVectors()
19 m_WristwatchComp = SCR_WristwatchComponent.Cast(
m_RTEntity.FindComponent(SCR_WristwatchComponent) );
28 protected void UpdatePreviewEntity()
33 if (m_WristwatchComp.GetMode() != EGadgetMode.IN_HAND)
34 m_WristwatchComp.SetMapMode();
37 m_WristwatchComp.UpdateTime();
41 BaseWorld previewWorld =
m_RTWorld.GetRef();
42 previewWorld.UpdateEntities();
46 protected void OnInputQuickBind(
float value, EActionTrigger reason)
52 protected override string GetPrefabResource()
54 return m_sPrefabResource;
60 override void SetVisible(
bool visible)
67 super.SetVisible(
false);
71 SCR_WristwatchComponent watchComp = SCR_WristwatchComponent.Cast(wristwatch.FindComponent(SCR_WristwatchComponent));
75 m_sPrefabResource = watchComp.GetMapPrefabResource();
77 super.SetVisible(visible);
82 ScriptCallQueue queue =
GetGame().GetCallqueue();
84 queue.CallLater(UpdatePreviewEntity, 0,
true);
88 ScriptCallQueue queue =
GetGame().GetCallqueue();
90 queue.Remove(UpdatePreviewEntity);
92 super.SetVisible(visible);
105 GetGame().GetInputManager().AddActionListener(
"MapToolWatch", EActionTrigger.DOWN, OnInputQuickBind);
110 override void Update(
float timeSlice)
116 WorkspaceWidget workspace = g_Game.GetWorkspace();