Commit Graph
14 Commits
Author SHA1 Message Date
bbassieandClaude Opus 5 1387b8a2db Fix gui element registration and iter removal
The top, left and relative element tables are keyed by the define, but
the duplicate registration assert looked up `define.name`, so it never
fired.

GuiIter.remove_element indexed `registered_scopes` by player index
instead of the scope elements it had just fetched, so it removed
nothing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 15:31:18 +00:00
bbassieandClaude Opus 5 164672602d Make the @as casts actually apply
emmylua only parses the inline cast as `--[[@as T]]`, the spaced form
`--[[ @as T ]]` is treated as a plain comment, so all 149 of them were
doing nothing.

LuaGuiElement.style is a union because a style name can be assigned to
it, so reading it back needs the cast.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 15:31:18 +00:00
bbassieandClaude Opus 5 0bb92966eb Fix type annotations the linter found to be wrong
Async ids come from `get_function_name`, which returns a string, but
were documented as numbers.

`setmetatable` in clusterio's compat module loses `LibCompat` on the
module return, so the require is cast.

`GuiData.__index` accepts a `DataKey` but emmylua needs that as an
index signature on the class.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 15:31:18 +00:00
Cooldude2606andGitHub 7ab721b4b6 Refactor some of the Guis from the legacy plugin (#399)
* Fix bugs in core and add default args to Gui defs

* Refactor production Gui

* Refactor landfill blueprint button

* Fix more bugs in core

* Consistent naming of new guis

* Refactor module inserter gui

* Refactor surveillance gui

* Add shorthand for data from arguments

* Make element names consistent

* Add types

* Change how table rows work

* Refactor player stats gui

* Refactor quick actions gui

* Refactor research milestones gui

* Refactor player bonus gui

* Refactor science production gui

* Refactor autofill gui

* Cleanup use of aligned flow

* Rename "Gui.element" to "Gui.define"

* Rename Gui types

* Rename property_from_arg

* Add guide for making guis

* Add full reference document

* Add condensed reference

* Apply style guide to refactored guis

* Bug fixes
2025-08-29 14:30:30 +01:00
Cooldude2606 1d95d899ea Fix lint issue 2025-08-04 21:26:56 +01:00
Cooldude2606andGitHub aedc3cff6b Fix lint errors on new luals version (#384) 2025-04-06 17:05:40 +01:00
phidiasandGitHub 55b1756a42 Fix missing storage reference (#373) 2025-02-03 21:20:08 +00:00
Cooldude2606 88a47e3edc Add core elements 2025-01-30 00:07:06 +00:00
Cooldude2606 ee6359582c Make GuiData more lean 2025-01-30 00:07:06 +00:00
Cooldude2606 0b665bbd46 Add control stage asserts 2025-01-30 00:07:06 +00:00
Cooldude2606 f534355861 Add property_from_args and global_data 2025-01-30 00:07:05 +00:00
Cooldude2606 2fc922218d Add events for data clean up 2025-01-30 00:07:05 +00:00
Cooldude2606 d752b01076 Add ExpElement 2025-01-30 00:07:04 +00:00
Cooldude2606 3b9d895682 Add ExpGui_GuiData 2025-01-30 00:07:04 +00:00