Merge HardwareCursor and SoftwareCursor into CursorManager.
This commit is contained in:
committed by
Matthias Mailänder
parent
d7f43b33c7
commit
847db5e59b
@@ -19,7 +19,6 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
public class TooltipContainerWidget : Widget
|
||||
{
|
||||
static readonly Action Nothing = () => { };
|
||||
readonly CursorProvider cursorProvider;
|
||||
|
||||
public int2 CursorOffset = new int2(0, 20);
|
||||
public int BottomEdgeYOffset = -5;
|
||||
@@ -30,7 +29,6 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
public TooltipContainerWidget()
|
||||
{
|
||||
cursorProvider = Game.ModData.CursorProvider;
|
||||
IsVisible = () => Game.RunTime > Viewport.LastMoveRunTime + TooltipDelayMilliseconds;
|
||||
}
|
||||
|
||||
@@ -54,7 +52,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
{
|
||||
get
|
||||
{
|
||||
var pos = Viewport.LastMousePos + (cursorProvider.DoubleCursorSize ? CursorOffset * 2 : CursorOffset);
|
||||
var pos = Viewport.LastMousePos + (Game.Cursor.DoubleCursorSize ? CursorOffset * 2 : CursorOffset);
|
||||
if (tooltip != null)
|
||||
{
|
||||
// If the tooltip overlaps the right edge of the screen, move it left until it fits
|
||||
@@ -63,7 +61,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
// If the tooltip overlaps the bottom edge of the screen, switch tooltip above cursor
|
||||
if (pos.Y + tooltip.Bounds.Bottom > Game.Renderer.Resolution.Height)
|
||||
pos = pos.WithY(Viewport.LastMousePos.Y + (cursorProvider.DoubleCursorSize ? 2 : 1) * BottomEdgeYOffset - tooltip.Bounds.Height);
|
||||
pos = pos.WithY(Viewport.LastMousePos.Y + (Game.Cursor.DoubleCursorSize ? 2 : 1) * BottomEdgeYOffset - tooltip.Bounds.Height);
|
||||
}
|
||||
|
||||
return pos;
|
||||
|
||||
Reference in New Issue
Block a user