6 bool isFixedMode =
true;
9 static int startPos[2];
10 static int startPosMultiSel[2];
14 static WorkspaceWidget m_WorkspaceWidget;
18 static int Scale(
int pos)
20 if (!m_WorkspaceWidget)
21 m_WorkspaceWidget =
GetGame().GetWorkspace();
23 return m_WorkspaceWidget.DPIScale(pos);
32 startPosMultiSel = {0, 0};
41 [
Attribute(defvalue:
"1.5", uiwidget: UIWidgets.EditBox,
desc:
"Panning: multiplier of keyboard panning speed",
params:
"0.1 10")]
42 float m_fPanKBMMultiplier;
44 [
Attribute(defvalue:
"1.5", uiwidget: UIWidgets.EditBox,
desc:
"Panning: multiplier of thubmstick panning speed",
params:
"0.1 10")]
45 float m_fPanStickMultiplier;
47 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.CheckBox,
desc:
"Enables panning by moving cursor to the screen edges")]
48 bool m_bEnableCursorEdgePan;
50 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.CheckBox,
desc:
"Center KBM cursor on map open")]
51 bool m_bIsCursorCenteredOnOpen;
53 [
Attribute(defvalue:
"0.1", uiwidget: UIWidgets.EditBox,
desc:
"Time it takes to perform zooming of a single step",
params:
"0.01 10")]
54 float m_fZoomAnimTime;
56 [
Attribute(defvalue:
"2", uiwidget: UIWidgets.EditBox,
desc:
"Each zoom step is increased/decreased by the currentZoom/thisVariable, lower number means faster steps",
params:
"0.1 10")]
57 float m_fZoomStrength;
59 [
Attribute(defvalue:
"100", uiwidget: UIWidgets.EditBox,
desc:
"This is multiplier of average frame time resulting in a rotation degree value",
params:
"100 1000")]
60 int m_iRotateSpeedMouse;
62 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.CheckBox,
desc:
"Enables custom map crosshair visuals")]
63 bool m_bEnableMapCrosshairVisuals;
65 [
Attribute(defvalue:
"0", uiwidget: UIWidgets.CheckBox,
desc:
"Enables crosshair grid coordinate display")]
66 bool m_bEnableCrosshairCoords;
68 [
Attribute(
"0 0 0 1", UIWidgets.ColorPicker,
desc:
"Cursor grid/guide lines color")]
69 ref Color m_GuidelineColor;
71 [
Attribute(
"", UIWidgets.Object,
"Cursor state configuration")]
72 protected ref array<ref SCR_CursorVisualState> m_aCursorStatesConfig;
74 protected ref map<EMapCursorState, SCR_CursorVisualState> m_aCursorStatesMap =
new map<EMapCursorState, SCR_CursorVisualState>;
77 protected static bool m_bRecentlyTraced;
78 protected static ref array<Widget> s_aTracedWidgets = {};
81 const int CURSOR_CAPTURE_OFFSET = 10;
82 const int GUILDING_LINE_WIDTH = 16;
83 const float PAN_DEFAULT_COUNTDOWN = 0.1;
84 const float SINGLE_SELECTION_RANGE = 50.0;
85 const float CIRCLE_SELECTION_RANGE = 500.0;
86 const float FREE_CURSOR_RESET = 3.0;
103 protected float m_fPanCountdown;
104 protected float m_fModifActionDelay;
105 protected float m_fZoomHoldTime;
106 protected float m_fHoverTime;
107 protected float m_fFreeCursorTime;
108 protected float m_fSelectHoldTime;
114 protected bool m_bIsInit;
115 protected bool m_bIsDisabled;
116 protected bool m_bIsDraggingAvailable;
117 protected bool m_bIsSelectionAvailable;
118 protected bool m_bIsModifierActive;
119 protected int m_iRotationDirVal;
120 protected float m_fZoomMultiplierWheel = 1;
121 protected InputManager m_InputManager;
124 protected CanvasWidget m_MapWidget;
128 protected Widget m_wCrossGrid;
129 protected ImageWidget m_wCrossLTop;
130 protected ImageWidget m_wCrossRTop;
131 protected ImageWidget m_wCrossLBot;
132 protected ImageWidget m_wGLLeft;
133 protected ImageWidget m_wGLTop;
134 protected Widget m_wCrossMCenter;
137 protected ImageWidget m_wGLRight;
138 protected ImageWidget m_wGLBot;
139 protected ImageWidget m_wGLFadeTop;
140 protected ImageWidget m_wGLFadeLeft;
141 protected ImageWidget m_wGLFadeRight;
142 protected ImageWidget m_wGLFadeBot;
143 protected TextWidget m_wCoordText;
157 static array<Widget> GetMapWidgetsUnderCursor()
161 s_aTracedWidgets.Clear();
162 return s_aTracedWidgets;
165 if (!m_bRecentlyTraced)
168 return s_aTracedWidgets;
179 m_CursorState |= state;
180 SetCursorType(m_CursorState);
188 m_CursorState &= ~state;
189 SetCursorType(m_CursorState);
196 if (!m_bEnableMapCrosshairVisuals)
202 m_CustomCursor.SetCursorVisual(
null);
204 m_CustomCursor.SetCursorVisual(cursorState);
206 SetCrosshairGridVisible(!cursorState.m_DisableCursorLines);
211 protected void SetCrosshairGridVisible(
bool state)
213 if (!m_wCrossGrid || !m_bEnableMapCrosshairVisuals)
216 m_wCrossGrid.SetVisible(state);
221 protected void OnInputDeviceIsGamepad(
bool isGamepad)
226 else if (m_fFreeCursorTime != 0)
227 m_CustomCursor.SetOpacity(1);
232 void SetWheelZoomMultiplier(
float value)
234 m_fZoomMultiplierWheel = value;
240 void ForceCenterCursor()
242 float screenX, screenY;
243 m_MapWidget.GetScreenSize(screenX, screenY);
250 m_fFreeCursorTime = FREE_CURSOR_RESET;
257 protected void HandleMove()
274 protected void HandlePan(
float timeSlice)
277 if (m_CursorState & STATE_PAN_RESTRICTED)
288 if (m_fPanCountdown == 0)
289 m_fPanCountdown = PAN_DEFAULT_COUNTDOWN;
291 float frameTime = System.GetFrameTimeS();
292 int px = (
int)(frameTime * 1000) * m_fPanKBMMultiplier;
306 if (m_fPanCountdown <= 0)
320 m_fPanCountdown -= timeSlice;
325 protected void HandleZoom()
339 if (m_CursorState & STATE_ZOOM_RESTRICTED)
351 protected void HandleHover(
float timeSlice)
356 m_fHoverTime += timeSlice;
358 if (m_fHoverTime >= 0.25)
360 float worldX, worldY;
362 vector curPos = Vector(worldX, 0, worldY);
377 float worldX, worldY;
379 vector curPos = Vector(worldX, 0, worldY);
382 if ( (m_CursorState & STATE_HOVER_RESTRICTED)
384 || (closeItem && closeItem !=
m_MapEntity.GetHoveredItem())
396 protected void HandleSelect()
399 if (m_CursorState & STATE_SELECT_RESTRICTED)
410 float worldX, worldY;
412 vector curPos = Vector(worldX, 0, worldY);
415 autoptr array<MapItem> selectedItems =
new array<MapItem>;
419 if (selected && (selectedItems.Count() != 1 || selectedItems[0] != selected) )
435 protected void HandleMultiSelect(
bool activate)
438 if ( (m_CursorState & STATE_MULTISELECT_RESTRICTED) != 0 || !activate)
446 autoptr array<MapItem> selectedItems =
new array<MapItem>;
447 GetCursorSelection(selectedItems);
448 int count = selectedItems.Count();
450 for (
int i = 0; i < count; i++ )
467 autoptr array<MapItem> selectedItems =
new array<MapItem>;
468 GetCursorSelection(selectedItems);
469 int count = selectedItems.Count();
471 for (
int i = 0; i < count; i++ )
473 selectedItems[i].SetHighlighted(
true);
481 protected void HandleDrag(
bool startDrag)
487 if (m_CursorState & STATE_DRAG_RESTRICTED)
492 if (SCR_MapToolInteractionUI.StartDrag())
504 SCR_MapToolInteractionUI.EndDrag();
511 protected void HandleRotateTool(
bool startRotate)
513 if (m_CursorState & STATE_ROTATE_RESTRICTED)
523 if (SCR_MapToolInteractionUI.StartRotate())
532 SCR_MapToolInteractionUI.EndRotate();
539 bool HandleDraw(
bool active)
542 if (active && (m_CursorState & STATE_DRAW_RESTRICTED) == 0)
561 bool HandleSubMenu(
bool active)
564 if (active && (m_CursorState & STATE_SUBMENU_RESTRICTED) == 0)
583 bool HandleDialog(
bool active)
609 void ToggleFastTravelDestinationSelection(
bool enable)
621 bool HandleContextualMenu(
bool doClose =
false)
624 if ((m_CursorState & STATE_CTXMENU_RESTRICTED) != 0 && !doClose)
655 protected void GetCursorSelection(out array<MapItem> mapItems)
658 float startWorldX, startWorldY, worldX, worldY;
661 vector startPos = Vector(startWorldX, 0, startWorldY);
662 vector curPos = Vector(worldX, 0, worldY);
666 m_MapEntity.GetInsideRect(mapItems, startPos, curPos);
669 float circleRadius = m_SelectionModule.GetSelCircleSize() / 2;
678 protected void GetCursorPosition(out
int x, out
int y)
680 WorkspaceWidget workspace =
GetGame().GetWorkspace();
685 float screenX, screenY, offX, offY;
686 m_MapWidget.GetScreenSize(screenX, screenY);
687 m_MapWidget.GetScreenPos(offX, offY);
689 WidgetManager.GetMousePos(x, y);
697 if (m_CursorState & STATE_RESET_RESTRICTED)
698 m_fFreeCursorTime = 0;
700 m_fFreeCursorTime += System.GetFrameTimeS();
702 if (m_fFreeCursorTime > FREE_CURSOR_RESET - 1.0)
704 float alpha = Math.InverseLerp(FREE_CURSOR_RESET, FREE_CURSOR_RESET - 1.0, m_fFreeCursorTime);
705 m_CustomCursor.SetOpacity(alpha);
708 if (m_fFreeCursorTime >= FREE_CURSOR_RESET)
711 m_fFreeCursorTime = 0;
712 m_CustomCursor.SetOpacity(1);
715 WidgetManager.GetMousePos(x, y);
726 if (m_bEnableCursorEdgePan)
727 TestEdgePan(x, y, screenX, screenY);
730 x = workspace.DPIUnscale(x);
731 y = workspace.DPIUnscale(y);
740 protected void TestEdgePan(inout
float x, inout
float y,
int screenX,
int screenY)
742 float windowWidth, windowHeight;
743 m_MapWidget.GetScreenSize(windowWidth, windowHeight);
748 if (x <= CURSOR_CAPTURE_OFFSET)
753 if (y <= CURSOR_CAPTURE_OFFSET)
758 if (x >= (
int)windowWidth - CURSOR_CAPTURE_OFFSET - 1)
763 if (y >= (
int)windowHeight - CURSOR_CAPTURE_OFFSET - 1)
773 protected void OnInputPanDrag(
float value, EActionTrigger reason )
776 if (m_CursorState & STATE_PAN_RESTRICTED)
779 m_fPanCountdown = PAN_DEFAULT_COUNTDOWN;
785 protected void OnInputPanH(
float value, EActionTrigger reason )
787 CalculatePan(value,
EMapPanMode.HORIZONTAL, m_fPanKBMMultiplier);
792 protected void OnInputPanV(
float value, EActionTrigger reason )
794 CalculatePan(value,
EMapPanMode.VERTICAL, m_fPanKBMMultiplier);
799 protected void OnInputPanHGamepad(
float value, EActionTrigger reason )
804 CalculatePan(1,
EMapPanMode.HORIZONTAL, value * m_fPanStickMultiplier);
809 protected void OnInputPanVGamepad(
float value, EActionTrigger reason )
814 CalculatePan(1,
EMapPanMode.VERTICAL, value * m_fPanStickMultiplier);
824 if (m_CursorState & STATE_PAN_RESTRICTED)
827 m_fPanCountdown = PAN_DEFAULT_COUNTDOWN;
828 int px = (System.GetFrameTimeS() * 1000);
831 px = px * multiPlier;
833 px = -px * multiPlier;
840 protected void OnInputGamepadCursorH(
float value, EActionTrigger reason )
847 m_fFreeCursorTime = 0;
848 m_CustomCursor.SetOpacity(1);
855 protected void OnInputGamepadCursorV(
float value, EActionTrigger reason )
862 m_fFreeCursorTime = 0;
863 m_CustomCursor.SetOpacity(1);
870 protected void OnInputZoom(
float value, EActionTrigger reason )
873 if (m_CursorState & STATE_ZOOM_RESTRICTED)
876 m_fZoomHoldTime += System.GetFrameTimeS();
877 if ( (m_CursorState &
EMapCursorState.CS_ZOOM) && m_fZoomHoldTime < 0.05)
882 m_MapEntity.ZoomSmooth(zoomPPU + zoomPPU/m_fZoomStrength, m_fZoomAnimTime,
false);
884 m_MapEntity.ZoomSmooth(zoomPPU - zoomPPU/m_fZoomStrength, m_fZoomAnimTime,
false);
891 protected void OnInputZoomWheelUp(
float value, EActionTrigger reason )
894 if (m_CursorState & STATE_ZOOM_RESTRICTED)
898 value = value * m_fZoomMultiplierWheel;
899 m_MapEntity.ZoomSmooth(targetPPU + targetPPU * (value * 0.001), m_fZoomAnimTime,
false);
904 protected void OnInputZoomWheelDown(
float value, EActionTrigger reason )
907 if (m_CursorState & STATE_ZOOM_RESTRICTED)
911 value = value * m_fZoomMultiplierWheel;
912 m_MapEntity.ZoomSmooth(targetPPU - targetPPU/2 * (value * 0.001), m_fZoomAnimTime,
false);
917 protected void OnInputDrag(
float value, EActionTrigger reason )
919 if (!m_bIsDraggingAvailable)
925 if (reason == EActionTrigger.DOWN)
933 protected void OnInputDragToggle(
float value, EActionTrigger reason )
935 if (!m_bIsDraggingAvailable)
949 protected void OnInputModifier(
float value, EActionTrigger reason )
951 if (reason == EActionTrigger.DOWN)
954 if (!SCR_MapToolInteractionUI.s_bIsRotating)
955 HandleRotateTool(
true);
960 if (SCR_MapToolInteractionUI.s_bIsRotating)
961 HandleRotateTool(
false);
967 protected void OnInputModifClick(
float value, EActionTrigger reason )
969 SCR_MapToolInteractionUI.ActivateAction();
974 protected void OnInputMultiSel(
float value, EActionTrigger reason )
976 if (reason == EActionTrigger.PRESSED)
978 if (m_fSelectHoldTime == 0)
981 m_fSelectHoldTime += System.GetFrameTimeS();
982 if (m_fSelectHoldTime < 0.2)
985 HandleMultiSelect(
true);
991 HandleMultiSelect(
false);
992 m_fSelectHoldTime = 0;
998 protected void OnInputMultiSelGamepad(
float value, EActionTrigger reason )
1000 if (reason == EActionTrigger.PRESSED)
1003 HandleMultiSelect(
true);
1007 HandleMultiSelect(
false);
1013 protected void OnPauseMenuOpened()
1022 protected void OnPauseMenuClosed()
1025 SetCursorType(m_CursorState);
1036 while (state != stateMin)
1038 if (m_CursorState & state)
1040 cfg = m_aCursorStatesMap.Get(state);
1053 protected void UpdateCrosshairUI()
1055 float sizeX, sizeY, cursorX, cursorY;
1056 m_wCrossMCenter.GetScreenSize(sizeX, sizeY);
1062 WorkspaceWidget workspace =
GetGame().GetWorkspace();
1063 cursorX = cursorX - workspace.DPIUnscale(sizeX)/2;
1064 cursorY = cursorY - workspace.DPIUnscale(sizeY)/2;
1068 m_MapWidget.GetScreenSize(sizeX, sizeY);
1070 m_wCrossLTop.SetSize(cursorX, cursorY);
1071 m_wCrossRTop.SetSize(workspace.DPIUnscale(sizeX) - cursorX, cursorY);
1072 m_wCrossLBot.SetSize(0, workspace.DPIUnscale(sizeY) - cursorY);
1073 m_wGLTop.SetSize(GUILDING_LINE_WIDTH, cursorY);
1074 m_wGLLeft.SetSize(cursorX, GUILDING_LINE_WIDTH);
1076 if (m_bEnableCrosshairCoords)
1080 m_wCoordText.SetText(Math.Round(wX).ToString() +
", " + Math.Round(wY).ToString());
1087 protected static void TraceMapWidgets()
1090 m_bRecentlyTraced =
true;
1095 protected void InitWidgets(Widget root)
1099 m_wCrossGrid = root.FindAnyWidget(
"CursorCrosshair");
1100 if (m_bEnableMapCrosshairVisuals)
1102 SetCrosshairGridVisible(
true);
1104 m_wCrossMCenter = m_wCrossGrid.FindAnyWidget(
"CrossMCenter");
1105 m_wCrossRTop = ImageWidget.Cast(m_wCrossGrid.FindAnyWidget(
"CrossRTop"));
1106 m_wCrossLTop = ImageWidget.Cast(m_wCrossGrid.FindAnyWidget(
"CrossLTop"));
1107 m_wCrossLBot = ImageWidget.Cast(m_wCrossGrid.FindAnyWidget(
"CrossLBot"));
1108 m_wGLTop = ImageWidget.Cast(m_wCrossGrid.FindAnyWidget(
"GLTop"));
1109 m_wGLLeft = ImageWidget.Cast(m_wCrossGrid.FindAnyWidget(
"GLLeft"));
1111 m_wGLFadeLeft = ImageWidget.Cast(m_wCrossGrid.FindAnyWidget(
"GLFadeLeft"));
1112 m_wGLRight = ImageWidget.Cast(m_wCrossGrid.FindAnyWidget(
"GLRight"));
1113 m_wGLFadeRight = ImageWidget.Cast(m_wCrossGrid.FindAnyWidget(
"GLFadeRight"));
1114 m_wGLBot = ImageWidget.Cast(m_wCrossGrid.FindAnyWidget(
"GLBot"));
1115 m_wGLFadeBot = ImageWidget.Cast(m_wCrossGrid.FindAnyWidget(
"GLFadeBot"));
1116 m_wGLFadeTop = ImageWidget.Cast(m_wCrossGrid.FindAnyWidget(
"GLFadeTop"));
1117 m_wCoordText = TextWidget.Cast(m_wCrossGrid.FindAnyWidget(
"CoordText"));
1121 m_wGLTop.SetColor(m_GuidelineColor);
1122 m_wGLLeft.SetColor(m_GuidelineColor);
1123 m_wGLRight.SetColor(m_GuidelineColor);
1124 m_wGLBot.SetColor(m_GuidelineColor);
1125 m_wGLFadeTop.SetColor(m_GuidelineColor);
1126 m_wGLFadeLeft.SetColor(m_GuidelineColor);
1127 m_wGLFadeRight.SetColor(m_GuidelineColor);
1128 m_wGLFadeBot.SetColor(m_GuidelineColor);
1129 m_wCoordText.SetColor(m_GuidelineColor);
1131 m_wCoordText.SetOpacity(0);
1133 if (m_bEnableCrosshairCoords)
1134 m_wCoordText.SetOpacity(1);
1138 SetCrosshairGridVisible(
false);
1142 if (!m_CustomCursor)
1148 protected void InitInputs()
1154 GetGame().OnInputDeviceIsGamepadInvoker().Insert(OnInputDeviceIsGamepad);
1157 PauseMenuUI.m_OnPauseMenuOpened.Insert(OnPauseMenuOpened);
1158 PauseMenuUI.m_OnPauseMenuClosed.Insert(OnPauseMenuClosed);
1160 m_InputManager.AddActionListener(
"MapPanDrag", EActionTrigger.PRESSED, OnInputPanDrag);
1161 m_InputManager.AddActionListener(
"MapPanH", EActionTrigger.PRESSED, OnInputPanH);
1162 m_InputManager.AddActionListener(
"MapPanV", EActionTrigger.PRESSED, OnInputPanV);
1163 m_InputManager.AddActionListener(
"MapPanHGamepad", EActionTrigger.VALUE, OnInputPanHGamepad);
1164 m_InputManager.AddActionListener(
"MapPanVGamepad", EActionTrigger.VALUE, OnInputPanVGamepad);
1165 m_InputManager.AddActionListener(
"MapGamepadCursorX", EActionTrigger.VALUE, OnInputGamepadCursorH);
1166 m_InputManager.AddActionListener(
"MapGamepadCursorY", EActionTrigger.VALUE, OnInputGamepadCursorV);
1167 m_InputManager.AddActionListener(
"MapZoom", EActionTrigger.PRESSED, OnInputZoom);
1168 m_InputManager.AddActionListener(
"MapWheelUp", EActionTrigger.PRESSED, OnInputZoomWheelUp);
1169 m_InputManager.AddActionListener(
"MapWheelDown", EActionTrigger.PRESSED, OnInputZoomWheelDown);
1170 m_InputManager.AddActionListener(
"MapSelect", EActionTrigger.UP, HandleSelect);
1174 if ( m_SelectionModule )
1176 m_InputManager.AddActionListener(
"MapMultiSelect", EActionTrigger.PRESSED, OnInputMultiSel);
1177 m_InputManager.AddActionListener(
"MapMultiSelect", EActionTrigger.UP, OnInputMultiSel);
1178 m_InputManager.AddActionListener(
"MapMultiSelectGamepad", EActionTrigger.PRESSED, OnInputMultiSelGamepad);
1179 m_InputManager.AddActionListener(
"MapMultiSelectGamepad", EActionTrigger.UP, OnInputMultiSelGamepad);
1183 if ( SCR_MapToolInteractionUI.Cast(
m_MapEntity.GetMapUIComponent(SCR_MapToolInteractionUI)) )
1185 m_bIsDraggingAvailable =
true;
1187 m_InputManager.AddActionListener(
"MapModifierKey", EActionTrigger.DOWN, OnInputModifier);
1188 m_InputManager.AddActionListener(
"MapModifierKey", EActionTrigger.UP, OnInputModifier);
1189 m_InputManager.AddActionListener(
"MapModifClick", EActionTrigger.DOWN, OnInputModifClick);
1190 m_InputManager.AddActionListener(
"MapDrag", EActionTrigger.DOWN, OnInputDrag);
1191 m_InputManager.AddActionListener(
"MapDrag", EActionTrigger.UP, OnInputDrag);
1192 m_InputManager.AddActionListener(
"MapDragGamepad", EActionTrigger.DOWN, OnInputDragToggle);
1195 m_bIsDraggingAvailable =
false;
1201 protected void CleanupInputs()
1207 GetGame().OnInputDeviceIsGamepadInvoker().Remove(OnInputDeviceIsGamepad);
1210 PauseMenuUI.m_OnPauseMenuOpened.Remove(OnPauseMenuOpened);
1211 PauseMenuUI.m_OnPauseMenuClosed.Remove(OnPauseMenuClosed);
1213 m_InputManager.RemoveActionListener(
"MapPanDrag", EActionTrigger.PRESSED, OnInputPanDrag);
1214 m_InputManager.RemoveActionListener(
"MapPanH", EActionTrigger.PRESSED, OnInputPanH);
1215 m_InputManager.RemoveActionListener(
"MapPanV", EActionTrigger.PRESSED, OnInputPanV);
1216 m_InputManager.RemoveActionListener(
"MapPanHGamepad", EActionTrigger.VALUE, OnInputPanHGamepad);
1217 m_InputManager.RemoveActionListener(
"MapPanVGamepad", EActionTrigger.VALUE, OnInputPanVGamepad);
1218 m_InputManager.RemoveActionListener(
"MapGamepadCursorX", EActionTrigger.VALUE, OnInputGamepadCursorH);
1219 m_InputManager.RemoveActionListener(
"MapGamepadCursorY", EActionTrigger.VALUE, OnInputGamepadCursorV);
1220 m_InputManager.RemoveActionListener(
"MapZoom", EActionTrigger.PRESSED, OnInputZoom);
1221 m_InputManager.RemoveActionListener(
"MapWheelUp", EActionTrigger.PRESSED, OnInputZoomWheelUp);
1222 m_InputManager.RemoveActionListener(
"MapWheelDown", EActionTrigger.PRESSED, OnInputZoomWheelDown);
1223 m_InputManager.RemoveActionListener(
"MapSelect", EActionTrigger.UP, HandleSelect);
1225 m_InputManager.RemoveActionListener(
"MapModifierKey", EActionTrigger.DOWN, OnInputModifier);
1226 m_InputManager.RemoveActionListener(
"MapModifierKey", EActionTrigger.UP, OnInputModifier);
1227 m_InputManager.RemoveActionListener(
"MapModifClick", EActionTrigger.DOWN, OnInputModifClick);
1228 m_InputManager.RemoveActionListener(
"MapDrag", EActionTrigger.DOWN, OnInputDrag);
1229 m_InputManager.RemoveActionListener(
"MapDrag", EActionTrigger.UP, OnInputDrag);
1230 m_InputManager.RemoveActionListener(
"MapDragGamepad", EActionTrigger.DOWN, OnInputDragToggle);
1232 m_InputManager.RemoveActionListener(
"MapMultiSelect", EActionTrigger.PRESSED, OnInputMultiSel);
1233 m_InputManager.RemoveActionListener(
"MapMultiSelect", EActionTrigger.UP, OnInputMultiSel);
1234 m_InputManager.RemoveActionListener(
"MapMultiSelectGamepad", EActionTrigger.PRESSED, OnInputMultiSelGamepad);
1235 m_InputManager.RemoveActionListener(
"MapMultiSelectGamepad", EActionTrigger.UP, OnInputMultiSelGamepad);
1241 override void OnMapOpen(MapConfiguration config)
1247 InitWidgets(config.RootWidgetRef);
1251 SetCursorType(m_CursorState);
1253 if (m_bIsCursorCenteredOnOpen ||
m_CursorInfo.isGamepad)
1254 ForceCenterCursor();
1258 override void OnMapClose(MapConfiguration config)
1268 override void Update(
float timeSlice)
1273 m_bRecentlyTraced =
false;
1284 HandleHover(timeSlice);
1285 HandlePan(timeSlice);
1289 if (m_bEnableMapCrosshairVisuals && (m_CursorState & CUSTOM_CURSOR_LOCKED) == 0)
1290 UpdateCrosshairUI();
1300 m_aCursorStatesMap.Insert(stateEnum, cursorState);
1310 [
Attribute(
"1", UIWidgets.ComboBox,
"Configure selected cursor state",
"", ParamEnumArray.FromEnum(
EMapCursorState))]
1313 [
Attribute(
"{E75FB4134580A496}UI/Textures/Cursor/cursors.imageset", UIWidgets.ResourceNamePicker,
desc:
"Imageset selection",
params:
"imageset")]
1314 ResourceName m_sCursorIconsImageset;
1316 [
Attribute(
"default", UIWidgets.EditBox,
desc:
"imageset quad")]
1317 string m_sImageQuad;
1319 [
Attribute(
"", UIWidgets.EditBox,
desc:
"imageset quad when controller is active instead of KBM \nIf this is not defined, attibute from above is used for both cases")]
1320 string m_sImageQuadController;
1322 [
Attribute(
"0", UIWidgets.Slider,
desc:
"Padding from top, in pixels",
"-32 32 1")]
1323 float m_fPaddingTop;
1325 [
Attribute(
"0", UIWidgets.Slider,
desc:
"Padding from left, in pixels",
"-32 32 1")]
1326 float m_fPaddingLeft;
1328 [
Attribute(
"0.76 0.38 0.08 1", UIWidgets.ColorPicker,
desc:
"Cursor color")]
1331 [
Attribute(
desc:
"Cursor lines are disabled in this state if otherwise active")]
1332 bool m_DisableCursorLines;
1340 override bool _WB_GetCustomTitle(BaseContainer source, out
string title)
1343 source.Get(
"m_eCursorState",
type);