Rework decoration renderable traits:
- Removed implicit pip definitions and IPips interface. New decoration traits have been added to render them. Pip types are no longer hardcoded in OpenRA.Game. - Decoration rendering is now managed by SelectionDecorations(Base), which allows us to remove assumptions about the selection box geometry from the decoration traits. - RenderNameTag has been replaced by WithNameTagDecoration, which is an otherwise normal decoration trait. - Unify the configuration and reduce duplication between traits. - Removed hardcoded references to specific selection box renderables. - Remove legacy cruft.
This commit is contained in:
@@ -66,6 +66,11 @@ namespace OpenRA.Primitives
|
||||
public int2 Location { get { return new int2(X, Y); } }
|
||||
public Size Size { get { return new Size(Width, Height); } }
|
||||
|
||||
public int2 TopLeft { get { return Location; } }
|
||||
public int2 TopRight { get { return new int2(X + Width, Y); } }
|
||||
public int2 BottomLeft { get { return new int2(X, Y + Height); } }
|
||||
public int2 BottomRight { get { return new int2(X + Width, Y + Height); } }
|
||||
|
||||
public bool Contains(int x, int y)
|
||||
{
|
||||
return x >= Left && x < Right && y >= Top && y < Bottom;
|
||||
|
||||
Reference in New Issue
Block a user