Skip to content

Move the virtual layer into exp_scenario - #463

Open
bbassie wants to merge 1 commit into
explosivegaming:mainfrom
bbassie:feature/scenario-vlayer
Open

Move the virtual layer into exp_scenario#463
bbassie wants to merge 1 commit into
explosivegaming:mainfrom
bbassie:feature/scenario-vlayer

Conversation

@bbassie

@bbassie bbassie commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The virtual layer was a legacy control module and a legacy gui on the legacy event system. The control module moves to exp_scenario/module/control/vlayer.lua in the event_handler shape with typed data (ExpScenario_Vlayer.*), the allowed item table built locally instead of rewriting the config, and one register_interface path for the four interface types. The gui moves to exp_scenario/module/gui/vlayer.lua in the shape of the other scenario guis: statistics are stat_label/stat_bar defines refreshed from display data computed once per tick, and the interface controls are a define which owns its dropdowns and exposes get_selected_type/get_selected_interface/refresh_interfaces. The /vlayer-info command and the player bonus gui are repointed; the public api names they use (get_circuits, get_statistics, energy_changed) are unchanged.

Deliberate changes: interfaces are removed by entity (remove_interface(interface)) rather than by searching a position; the circuit wiring parameter is gone because connect_neighbour no longer exists and nothing ever passed it; circuit slots are cleared before being set instead of the retry dance, and the combinator description is written once at creation. remove_item had two bugs: when part of a request came from the unallocated pool it subtracted the full request from storage, and it never took the unallocated production back out of the total. Both are fixed.

The locale moves to [exp-gui_vlayer] in en, zh-CN and zh-TW with keys named by use (caption-stat-*, tooltip-stat-*, type-*, message-*), the legacy [vlayer] sections are removed, and the two legacy modules and their file loader entries are deleted. The config stays in exp_legacy/config/vlayer.lua for now.

Lua lint is clean. On my dev instance the scenario loads with 0 errors, and over rcon I checked: landfill, solar and accumulator insertion with partial allocation and the remaining area deficit, landfill refusing to leave while in use, creating all four interface types, the input chest draining into storage, the circuit signals (A, U, R, M, P, S, C, E plus item counts), the energy interface charging from production, an output request being filled from storage, and removing all four interfaces with the chest contents dropped. The gui itself (bars, dropdowns, the build selection) needs a player, so that part is untested here.

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.
@bbassie
bbassie force-pushed the feature/scenario-vlayer branch from 314fbd4 to dfe3a6c Compare September 6, 2026 16:44
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.

1 participant