mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-11 15:54:52 +09:00
The virtual layer was a legacy control module and a legacy gui built on the legacy event system. The control module moves to exp_scenario/module/control/vlayer.lua in the event_handler shape, with the data typed and the allowed item table built locally rather than by rewriting the config. The gui moves to exp_scenario/module/gui/vlayer.lua in the shape of the other scenario guis: statistics as label and bar defines refreshed from display data computed once, and the interface controls as a define which owns its dropdowns. Api changes while moving: interfaces are removed by entity rather than by searching a position, the dead circuit wiring parameter is gone since connect_neighbour no longer exists, and remove_item now takes only the unallocated amount out of storage and counts that production back out of the total, which the legacy module got wrong. The locale moves to [exp-gui_vlayer] in en, zh-CN and zh-TW and the legacy [vlayer] sections, modules and file loader entries are removed. Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
27 lines
843 B
Lua
27 lines
843 B
Lua
--[[-- Commands - VLayer
|
|
Adds a virtual layer to store power to save space.
|
|
]]
|
|
|
|
local Commands = require("modules/exp_commands")
|
|
local Vlayer = require("modules/exp_scenario/control/vlayer")
|
|
|
|
--- @class ExpCommand_vlayer.commands
|
|
local commands = {}
|
|
|
|
--- Print all vlayer information
|
|
--- @class ExpCommands_vlayer.commands.vlayer: ExpCommand
|
|
commands.vlayer = Commands.new("vlayer-info", { "exp-commands_vlayer.description" })
|
|
:register(function(player)
|
|
local index = 3
|
|
local response = { "", "exp-commands_vlayer.title" } --- @type LocalisedString
|
|
for title, value in pairs(Vlayer.get_circuits()) do
|
|
response[index] = { "exp-commands_vlayer.result", title, value }
|
|
index = index + 1
|
|
end
|
|
return Commands.status.success(response)
|
|
end)
|
|
|
|
return {
|
|
commands = commands,
|
|
}
|