devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

Lua: Display Remaining Staff Charges

Open kphoenix137 opened this issue 9 months ago • 6 comments

Adds a toggle that displays remaining charges over the spell select button when an item with charges is equipped, and the charges spell is selected. Displays gold text for current charges == max charges, otherwise blue text. Blue text is used to avoid confusion, as white is used to signal keybinds to the player.

image image

kphoenix137 avatar Mar 10 '25 01:03 kphoenix137

Why a toggle? This should be the default IMHO.

I'm not a fan of using blue though, it is inconsistent with other parts of the UI.

Also, have you considered showing the value the same way that health and mana show, i.e. current / max? Instead of just current?

julealgon avatar Mar 10 '25 17:03 julealgon

Why a toggle? This should be the default IMHO.

Same reason Life and Mana flask values are toggles.

I'm not a fan of using blue though, it is inconsistent with other parts of the UI.

See OP why blue is used.

Also, have you considered showing the value the same way that health and mana show, i.e. current / max? Instead of just current?

Started with that. It ends up overlapping both the left and right borders a bit on certain numbers. I feel it's unnecessary extra information that occludes more of the spell icon graphic.

kphoenix137 avatar Mar 10 '25 17:03 kphoenix137

Looks like a good option to have. Also seems like it will be easy to convert it to Lua.

@StephenCWills Shouldn't most interface changes be (converted to) Lua mods and removed from the actual code? That would allow you guys to package these mods with DevilutionX, remove some optional stuff from the code (which are always a heated debate) and leave the base game as close to vanilla as possible.

malvarenga123 avatar Mar 21 '25 20:03 malvarenga123

Looks like a good option to have. Also seems like it will be easy to convert it to Lua.

@StephenCWills Shouldn't most interface changes be (converted to) Lua mods and removed from the actual code? That would allow you guys to package these mods with DevilutionX, remove some optional stuff from the code (which are always a heated debate) and leave the base game as close to vanilla as possible.

It remains to be seen if this would quell arguments against optional features, as moving them into Lua mods still presents the same identical end result to the player, but with the extra step of needing to toggle the mod off to remove the toggle option for that feature from the Settings sub-menu.

But yes, it's the plan to move as many optional features to Lua as possible, within reason. Things that only exist as a boolean check based on a toggle aren't worth moving to Lua, as the only thing the Lua script would do is return a true or a false without any actual logic. Pointless when the toggle itself is a boolean.

kphoenix137 avatar Mar 21 '25 22:03 kphoenix137

Shouldn't most interface changes be (converted to) Lua mods and removed from the actual code? That would allow you guys to package these mods with DevilutionX, remove some optional stuff from the code (which are always a heated debate) and leave the base game as close to vanilla as possible.

Not just UI changes. I intend to have APIs developed in Lua that enable us to implement the existing HUD in Lua. This would naturally enable mods that offer things like independent scaling of the UI and straight-up replacement HUDs. Currently, the target for this is 1.7.0, but if we're just talking about the changes in this PR, we can almost do it in Lua already.

StephenCWills avatar Mar 22 '25 00:03 StephenCWills

Drafting so I can convert this into a Lua PR.

kphoenix137 avatar Mar 22 '25 00:03 kphoenix137