Commit Graph
90 Commits
Author SHA1 Message Date
bbassieandClaude Opus 5 2032cadc1b Fix rocket info silo pruning and unit number keys
The prune loop shadowed its own parameter, so `silo_data[unit_number] =
nil` wrote into the entry instead of removing it from the table.

`unit_number` is optional on LuaEntity but always set for a silo. Note
that `--[[ @as ]]` does not narrow for an index expression, only
`@cast` does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 15:31:18 +00:00
bbassieandClaude Opus 5 c233a9ab06 Defer need-check-nil and clean up stale suppressions
emmylua deserialises an unknown diagnostic code to a catch all that
matches no checker, so every `invisible`, `nil-check` and
`global-element` suppression was silently doing nothing. Renamed to the
emmylua codes. `name-style-check` has no equivalent and is dropped, it
was already disabled under luals.

The `get_tile` suppressions referenced an api typedef bug from 2024
which no longer reproduces.

need-check-nil is deferred rather than disabled on merit: a third of the
407 findings come from MapPosition and BoundingBox being aliased as
`struct|[double, double]`, so every `entity.position.x` reads as
possibly nil. The rest need per site knowledge of runtime invariants.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 15:31:18 +00:00
bbassieandClaude Opus 5 b9cfbc9036 Narrow aabb types and give generic aliases their type argument
The aabb functions all index the named members, so passing the
shorthand [MapPosition, MapPosition] form would error at runtime. The
annotations now say so.

emmylua requires a type argument on a generic alias, luals did not.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 15:31:18 +00:00
bbassieandClaude Opus 5 90f32699c7 Fix duplicate class and annotation placement lint errors
Classes contributed to by more than one file now carry the `partial`
attribute. trains.lua declared its command as `ExpCommand_Artillery`,
which was a copy paste.

`Color.0` and `MapPosition.0` became `.struct` in fmtk 2.1.6.

emmylua rejects `@type` on a function statement or a `do` block, so
those are moved onto the local or replaced by `@param` and `@return`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 15:31:18 +00:00
bbassieandClaude Opus 5 c6da1fd9ac Replace the luals lint config with emmylua
fmtk 2.1.4 onwards generates typedefs targeting emmylua that luals
misreads, and every fmtk changelog since 2.1.5 states luals support is
being dropped. luals 3.18.2 is already the latest release, so there is
nothing to bump.

The `--clusterio-modules` plugin has no emmylua equivalent, as emmylua
has no plugin interface, so it is reimplemented as `workspace.moduleMap`.
Those rules rewrite each file's own module path rather than the require
string, hence the reversed direction.

type.patch.lua is obsolete: `raise_event` now takes `LuaEventType` in
the generated typedefs, and `LuaObject` has become `LuaObject.base`.
exp_scenario/.luacheckrc was already dead, luacheck is never invoked.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 15:31:18 +00:00
Cooldude2606andGitHub a324388bc8 Merge pull request #448 from bbassie/feature/roles-plugin
Add exp_roles plugin and scenario permissions
2026-08-06 15:45:04 +01:00
phidiasandGitHub 4255522c57 Research Log (#447)
* Update research.lua

* Fix config file references in research milestones
2026-08-04 14:35:26 +01:00
bbassieandClaude Opus 5 e852abc309 Define scenario permissions for legacy role actions
The role system is moving onto clusterio's own roles and permissions, which
requires every in game action to exist as a real permission rather than a bare
string held only by the lua config.

Adds a permission for each of the 104 actions and 7 flags used by the legacy
role config. Names are derived from the legacy action by a deterministic
transform, exported so the lua side can apply the same mapping and keep existing
call sites working. Command descriptions are taken from the existing locale
entries so they match what players already see.

Actions held by the Guest role are marked grantByDefault, since the in game
default role and clusterio's default role are the same concept.

Role management actions have no scenario permission; they map onto
core.user.update_roles and core.role.list instead.

Also corrects the /unjail description, which was a copy of /jail.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 09:11:26 +00:00
Cooldude2606 a07be7b7ed Bump version in package jsons 2026-07-14 00:50:00 +01:00
Cooldude2606 50daa81a4a Fix require for /debug 2026-06-29 01:14:39 +01:00
phidiasandGitHub c4f9c97130 remove limit (#446)
* Update surface.lua

* .

* .
2026-06-28 21:53:43 +01:00
Cooldude2606andGitHub 4fe0e9c0a6 Add AABB.size (#445) 2026-06-27 14:02:49 +01:00
Cooldude2606andGitHub 27b1a34a83 Merge pull request #443 from Cooldude2606/fix/lint
Fixes many lint issues and other bugs
2026-06-26 15:58:47 +01:00
phidiasandGitHub 1f3689a0ac entity api change (#442)
* Update warps.lua

* .

* .
2026-06-26 15:45:46 +01:00
Cooldude2606 7890540a3e Final lint fixes 2026-06-26 15:40:53 +01:00
Cooldude2606 8b3c437847 Move debug GUI out of legacy 2026-06-26 15:22:06 +01:00
Cooldude2606 95bb8ac304 Move logo out of legacy 2026-06-26 15:09:11 +01:00
Cooldude2606 7be2f8d490 Fix lint errors 2026-06-26 15:02:08 +01:00
Cooldude2606 3b6163451c Fix missed use of bonus.initial_value 2026-06-26 14:34:12 +01:00
Cooldude2606 147c586c4b Remove invalid item from file loader 2026-06-26 14:30:35 +01:00
71ab3e7be4 clear blueprint changed to selection (#435)
* Update surface.lua

* Update en.cfg

* Update surface.lua

* Update en.cfg

* Fix description keys for ground items and blueprints

* Update roles.lua

* Update surface.lua

* Update quick_actions.lua

* Update en.cfg

* Update en.cfg

* Update surface.lua

* Update zh-CN.cfg

* Update zh-TW.cfg

* .

* .

* .

* Many fixes and reverts

---------

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
2026-06-26 13:15:49 +01:00
3a46ec4fa4 Migrate player list gui to scenario (#421)
* Migrate player list gui to scenario

Move modules/gui/player-list into exp_scenario/gui/player_list using the
new exp_gui element API, matching the other scenario guis.

- Store the selected player and action on the container's player data
  instead of a datastore, folding the datastore on_update reactivity
  into explicit setter functions
- Switch the actions config to injected accessor functions and the
  exp-gui_player-list locale namespace
- Add the locale section, register in control.lua, and disable the
  legacy module in the file loader

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Align names and call patterns to best practice

Apply the conventions from the rocket info gui review to the player list,
and remove the now migrated legacy module.

- Move row building onto the table def as calculate_row_data, and refresh
  via refresh_player which computes the row data once per player
- Store the selection on the container with private/public accessor
  methods instead of poking element data directly
- Store the selected player as a LuaPlayer rather than a string and update
  the actions config to match
- Use :style{} on the player table and make the action and reason bars
  their own element definitions
- Delete the migrated legacy gui and its file loader entry

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Address player list review feedback

- Rename the player table element data class to element_data
- Remove the redundant offline selection clear; on_player_left_game
  already clears any selection pointing at a player who disconnects
- Move the action bar and reason bar visibility into their own refresh
  methods so refresh_player just delegates to them

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Style and locale fixes

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
2026-06-26 12:42:33 +01:00
Cooldude2606 31c18c7851 Style and locale fixes 2026-06-26 12:41:49 +01:00
phidiasandGitHub 3a8d83f981 research changes (#430)
* Add event handlers for research reversed and queued

* Update roles.lua

* Remove bonus inventory settings from research.lua

Removed bonus inventory configuration for mining productivity.

* Update en.cfg

* Update zh-CN.cfg

* Update zh-TW.cfg

* Update research.lua

* Delete exp_scenario/module/commands/research.lua

* Update quick_actions.lua

* Update research.lua

* Update research.lua

* Update research.lua
2026-06-26 11:56:24 +01:00
21779988f0 lawnmower changed to selection (#434)
* Update lawnmower.lua

* Update quick_actions.lua

* Update lawnmower.lua

* update locale

* Update lawnmower.lua

* Fix game.get_player

---------

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
2026-06-26 11:54:05 +01:00
d548cebc17 repair add quick action, changed to selection (#437)
* Update repair.lua

* Update repair.lua

* Update quick_actions.lua

* Update en.cfg

* Update repair.lua

* Refactor repair command to use area selection

* Update en.cfg

* Fixes

---------

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
2026-06-26 11:43:09 +01:00
8190b2165d mine depletion (#439)
* Update mine_depletion.lua

* Update miner.lua

* Update mine_depletion.lua

* Compatibility with 2.0 and 2.1

---------

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
2026-06-26 11:37:00 +01:00
2a1a5c952b home add quick action (#436)
* Update home.lua

* Update quick_actions.lua

---------

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
2026-06-25 23:15:31 +01:00
phidiasandGitHub aa7fe73bb0 vlayer info add quick action (#438)
* Update vlayer.lua

* Add vlayer command to quick actions
2026-06-25 23:14:14 +01:00
phidiasandGitHub 7c9d47b6db remove landfill blueprint (#433)
* Delete exp_scenario/module/gui/landfill_blueprint.lua

* Update control.lua

* Update roles.lua

* Update en.cfg

* Update zh-CN.cfg

* Update zh-TW.cfg
2026-06-24 21:34:51 +01:00
dc015bc609 bonus changes (#429)
* Delete exp_legacy/module/modules/data/bonus.lua

* Update _file_loader.lua

* Update roles.lua

* Update bonus.lua

* Update player_bonus.lua

* Update bonus.lua

---------

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
2026-06-24 21:30:46 +01:00
bbassieandClaude Opus 4.8 df129b5e9a Address player list review feedback
- Rename the player table element data class to element_data
- Remove the redundant offline selection clear; on_player_left_game
  already clears any selection pointing at a player who disconnects
- Move the action bar and reason bar visibility into their own refresh
  methods so refresh_player just delegates to them

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 18:22:37 +00:00
bbassieandClaude Opus 4.8 4bd5394268 Align names and call patterns to best practice
Apply the conventions from the rocket info gui review to the player list,
and remove the now migrated legacy module.

- Move row building onto the table def as calculate_row_data, and refresh
  via refresh_player which computes the row data once per player
- Store the selection on the container with private/public accessor
  methods instead of poking element data directly
- Store the selected player as a LuaPlayer rather than a string and update
  the actions config to match
- Use :style{} on the player table and make the action and reason bars
  their own element definitions
- Delete the migrated legacy gui and its file loader entry

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 20:10:20 +00:00
Cooldude2606 05cb831b30 Update Locales 2026-06-20 16:43:26 +01:00
Cooldude2606 05b586fb8c Align names and call patterns to best practice 2026-06-20 16:35:44 +01:00
bbassieandClaude Opus 4.8 b1c0f2535b Migrate player list gui to scenario
Move modules/gui/player-list into exp_scenario/gui/player_list using the
new exp_gui element API, matching the other scenario guis.

- Store the selected player and action on the container's player data
  instead of a datastore, folding the datastore on_update reactivity
  into explicit setter functions
- Switch the actions config to injected accessor functions and the
  exp-gui_player-list locale namespace
- Add the locale section, register in control.lua, and disable the
  legacy module in the file loader

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 12:07:03 +00:00
bbassieandClaude Opus 4.8 8f6d6e1caa Fix milestone lint warning in rocket info gui
Narrow the milestone loop variable with a type check instead of an
@cast, which tripped cast-type-mismatch because the milestones config
mixes the show_milestones flag in with the numbers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 20:05:48 +00:00
bbassieandClaude Opus 4.8 0ead1a51f9 Use gui force data and add_row pattern for rocket info
Address review feedback: store the per-force rocket stats, launch times
and silos on the container's force data instead of a separate storage
registration, and rebuild the stats, milestone and progress tables with
add_row/refresh_row helpers that update label references in place.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 18:53:23 +00:00
bbassieandClaude Opus 4.8 1fcf351566 Migrate rocket info gui to scenario and fix for Space Age
Port modules/gui/rocket-info into exp_scenario/gui/rocket_info using the
new exp_gui element API, matching the other scenario guis. The per-force
stats, launch times and silo tracking from the legacy control module are
folded into the gui module.

- Drop the removed auto/remote launch controls and count launches via
  on_cargo_pod_finished_ascending instead of the old launch event
- Add the exp-gui_rocket-info locale section
- Disable the legacy module in the file loader and re-enable the
  gui/rocket-info role permission

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 00:18:37 +00:00
Cooldude2606 a521cdd901 Change to dev env to fix building 2026-05-22 20:15:36 +01:00
Cooldude2606 b64e109bf1 Plugin Setup exp_groups 2026-05-20 01:48:26 +01:00
Cooldude2606andGitHub 73e53a656d Merge pull request #418 from Cooldude2606/gui/readme
Refactor readme gui
2026-05-19 22:21:34 +01:00
Cooldude2606 620161938f Refactor readme gui 2026-05-13 23:31:33 +01:00
1a561f9d1d extra_logging spaces and fix to player_died (#417)
* extra_logging spaces and fix to player_died

* Update extra_logging.lua

* Update extra_logging.lua

* Update extra_logging.lua

* Remove redundant checks

---------

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
2026-05-13 20:47:02 +01:00
6cbc4e5cfb fix inventory clear (#416)
* Update clear_items function to accept player name

* Update inventory_clear.lua

* Update exp_scenario/module/control/inventory_clear.lua

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>

---------

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
2026-03-27 13:48:53 +00:00
Cooldude2606 91b6d25597 Fix scenario web code 2026-01-15 13:51:00 +00:00
Cooldude2606andGitHub 550cf09967 Refactor task list (#414) 2025-12-15 14:52:27 +00:00
Cooldude2606andGitHub 9bd699ebf1 Refactor legacy addons into Clusterio format (#413)
* Refactor custom start

* Refactor afk kick

* Fix use of assert get player

* Refactor chat popup

* Refactor chat auto reply

* Refactor help bubbles

* Refactor damage popups

* Refactor death markers

* Refactor deconstruction log

* Remove FAGC logging

* Refactor discord alerts

* Refactor insert pickup

* Refactor inventory clear

* Refactor extra logging

* Refactor nuke protection

* Refactor pollution grading

* Refactor protection jail

* Refactor report jail

* Refactor mine depletion

* Refactor degrading tiles

* Refactor station auto name

* Refactor spawn area

* Refactor fast deconstruction

* Bug Fixes
2025-12-02 18:34:24 +00:00
phidiasandGitHub a45f53bc48 GUI Research Milestone Hide Hidden (#412) 2025-12-02 18:33:38 +00:00
Cooldude2606 360247d292 Fix surface bonus application 2025-09-21 19:45:42 +01:00