map_editor¶
Source: base/tealdef/gui/map_editor/map_editor.d.tl
Notes
Windows of the map editor for generating or importing the height map, generating towns and industries and generating main connections, loaded with ug_require "/gui/map_editor/map_editor.tl".
MapEditor¶
record global base/tealdef/gui/map_editor/map_editor.d.tl:3
global record MapEditor
Load: local map_editor = ug_require "/gui/map_editor/map_editor.tl"
Notes
The map editor tools.
Fields
| Name | Type | Description |
|---|---|---|
MapEditorTool |
ReactToolDefinition<MapEditor.MapEditorToolParams> |
Tool that shows one of the map editor windows, selected by variant. The windows are created beforehand by prepareWindows and only shown and hidden. used 3× in the base game |
Functions
prepareWindows(gameCtx : GameContext, MapEditor.MapEditorConfig) base/tealdef/gui/map_editor/map_editor.d.tl:39
Call as map_editor.prepareWindows
for performance reasons, the windows are created initially and reused later
MapEditor.MapEditorToolVariant¶
enum base/tealdef/gui/map_editor/map_editor.d.tl:5
enum MapEditorToolVariant
Notes
Which map editor window the tool shows.
Used in the base game: 6 times in 2 files
base/content/gui/gui/map_editor/map_editor.tl:16
base/content/gui/gui/game_bar/game_bar.tl:680
MapEditor.MapEditorConfig¶
record base/tealdef/gui/map_editor/map_editor.d.tl:11
record MapEditorConfig
Notes
Configuration passed to prepareWindows.
Used in the base game: 2 times in 2 files
base/content/gui/gui/map_editor/map_editor.tl:2910
base/content/gui/gui/main/game.tl:356
Fields
| Name | Type | Description |
|---|---|---|
mapEditorGlobalStateRef |
ReactRefT<MapEditor.GlobalState> |
State shared by all map editor windows. |
hasHeightMapImporter |
boolean |
Whether height maps can be imported (map editor, not on consoles). |
hasHeightMapExporter |
boolean |
Whether the height map can be exported (map editor, not on consoles). |
hasTownGenerator |
boolean |
Whether the town generator tab is shown. |
hasIndustryGenerator |
boolean |
Whether the industry generator tab is shown. |
MapEditor.GlobalState¶
record base/tealdef/gui/map_editor/map_editor.d.tl:21
record GlobalState
Notes
State shared by the map editor windows.
Used in the base game: 15 times in 3 files
base/content/gui/gui/map_editor/map_editor.tl:188
local function setEditorBusy(editorStateRef : ReactRefT<MapEditor.GlobalState>, key : string, inProgress : boolean)
base/content/gui/gui/game_bar/game_bar.tl:675
base/content/gui/gui/main/game.tl:332
Fields
| Name | Type | Description |
|---|---|---|
operationInProgress |
string |
Key of the editor tab whose operation (for example a generation) is running; while set, the other tabs are unavailable. nil when idle. |
MapEditor.MapEditorToolParams¶
record base/tealdef/gui/map_editor/map_editor.d.tl:25
record MapEditorToolParams is ToolReactUtil.IToolParam
Notes
Tool parameters of MapEditorTool.
Used in the base game: 8 times in 2 files
base/content/gui/gui/map_editor/map_editor.tl:177
base/content/gui/gui/game_bar/game_bar.tl:43
Fields
| Name | Type | Description |
|---|---|---|
variant |
MapEditorToolVariant |
Window to show. |
mapEditorGlobalStateRef |
ReactRefT<MapEditor.GlobalState> |
State shared by all map editor windows. |
hasHeightMapImporter |
boolean |
Whether height maps can be imported. |
hasHeightMapExporter |
boolean |
Whether the height map can be exported. |
hasTownGenerator |
boolean |
Whether the town generator tab is shown. |
hasIndustryGenerator |
boolean |
Whether the industry generator tab is shown. |