xivdev / Penumbra

FINAL FANTASY XIV modding, but actually good this time
581 stars 114 forks source link

Add shared tag system for tagging individual mods #399

Closed AeAstralis closed 3 months ago

AeAstralis commented 4 months ago

Foreword

While coding is what I do for a living, I had absolutely zero experience with FFXIV plugin code or ImGui prior to this little project. As such I'm expecting there to be more than a few issues with this PR, and have marked it as a draft.

Description

Adds a new system of shared tags that are saved in the Penumbra config, and can then be 1-click added or removed to/from mods via a popup menu. The use case for this new system is to allow users to more easily re-use tags and to allow them to quickly tag individual mods.

Shared tags can be added/removed/modified via a new Tags section of the main Penumbra Settings tab. Once any shared tags have been saved, the menu to add a shared tag to a mod can be accessed via a new tags button that shows up in the Description and Edit Mod tabs, to the right of the existing + button that already existed for typing in new tags.

Clicking the new button will open a popup that is populated with buttons for each shared tag that the user has saved. Tags that can be added are indicated by green buttons, tags that can be removed by red. Tags that cannot be changed are grayed out, which happens if a user is editing local tags and a specific shared tag is already present as a mod tag (and vice versa). The popup will stay open until the user closes it with a right-click.

Shared tags have the same restrictions as regular mod tags, and the application of shared tags should respect the same limits as application of normal tags.

Dependencies

I wasn't able to get the new button to align well with the existing elements without a change to TagButtons.cs. As a result, this PR is dependent on the Ottermandias/OtterGui#9. Once that PR is merged in I can update this PR to point at the latest submodule commit. The dependency has been merged in, and I have added a commit to update the OtterGui version in the PR.

In order to avoid changing too much of the logic there, I simply added an optional parameter that allows offsetting how far from the right edge of the window that the + button can be drawn.

Issues

The screenshot link in the issue is dead, but I think this likely fulfills #307.

Screenshots

Settings

Settings Tab

Mod Description

Mod Description Tab

Edit Mod

Mod Edit Mod Tab

Mod Description with Shared Tags Popup

Mods Description Tab with Popup

Mod Description with Shared Tags Popup 2

Mods Description Tab with Popup 2

AeAstralis commented 4 months ago

As a general PR style thing, would you prefer I address feedback in additional commits or amend them into the original one?

Ottermandias commented 4 months ago

Additional commits in the same PR. No rewriting history. :)

AeAstralis commented 4 months ago

The above commit should address all of the above comments except the issue around the popup. I tried tinkering with the logic a bit but didn't make any headway.

AeAstralis commented 3 months ago

I meant to mark this as ready for review with my last comment but completely forgot to do so.