spoilers: cursor dies
This commit is contained in:
@@ -1,28 +0,0 @@
|
|||||||
#region Copyright & License Information
|
|
||||||
/*
|
|
||||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
|
||||||
* This file is part of OpenRA, which is free software. It is made
|
|
||||||
* available to you under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation. For more information,
|
|
||||||
* see COPYING.
|
|
||||||
*/
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
using OpenRA.Graphics;
|
|
||||||
|
|
||||||
namespace OpenRA
|
|
||||||
{
|
|
||||||
public class Cursor
|
|
||||||
{
|
|
||||||
CursorSequence sequence;
|
|
||||||
public Cursor(string cursor)
|
|
||||||
{
|
|
||||||
sequence = CursorProvider.GetCursorSequence(cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Draw(int frame, float2 pos)
|
|
||||||
{
|
|
||||||
sequence.GetSprite(frame).DrawAt(pos - sequence.Hotspot, Game.modData.Palette.GetPaletteIndex(sequence.Palette));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -87,7 +87,11 @@ namespace OpenRA.Graphics
|
|||||||
|
|
||||||
Widget.DoDraw();
|
Widget.DoDraw();
|
||||||
var cursorName = Widget.RootWidget.GetCursorOuter(Viewport.LastMousePos) ?? "default";
|
var cursorName = Widget.RootWidget.GetCursorOuter(Viewport.LastMousePos) ?? "default";
|
||||||
new Cursor(cursorName).Draw((int)cursorFrame, Viewport.LastMousePos + Location);
|
var cursorSequence = CursorProvider.GetCursorSequence(cursorName);
|
||||||
|
|
||||||
|
cursorSequence.GetSprite((int)cursorFrame).DrawAt(
|
||||||
|
Viewport.LastMousePos + Location - cursorSequence.Hotspot,
|
||||||
|
Game.modData.Palette.GetPaletteIndex(cursorSequence.Palette));
|
||||||
|
|
||||||
renderer.EndFrame( inputHandler );
|
renderer.EndFrame( inputHandler );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,6 @@
|
|||||||
<Compile Include="Traits\World\SpatialBins.cs" />
|
<Compile Include="Traits\World\SpatialBins.cs" />
|
||||||
<Compile Include="Traits\World\Country.cs" />
|
<Compile Include="Traits\World\Country.cs" />
|
||||||
<Compile Include="Actor.cs" />
|
<Compile Include="Actor.cs" />
|
||||||
<Compile Include="Cursor.cs" />
|
|
||||||
<Compile Include="GameRules\Rules.cs" />
|
<Compile Include="GameRules\Rules.cs" />
|
||||||
<Compile Include="Graphics\Animation.cs" />
|
<Compile Include="Graphics\Animation.cs" />
|
||||||
<Compile Include="Game.cs" />
|
<Compile Include="Game.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user