-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor spells window/item #2659
Conversation
private readonly Label _cooldownLabel; | ||
private readonly SpellsWindow _spellWindow; | ||
private Draggable? _dragIcon; | ||
private SpellDescriptionWindow? _descWindow; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_descriptionWindow
// Controls | ||
private readonly Label _cooldownLabel; | ||
private readonly SpellsWindow _spellWindow; | ||
private Draggable? _dragIcon; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to be with other drag related properties
|
||
public ImagePanel Container; | ||
|
||
// Drag Handling | ||
public bool IsDragging; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be below the constructor and should be { get; private set; }
not a field
private int _mouseX = -1; | ||
private int _mouseY = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be one Point _mousePosition
_mouseX = InputHandler.MousePosition.X - _iconImage.ToCanvas(new Point(0, 0)).X; | ||
_mouseY = InputHandler.MousePosition.Y - _iconImage.ToCanvas(new Point(0, 0)).Y; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling ToCanvas()
twice instead of caching the value is atrocious and should be fixed
mContextMenu?.Close(); | ||
mSpellWindow.IsHidden = true; | ||
_contextMenu?.Close(); | ||
base.Hide(); | ||
} | ||
|
||
public FloatRect RenderBounds() | ||
{ | ||
var rect = new FloatRect() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use FloatRect rect = new()
} | ||
|
||
private void Pnl_DoubleClicked(Base sender, MouseButtonState arguments) | ||
void _iconImage_HoverLeave(Base sender, EventArgs arguments) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private void
} | ||
|
||
void pnl_Clicked(Base sender, MouseButtonState arguments) | ||
void _iconImage_Clicked(Base sender, MouseButtonState arguments) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private void
{ | ||
mCooldownLabel.IsHidden = true; | ||
if (spell != null) | ||
var spellTex = Globals.ContentManager?.GetTexture(TextureType.Spell, spell.Icon); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spellIconTexture
mTexLoaded = string.Empty; | ||
if (_descWindow != null) | ||
{ | ||
_descWindow.Dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_descriptionWindow?.Dispose();
assets AscensionGameDev/Intersect-Assets#67
1741800212_Intersect_Client.mp4