local active_mods = script.active_mods RECIPEBOOK_ACTIVE = (active_mods["RecipeBook"] ~= nil) RECIPEBOOK_API_VERSION = 4 -- the API version of Recipe Book this mod works with BEACON_OVERLOAD_ACTIVE = ( active_mods["space-exploration"] or active_mods["wret-beacon-rebalance-mod"] or active_mods["beacon-overhaul"] ) and true DEBUGGER_ACTIVE = (active_mods["debugadapter"] ~= nil) DEV_ACTIVE = false -- enables certain conveniences for development llog = require("llog") MAGIC_NUMBERS = { margin_of_error = 1e-6, -- the margin of error for floating point calculations subfactory_deletion_delay = 15 * 60 * 60, -- ticks to deletion after subfactory trashing modal_search_rate_limit = 10, -- ticks between modal search runs effects_lower_bound = -0.8, effects_upper_bound = 327.67, -- Some magic numbers to determine and calculate the dimensions of the main dialog frame_spacing = 12, -- Spacing between the base frames in the main dialog title_bar_height = 28, -- Height of the main dialog title bar subheader_height = 36, -- Height of the subfactory list subheader list_width = 300, -- Width of the subfactory list list_element_height = 28, -- Height of an individual subfactory list element info_height = 138, -- Height of the subfactory info frame item_button_size = 40, -- Size of item box buttons item_box_max_rows = 4, -- Maximum number of rows in an item box -- Various other UI-related magic numbers recipes_per_row = 6, -- Number of recipes per row in the recipe picker items_per_row = 10, -- Number of items per row in the item picker groups_per_row = 6, -- Number of groups in a row in the item picker blueprint_limit = 12 -- Maxmimum number of blueprints allowed per subfactory } CUSTOM_EVENTS = { open_modal_dialog = script.generate_event_name(), close_modal_dialog = script.generate_event_name(), build_gui_element = script.generate_event_name(), refresh_gui_element = script.generate_event_name() } fancytable = require("__flib__.table") -- has more functionality than built-in table translator = require("__flib__.dictionary-lite") -- translation module for localised search util = require("util.util") -- LuaLS doesn't like this being called 'util' require("ui.base.main_dialog") require("ui.base.compact_dialog") require("ui.base.modal_dialog") -- Not sure yet how to make these not global variables (filled via event_handler) TUTORIAL_TOOLTIPS = {} ---@type { [string]: LocalisedString } GLOBAL_HANDLERS = {} ---@type { [string]: function } require("backend.init") require("ui.event_handler") TUTORIAL_EXPORT_STRING = "e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5/4th0jOEr/c3VWvb0EwSnjdBVeWb3GMWj14mRddIpcYIcovw2SXRWKisVSWFjxWjNwXbMEy230TxThviPv/uVYHJ/cJ8tLCa/x1cUsyPeO73BZpbSo7XvwFHm6Nsw==" ---@class Event ---@field name defines.events ---@field tick Tick ---@class GuiEvent : Event ---@field player_index PlayerIndex ---@alias Timescale 1 | 60 | 3600 ---@alias FPCopyableObject FPLine | FPMachine | FPBeacon | FPModule | FPItem | FPFuel ---@alias FPParentObject FPFactory | FPSubfactory | FPFloor | FPLine | FPModuleSet ---@alias SwitchState "left" | "right" ---@alias PlayerIndex uint ---@alias Tick uint ---@alias VersionString string ---@alias ModToVersion { [string]: VersionString } ---@alias ModuleLimitations { [string]: true } ---@alias AllowedEffects { [string]: boolean } ---@alias ItemType string ---@alias ItemName string