Skip to content

Add tool filter#142

Merged
ScalarVector1 merged 6 commits intoScalarVector1:masterfrom
emyhrberg:AddToolFilter
Jun 13, 2025
Merged

Add tool filter#142
ScalarVector1 merged 6 commits intoScalarVector1:masterfrom
emyhrberg:AddToolFilter

Conversation

@emyhrberg
Copy link
Contributor

Description:

See issue #141

Testing:

Testing was done with multiple mod scenarios:

  1. Only DragonLens enabled
  2. DragonLens and a mod which adds Tools
  3. DragonLens and mods which adds no Tool's

All scenarios act as expected, showing only mods which add tools.

Changes:

Added the new ToolModFilter class and use it in BrowserTool class in SetupFilters method.

Demo:

dotnet_eNI5LD8whp.mp4

@emyhrberg
Copy link
Contributor Author

@ScalarVector1 Is this PR ok to merge?


public override string Name => mod.DisplayName;

public override string Description => mod.DisplayName;
Copy link
Owner

Choose a reason for hiding this comment

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

Should have a real description here or a localization key get, dont just repeat the name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should have a real description here or a localization key get, dont just repeat the name

Added localization entry for Description

Texture2D tex = null;

string path = $"{mod.Name}/icon_small";
string dlPath = $"{mod.Name}/icon";
Copy link
Owner

Choose a reason for hiding this comment

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

Would prefer a default asset with a more fitting size, Assets.Filters.Vanilla may work well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

if (mod.Name == "DragonLens")
tex = ModContent.Request<Texture2D>(dlPath).Value;
if (ModContent.HasAsset(path))
tex = ModContent.Request<Texture2D>(path).Value;
Copy link
Owner

Choose a reason for hiding this comment

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

this would override if DL ever adds an icon_small, is this the intended behavior?

Copy link
Owner

Choose a reason for hiding this comment

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

Ideally if this does happen the external logic checkifn tfor the mod is removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, used vanilla asset for DragonLens tools

@emyhrberg
Copy link
Contributor Author

@ScalarVector1 Updated with your comments

Demo:

@emyhrberg emyhrberg requested a review from ScalarVector1 May 23, 2025 22:46
@emyhrberg
Copy link
Contributor Author

@ScalarVector1 Hi, is the latest updates ok?

@ScalarVector1 ScalarVector1 merged commit f88ea1c into ScalarVector1:master Jun 13, 2025
1 check passed
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

Comments