mrcomac / token-action-hud-swade

FoundryVTT Token Action HUD for Savage Worlds
MIT License
5 stars 4 forks source link

Reset Actions not working #8

Closed Vogliadicone closed 1 year ago

Vogliadicone commented 1 year ago

After deleting a category in the Token Action HUD I can't get the category back. F.e. I deleted the category "General". I thought, the "Reset Actions" button would bring the category back, but that wasn't the case. The category was still missing after that. ResetActions

Also just typing "General" into the field with the groups creates a new group "General", but without the standard content, i.e. the Bennies.

I could only bring back the "General" category via the "Reset HUD" option in the module options and an reload. But after doing so, I had to reconfigure the HUD for all my players. So an easier way would be appreciated.

mrcomac commented 1 year ago

I'll need to investiga this to understand the default behaviour from token hud core. You can reset it in the options of token action hud core. it will reload all data for the hud.

mrcomac commented 1 year ago

This update might resolve this issue https://github.com/Larkinabout/fvtt-token-action-hud-core/releases/tag/1.4.10

Larkinabout commented 1 year ago

There's an important difference between the 'Reset Actions' operation and the 'Reset HUD' module setting to be aware of.

This is because the layout of actions (their order and whether they are shown or hidden) is stored per actor, but the layout of groups is stored per user.

In the case of this issue, you'd want to use the 'Reset HUD' module setting for Token Action HUD Core.

Vogliadicone commented 1 year ago

Ok, the "Reset HUD" button in the module setting for Token Action HUD Core works fine. But what's not working for me is the "Reset Actions" button.

F.e. I delete all categories under "Skills", press "Reset Actions" and there are still no categories under "Skills". The "Reset Action" button seems to have no effect at all.

If you can't reproduce it, can I help you with some data? What do you need?

Vogliadicone commented 1 year ago

Just to let you know, I updated to 0.7.2, reseted the Token Action HUD via the "Reset HUD" option and still have the same problem.

F.e. I added some stuff to the "General" section: HUD_1 And didn't see any changes after "Reset Actions": HUD_2

Not a big deal, since the "Reset HUD" button is working, but after using that, I have to reconfigure the HUD settings for all my players.

mrcomac commented 1 year ago

I'll test the behavior of this on DND using the action token hud for dnd and will replicate to swade.

mrcomac commented 1 year ago

same behaviour on the DND HUD.. I'll keep investigating.

Larkinabout commented 1 year ago

Just to clarify the 'Reset Actions' operation resets actions within groups, it doesn't reset the groups themselves. Once you start editing the HUD, there's no halfway reset, you either need to start over (by using the 'Reset HUD' setting) or just delete the groups that you previously added but don't want anymore.

In essence, the outcome you're seeing is intended.

Vogliadicone commented 1 year ago

Hm, I fear, I still don't get it or it doesn't work like expected. Per default the group "Attributes" shows "Attributes" and "Derived Stats". I delete the "Derived Stats" within that group. Later I press the "Reset Actions" button.

I thought, that the Reset resets this group "Attributes" to it's default, so that afterwards I can see again "Attributes" and "Derived Stats". But it doesn't do that. Actually the button seems to have no effect at all. Neither for this group, nor another. But if it has no effect, than I would better remove the option to avoid confusion. Or maybe I just misunderstand the option at all.

mrcomac commented 1 year ago

@Larkinabout when we click on reset actions, is it possible to HUD core remove action for that group and call a function in action handle passing the group to reset the actions? This way we can add a feature to the sysstem huds to reset a specific group (hud core removes and each other hud needs to rebuild it)

It's a change that requires all other huds to change to write the _reloadActions function. Maybe can also allow to setup a config variable to true or false and disable this behavior to keep compatibility with is already in place, and if a hud wants to implement it, also need to change this variable to true.

Larkinabout commented 1 year ago

Hm, I fear, I still don't get it or it doesn't work like expected. Per default the group "Attributes" shows "Attributes" and "Derived Stats". I delete the "Derived Stats" within that group. Later I press the "Reset Actions" button.

Hopefully this illustrates what 'Reset Actions' does:

token-action-hud-core-reset-actions

It resets the actions within groups, it doesn't add/remove groups or restore the HUD to the default layout.

I've chosen not to add a 'Reset Groups' operation as they are easy to add or remove and for the whole HUD, the 'Reset HUD' can be used. In the future, I may extend it so that there's a reset actions operation per group, but resetting individual groups is better done by removing or adding them.

@Larkinabout when we click on reset actions, is it possible to HUD core remove action for that group and call a function in action handle passing the group to reset the actions? This way we can add a feature to the sysstem huds to reset a specific group (hud core removes and each other hud needs to rebuild it)

As a core operation I think it'd end up confusing users if the button does a different thing for different systems.

If I can understand what function you're trying to achieve, it may be it can be added as a core feature.

Vogliadicone commented 1 year ago

Thanks, I got it now! But I think the "Reset Actions" option needs a helping description or a tooltip. At least something like "Reset Actions within groups to default". Because right now with the placing and the name of the option, I would never have guessed, what it's doing...

mrcomac commented 1 year ago

@Vogliadicone since the misunderstanding has been solved can we close this issue?

Vogliadicone commented 1 year ago

Sure.