Skip to content

Make set_power_configuration use refactored cfg stuff#4733

Open
PieterVdc wants to merge 4 commits intodkfans:masterfrom
PieterVdc:power_cfg_script
Open

Make set_power_configuration use refactored cfg stuff#4733
PieterVdc wants to merge 4 commits intodkfans:masterfrom
PieterVdc:power_cfg_script

Conversation

@PieterVdc
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 5, 2026 18:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors power configuration updates to use the shared named-field config infrastructure, bringing SET_POWER_CONFIGURATION closer to the existing room/trap/effect-generator config paths and exposing the same capability to Lua.

Changes:

  • Replaced the bespoke SET_POWER_CONFIGURATION script parsing/processing code with set_config_check / set_config_process using magic_powers_named_fields_set.
  • Added and registered the Lua SetPowerConfiguration binding and updated the Lua binding stub.
  • Converted power POWER / COST parsing in config_magic.c to custom named-field handlers and moved spell-tab refresh into update_powers_tab_to_config().

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/lvl_script_commands.c Swaps power script handling over to the generic named-field config helpers.
src/lua_api.c Adds the Lua-facing SetPowerConfiguration entry point and registers it globally.
src/frontmenu_ingame_tabs.c Makes power-tab refresh also reopen the active spell menu, matching room/trap refresh behavior.
src/config_magic.h Exports the power named-field set for shared use.
src/config_magic.c Removes the old power command table and adds named-field parsing/assignment for power config values.
config/fxdata/lua/bindings/config.lua Publishes the Lua binding stub for SetPowerConfiguration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/config_magic.c Outdated
Comment thread src/lvl_script_commands.c
Comment thread src/lvl_script_commands.c
Comment thread src/lua_api.c
Comment thread src/lua_api.c
PieterVdc and others added 3 commits May 5, 2026 21:09
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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