Move the virtual layer into exp_scenario - #463
Open
bbassie wants to merge 1 commit into
Open
Conversation
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
force-pushed
the
feature/scenario-vlayer
branch
from
September 6, 2026 16:44
314fbd4 to
dfe3a6c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.luain the event_handler shape with typed data (ExpScenario_Vlayer.*), the allowed item table built locally instead of rewriting the config, and oneregister_interfacepath for the four interface types. The gui moves toexp_scenario/module/gui/vlayer.luain the shape of the other scenario guis: statistics arestat_label/stat_bardefines refreshed from display data computed once per tick, and the interface controls are a define which owns its dropdowns and exposesget_selected_type/get_selected_interface/refresh_interfaces. The/vlayer-infocommand 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 becauseconnect_neighbourno 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_itemhad 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 inexp_legacy/config/vlayer.luafor 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.