diff --git a/exp_legacy/module/config/vlayer.lua b/exp_legacy/module/config/vlayer.lua index d80ed827..c2e0761a 100644 --- a/exp_legacy/module/config/vlayer.lua +++ b/exp_legacy/module/config/vlayer.lua @@ -35,6 +35,20 @@ return { storage_output = 1, -- >0 allows for item teleportation (allowed_items only) }, + --- @class Vlayer.ItemProperties + --- @field starting_value number + --- @field required_area number + --- @field production number? + --- @field discharge number? + --- @field capacity number? + --- @field surface_area number? + --- @field fuel_value number? + --- @field power boolean? + --- @field modded boolean? Set when the item is registered from a modded equivalent + --- @field base_game_equivalent string? + --- @field multiplier number? + + --- @type table allowed_items = { --- @setting allowed_items List of all items allowed in vlayer storage and their properties --[[ Allowed properties: diff --git a/exp_legacy/module/modules/control/vlayer.lua b/exp_legacy/module/modules/control/vlayer.lua index 39346063..37718244 100644 --- a/exp_legacy/module/modules/control/vlayer.lua +++ b/exp_legacy/module/modules/control/vlayer.lua @@ -14,10 +14,10 @@ local mega = 1000000 local vlayer = {} local vlayer_data = { entity_interfaces = { - energy = {}, - circuit = {}, - storage_input = {}, - storage_output = {}, + energy = {}, --- @type LuaEntity[] + circuit = {}, --- @type LuaEntity[] + storage_input = {}, --- @type LuaEntity[] + storage_output = {}, --- @type LuaEntity[] }, properties = { total_surface_area = 0, @@ -582,11 +582,11 @@ local function handle_circuit_interfaces() if not interface.valid then vlayer_data.entity_interfaces.circuit[index] = nil else - local circuit_oc = interface.get_or_create_control_behavior() - if circuit_oc.sections_count == 0 then - circuit_oc.add_section() + local control = interface.get_or_create_control_behavior() + if control.sections_count == 0 then + control.add_section() end - circuit_oc = circuit_oc.sections[1] + local circuit_oc = control.sections[1] local signal_index = 1 local circuit = vlayer.get_circuits() diff --git a/exp_legacy/module/modules/gui/vlayer.lua b/exp_legacy/module/modules/gui/vlayer.lua index a57f090a..47d1abe1 100644 --- a/exp_legacy/module/modules/gui/vlayer.lua +++ b/exp_legacy/module/modules/gui/vlayer.lua @@ -22,9 +22,9 @@ local function aabb_align_expand(aabb) } end -local vlayer_container -local vlayer_gui_control_type -local vlayer_gui_control_list +local vlayer_container --- @type ExpElement +local vlayer_gui_control_type --- @type ExpElement +local vlayer_gui_control_list --- @type ExpElement local vlayer_control_type_list = { [1] = "energy", @@ -87,7 +87,7 @@ SelectArea:on_selection(function(event) local container = Gui.get_left_element(vlayer_container, player) local disp = container.frame["vlayer_st_2"].disp.table local target = vlayer_control_type_list[disp[vlayer_gui_control_type.name].selected_index] - local entities + local entities --- @type LuaEntity[] if config.power_on_space and event.surface and event.surface.platform and target == "energy" then if player.force.technologies[config.power_on_space_research.name].level >= config.power_on_space_research.level then