Show correct action cursor over minimap
Refs: #1847 Differential Revision: https://code.wildfiregames.com/D2718 This was SVN commit r23619.
This commit is contained in:
parent
2e6aecb210
commit
9306d84905
@ -88,9 +88,9 @@ function updateCursorAndTooltip()
|
||||
var cursorSet = false;
|
||||
var tooltipSet = false;
|
||||
var informationTooltip = Engine.GetGUIObjectByName("informationTooltip");
|
||||
if (!mouseIsOverObject && (inputState == INPUT_NORMAL || inputState == INPUT_PRESELECTEDACTION))
|
||||
if (!mouseIsOverObject && (inputState == INPUT_NORMAL || inputState == INPUT_PRESELECTEDACTION) || g_MiniMapPanel.isMouseOverMiniMap())
|
||||
{
|
||||
let action = determineAction(mouseX, mouseY);
|
||||
let action = determineAction(mouseX, mouseY, g_MiniMapPanel.isMouseOverMiniMap());
|
||||
if (action)
|
||||
{
|
||||
if (action.cursor)
|
||||
@ -239,7 +239,9 @@ function determineAction(x, y, fromMiniMap)
|
||||
// thus the most specific should appear first.
|
||||
|
||||
let actionInfo = undefined;
|
||||
if (preSelectedAction != ACTION_NONE)
|
||||
// Disable preselected actions on the minimap because their
|
||||
// left-click interferes with the minimap left-click anyways.
|
||||
if (preSelectedAction != ACTION_NONE && !fromMiniMap)
|
||||
{
|
||||
for (let action of g_UnitActionsSortedKeys)
|
||||
if (g_UnitActions[action].preSelectedActionCheck)
|
||||
|
@ -7,6 +7,9 @@ class MiniMap
|
||||
constructor()
|
||||
{
|
||||
Engine.GetGUIObjectByName("minimap").onWorldClick = this.onWorldClick.bind(this);
|
||||
Engine.GetGUIObjectByName("minimap").onMouseEnter = this.onMouseEnter.bind(this);
|
||||
Engine.GetGUIObjectByName("minimap").onMouseLeave = this.onMouseLeave.bind(this);
|
||||
this.mouseIsOverMiniMap = false;
|
||||
}
|
||||
|
||||
onWorldClick(target)
|
||||
@ -23,4 +26,19 @@ class MiniMap
|
||||
let action = determineAction(undefined, undefined, true);
|
||||
return action && handleUnitAction(target, action);
|
||||
}
|
||||
|
||||
onMouseEnter()
|
||||
{
|
||||
this.mouseIsOverMiniMap = true;
|
||||
}
|
||||
|
||||
onMouseLeave()
|
||||
{
|
||||
this.mouseIsOverMiniMap = false;
|
||||
}
|
||||
|
||||
isMouseOverMiniMap()
|
||||
{
|
||||
return this.mouseIsOverMiniMap;
|
||||
}
|
||||
}
|
||||
|
@ -9,4 +9,9 @@ class MiniMapPanel
|
||||
this.idleWorkerButton = new MiniMapIdleWorkerButton(playerViewControl, idleWorkerClasses);
|
||||
this.miniMap = new MiniMap();
|
||||
}
|
||||
|
||||
isMouseOverMiniMap()
|
||||
{
|
||||
return this.miniMap.isMouseOverMiniMap();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user