Skip to content
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

Merged
merged 3 commits into from
Mar 12, 2025
Merged

Conversation

WeylonSantana
Copy link
Contributor

@WeylonSantana WeylonSantana commented Mar 12, 2025

assets AscensionGameDev/Intersect-Assets#67

1741800212_Intersect_Client.mp4

private readonly Label _cooldownLabel;
private readonly SpellsWindow _spellWindow;
private Draggable? _dragIcon;
private SpellDescriptionWindow? _descWindow;
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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

Comment on lines +33 to +34
private int _mouseX = -1;
private int _mouseY = -1;
Copy link
Member

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

Comment on lines +268 to +269
_mouseX = InputHandler.MousePosition.X - _iconImage.ToCanvas(new Point(0, 0)).X;
_mouseY = InputHandler.MousePosition.Y - _iconImage.ToCanvas(new Point(0, 0)).Y;
Copy link
Member

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()
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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);
Copy link
Member

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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_descriptionWindow?.Dispose();

@lodicolo lodicolo merged commit 6c1d3f8 into AscensionGameDev:main Mar 12, 2025
1 check passed
@lodicolo lodicolo deleted the spell-window branch March 12, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants