docs(research): TpF3 mod tooling and structure, offline wiki/script-doc copies
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
0213e22d66
39 files changed
+66135
No files matched your search
@@ -0,0 +1,89 @@
|
||||
<!-- Source: https://wiki.transportfever3.com/script-doc/api.html (fetched 2026-10-04) -->
|
||||
|
||||
[index](index.html) / api
|
||||
|
||||
---
|
||||
|
||||
# Module api[🔗](#api)
|
||||
|
||||
```
|
||||
global record api res: Res
|
||||
gui: Gui
|
||||
engine: Engine
|
||||
type: Type
|
||||
util: ApiUtil
|
||||
cmd: Cmd
|
||||
modhub: ModhubApi
|
||||
end
|
||||
global app: App
|
||||
global loaderHelper: LoaderHelper
|
||||
```
|
||||
|
||||
## Category: globals[🔗](#category-globals)
|
||||
|
||||
### api[🔗](#$api~api)
|
||||
|
||||
```
|
||||
global record api res: Res
|
||||
gui: Gui
|
||||
engine: Engine
|
||||
type: Type
|
||||
util: ApiUtil
|
||||
cmd: Cmd
|
||||
modhub: ModhubApi
|
||||
end
|
||||
```
|
||||
|
||||
### api.res[🔗](#$api~api.res)
|
||||
|
||||
```
|
||||
api.res: Res
|
||||
```
|
||||
|
||||
### api.gui[🔗](#$api~api.gui)
|
||||
|
||||
```
|
||||
api.gui: Gui
|
||||
```
|
||||
|
||||
### api.engine[🔗](#$api~api.engine)
|
||||
|
||||
```
|
||||
api.engine: Engine
|
||||
```
|
||||
|
||||
### api.type[🔗](#$api~api.type)
|
||||
|
||||
```
|
||||
api.type: Type
|
||||
```
|
||||
|
||||
### api.util[🔗](#$api~api.util)
|
||||
|
||||
```
|
||||
api.util: ApiUtil
|
||||
```
|
||||
|
||||
### api.cmd[🔗](#$api~api.cmd)
|
||||
|
||||
```
|
||||
api.cmd: Cmd
|
||||
```
|
||||
|
||||
### api.modhub[🔗](#$api~api.modhub)
|
||||
|
||||
```
|
||||
api.modhub: ModhubApi
|
||||
```
|
||||
|
||||
### app[🔗](#$api~app)
|
||||
|
||||
```
|
||||
global app: App
|
||||
```
|
||||
|
||||
### loaderHelper[🔗](#$api~loaderHelper)
|
||||
|
||||
```
|
||||
global loaderHelper: LoaderHelper
|
||||
```
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,723 @@
|
||||
<!-- Source: https://wiki.transportfever3.com/script-doc/api/res.html (fetched 2026-10-04) -->
|
||||
|
||||
[index](../index.html) / [api](../api.html) / res
|
||||
|
||||
---
|
||||
|
||||
# Module api.res[🔗](#api.res)
|
||||
|
||||
Repositories containing game resources (models, tracks, streets, ...)
|
||||
|
||||
```
|
||||
global record Res buildingTypeRep: ResTypeRep<integer, BuildingType>
|
||||
bridgeTypeRep: ResTypeRep<integer, BridgeType>
|
||||
constructionRep: ResTypeRep<integer, ConstructionDesc>
|
||||
metaConstructionRep: ResTypeRep<integer, MetaConstructionDesc>
|
||||
genericRep: GenericRep
|
||||
economyRep: ResTypeRep<integer, EconomyDesc>
|
||||
climateRep: ResTypeRep<integer, ClimateDesc>
|
||||
terrainGeneratorRep: ResTypeRep<integer, TerrainGeneratorDesc>
|
||||
environmentRep: ResTypeRep<integer, Environment>
|
||||
playlistRep: ResTypeRep<integer, PlaylistDesc>
|
||||
gameScriptRep: ResTypeRep<integer, GameScriptType>
|
||||
cargoClassRep: CargoClassRep
|
||||
cargoTypeRep: CargoTypeRep
|
||||
nameRep: ResTypeRep<integer, NameDesc>
|
||||
campaignRep: ResTypeRep<integer, CampaignDesc>
|
||||
missionRep: ResTypeRep<integer, MissionDesc>
|
||||
modelRep: ModelRep
|
||||
multipleUnitRep: ResTypeRep<integer, MultipleUnit>
|
||||
streetTemplateRep: ResTypeRep<integer, StreetTemplate>
|
||||
edgeDecorationRep: ResTypeRep<integer, EdgeDecoration>
|
||||
terrainMaterialTypeRep: ResTypeRep<integer, TerrainMaterialType>
|
||||
trafficLightTypeRep: ResTypeRep<integer, TrafficLightType>
|
||||
tunnelTypeRep: ResTypeRep<integer, BridgeType>
|
||||
moduleRep: ResTypeRep<integer, ModuleDesc>
|
||||
railroadCrossingTypeRep: ResTypeRep<integer, RailroadCrossingType>
|
||||
streetStyleRep: ResTypeRep<integer, StreetStyle>
|
||||
builderAudioSetRep: ResTypeRep<integer, BuilderAudioSet>
|
||||
soundSetRep: ResTypeRep<integer, SoundSet>
|
||||
groundTextureRep: ResTypeRep<string, GroundTexture>
|
||||
autoGroundTexRep: ResTypeRep<string, AutoGroundTex>
|
||||
getBaseConfig: function(): BaseConfig
|
||||
end
|
||||
global record CargoClassRep getCargoClassId: function(cargoClass : string): CargoClassId
|
||||
hasCargoClass: function(cargoClass : string): boolean
|
||||
end
|
||||
global record CargoTypeRep forEachCargoType: function(cargoTypeSet : CargoTypeSet, callback : function(CargoTypeId))
|
||||
hasCargoType: function(cargoTypeSet : CargoTypeSet, test : CargoTypeId, inverse : boolean): boolean
|
||||
getPassengerCargoTypeId: function(): CargoTypeId
|
||||
end
|
||||
global record GameScriptType getState: function(GameScriptType): {<any type> : <any type>}
|
||||
end
|
||||
global record GenericRep getAllOfType: function(typeName : string, includeInvisible : boolean): {integer}
|
||||
end
|
||||
global record ModelRep forEachModelWithMetadata: function(metadata : string, callback : function(string))
|
||||
end
|
||||
global interface ResTypeRep<K, T> get: function(id : K): T
|
||||
getName: function(id : K): string
|
||||
find: function(resName : string): K
|
||||
findAndGet: function(resName : string): T
|
||||
getAll: function(includeInvisible : boolean): {K : string}
|
||||
add: function(resName : ResName, resource : T, visible : boolean): K
|
||||
setVisible: function(id : K, visible : boolean)
|
||||
isVisible: function(id : K): boolean
|
||||
getAsTable: function(id : K): T
|
||||
setAsTable: function(id : K, t : T): boolean
|
||||
addAsTable: function(the : ResName, t : T): K
|
||||
end
|
||||
```
|
||||
|
||||
## Category: main[🔗](#category-main)
|
||||
|
||||
### Res[🔗](#$api.res~Res)
|
||||
|
||||
```
|
||||
global record Res buildingTypeRep: ResTypeRep<integer, BuildingType>
|
||||
bridgeTypeRep: ResTypeRep<integer, BridgeType>
|
||||
constructionRep: ResTypeRep<integer, ConstructionDesc>
|
||||
metaConstructionRep: ResTypeRep<integer, MetaConstructionDesc>
|
||||
genericRep: GenericRep
|
||||
economyRep: ResTypeRep<integer, EconomyDesc>
|
||||
climateRep: ResTypeRep<integer, ClimateDesc>
|
||||
terrainGeneratorRep: ResTypeRep<integer, TerrainGeneratorDesc>
|
||||
environmentRep: ResTypeRep<integer, Environment>
|
||||
playlistRep: ResTypeRep<integer, PlaylistDesc>
|
||||
gameScriptRep: ResTypeRep<integer, GameScriptType>
|
||||
cargoClassRep: CargoClassRep
|
||||
cargoTypeRep: CargoTypeRep
|
||||
nameRep: ResTypeRep<integer, NameDesc>
|
||||
campaignRep: ResTypeRep<integer, CampaignDesc>
|
||||
missionRep: ResTypeRep<integer, MissionDesc>
|
||||
modelRep: ModelRep
|
||||
multipleUnitRep: ResTypeRep<integer, MultipleUnit>
|
||||
streetTemplateRep: ResTypeRep<integer, StreetTemplate>
|
||||
edgeDecorationRep: ResTypeRep<integer, EdgeDecoration>
|
||||
terrainMaterialTypeRep: ResTypeRep<integer, TerrainMaterialType>
|
||||
trafficLightTypeRep: ResTypeRep<integer, TrafficLightType>
|
||||
tunnelTypeRep: ResTypeRep<integer, BridgeType>
|
||||
moduleRep: ResTypeRep<integer, ModuleDesc>
|
||||
railroadCrossingTypeRep: ResTypeRep<integer, RailroadCrossingType>
|
||||
streetStyleRep: ResTypeRep<integer, StreetStyle>
|
||||
builderAudioSetRep: ResTypeRep<integer, BuilderAudioSet>
|
||||
soundSetRep: ResTypeRep<integer, SoundSet>
|
||||
groundTextureRep: ResTypeRep<string, GroundTexture>
|
||||
autoGroundTexRep: ResTypeRep<string, AutoGroundTex>
|
||||
getBaseConfig: function(): BaseConfig
|
||||
end
|
||||
```
|
||||
|
||||
List of all repositories
|
||||
|
||||
### Res.buildingTypeRep[🔗](#$api.res~Res.buildingTypeRep)
|
||||
|
||||
```
|
||||
Res.buildingTypeRep: ResTypeRep<integer, BuildingType>
|
||||
```
|
||||
|
||||
A resource repository containing data for town buildings.
|
||||
|
||||
### Res.bridgeTypeRep[🔗](#$api.res~Res.bridgeTypeRep)
|
||||
|
||||
```
|
||||
Res.bridgeTypeRep: ResTypeRep<integer, BridgeType>
|
||||
```
|
||||
|
||||
A resource repository containing data from the bridge configuration files and from dynamically generated bridges.
|
||||
|
||||
### Res.constructionRep[🔗](#$api.res~Res.constructionRep)
|
||||
|
||||
```
|
||||
Res.constructionRep: ResTypeRep<integer, ConstructionDesc>
|
||||
```
|
||||
|
||||
A resource repository containing data from the ".con" files and from dynamically generated constructions.
|
||||
|
||||
### Res.metaConstructionRep[🔗](#$api.res~Res.metaConstructionRep)
|
||||
|
||||
```
|
||||
Res.metaConstructionRep: ResTypeRep<integer, MetaConstructionDesc>
|
||||
```
|
||||
|
||||
A resource repository containing data for all custom resources.
|
||||
|
||||
### Res.genericRep[🔗](#$api.res~Res.genericRep)
|
||||
|
||||
```
|
||||
Res.genericRep: GenericRep
|
||||
```
|
||||
|
||||
### Res.economyRep[🔗](#$api.res~Res.economyRep)
|
||||
|
||||
```
|
||||
Res.economyRep: ResTypeRep<integer, EconomyDesc>
|
||||
```
|
||||
|
||||
A resource repository containing data from the ".eco" economy resources.
|
||||
|
||||
### Res.climateRep[🔗](#$api.res~Res.climateRep)
|
||||
|
||||
```
|
||||
Res.climateRep: ResTypeRep<integer, ClimateDesc>
|
||||
```
|
||||
|
||||
A resource repository containing data for the climates.
|
||||
|
||||
### Res.terrainGeneratorRep[🔗](#$api.res~Res.terrainGeneratorRep)
|
||||
|
||||
```
|
||||
Res.terrainGeneratorRep: ResTypeRep<integer, TerrainGeneratorDesc>
|
||||
```
|
||||
|
||||
A resource repository containing data for the terrain generation.
|
||||
|
||||
### Res.environmentRep[🔗](#$api.res~Res.environmentRep)
|
||||
|
||||
```
|
||||
Res.environmentRep: ResTypeRep<integer, Environment>
|
||||
```
|
||||
|
||||
A resource repository containing data for the environment.
|
||||
|
||||
### Res.playlistRep[🔗](#$api.res~Res.playlistRep)
|
||||
|
||||
```
|
||||
Res.playlistRep: ResTypeRep<integer, PlaylistDesc>
|
||||
```
|
||||
|
||||
A repository for playlists.
|
||||
|
||||
### Res.gameScriptRep[🔗](#$api.res~Res.gameScriptRep)
|
||||
|
||||
```
|
||||
Res.gameScriptRep: ResTypeRep<integer, GameScriptType>
|
||||
```
|
||||
|
||||
A resource repository containing game scripts.
|
||||
|
||||
### Res.cargoClassRep[🔗](#$api.res~Res.cargoClassRep)
|
||||
|
||||
```
|
||||
Res.cargoClassRep: CargoClassRep
|
||||
```
|
||||
|
||||
A resource repository containing data with all the cargo classes.
|
||||
|
||||
### Res.cargoTypeRep[🔗](#$api.res~Res.cargoTypeRep)
|
||||
|
||||
```
|
||||
Res.cargoTypeRep: CargoTypeRep
|
||||
```
|
||||
|
||||
A resource repository containing data with all the cargo types.
|
||||
|
||||
### Res.nameRep[🔗](#$api.res~Res.nameRep)
|
||||
|
||||
```
|
||||
Res.nameRep: ResTypeRep<integer, NameDesc>
|
||||
```
|
||||
|
||||
A resource repository for names.
|
||||
|
||||
### Res.campaignRep[🔗](#$api.res~Res.campaignRep)
|
||||
|
||||
```
|
||||
Res.campaignRep: ResTypeRep<integer, CampaignDesc>
|
||||
```
|
||||
|
||||
A resource repository for campaign chapters.
|
||||
|
||||
### Res.missionRep[🔗](#$api.res~Res.missionRep)
|
||||
|
||||
```
|
||||
Res.missionRep: ResTypeRep<integer, MissionDesc>
|
||||
```
|
||||
|
||||
A resource repository for campaign missions.
|
||||
|
||||
### Res.modelRep[🔗](#$api.res~Res.modelRep)
|
||||
|
||||
```
|
||||
Res.modelRep: ModelRep
|
||||
```
|
||||
|
||||
A resource repository containing all the game models and metadata.
|
||||
|
||||
### Res.multipleUnitRep[🔗](#$api.res~Res.multipleUnitRep)
|
||||
|
||||
```
|
||||
Res.multipleUnitRep: ResTypeRep<integer, MultipleUnit>
|
||||
```
|
||||
|
||||
A resource repository containing data from the multiple unit files and from dynamically generated multiple units.
|
||||
|
||||
### Res.streetTemplateRep[🔗](#$api.res~Res.streetTemplateRep)
|
||||
|
||||
```
|
||||
Res.streetTemplateRep: ResTypeRep<integer, StreetTemplate>
|
||||
```
|
||||
|
||||
A resource repository containing data from the street template files and from dynamically generated street templates.
|
||||
|
||||
### Res.edgeDecorationRep[🔗](#$api.res~Res.edgeDecorationRep)
|
||||
|
||||
```
|
||||
Res.edgeDecorationRep: ResTypeRep<integer, EdgeDecoration>
|
||||
```
|
||||
|
||||
### Res.terrainMaterialTypeRep[🔗](#$api.res~Res.terrainMaterialTypeRep)
|
||||
|
||||
```
|
||||
Res.terrainMaterialTypeRep: ResTypeRep<integer, TerrainMaterialType>
|
||||
```
|
||||
|
||||
A resource repository containing materials.
|
||||
|
||||
### Res.trafficLightTypeRep[🔗](#$api.res~Res.trafficLightTypeRep)
|
||||
|
||||
```
|
||||
Res.trafficLightTypeRep: ResTypeRep<integer, TrafficLightType>
|
||||
```
|
||||
|
||||
A resource repository containing data from the traffic lights.
|
||||
|
||||
### Res.tunnelTypeRep[🔗](#$api.res~Res.tunnelTypeRep)
|
||||
|
||||
```
|
||||
Res.tunnelTypeRep: ResTypeRep<integer, BridgeType>
|
||||
```
|
||||
|
||||
A resource repository containing data from the tunnel configuration files and from dynamically generated tunnels.
|
||||
|
||||
### Res.moduleRep[🔗](#$api.res~Res.moduleRep)
|
||||
|
||||
```
|
||||
Res.moduleRep: ResTypeRep<integer, ModuleDesc>
|
||||
```
|
||||
|
||||
A resource repository containing data from the ".modules" files and from dynamically generated modules.
|
||||
|
||||
### Res.railroadCrossingTypeRep[🔗](#$api.res~Res.railroadCrossingTypeRep)
|
||||
|
||||
```
|
||||
Res.railroadCrossingTypeRep: ResTypeRep<integer, RailroadCrossingType>
|
||||
```
|
||||
|
||||
A resource repository containing data from the railroad crossing files and from dynamically generated railroad crossing types.
|
||||
|
||||
### Res.streetStyleRep[🔗](#$api.res~Res.streetStyleRep)
|
||||
|
||||
```
|
||||
Res.streetStyleRep: ResTypeRep<integer, StreetStyle>
|
||||
```
|
||||
|
||||
A resource repository containing data from the street type files and from dynamically generated street types.
|
||||
|
||||
### Res.builderAudioSetRep[🔗](#$api.res~Res.builderAudioSetRep)
|
||||
|
||||
```
|
||||
Res.builderAudioSetRep: ResTypeRep<integer, BuilderAudioSet>
|
||||
```
|
||||
|
||||
A resource repository containing data for audio sets for building
|
||||
|
||||
### Res.soundSetRep[🔗](#$api.res~Res.soundSetRep)
|
||||
|
||||
```
|
||||
Res.soundSetRep: ResTypeRep<integer, SoundSet>
|
||||
```
|
||||
|
||||
A resource repository containing data for sound sets
|
||||
|
||||
### Res.groundTextureRep[🔗](#$api.res~Res.groundTextureRep)
|
||||
|
||||
```
|
||||
Res.groundTextureRep: ResTypeRep<string, GroundTexture>
|
||||
```
|
||||
|
||||
A resource repository containing data for ground textures.
|
||||
|
||||
### Res.autoGroundTexRep[🔗](#$api.res~Res.autoGroundTexRep)
|
||||
|
||||
```
|
||||
Res.autoGroundTexRep: ResTypeRep<string, AutoGroundTex>
|
||||
```
|
||||
|
||||
A resource repository containing data for automatic ground texture definitions.
|
||||
|
||||
### Res.getBaseConfig[🔗](#$api.res~Res.getBaseConfig)
|
||||
|
||||
```
|
||||
function Res.getBaseConfig(): BaseConfig
|
||||
```
|
||||
|
||||
Gets the base config, it contains most of the data which was read from "base/base\_config.lua".
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `BaseConfig` — Table the configuration table. See https://wiki.transportfever3.com/doku.php?id=modding:baseconfig for a detailed explanation.
|
||||
|
||||
## Category: globals[🔗](#category-globals)
|
||||
|
||||
### CargoClassRep[🔗](#$api.res~CargoClassRep)
|
||||
|
||||
```
|
||||
global record CargoClassRep getCargoClassId: function(cargoClass : string): CargoClassId
|
||||
hasCargoClass: function(cargoClass : string): boolean
|
||||
end
|
||||
```
|
||||
|
||||
### CargoClassRep.getCargoClassId[🔗](#$api.res~CargoClassRep.getCargoClassId)
|
||||
|
||||
```
|
||||
function CargoClassRep.getCargoClassId(cargoClass : string): CargoClassId
|
||||
```
|
||||
|
||||
Gets the CargoClassId for a given CargoClass name
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `cargoClass` :`string` — cargo class name
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `CargoClassId` — cargo class id
|
||||
|
||||
### CargoClassRep.hasCargoClass[🔗](#$api.res~CargoClassRep.hasCargoClass)
|
||||
|
||||
```
|
||||
function CargoClassRep.hasCargoClass(cargoClass : string): boolean
|
||||
```
|
||||
|
||||
Checks if the given cargo class is present, this can be used if some cargo classes exist but are invisible
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `cargoClass` :`string` — cargo class name
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `boolean` — true if present
|
||||
|
||||
### CargoTypeRep[🔗](#$api.res~CargoTypeRep)
|
||||
|
||||
```
|
||||
global record CargoTypeRep forEachCargoType: function(cargoTypeSet : CargoTypeSet, callback : function(CargoTypeId))
|
||||
hasCargoType: function(cargoTypeSet : CargoTypeSet, test : CargoTypeId, inverse : boolean): boolean
|
||||
getPassengerCargoTypeId: function(): CargoTypeId
|
||||
end
|
||||
```
|
||||
|
||||
### CargoTypeRep.forEachCargoType[🔗](#$api.res~CargoTypeRep.forEachCargoType)
|
||||
|
||||
```
|
||||
function CargoTypeRep.forEachCargoType(cargoTypeSet : CargoTypeSet, callback : function(CargoTypeId))
|
||||
```
|
||||
|
||||
Iterates over all cargo types in a given cargo type set
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `cargoTypeSet` :`CargoTypeSet` — the cargo type set to iterate over
|
||||
* `callback` :`function(CargoTypeId)` — a callback for each cargo type
|
||||
|
||||
### CargoTypeRep.hasCargoType[🔗](#$api.res~CargoTypeRep.hasCargoType)
|
||||
|
||||
```
|
||||
function CargoTypeRep.hasCargoType(cargoTypeSet : CargoTypeSet, test : CargoTypeId, inverse : boolean): boolean
|
||||
```
|
||||
|
||||
Checks if a cargo type set contains a specific cargo type
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `cargoTypeSet` :`CargoTypeSet` — the cargo type set to check
|
||||
* `test` :`CargoTypeId` — the cargo type to test for
|
||||
* `inverse` :`boolean` — if true, the function returns true when any other cargo exists
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `boolean`
|
||||
|
||||
### CargoTypeRep.getPassengerCargoTypeId[🔗](#$api.res~CargoTypeRep.getPassengerCargoTypeId)
|
||||
|
||||
```
|
||||
function CargoTypeRep.getPassengerCargoTypeId(): CargoTypeId
|
||||
```
|
||||
|
||||
Returns the cargo type id for passenger
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `CargoTypeId`
|
||||
|
||||
### GameScriptType[🔗](#$api.res~GameScriptType)
|
||||
|
||||
```
|
||||
global record GameScriptType getState: function(GameScriptType): {<any type> : <any type>}
|
||||
end
|
||||
```
|
||||
|
||||
### GameScriptType.getState[🔗](#$api.res~GameScriptType.getState)
|
||||
|
||||
```
|
||||
function GameScriptType.getState(GameScriptType): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `GameScriptType`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### GenericRep[🔗](#$api.res~GenericRep)
|
||||
|
||||
```
|
||||
global record GenericRep getAllOfType: function(typeName : string, includeInvisible : boolean): {integer}
|
||||
end
|
||||
```
|
||||
|
||||
### GenericRep.getAllOfType[🔗](#$api.res~GenericRep.getAllOfType)
|
||||
|
||||
```
|
||||
function GenericRep.getAllOfType(typeName : string, includeInvisible : boolean): {integer}
|
||||
```
|
||||
|
||||
Gets all Generic resource types of a given type name
|
||||
does not allow typeName in { "gui*res*overwrite", "gui\_res" }, for those, use `api.gui.genericRep`
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `typeName` :`string` — type name
|
||||
* `includeInvisible` :`boolean` — whether to include invisible
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{integer}` — resource ids
|
||||
|
||||
### ModelRep[🔗](#$api.res~ModelRep)
|
||||
|
||||
```
|
||||
global record ModelRep forEachModelWithMetadata: function(metadata : string, callback : function(string))
|
||||
end
|
||||
```
|
||||
|
||||
### ModelRep.forEachModelWithMetadata[🔗](#$api.res~ModelRep.forEachModelWithMetadata)
|
||||
|
||||
```
|
||||
function ModelRep.forEachModelWithMetadata(metadata : string, callback : function(string))
|
||||
```
|
||||
|
||||
Iterates over all the models with a specific metadata
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `metadata` :`string` — the name of the metadata
|
||||
* `callback` :`function(string)` — a callback for every model that contains the specified metadata
|
||||
|
||||
### ResTypeRep[🔗](#$api.res~ResTypeRep)
|
||||
|
||||
```
|
||||
global interface ResTypeRep<K, T> get: function(id : K): T
|
||||
getName: function(id : K): string
|
||||
find: function(resName : string): K
|
||||
findAndGet: function(resName : string): T
|
||||
getAll: function(includeInvisible : boolean): {K : string}
|
||||
add: function(resName : ResName, resource : T, visible : boolean): K
|
||||
setVisible: function(id : K, visible : boolean)
|
||||
isVisible: function(id : K): boolean
|
||||
getAsTable: function(id : K): T
|
||||
setAsTable: function(id : K, t : T): boolean
|
||||
addAsTable: function(the : ResName, t : T): K
|
||||
end
|
||||
```
|
||||
|
||||
Generic interface for repositories
|
||||
Resources are generally static (initialized when the game starts and don't change)
|
||||
Make sure that resource exists before trying to access them
|
||||
Resource ids are only valid within the same repository
|
||||
|
||||
##### Type Parameters
|
||||
|
||||
* **`K`**
|
||||
* **`T`**
|
||||
|
||||
### ResTypeRep.get[🔗](#$api.res~ResTypeRep.get)
|
||||
|
||||
```
|
||||
function ResTypeRep.get(id : K): T
|
||||
```
|
||||
|
||||
Gets the resource for a given id - (can be used to directly modify the resource,
|
||||
but this is discouraged, except for performance reasons. Use getAsTable and setAsTable instead.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `id` :`K` — a resource id
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `T` — the resource
|
||||
|
||||
### ResTypeRep.getName[🔗](#$api.res~ResTypeRep.getName)
|
||||
|
||||
```
|
||||
function ResTypeRep.getName(id : K): string
|
||||
```
|
||||
|
||||
Gets the resource name for a given id
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `id` :`K` — a resource id
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string` — the resource name
|
||||
|
||||
### ResTypeRep.find[🔗](#$api.res~ResTypeRep.find)
|
||||
|
||||
```
|
||||
function ResTypeRep.find(resName : string): K
|
||||
```
|
||||
|
||||
Finds the id of the given resource name and returns its id
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `resName` :`string` — a resource name
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `K` — the id of the resource, -1 if the resource doesn't exist
|
||||
|
||||
### ResTypeRep.findAndGet[🔗](#$api.res~ResTypeRep.findAndGet)
|
||||
|
||||
```
|
||||
function ResTypeRep.findAndGet(resName : string): T
|
||||
```
|
||||
|
||||
Finds the resource with the given name and returns it
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `resName` :`string` — a resource name
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `T` — the resource, and an error if the resource is not found
|
||||
|
||||
### ResTypeRep.getAll[🔗](#$api.res~ResTypeRep.getAll)
|
||||
|
||||
```
|
||||
function ResTypeRep.getAll(includeInvisible : boolean): {K : string}
|
||||
```
|
||||
|
||||
Gets all resources
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `includeInvisible` :`boolean` — if invisible resources should be included, false by default
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{K : string}` — a dictionary containing all id and resource names
|
||||
|
||||
### ResTypeRep.add[🔗](#$api.res~ResTypeRep.add)
|
||||
|
||||
```
|
||||
function ResTypeRep.add(resName : ResName, resource : T, visible : boolean): K
|
||||
```
|
||||
|
||||
Adds a new resource to the repository
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `resName` :`ResName` — the resource name of the new resource
|
||||
* `resource` :`T` — the resource itself
|
||||
* `visible` :`boolean` — if the resource is visible
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `K` — the id of the newly added resource
|
||||
|
||||
### ResTypeRep.setVisible[🔗](#$api.res~ResTypeRep.setVisible)
|
||||
|
||||
```
|
||||
function ResTypeRep.setVisible(id : K, visible : boolean)
|
||||
```
|
||||
|
||||
Sets a resource visible
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `id` :`K` — the id of the resource
|
||||
* `visible` :`boolean` — if the resource should be visible
|
||||
|
||||
### ResTypeRep.isVisible[🔗](#$api.res~ResTypeRep.isVisible)
|
||||
|
||||
```
|
||||
function ResTypeRep.isVisible(id : K): boolean
|
||||
```
|
||||
|
||||
Checks if a resource is visible
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `id` :`K` — the id of the resource
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `boolean` — if the resource is visible
|
||||
|
||||
### ResTypeRep.getAsTable[🔗](#$api.res~ResTypeRep.getAsTable)
|
||||
|
||||
```
|
||||
function ResTypeRep.getAsTable(id : K): T
|
||||
```
|
||||
|
||||
Gets the resource for a given id as a pure lua table
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `id` :`K` — a resource id
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `T` — the resource
|
||||
|
||||
### ResTypeRep.setAsTable[🔗](#$api.res~ResTypeRep.setAsTable)
|
||||
|
||||
```
|
||||
function ResTypeRep.setAsTable(id : K, t : T): boolean
|
||||
```
|
||||
|
||||
Updates the resource for a given id from a pure lua table (as if it was the resource file)
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `id` :`K` — a resource id
|
||||
* `t` :`T` — the resource
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `boolean` — success
|
||||
|
||||
### ResTypeRep.addAsTable[🔗](#$api.res~ResTypeRep.addAsTable)
|
||||
|
||||
```
|
||||
function ResTypeRep.addAsTable(the : ResName, t : T): K
|
||||
```
|
||||
|
||||
Add a new resource from a pure lua table (as if it was the resource file)
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `the` :`ResName` — name of the resource to add (should be unique)
|
||||
* `t` :`T` — the resource to add
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `K` — the newly added id
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,479 @@
|
||||
<!-- Source: https://wiki.transportfever3.com/script-doc/api/type/mod.html (fetched 2026-10-04) -->
|
||||
|
||||
[index](../../index.html) / [api](../../api.html) / [type](../type.html) / mod
|
||||
|
||||
---
|
||||
|
||||
# Module api.type.mod[🔗](#api.type.mod)
|
||||
|
||||
Contains all type definitions for the mods.
|
||||
|
||||
```
|
||||
[Expand All] [Collapse All]
|
||||
|
||||
global record Mod record ModId new: function(): ModId
|
||||
equals: function(ModId, ModId): boolean
|
||||
name: string
|
||||
end
|
||||
record ModRef modId: ModId
|
||||
revisionMin: integer
|
||||
revisionMax: integer
|
||||
end
|
||||
record ModRefInfo displayName: string
|
||||
url: string
|
||||
end
|
||||
record ModDependency mod: ModRef
|
||||
optional: boolean
|
||||
loadBefore: boolean
|
||||
modInfo: ModRefInfo
|
||||
end
|
||||
record ModIncompatibility mod: ModRef
|
||||
end
|
||||
record GameModDesc modId: ModId
|
||||
modSource: string
|
||||
modhubModId: string
|
||||
name: string
|
||||
severityRemove: integer
|
||||
end
|
||||
record ModDesc severityAdd: integer
|
||||
severityRemove: integer
|
||||
params: {ScriptParam}
|
||||
visible: boolean
|
||||
cosmetic: boolean
|
||||
autoActivate: boolean
|
||||
url: string
|
||||
dependencies: {ModDependency}
|
||||
incompatibilities: {ModIncompatibility}
|
||||
revision: integer
|
||||
end
|
||||
record ModSize numModels: integer
|
||||
numTextures: integer
|
||||
numMeshes: integer
|
||||
totalEstimatedSizeMB: integer
|
||||
end
|
||||
end
|
||||
global type ModId = integer
|
||||
```
|
||||
|
||||
## Category: main[🔗](#category-main)
|
||||
|
||||
### Mod[🔗](#$api.type.mod~Mod)
|
||||
|
||||
```
|
||||
[Expand All] [Collapse All]
|
||||
|
||||
global record Mod record ModId new: function(): ModId
|
||||
equals: function(ModId, ModId): boolean
|
||||
name: string
|
||||
end
|
||||
record ModRef modId: ModId
|
||||
revisionMin: integer
|
||||
revisionMax: integer
|
||||
end
|
||||
record ModRefInfo displayName: string
|
||||
url: string
|
||||
end
|
||||
record ModDependency mod: ModRef
|
||||
optional: boolean
|
||||
loadBefore: boolean
|
||||
modInfo: ModRefInfo
|
||||
end
|
||||
record ModIncompatibility mod: ModRef
|
||||
end
|
||||
record GameModDesc modId: ModId
|
||||
modSource: string
|
||||
modhubModId: string
|
||||
name: string
|
||||
severityRemove: integer
|
||||
end
|
||||
record ModDesc severityAdd: integer
|
||||
severityRemove: integer
|
||||
params: {ScriptParam}
|
||||
visible: boolean
|
||||
cosmetic: boolean
|
||||
autoActivate: boolean
|
||||
url: string
|
||||
dependencies: {ModDependency}
|
||||
incompatibilities: {ModIncompatibility}
|
||||
revision: integer
|
||||
end
|
||||
record ModSize numModels: integer
|
||||
numTextures: integer
|
||||
numMeshes: integer
|
||||
totalEstimatedSizeMB: integer
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
Refer to https://wiki.transportfever3.com/doku.php?id=modding:moddefinition for more details about mod and mod interface in general
|
||||
|
||||
### Mod.ModId[🔗](#$api.type.mod~Mod.ModId)
|
||||
|
||||
```
|
||||
record Mod.ModId new: function(): ModId
|
||||
equals: function(ModId, ModId): boolean
|
||||
name: string
|
||||
end
|
||||
```
|
||||
|
||||
Mod identifier
|
||||
|
||||
### Mod.ModId.new[🔗](#$api.type.mod~Mod.ModId.new)
|
||||
|
||||
```
|
||||
function Mod.ModId.new(): ModId
|
||||
```
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `ModId`
|
||||
|
||||
### Mod.ModId.equals[🔗](#$api.type.mod~Mod.ModId.equals)
|
||||
|
||||
```
|
||||
function Mod.ModId.equals(ModId, ModId): boolean
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `ModId`
|
||||
* `ModId`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `boolean`
|
||||
|
||||
### Mod.ModId.name[🔗](#$api.type.mod~Mod.ModId.name)
|
||||
|
||||
```
|
||||
Mod.ModId.name: string
|
||||
```
|
||||
|
||||
A string that identify the mod
|
||||
|
||||
### Mod.ModRef[🔗](#$api.type.mod~Mod.ModRef)
|
||||
|
||||
```
|
||||
record Mod.ModRef modId: ModId
|
||||
revisionMin: integer
|
||||
revisionMax: integer
|
||||
end
|
||||
```
|
||||
|
||||
A reference to a mod
|
||||
|
||||
### Mod.ModRef.modId[🔗](#$api.type.mod~Mod.ModRef.modId)
|
||||
|
||||
```
|
||||
Mod.ModRef.modId: ModId
|
||||
```
|
||||
|
||||
Mod id
|
||||
|
||||
### Mod.ModRef.revisionMin[🔗](#$api.type.mod~Mod.ModRef.revisionMin)
|
||||
|
||||
```
|
||||
Mod.ModRef.revisionMin: integer
|
||||
```
|
||||
|
||||
The minimum compatible revision
|
||||
|
||||
### Mod.ModRef.revisionMax[🔗](#$api.type.mod~Mod.ModRef.revisionMax)
|
||||
|
||||
```
|
||||
Mod.ModRef.revisionMax: integer
|
||||
```
|
||||
|
||||
The maximum compatible revision
|
||||
|
||||
### Mod.ModRefInfo[🔗](#$api.type.mod~Mod.ModRefInfo)
|
||||
|
||||
```
|
||||
record Mod.ModRefInfo displayName: string
|
||||
url: string
|
||||
end
|
||||
```
|
||||
|
||||
User facing mod informations
|
||||
|
||||
### Mod.ModRefInfo.displayName[🔗](#$api.type.mod~Mod.ModRefInfo.displayName)
|
||||
|
||||
```
|
||||
Mod.ModRefInfo.displayName: string
|
||||
```
|
||||
|
||||
Display name of the mod
|
||||
|
||||
### Mod.ModRefInfo.url[🔗](#$api.type.mod~Mod.ModRefInfo.url)
|
||||
|
||||
```
|
||||
Mod.ModRefInfo.url: string
|
||||
```
|
||||
|
||||
URL to the mod page
|
||||
|
||||
### Mod.ModDependency[🔗](#$api.type.mod~Mod.ModDependency)
|
||||
|
||||
```
|
||||
record Mod.ModDependency mod: ModRef
|
||||
optional: boolean
|
||||
loadBefore: boolean
|
||||
modInfo: ModRefInfo
|
||||
end
|
||||
```
|
||||
|
||||
Describes a dependency to another mod
|
||||
|
||||
### Mod.ModDependency.mod[🔗](#$api.type.mod~Mod.ModDependency.mod)
|
||||
|
||||
```
|
||||
Mod.ModDependency.mod: ModRef
|
||||
```
|
||||
|
||||
Mod Ref of the depedency
|
||||
|
||||
### Mod.ModDependency.optional[🔗](#$api.type.mod~Mod.ModDependency.optional)
|
||||
|
||||
```
|
||||
Mod.ModDependency.optional: boolean
|
||||
```
|
||||
|
||||
If the depedency is optional
|
||||
|
||||
### Mod.ModDependency.loadBefore[🔗](#$api.type.mod~Mod.ModDependency.loadBefore)
|
||||
|
||||
```
|
||||
Mod.ModDependency.loadBefore: boolean
|
||||
```
|
||||
|
||||
If this depedency needs to be loaded before the dependant
|
||||
|
||||
### Mod.ModDependency.modInfo[🔗](#$api.type.mod~Mod.ModDependency.modInfo)
|
||||
|
||||
```
|
||||
Mod.ModDependency.modInfo: ModRefInfo
|
||||
```
|
||||
|
||||
Mod info for the depedency
|
||||
|
||||
### Mod.ModIncompatibility[🔗](#$api.type.mod~Mod.ModIncompatibility)
|
||||
|
||||
```
|
||||
record Mod.ModIncompatibility mod: ModRef
|
||||
end
|
||||
```
|
||||
|
||||
Describes an incompatibility with another mod
|
||||
|
||||
### Mod.ModIncompatibility.mod[🔗](#$api.type.mod~Mod.ModIncompatibility.mod)
|
||||
|
||||
```
|
||||
Mod.ModIncompatibility.mod: ModRef
|
||||
```
|
||||
|
||||
### Mod.GameModDesc[🔗](#$api.type.mod~Mod.GameModDesc)
|
||||
|
||||
```
|
||||
record Mod.GameModDesc modId: ModId
|
||||
modSource: string
|
||||
modhubModId: string
|
||||
name: string
|
||||
severityRemove: integer
|
||||
end
|
||||
```
|
||||
|
||||
Contains general information about the mod
|
||||
|
||||
### Mod.GameModDesc.modId[🔗](#$api.type.mod~Mod.GameModDesc.modId)
|
||||
|
||||
```
|
||||
Mod.GameModDesc.modId: ModId
|
||||
```
|
||||
|
||||
Mod id
|
||||
|
||||
### Mod.GameModDesc.modSource[🔗](#$api.type.mod~Mod.GameModDesc.modSource)
|
||||
|
||||
```
|
||||
Mod.GameModDesc.modSource: string
|
||||
```
|
||||
|
||||
The origin of the mod (eg. User Mod, Staging Area, DLC, mod.io, ...)
|
||||
|
||||
### Mod.GameModDesc.modhubModId[🔗](#$api.type.mod~Mod.GameModDesc.modhubModId)
|
||||
|
||||
```
|
||||
Mod.GameModDesc.modhubModId: string
|
||||
```
|
||||
|
||||
Mod id in the modhub backend
|
||||
|
||||
### Mod.GameModDesc.name[🔗](#$api.type.mod~Mod.GameModDesc.name)
|
||||
|
||||
```
|
||||
Mod.GameModDesc.name: string
|
||||
```
|
||||
|
||||
Display name of the mod (User facing)
|
||||
|
||||
### Mod.GameModDesc.severityRemove[🔗](#$api.type.mod~Mod.GameModDesc.severityRemove)
|
||||
|
||||
```
|
||||
Mod.GameModDesc.severityRemove: integer
|
||||
```
|
||||
|
||||
If removing this mod could cause instability to a savegame.
|
||||
Any value above 0 will trigger a message when trying to remove the mod from a savegame
|
||||
0: None, 1: Warning, 2:Critical
|
||||
|
||||
### Mod.ModDesc[🔗](#$api.type.mod~Mod.ModDesc)
|
||||
|
||||
```
|
||||
record Mod.ModDesc severityAdd: integer
|
||||
severityRemove: integer
|
||||
params: {ScriptParam}
|
||||
visible: boolean
|
||||
cosmetic: boolean
|
||||
autoActivate: boolean
|
||||
url: string
|
||||
dependencies: {ModDependency}
|
||||
incompatibilities: {ModIncompatibility}
|
||||
revision: integer
|
||||
end
|
||||
```
|
||||
|
||||
### Mod.ModDesc.severityAdd[🔗](#$api.type.mod~Mod.ModDesc.severityAdd)
|
||||
|
||||
```
|
||||
Mod.ModDesc.severityAdd: integer
|
||||
```
|
||||
|
||||
If adding this mod could cause instability to a savegame.
|
||||
Any value above 0 will trigger a message when trying to add the mod to a savegame
|
||||
0: None, 1: Warning, 2:Critical
|
||||
|
||||
### Mod.ModDesc.severityRemove[🔗](#$api.type.mod~Mod.ModDesc.severityRemove)
|
||||
|
||||
```
|
||||
Mod.ModDesc.severityRemove: integer
|
||||
```
|
||||
|
||||
If removing this mod could cause instability to a savegame.
|
||||
Any value above 0 will trigger a message when trying to remove the mod from a savegame
|
||||
0: None, 1: Warning, 2:Critical
|
||||
|
||||
### Mod.ModDesc.params[🔗](#$api.type.mod~Mod.ModDesc.params)
|
||||
|
||||
```
|
||||
Mod.ModDesc.params: {ScriptParam}
|
||||
```
|
||||
|
||||
Script parameters to dynamically configure the mod
|
||||
|
||||
### Mod.ModDesc.visible[🔗](#$api.type.mod~Mod.ModDesc.visible)
|
||||
|
||||
```
|
||||
Mod.ModDesc.visible: boolean
|
||||
```
|
||||
|
||||
If if the mod is visible, hidden mod cannot auto-activate
|
||||
|
||||
### Mod.ModDesc.cosmetic[🔗](#$api.type.mod~Mod.ModDesc.cosmetic)
|
||||
|
||||
```
|
||||
Mod.ModDesc.cosmetic: boolean
|
||||
```
|
||||
|
||||
If the mod is purely cosmetic, cosmetic mods still allow achievement from being earned while playing
|
||||
|
||||
### Mod.ModDesc.autoActivate[🔗](#$api.type.mod~Mod.ModDesc.autoActivate)
|
||||
|
||||
```
|
||||
Mod.ModDesc.autoActivate: boolean
|
||||
```
|
||||
|
||||
If the mod is automatically activate by the game
|
||||
|
||||
### Mod.ModDesc.url[🔗](#$api.type.mod~Mod.ModDesc.url)
|
||||
|
||||
```
|
||||
Mod.ModDesc.url: string
|
||||
```
|
||||
|
||||
URL to the mod page
|
||||
|
||||
### Mod.ModDesc.dependencies[🔗](#$api.type.mod~Mod.ModDesc.dependencies)
|
||||
|
||||
```
|
||||
Mod.ModDesc.dependencies: {ModDependency}
|
||||
```
|
||||
|
||||
Mods this mod depends on
|
||||
|
||||
### Mod.ModDesc.incompatibilities[🔗](#$api.type.mod~Mod.ModDesc.incompatibilities)
|
||||
|
||||
```
|
||||
Mod.ModDesc.incompatibilities: {ModIncompatibility}
|
||||
```
|
||||
|
||||
Mods this mod is incompatible with
|
||||
|
||||
### Mod.ModDesc.revision[🔗](#$api.type.mod~Mod.ModDesc.revision)
|
||||
|
||||
```
|
||||
Mod.ModDesc.revision: integer
|
||||
```
|
||||
|
||||
version of the mod
|
||||
|
||||
### Mod.ModSize[🔗](#$api.type.mod~Mod.ModSize)
|
||||
|
||||
```
|
||||
record Mod.ModSize numModels: integer
|
||||
numTextures: integer
|
||||
numMeshes: integer
|
||||
totalEstimatedSizeMB: integer
|
||||
end
|
||||
```
|
||||
|
||||
Information about the size of the mod
|
||||
|
||||
### Mod.ModSize.numModels[🔗](#$api.type.mod~Mod.ModSize.numModels)
|
||||
|
||||
```
|
||||
Mod.ModSize.numModels: integer
|
||||
```
|
||||
|
||||
The number of models contained in the mod
|
||||
|
||||
### Mod.ModSize.numTextures[🔗](#$api.type.mod~Mod.ModSize.numTextures)
|
||||
|
||||
```
|
||||
Mod.ModSize.numTextures: integer
|
||||
```
|
||||
|
||||
The number of texture contained in the mod
|
||||
|
||||
### Mod.ModSize.numMeshes[🔗](#$api.type.mod~Mod.ModSize.numMeshes)
|
||||
|
||||
```
|
||||
Mod.ModSize.numMeshes: integer
|
||||
```
|
||||
|
||||
The number of meshes contained in the mod
|
||||
|
||||
### Mod.ModSize.totalEstimatedSizeMB[🔗](#$api.type.mod~Mod.ModSize.totalEstimatedSizeMB)
|
||||
|
||||
```
|
||||
Mod.ModSize.totalEstimatedSizeMB: integer
|
||||
```
|
||||
|
||||
The approximate size of the mod
|
||||
|
||||
## Category: globals[🔗](#category-globals)
|
||||
|
||||
### ModId[🔗](#$api.type.mod~ModId)
|
||||
|
||||
```
|
||||
global type ModId = integer
|
||||
```
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,788 @@
|
||||
<!-- Source: https://wiki.transportfever3.com/script-doc/app.html (fetched 2026-10-04) -->
|
||||
|
||||
[index](index.html) / app
|
||||
|
||||
---
|
||||
|
||||
# Module app[🔗](#app)
|
||||
|
||||
Module controlling high level functions for the application, can be used to manipulate save games.
|
||||
|
||||
```
|
||||
[Expand All] [Collapse All]
|
||||
|
||||
global record App record ProgressMonitor getProgress: function(ProgressMonitor): number
|
||||
getTask: function(ProgressMonitor): string
|
||||
end
|
||||
quit: function(instant : boolean)
|
||||
restart: function()
|
||||
printMemoryStats: function()
|
||||
startGame: function(startGameParams : StartGameParams)
|
||||
startGame2: function(map : GameMap, seed : string, startDate : Date, startTimeOfDaySeconds : integer, startCloudCoverage : number, isMapEditor : boolean, mods : {Mod.ModId}, configDict : {{string, string}}, modParams : {string : {string : integer}})
|
||||
stopGame: function()
|
||||
findAllSavegames: function(namespace : string): {SaveGameInfo}
|
||||
loadGame: function(saveId : SaveGameId, isMapEditor : boolean, info : SaveGameData.SaveGameDetails)
|
||||
loadMission: function(saveId : SaveGameId, campaign : string, mission : string)
|
||||
saveGame: function(name : string, callBack : function(), isMapEditor : boolean, skipSetName : boolean)
|
||||
parseSavegameName: function(savegameName : string): ParsedSavegameName
|
||||
getSavegameComplexity: function(saveGameDetails : SaveGameData.SaveGameDetails): integer
|
||||
getSavegameComplexityLimit: function(): integer
|
||||
getSavegameInfo: function(saveId : SaveGameId): Async<SaveGameData>
|
||||
getSavegameImage: function(saveId : SaveGameId): GameScreenshot | nil
|
||||
deleteSavegame: function(saveId : SaveGameId): boolean
|
||||
getUserProfile: function(): UserProfile
|
||||
findBuiltinSavegames: function(isMapSave : boolean): {SaveGameInfo}
|
||||
getSaveGameStorageInfo: function(): SaveGameStorageInfo
|
||||
getSupportedMSAASampleCounts: function(): {integer}
|
||||
loadUserdata: function(directory : string, fileName : string): {<any type> : <any type>}
|
||||
saveUserdata: function(directory : string, fileName : string, table : {<any type> : <any type>})
|
||||
removeUserdata: function(directory : string, fileName : string)
|
||||
getAllUserdata: function(directory : string): {string}
|
||||
playVoiceOverOrStop: function(resName : string)
|
||||
makeEmptyMap: function(climate : string, numTiles : Vec2i, waterLevel : number): GameMap
|
||||
getInputActionRep: function(): InputActionRep
|
||||
refreshMods: function()
|
||||
setWaitForStartReadyGame: function()
|
||||
isWaitForStartReadyGame: function(): boolean
|
||||
startReadyGame: function()
|
||||
getRandomTips: function(): {string}
|
||||
getModTagTranslation: function(tag : string): string
|
||||
getProgressMonitor: function(): ProgressMonitor
|
||||
openUserDataFolder: function()
|
||||
openUserDataSubFolder: function(directory : string)
|
||||
getUserDataFolder: function(): string
|
||||
getAllHeightmaps: function(): {string}
|
||||
getGPUCapabilities: function(): GPUCapabilities
|
||||
writeHeightmap: function(map : GameMap, path : string, writeStl : boolean, sixteenBits : boolean): boolean
|
||||
showNodeEditor: function()
|
||||
record SaveGameNamespace getUserdata: function(): string
|
||||
getSavegame: function(): string
|
||||
getSavemap: function(): string
|
||||
end
|
||||
record Debug setForcedGamepadDynamicScrollRepeatSpeed: function(speed : integer)
|
||||
pushGamepadButtonKeyInputEvent: function(gamepadButtonName : string, press : boolean)
|
||||
end
|
||||
debug: Debug
|
||||
end
|
||||
```
|
||||
|
||||
## Category: globals[🔗](#category-globals)
|
||||
|
||||
### App[🔗](#$app~App)
|
||||
|
||||
```
|
||||
[Expand All] [Collapse All]
|
||||
|
||||
global record App record ProgressMonitor getProgress: function(ProgressMonitor): number
|
||||
getTask: function(ProgressMonitor): string
|
||||
end
|
||||
quit: function(instant : boolean)
|
||||
restart: function()
|
||||
printMemoryStats: function()
|
||||
startGame: function(startGameParams : StartGameParams)
|
||||
startGame2: function(map : GameMap, seed : string, startDate : Date, startTimeOfDaySeconds : integer, startCloudCoverage : number, isMapEditor : boolean, mods : {Mod.ModId}, configDict : {{string, string}}, modParams : {string : {string : integer}})
|
||||
stopGame: function()
|
||||
findAllSavegames: function(namespace : string): {SaveGameInfo}
|
||||
loadGame: function(saveId : SaveGameId, isMapEditor : boolean, info : SaveGameData.SaveGameDetails)
|
||||
loadMission: function(saveId : SaveGameId, campaign : string, mission : string)
|
||||
saveGame: function(name : string, callBack : function(), isMapEditor : boolean, skipSetName : boolean)
|
||||
parseSavegameName: function(savegameName : string): ParsedSavegameName
|
||||
getSavegameComplexity: function(saveGameDetails : SaveGameData.SaveGameDetails): integer
|
||||
getSavegameComplexityLimit: function(): integer
|
||||
getSavegameInfo: function(saveId : SaveGameId): Async<SaveGameData>
|
||||
getSavegameImage: function(saveId : SaveGameId): GameScreenshot | nil
|
||||
deleteSavegame: function(saveId : SaveGameId): boolean
|
||||
getUserProfile: function(): UserProfile
|
||||
findBuiltinSavegames: function(isMapSave : boolean): {SaveGameInfo}
|
||||
getSaveGameStorageInfo: function(): SaveGameStorageInfo
|
||||
getSupportedMSAASampleCounts: function(): {integer}
|
||||
loadUserdata: function(directory : string, fileName : string): {<any type> : <any type>}
|
||||
saveUserdata: function(directory : string, fileName : string, table : {<any type> : <any type>})
|
||||
removeUserdata: function(directory : string, fileName : string)
|
||||
getAllUserdata: function(directory : string): {string}
|
||||
playVoiceOverOrStop: function(resName : string)
|
||||
makeEmptyMap: function(climate : string, numTiles : Vec2i, waterLevel : number): GameMap
|
||||
getInputActionRep: function(): InputActionRep
|
||||
refreshMods: function()
|
||||
setWaitForStartReadyGame: function()
|
||||
isWaitForStartReadyGame: function(): boolean
|
||||
startReadyGame: function()
|
||||
getRandomTips: function(): {string}
|
||||
getModTagTranslation: function(tag : string): string
|
||||
getProgressMonitor: function(): ProgressMonitor
|
||||
openUserDataFolder: function()
|
||||
openUserDataSubFolder: function(directory : string)
|
||||
getUserDataFolder: function(): string
|
||||
getAllHeightmaps: function(): {string}
|
||||
getGPUCapabilities: function(): GPUCapabilities
|
||||
writeHeightmap: function(map : GameMap, path : string, writeStl : boolean, sixteenBits : boolean): boolean
|
||||
showNodeEditor: function()
|
||||
record SaveGameNamespace getUserdata: function(): string
|
||||
getSavegame: function(): string
|
||||
getSavemap: function(): string
|
||||
end
|
||||
record Debug setForcedGamepadDynamicScrollRepeatSpeed: function(speed : integer)
|
||||
pushGamepadButtonKeyInputEvent: function(gamepadButtonName : string, press : boolean)
|
||||
end
|
||||
debug: Debug
|
||||
end
|
||||
```
|
||||
|
||||
### App.ProgressMonitor[🔗](#$app~App.ProgressMonitor)
|
||||
|
||||
```
|
||||
record App.ProgressMonitor getProgress: function(ProgressMonitor): number
|
||||
getTask: function(ProgressMonitor): string
|
||||
end
|
||||
```
|
||||
|
||||
### App.ProgressMonitor.getProgress[🔗](#$app~App.ProgressMonitor.getProgress)
|
||||
|
||||
```
|
||||
function App.ProgressMonitor.getProgress(ProgressMonitor): number
|
||||
```
|
||||
|
||||
Returns the current progress as a value from 0 to 1
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `ProgressMonitor`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `number`
|
||||
|
||||
### App.ProgressMonitor.getTask[🔗](#$app~App.ProgressMonitor.getTask)
|
||||
|
||||
```
|
||||
function App.ProgressMonitor.getTask(ProgressMonitor): string
|
||||
```
|
||||
|
||||
Returns the current task being executed
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `ProgressMonitor`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string`
|
||||
|
||||
### App.quit[🔗](#$app~App.quit)
|
||||
|
||||
```
|
||||
function App.quit(instant : boolean)
|
||||
```
|
||||
|
||||
Quit the application.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `instant` :`boolean` — immediately quit one exit
|
||||
|
||||
### App.restart[🔗](#$app~App.restart)
|
||||
|
||||
```
|
||||
function App.restart()
|
||||
```
|
||||
|
||||
Restart the application
|
||||
|
||||
### App.printMemoryStats[🔗](#$app~App.printMemoryStats)
|
||||
|
||||
```
|
||||
function App.printMemoryStats()
|
||||
```
|
||||
|
||||
Prints memory statistics to the log output.
|
||||
|
||||
### App.startGame[🔗](#$app~App.startGame)
|
||||
|
||||
```
|
||||
function App.startGame(startGameParams : StartGameParams)
|
||||
```
|
||||
|
||||
Starts a new test game by specifying some basic parameters
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `startGameParams` :`StartGameParams` — start game parameters (optional) - if not set, the game will start with default values
|
||||
|
||||
### App.startGame2[🔗](#$app~App.startGame2)
|
||||
|
||||
```
|
||||
function App.startGame2(map : GameMap, seed : string, startDate : Date, startTimeOfDaySeconds : integer, startCloudCoverage : number, isMapEditor : boolean, mods : {Mod.ModId}, configDict : {{string, string}}, modParams : {string : {string : integer}})
|
||||
```
|
||||
|
||||
Starts a new game
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `map` :`GameMap` — the map to use
|
||||
* `seed` :`string` — the seed use for the map generation
|
||||
* `startDate` :`Date` — the start date
|
||||
* `startTimeOfDaySeconds` :`integer` — is the start time of the day in seconds
|
||||
* `startCloudCoverage` :`number` — is the start cloud coverage
|
||||
* `isMapEditor` :`boolean` — starting from map editor
|
||||
* `mods` :`{Mod.ModId}` — list of mods to start the game with
|
||||
* `configDict` :`{{string, string}}` — list of game settings
|
||||
* `modParams` :`{string : {string : integer}}` — list of mod params
|
||||
|
||||
### App.stopGame[🔗](#$app~App.stopGame)
|
||||
|
||||
```
|
||||
function App.stopGame()
|
||||
```
|
||||
|
||||
Stops the current game.
|
||||
|
||||
### App.findAllSavegames[🔗](#$app~App.findAllSavegames)
|
||||
|
||||
```
|
||||
function App.findAllSavegames(namespace : string): {SaveGameInfo}
|
||||
```
|
||||
|
||||
Obtain list of all savegames.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `namespace` :`string` — from which to obtain information (see app.SaveGameNamespace.getSavemap() or app.SaveGameNamespace.getSavegame() for the namespaces)
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{SaveGameInfo}` — a list of all savegame
|
||||
|
||||
### App.loadGame[🔗](#$app~App.loadGame)
|
||||
|
||||
```
|
||||
function App.loadGame(saveId : SaveGameId, isMapEditor : boolean, info : SaveGameData.SaveGameDetails)
|
||||
```
|
||||
|
||||
Loads a savegame
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `saveId` :`SaveGameId` — the savegame id
|
||||
* `isMapEditor` :`boolean` — if the savegame is loaded in the map editor
|
||||
* `info` :`SaveGameData.SaveGameDetails` — savegame info (optional)
|
||||
|
||||
### App.loadMission[🔗](#$app~App.loadMission)
|
||||
|
||||
```
|
||||
function App.loadMission(saveId : SaveGameId, campaign : string, mission : string)
|
||||
```
|
||||
|
||||
Loads a mission
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `saveId` :`SaveGameId` — the savegame id
|
||||
* `campaign` :`string` — campaign name
|
||||
* `mission` :`string` — mission name
|
||||
|
||||
### App.saveGame[🔗](#$app~App.saveGame)
|
||||
|
||||
```
|
||||
function App.saveGame(name : string, callBack : function(), isMapEditor : boolean, skipSetName : boolean)
|
||||
```
|
||||
|
||||
Saves the current game.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `name` :`string` — the name of the savegame
|
||||
* `callBack` :`function()` — callback when the savegame is finished
|
||||
* `isMapEditor` :`boolean` — is saving from the map editor
|
||||
* `skipSetName` :`boolean` — skips setting the savegame name as the current default savegame name (optional)
|
||||
|
||||
### App.parseSavegameName[🔗](#$app~App.parseSavegameName)
|
||||
|
||||
```
|
||||
function App.parseSavegameName(savegameName : string): ParsedSavegameName
|
||||
```
|
||||
|
||||
Parse savegame info from its file name
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `savegameName` :`string` — the name of the savegame
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `ParsedSavegameName` — The info (most notably, savegame type and group name)
|
||||
|
||||
### App.getSavegameComplexity[🔗](#$app~App.getSavegameComplexity)
|
||||
|
||||
```
|
||||
function App.getSavegameComplexity(saveGameDetails : SaveGameData.SaveGameDetails): integer
|
||||
```
|
||||
|
||||
Get an estimated value of the savegame complexity
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `saveGameDetails` :`SaveGameData.SaveGameDetails` — the savegame data of the savegame
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `integer` — a value that represents the estimate size of the savegame
|
||||
|
||||
### App.getSavegameComplexityLimit[🔗](#$app~App.getSavegameComplexityLimit)
|
||||
|
||||
```
|
||||
function App.getSavegameComplexityLimit(): integer
|
||||
```
|
||||
|
||||
Get an limit for the savegame complexity for the current platform
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `integer` — the complexity limit for the current platform
|
||||
|
||||
### App.getSavegameInfo[🔗](#$app~App.getSavegameInfo)
|
||||
|
||||
```
|
||||
function App.getSavegameInfo(saveId : SaveGameId): Async<SaveGameData>
|
||||
```
|
||||
|
||||
Loads savegame metadata asynchronously.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `saveId` :`SaveGameId` — the savegame id
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `Async<SaveGameData>` — an async object with the savegame data
|
||||
|
||||
### App.getSavegameImage[🔗](#$app~App.getSavegameImage)
|
||||
|
||||
```
|
||||
function App.getSavegameImage(saveId : SaveGameId): GameScreenshot | nil
|
||||
```
|
||||
|
||||
Obtains the savegame preview image
|
||||
Note: This is - usually, if not explicitly changed in userdata - the same image as GameMetadata.screenshot but with the full available resolution
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `saveId` :`SaveGameId` — the savegame id
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `GameScreenshot | nil` — the image, or nil if no preview image is available
|
||||
|
||||
### App.deleteSavegame[🔗](#$app~App.deleteSavegame)
|
||||
|
||||
```
|
||||
function App.deleteSavegame(saveId : SaveGameId): boolean
|
||||
```
|
||||
|
||||
Deletes a savegame
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `saveId` :`SaveGameId` — the savegame to delete
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `boolean` — if the savegame was successfully deleted
|
||||
|
||||
### App.getUserProfile[🔗](#$app~App.getUserProfile)
|
||||
|
||||
```
|
||||
function App.getUserProfile(): UserProfile
|
||||
```
|
||||
|
||||
Obtain the user profile.
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `UserProfile` — the user profile
|
||||
|
||||
### App.findBuiltinSavegames[🔗](#$app~App.findBuiltinSavegames)
|
||||
|
||||
```
|
||||
function App.findBuiltinSavegames(isMapSave : boolean): {SaveGameInfo}
|
||||
```
|
||||
|
||||
Obtains a list of built-in savegames.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `isMapSave` :`boolean` — true to list built-in maps, false to list built-in savegames
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{SaveGameInfo}` — list of savegames
|
||||
|
||||
### App.getSaveGameStorageInfo[🔗](#$app~App.getSaveGameStorageInfo)
|
||||
|
||||
```
|
||||
function App.getSaveGameStorageInfo(): SaveGameStorageInfo
|
||||
```
|
||||
|
||||
Returns the savegame storage infos
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `SaveGameStorageInfo` — savegame storage info
|
||||
|
||||
### App.getSupportedMSAASampleCounts[🔗](#$app~App.getSupportedMSAASampleCounts)
|
||||
|
||||
```
|
||||
function App.getSupportedMSAASampleCounts(): {integer}
|
||||
```
|
||||
|
||||
Returns the supported MSAA sample counts
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{integer}` — list of supported sample counts
|
||||
|
||||
### App.loadUserdata[🔗](#$app~App.loadUserdata)
|
||||
|
||||
```
|
||||
function App.loadUserdata(directory : string, fileName : string): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
Load a custom userdata file
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `directory` :`string` — a folder in the userdata directory
|
||||
* `fileName` :`string` — a lua filename (without .lua extension)
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}` — the deserialized lua data
|
||||
|
||||
### App.saveUserdata[🔗](#$app~App.saveUserdata)
|
||||
|
||||
```
|
||||
function App.saveUserdata(directory : string, fileName : string, table : {<any type> : <any type>})
|
||||
```
|
||||
|
||||
Saves a custom table as lua file.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `directory` :`string` — a folder in the userdata directory
|
||||
* `fileName` :`string` — the filename to save to (without .lua extension)
|
||||
* `table` :`{<any type> : <any type>}` — the table to serialize
|
||||
|
||||
### App.removeUserdata[🔗](#$app~App.removeUserdata)
|
||||
|
||||
```
|
||||
function App.removeUserdata(directory : string, fileName : string)
|
||||
```
|
||||
|
||||
Removes a userdata.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `directory` :`string` — a folder in the userdata directory
|
||||
* `fileName` :`string` — the filename to remove (without .lua extension)
|
||||
|
||||
### App.getAllUserdata[🔗](#$app~App.getAllUserdata)
|
||||
|
||||
```
|
||||
function App.getAllUserdata(directory : string): {string}
|
||||
```
|
||||
|
||||
Returns a list of all saved mod preset names.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `directory` :`string` — a folder in the userdata directory
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{string}` — a list of mod preset names
|
||||
|
||||
### App.playVoiceOverOrStop[🔗](#$app~App.playVoiceOverOrStop)
|
||||
|
||||
```
|
||||
function App.playVoiceOverOrStop(resName : string)
|
||||
```
|
||||
|
||||
Plays a voice over if not currently playing, otherwise stops it.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `resName` :`string` — the file to play
|
||||
|
||||
### App.makeEmptyMap[🔗](#$app~App.makeEmptyMap)
|
||||
|
||||
```
|
||||
function App.makeEmptyMap(climate : string, numTiles : Vec2i, waterLevel : number): GameMap
|
||||
```
|
||||
|
||||
Creates an empty map (for tooling / map generation workflows).
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `climate` :`string` — climate resource name
|
||||
* `numTiles` :`Vec2i` — map dimension in tiles
|
||||
* `waterLevel` :`number` — water level height
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `GameMap` — the map
|
||||
|
||||
### App.getInputActionRep[🔗](#$app~App.getInputActionRep)
|
||||
|
||||
```
|
||||
function App.getInputActionRep(): InputActionRep
|
||||
```
|
||||
|
||||
Returns the global input action repository.
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `InputActionRep` — input action repository
|
||||
|
||||
### App.refreshMods[🔗](#$app~App.refreshMods)
|
||||
|
||||
```
|
||||
function App.refreshMods()
|
||||
```
|
||||
|
||||
Refreshes the installed mods
|
||||
|
||||
### App.setWaitForStartReadyGame[🔗](#$app~App.setWaitForStartReadyGame)
|
||||
|
||||
```
|
||||
function App.setWaitForStartReadyGame()
|
||||
```
|
||||
|
||||
Wait for the game to be ready to start. This is called when loading a game to prevent the game from starting automatically
|
||||
|
||||
### App.isWaitForStartReadyGame[🔗](#$app~App.isWaitForStartReadyGame)
|
||||
|
||||
```
|
||||
function App.isWaitForStartReadyGame(): boolean
|
||||
```
|
||||
|
||||
Return if the `setWaitForStartReadyGame` had been called for this game.
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `boolean`
|
||||
|
||||
### App.startReadyGame[🔗](#$app~App.startReadyGame)
|
||||
|
||||
```
|
||||
function App.startReadyGame()
|
||||
```
|
||||
|
||||
Start Game that is fully loaded and ready to play. This is called after the progress page has finished loading the game.
|
||||
|
||||
### App.getRandomTips[🔗](#$app~App.getRandomTips)
|
||||
|
||||
```
|
||||
function App.getRandomTips(): {string}
|
||||
```
|
||||
|
||||
Gets the list of random tips
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{string}` — a list of tips as string
|
||||
|
||||
### App.getModTagTranslation[🔗](#$app~App.getModTagTranslation)
|
||||
|
||||
```
|
||||
function App.getModTagTranslation(tag : string): string
|
||||
```
|
||||
|
||||
Returns a translated name for a mod tag.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `tag` :`string` — tag to translate
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string` — the translated tag
|
||||
|
||||
### App.getProgressMonitor[🔗](#$app~App.getProgressMonitor)
|
||||
|
||||
```
|
||||
function App.getProgressMonitor(): ProgressMonitor
|
||||
```
|
||||
|
||||
Gets the load progress monitor
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `ProgressMonitor`
|
||||
|
||||
### App.openUserDataFolder[🔗](#$app~App.openUserDataFolder)
|
||||
|
||||
```
|
||||
function App.openUserDataFolder()
|
||||
```
|
||||
|
||||
Opens the user data folder in the OS file manager
|
||||
|
||||
### App.openUserDataSubFolder[🔗](#$app~App.openUserDataSubFolder)
|
||||
|
||||
```
|
||||
function App.openUserDataSubFolder(directory : string)
|
||||
```
|
||||
|
||||
Opens the heightmaps folder in the OS file manager
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `directory` :`string` — subfolder
|
||||
|
||||
### App.getUserDataFolder[🔗](#$app~App.getUserDataFolder)
|
||||
|
||||
```
|
||||
function App.getUserDataFolder(): string
|
||||
```
|
||||
|
||||
Gets the directory containing userdata
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string`
|
||||
|
||||
### App.getAllHeightmaps[🔗](#$app~App.getAllHeightmaps)
|
||||
|
||||
```
|
||||
function App.getAllHeightmaps(): {string}
|
||||
```
|
||||
|
||||
Gets a list of all heightmaps in the userdata directory
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{string}` — list of heightmaps files
|
||||
|
||||
### App.getGPUCapabilities[🔗](#$app~App.getGPUCapabilities)
|
||||
|
||||
```
|
||||
function App.getGPUCapabilities(): GPUCapabilities
|
||||
```
|
||||
|
||||
Get information about the GPU
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `GPUCapabilities`
|
||||
|
||||
### App.writeHeightmap[🔗](#$app~App.writeHeightmap)
|
||||
|
||||
```
|
||||
function App.writeHeightmap(map : GameMap, path : string, writeStl : boolean, sixteenBits : boolean): boolean
|
||||
```
|
||||
|
||||
Writes a heightmap image (and optionally an STL) for a map.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `map` :`GameMap` — the map to write
|
||||
* `path` :`string` — the relative path (extension will be added if missing)
|
||||
* `writeStl` :`boolean` — write as an STL file as well
|
||||
* `sixteenBits` :`boolean` — use 16 bits depth for the heightmap (default 8 bits depth)
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `boolean` — if the heightmap was successfully written
|
||||
|
||||
### App.showNodeEditor[🔗](#$app~App.showNodeEditor)
|
||||
|
||||
```
|
||||
function App.showNodeEditor()
|
||||
```
|
||||
|
||||
Shows the node editor.
|
||||
|
||||
### App.SaveGameNamespace[🔗](#$app~App.SaveGameNamespace)
|
||||
|
||||
```
|
||||
record App.SaveGameNamespace getUserdata: function(): string
|
||||
getSavegame: function(): string
|
||||
getSavemap: function(): string
|
||||
end
|
||||
```
|
||||
|
||||
Savegame namespace constants.
|
||||
|
||||
### App.SaveGameNamespace.getUserdata[🔗](#$app~App.SaveGameNamespace.getUserdata)
|
||||
|
||||
```
|
||||
function App.SaveGameNamespace.getUserdata(): string
|
||||
```
|
||||
|
||||
Returns the userdata savegame namespace.
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string`
|
||||
|
||||
### App.SaveGameNamespace.getSavegame[🔗](#$app~App.SaveGameNamespace.getSavegame)
|
||||
|
||||
```
|
||||
function App.SaveGameNamespace.getSavegame(): string
|
||||
```
|
||||
|
||||
Returns the savegame namespace.
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string`
|
||||
|
||||
### App.SaveGameNamespace.getSavemap[🔗](#$app~App.SaveGameNamespace.getSavemap)
|
||||
|
||||
```
|
||||
function App.SaveGameNamespace.getSavemap(): string
|
||||
```
|
||||
|
||||
Returns the savemap namespace.
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string`
|
||||
|
||||
### App.Debug[🔗](#$app~App.Debug)
|
||||
|
||||
```
|
||||
record App.Debug setForcedGamepadDynamicScrollRepeatSpeed: function(speed : integer)
|
||||
pushGamepadButtonKeyInputEvent: function(gamepadButtonName : string, press : boolean)
|
||||
end
|
||||
```
|
||||
|
||||
### App.Debug.setForcedGamepadDynamicScrollRepeatSpeed[🔗](#$app~App.Debug.setForcedGamepadDynamicScrollRepeatSpeed)
|
||||
|
||||
```
|
||||
function App.Debug.setForcedGamepadDynamicScrollRepeatSpeed(speed : integer)
|
||||
```
|
||||
|
||||
Overrides gamepad dynamic scroll repeat speed.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `speed` :`integer` — the scroll speed (0: 1/sec, 3: max speed), or nil to clear the override
|
||||
|
||||
### App.Debug.pushGamepadButtonKeyInputEvent[🔗](#$app~App.Debug.pushGamepadButtonKeyInputEvent)
|
||||
|
||||
```
|
||||
function App.Debug.pushGamepadButtonKeyInputEvent(gamepadButtonName : string, press : boolean)
|
||||
```
|
||||
|
||||
Pushes a gamepad button event into the input queue.
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `gamepadButtonName` :`string` — the button to push
|
||||
* `press` :`boolean` — if pressed
|
||||
|
||||
### App.debug[🔗](#$app~App.debug)
|
||||
|
||||
```
|
||||
App.debug: Debug
|
||||
```
|
||||
@@ -0,0 +1,123 @@
|
||||
<!-- Source: https://wiki.transportfever3.com/script-doc/content/base/difficulty_util.html (fetched 2026-10-04) -->
|
||||
|
||||
[index](../../index.html) / content / base / difficulty\_util
|
||||
|
||||
---
|
||||
|
||||
# Module content.base.difficulty\_util[🔗](#content.base.difficulty_util)
|
||||
|
||||
```
|
||||
global record DifficultyUtil calculateDifficulty: function({string : integer}): GameDifficulty
|
||||
getModParamPreset: function(GameDifficulty): {string : integer}
|
||||
getLabel: function(GameDifficulty): string
|
||||
getScale: function(string, integer): number
|
||||
getAllValues: function(string): {number}
|
||||
end
|
||||
global enum GameDifficulty "Easy"
|
||||
"Hard"
|
||||
"Medium"
|
||||
"VeryHard"
|
||||
end
|
||||
```
|
||||
|
||||
## Category: globals[🔗](#category-globals)
|
||||
|
||||
### DifficultyUtil[🔗](#$content.base.difficulty_util~DifficultyUtil)
|
||||
|
||||
```
|
||||
global record DifficultyUtil calculateDifficulty: function({string : integer}): GameDifficulty
|
||||
getModParamPreset: function(GameDifficulty): {string : integer}
|
||||
getLabel: function(GameDifficulty): string
|
||||
getScale: function(string, integer): number
|
||||
getAllValues: function(string): {number}
|
||||
end
|
||||
```
|
||||
|
||||
### DifficultyUtil.calculateDifficulty[🔗](#$content.base.difficulty_util~DifficultyUtil.calculateDifficulty)
|
||||
|
||||
```
|
||||
function DifficultyUtil.calculateDifficulty({string : integer}): GameDifficulty
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `{string : integer}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `GameDifficulty`
|
||||
|
||||
### DifficultyUtil.getModParamPreset[🔗](#$content.base.difficulty_util~DifficultyUtil.getModParamPreset)
|
||||
|
||||
```
|
||||
function DifficultyUtil.getModParamPreset(GameDifficulty): {string : integer}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `GameDifficulty`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{string : integer}`
|
||||
|
||||
### DifficultyUtil.getLabel[🔗](#$content.base.difficulty_util~DifficultyUtil.getLabel)
|
||||
|
||||
```
|
||||
function DifficultyUtil.getLabel(GameDifficulty): string
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `GameDifficulty`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string`
|
||||
|
||||
### DifficultyUtil.getScale[🔗](#$content.base.difficulty_util~DifficultyUtil.getScale)
|
||||
|
||||
```
|
||||
function DifficultyUtil.getScale(string, integer): number
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `integer`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `number`
|
||||
|
||||
### DifficultyUtil.getAllValues[🔗](#$content.base.difficulty_util~DifficultyUtil.getAllValues)
|
||||
|
||||
```
|
||||
function DifficultyUtil.getAllValues(string): {number}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{number}`
|
||||
|
||||
### GameDifficulty[🔗](#$content.base.difficulty_util~GameDifficulty)
|
||||
|
||||
```
|
||||
global enum GameDifficulty "Easy"
|
||||
"Hard"
|
||||
"Medium"
|
||||
"VeryHard"
|
||||
end
|
||||
```
|
||||
|
||||
### GameDifficulty."Easy"[🔗](#$content.base.difficulty_util~GameDifficulty.)
|
||||
|
||||
### GameDifficulty."Hard"[🔗](#$content.base.difficulty_util~GameDifficulty.)
|
||||
|
||||
### GameDifficulty."Medium"[🔗](#$content.base.difficulty_util~GameDifficulty.)
|
||||
|
||||
### GameDifficulty."VeryHard"[🔗](#$content.base.difficulty_util~GameDifficulty.)
|
||||
@@ -0,0 +1,427 @@
|
||||
<!-- Source: https://wiki.transportfever3.com/script-doc/content/base/model_metadata_util.html (fetched 2026-10-04) -->
|
||||
|
||||
[index](../../index.html) / content / base / model\_metadata\_util
|
||||
|
||||
---
|
||||
|
||||
# Module content.base.model\_metadata\_util[🔗](#content.base.model_metadata_util)
|
||||
|
||||
```
|
||||
global record ModelMetadataUtil convertEmissionData: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addEmissionMetadata: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addCostMetadata: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addTransportVehicleTransportModes: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addFilterTags: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
newLoadSpeedsAndMaintenanceFactor: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
turnRoadAndRailToLandVehicle: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addVehicleExtent: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addTransformatorConfig: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
toCompartmentList: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
replaceMeshIdWithNodeName: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
squeezeConfigsToOneConfigForVehicles: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
sortLods: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addTextureLods: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addTreeReputationFactor: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
makeLoadIndicators: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
makeLoadIndicatorFormats: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
makeCargoEntry: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
makeCargoTypeSet: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
convertCargoType: function(string, string): string
|
||||
convertCargoTypeSet: function({<any type> : <any type>}, string): {<any type> : <any type>}
|
||||
convertCargoTypes: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addIconMetadata: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
convertParticleSystem: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
end
|
||||
```
|
||||
|
||||
## Category: globals[🔗](#category-globals)
|
||||
|
||||
### ModelMetadataUtil[🔗](#$content.base.model_metadata_util~ModelMetadataUtil)
|
||||
|
||||
```
|
||||
global record ModelMetadataUtil convertEmissionData: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addEmissionMetadata: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addCostMetadata: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addTransportVehicleTransportModes: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addFilterTags: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
newLoadSpeedsAndMaintenanceFactor: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
turnRoadAndRailToLandVehicle: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addVehicleExtent: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addTransformatorConfig: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
toCompartmentList: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
replaceMeshIdWithNodeName: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
squeezeConfigsToOneConfigForVehicles: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
sortLods: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addTextureLods: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addTreeReputationFactor: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
makeLoadIndicators: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
makeLoadIndicatorFormats: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
makeCargoEntry: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
makeCargoTypeSet: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
convertCargoType: function(string, string): string
|
||||
convertCargoTypeSet: function({<any type> : <any type>}, string): {<any type> : <any type>}
|
||||
convertCargoTypes: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
addIconMetadata: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
convertParticleSystem: function(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
end
|
||||
```
|
||||
|
||||
### ModelMetadataUtil.convertEmissionData[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.convertEmissionData)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.convertEmissionData(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.addEmissionMetadata[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.addEmissionMetadata)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.addEmissionMetadata(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.addCostMetadata[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.addCostMetadata)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.addCostMetadata(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.addTransportVehicleTransportModes[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.addTransportVehicleTransportModes)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.addTransportVehicleTransportModes(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.addFilterTags[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.addFilterTags)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.addFilterTags(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.newLoadSpeedsAndMaintenanceFactor[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.newLoadSpeedsAndMaintenanceFactor)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.newLoadSpeedsAndMaintenanceFactor(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.turnRoadAndRailToLandVehicle[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.turnRoadAndRailToLandVehicle)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.turnRoadAndRailToLandVehicle(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.addVehicleExtent[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.addVehicleExtent)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.addVehicleExtent(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.addTransformatorConfig[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.addTransformatorConfig)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.addTransformatorConfig(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.toCompartmentList[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.toCompartmentList)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.toCompartmentList(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.replaceMeshIdWithNodeName[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.replaceMeshIdWithNodeName)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.replaceMeshIdWithNodeName(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.squeezeConfigsToOneConfigForVehicles[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.squeezeConfigsToOneConfigForVehicles)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.squeezeConfigsToOneConfigForVehicles(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.sortLods[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.sortLods)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.sortLods(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.addTextureLods[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.addTextureLods)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.addTextureLods(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.addTreeReputationFactor[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.addTreeReputationFactor)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.addTreeReputationFactor(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.makeLoadIndicators[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.makeLoadIndicators)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.makeLoadIndicators(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.makeLoadIndicatorFormats[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.makeLoadIndicatorFormats)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.makeLoadIndicatorFormats(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.makeCargoEntry[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.makeCargoEntry)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.makeCargoEntry(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.makeCargoTypeSet[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.makeCargoTypeSet)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.makeCargoTypeSet(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.convertCargoType[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.convertCargoType)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.convertCargoType(string, string): string
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `string`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string`
|
||||
|
||||
### ModelMetadataUtil.convertCargoTypeSet[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.convertCargoTypeSet)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.convertCargoTypeSet({<any type> : <any type>}, string): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `{<any type> : <any type>}`
|
||||
* `string`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.convertCargoTypes[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.convertCargoTypes)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.convertCargoTypes(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.addIconMetadata[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.addIconMetadata)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.addIconMetadata(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
|
||||
### ModelMetadataUtil.convertParticleSystem[🔗](#$content.base.model_metadata_util~ModelMetadataUtil.convertParticleSystem)
|
||||
|
||||
```
|
||||
function ModelMetadataUtil.convertParticleSystem(string, {<any type> : <any type>}): {<any type> : <any type>}
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{<any type> : <any type>}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `{<any type> : <any type>}`
|
||||
@@ -0,0 +1,41 @@
|
||||
<!-- Source: https://wiki.transportfever3.com/script-doc/content/base/post_run_util.html (fetched 2026-10-04) -->
|
||||
|
||||
[index](../../index.html) / content / base / post\_run\_util
|
||||
|
||||
---
|
||||
|
||||
# Module content.base.post\_run\_util[🔗](#content.base.post_run_util)
|
||||
|
||||
```
|
||||
global record PostRunUtil applyCostScale: function()
|
||||
updateDesc: function(ModelMetadata.Description, number, number)
|
||||
end
|
||||
```
|
||||
|
||||
## Category: globals[🔗](#category-globals)
|
||||
|
||||
### PostRunUtil[🔗](#$content.base.post_run_util~PostRunUtil)
|
||||
|
||||
```
|
||||
global record PostRunUtil applyCostScale: function()
|
||||
updateDesc: function(ModelMetadata.Description, number, number)
|
||||
end
|
||||
```
|
||||
|
||||
### PostRunUtil.applyCostScale[🔗](#$content.base.post_run_util~PostRunUtil.applyCostScale)
|
||||
|
||||
```
|
||||
function PostRunUtil.applyCostScale()
|
||||
```
|
||||
|
||||
### PostRunUtil.updateDesc[🔗](#$content.base.post_run_util~PostRunUtil.updateDesc)
|
||||
|
||||
```
|
||||
function PostRunUtil.updateDesc(ModelMetadata.Description, number, number)
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `ModelMetadata.Description`
|
||||
* `number`
|
||||
* `number`
|
||||
@@ -0,0 +1,27 @@
|
||||
<!-- Source: https://wiki.transportfever3.com/script-doc/content/gui/main/mod_entry_point.html (fetched 2026-10-04) -->
|
||||
|
||||
[index](../../../index.html) / content / gui / main / mod\_entry\_point
|
||||
|
||||
---
|
||||
|
||||
# Module content.gui.main.mod\_entry\_point[🔗](#content.gui.main.mod_entry_point)
|
||||
|
||||
```
|
||||
global record ModEntryPoint ModEntryPointExtension: ExtensionPoint0
|
||||
end
|
||||
```
|
||||
|
||||
## Category: globals[🔗](#category-globals)
|
||||
|
||||
### ModEntryPoint[🔗](#$content.gui.main.mod_entry_point~ModEntryPoint)
|
||||
|
||||
```
|
||||
global record ModEntryPoint ModEntryPointExtension: ExtensionPoint0
|
||||
end
|
||||
```
|
||||
|
||||
### ModEntryPoint.ModEntryPointExtension[🔗](#$content.gui.main.mod_entry_point~ModEntryPoint.ModEntryPointExtension)
|
||||
|
||||
```
|
||||
ModEntryPoint.ModEntryPointExtension: ExtensionPoint0
|
||||
```
|
||||
@@ -0,0 +1,505 @@
|
||||
<!-- Source: https://wiki.transportfever3.com/script-doc/content/gui/main/script_param_util.html (fetched 2026-10-04) -->
|
||||
|
||||
[index](../../../index.html) / content / gui / main / script\_param\_util
|
||||
|
||||
---
|
||||
|
||||
# Module content.gui.main.script\_param\_util[🔗](#content.gui.main.script_param_util)
|
||||
|
||||
```
|
||||
[Expand All] [Collapse All]
|
||||
|
||||
global record ScriptParamUtil record ParamForUi enum IconStyle "Colored"
|
||||
"Default"
|
||||
end
|
||||
uiType: ScriptParamType
|
||||
iconStyle: IconStyle
|
||||
name: string
|
||||
values: {string}
|
||||
numbers: {number}
|
||||
tooltips: {string}
|
||||
defaultIndex: integer
|
||||
hideLabel: boolean
|
||||
allowCoalesce: boolean
|
||||
makeCompactButtonFn: function(number): TreeNodeId
|
||||
formatValueFn: function(number): string
|
||||
stepValueFn: function(number, integer, boolean): number
|
||||
end
|
||||
record CompSimpleParam scriptParam: ParamForUi
|
||||
currentValue: number
|
||||
onValueChange: function(number)
|
||||
toggleButtonsFlowLayout: boolean
|
||||
vertical: boolean
|
||||
compact: boolean
|
||||
addSpacer: boolean
|
||||
disableGamepadNavigation: boolean
|
||||
onHover: function(boolean)
|
||||
gameCtx: GameContext
|
||||
updateCurrentValue: boolean
|
||||
end
|
||||
buildScriptParamCompSimple: function(CompSimpleParam): TreeNodeId
|
||||
buildScriptParamComp: function(ScriptParam, integer, function(integer), boolean, boolean, function(boolean), boolean): TreeNodeId
|
||||
searchAndBuildScriptParamComp: function(string, function(string) : number, function(string, number), boolean, function(boolean), {string}, boolean): MenuIconReactUtil.HintWidgetParam.Data, TreeNodeId
|
||||
wrap: function(string, boolean, TreeNodeId, boolean, function(boolean), string): TreeNodeId
|
||||
getScriptParam: function(string, {string}): ScriptParam
|
||||
clampScriptParamToDiscreteValue: function(number, ScriptParam): number
|
||||
clampScriptParamValueIndex: function(number, ScriptParam): integer
|
||||
getScriptParamDefaultValue: function({number}, integer): number
|
||||
getScriptParamDefaultValueIndex: function({number}, integer): integer
|
||||
getScriptParamLabel: function(string, number, {string}): string
|
||||
getScriptParamLabelUnfiltered: function(string, number): string
|
||||
end
|
||||
```
|
||||
|
||||
## Category: globals[🔗](#category-globals)
|
||||
|
||||
### ScriptParamUtil[🔗](#$content.gui.main.script_param_util~ScriptParamUtil)
|
||||
|
||||
```
|
||||
[Expand All] [Collapse All]
|
||||
|
||||
global record ScriptParamUtil record ParamForUi enum IconStyle "Colored"
|
||||
"Default"
|
||||
end
|
||||
uiType: ScriptParamType
|
||||
iconStyle: IconStyle
|
||||
name: string
|
||||
values: {string}
|
||||
numbers: {number}
|
||||
tooltips: {string}
|
||||
defaultIndex: integer
|
||||
hideLabel: boolean
|
||||
allowCoalesce: boolean
|
||||
makeCompactButtonFn: function(number): TreeNodeId
|
||||
formatValueFn: function(number): string
|
||||
stepValueFn: function(number, integer, boolean): number
|
||||
end
|
||||
record CompSimpleParam scriptParam: ParamForUi
|
||||
currentValue: number
|
||||
onValueChange: function(number)
|
||||
toggleButtonsFlowLayout: boolean
|
||||
vertical: boolean
|
||||
compact: boolean
|
||||
addSpacer: boolean
|
||||
disableGamepadNavigation: boolean
|
||||
onHover: function(boolean)
|
||||
gameCtx: GameContext
|
||||
updateCurrentValue: boolean
|
||||
end
|
||||
buildScriptParamCompSimple: function(CompSimpleParam): TreeNodeId
|
||||
buildScriptParamComp: function(ScriptParam, integer, function(integer), boolean, boolean, function(boolean), boolean): TreeNodeId
|
||||
searchAndBuildScriptParamComp: function(string, function(string) : number, function(string, number), boolean, function(boolean), {string}, boolean): MenuIconReactUtil.HintWidgetParam.Data, TreeNodeId
|
||||
wrap: function(string, boolean, TreeNodeId, boolean, function(boolean), string): TreeNodeId
|
||||
getScriptParam: function(string, {string}): ScriptParam
|
||||
clampScriptParamToDiscreteValue: function(number, ScriptParam): number
|
||||
clampScriptParamValueIndex: function(number, ScriptParam): integer
|
||||
getScriptParamDefaultValue: function({number}, integer): number
|
||||
getScriptParamDefaultValueIndex: function({number}, integer): integer
|
||||
getScriptParamLabel: function(string, number, {string}): string
|
||||
getScriptParamLabelUnfiltered: function(string, number): string
|
||||
end
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi)
|
||||
|
||||
```
|
||||
[Expand All] [Collapse All]
|
||||
|
||||
record ScriptParamUtil.ParamForUi enum IconStyle "Colored"
|
||||
"Default"
|
||||
end
|
||||
uiType: ScriptParamType
|
||||
iconStyle: IconStyle
|
||||
name: string
|
||||
values: {string}
|
||||
numbers: {number}
|
||||
tooltips: {string}
|
||||
defaultIndex: integer
|
||||
hideLabel: boolean
|
||||
allowCoalesce: boolean
|
||||
makeCompactButtonFn: function(number): TreeNodeId
|
||||
formatValueFn: function(number): string
|
||||
stepValueFn: function(number, integer, boolean): number
|
||||
end
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi.IconStyle[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.IconStyle)
|
||||
|
||||
```
|
||||
enum ScriptParamUtil.ParamForUi.IconStyle "Colored"
|
||||
"Default"
|
||||
end
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi.IconStyle."Colored"[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.IconStyle.)
|
||||
|
||||
### ScriptParamUtil.ParamForUi.IconStyle."Default"[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.IconStyle.)
|
||||
|
||||
### ScriptParamUtil.ParamForUi.uiType[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.uiType)
|
||||
|
||||
```
|
||||
ScriptParamUtil.ParamForUi.uiType: ScriptParamType
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi.iconStyle[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.iconStyle)
|
||||
|
||||
```
|
||||
ScriptParamUtil.ParamForUi.iconStyle: IconStyle
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi.name[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.name)
|
||||
|
||||
```
|
||||
ScriptParamUtil.ParamForUi.name: string
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi.values[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.values)
|
||||
|
||||
```
|
||||
ScriptParamUtil.ParamForUi.values: {string}
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi.numbers[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.numbers)
|
||||
|
||||
```
|
||||
ScriptParamUtil.ParamForUi.numbers: {number}
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi.tooltips[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.tooltips)
|
||||
|
||||
```
|
||||
ScriptParamUtil.ParamForUi.tooltips: {string}
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi.defaultIndex[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.defaultIndex)
|
||||
|
||||
```
|
||||
ScriptParamUtil.ParamForUi.defaultIndex: integer
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi.hideLabel[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.hideLabel)
|
||||
|
||||
```
|
||||
ScriptParamUtil.ParamForUi.hideLabel: boolean
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi.allowCoalesce[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.allowCoalesce)
|
||||
|
||||
```
|
||||
ScriptParamUtil.ParamForUi.allowCoalesce: boolean
|
||||
```
|
||||
|
||||
### ScriptParamUtil.ParamForUi.makeCompactButtonFn[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.makeCompactButtonFn)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.ParamForUi.makeCompactButtonFn(number): TreeNodeId
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `number`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `TreeNodeId`
|
||||
|
||||
### ScriptParamUtil.ParamForUi.formatValueFn[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.formatValueFn)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.ParamForUi.formatValueFn(number): string
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `number`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string`
|
||||
|
||||
### ScriptParamUtil.ParamForUi.stepValueFn[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.stepValueFn)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.ParamForUi.stepValueFn(number, integer, boolean): number
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `number`
|
||||
* `integer`
|
||||
* `boolean`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `number`
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam)
|
||||
|
||||
```
|
||||
record ScriptParamUtil.CompSimpleParam scriptParam: ParamForUi
|
||||
currentValue: number
|
||||
onValueChange: function(number)
|
||||
toggleButtonsFlowLayout: boolean
|
||||
vertical: boolean
|
||||
compact: boolean
|
||||
addSpacer: boolean
|
||||
disableGamepadNavigation: boolean
|
||||
onHover: function(boolean)
|
||||
gameCtx: GameContext
|
||||
updateCurrentValue: boolean
|
||||
end
|
||||
```
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam.scriptParam[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.scriptParam)
|
||||
|
||||
```
|
||||
ScriptParamUtil.CompSimpleParam.scriptParam: ParamForUi
|
||||
```
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam.currentValue[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.currentValue)
|
||||
|
||||
```
|
||||
ScriptParamUtil.CompSimpleParam.currentValue: number
|
||||
```
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam.onValueChange[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.onValueChange)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.CompSimpleParam.onValueChange(number)
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `number`
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam.toggleButtonsFlowLayout[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.toggleButtonsFlowLayout)
|
||||
|
||||
```
|
||||
ScriptParamUtil.CompSimpleParam.toggleButtonsFlowLayout: boolean
|
||||
```
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam.vertical[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.vertical)
|
||||
|
||||
```
|
||||
ScriptParamUtil.CompSimpleParam.vertical: boolean
|
||||
```
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam.compact[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.compact)
|
||||
|
||||
```
|
||||
ScriptParamUtil.CompSimpleParam.compact: boolean
|
||||
```
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam.addSpacer[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.addSpacer)
|
||||
|
||||
```
|
||||
ScriptParamUtil.CompSimpleParam.addSpacer: boolean
|
||||
```
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam.disableGamepadNavigation[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.disableGamepadNavigation)
|
||||
|
||||
```
|
||||
ScriptParamUtil.CompSimpleParam.disableGamepadNavigation: boolean
|
||||
```
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam.onHover[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.onHover)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.CompSimpleParam.onHover(boolean)
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `boolean`
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam.gameCtx[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.gameCtx)
|
||||
|
||||
```
|
||||
ScriptParamUtil.CompSimpleParam.gameCtx: GameContext
|
||||
```
|
||||
|
||||
### ScriptParamUtil.CompSimpleParam.updateCurrentValue[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.updateCurrentValue)
|
||||
|
||||
```
|
||||
ScriptParamUtil.CompSimpleParam.updateCurrentValue: boolean
|
||||
```
|
||||
|
||||
### ScriptParamUtil.buildScriptParamCompSimple[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.buildScriptParamCompSimple)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.buildScriptParamCompSimple(CompSimpleParam): TreeNodeId
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `CompSimpleParam`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `TreeNodeId`
|
||||
|
||||
### ScriptParamUtil.buildScriptParamComp[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.buildScriptParamComp)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.buildScriptParamComp(ScriptParam, integer, function(integer), boolean, boolean, function(boolean), boolean): TreeNodeId
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `ScriptParam`
|
||||
* `integer`
|
||||
* `function(integer)`
|
||||
* `boolean`
|
||||
* `boolean`
|
||||
* `function(boolean)`
|
||||
* `boolean`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `TreeNodeId`
|
||||
|
||||
### ScriptParamUtil.searchAndBuildScriptParamComp[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.searchAndBuildScriptParamComp)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.searchAndBuildScriptParamComp(string, function(string) : number, function(string, number), boolean, function(boolean), {string}, boolean): MenuIconReactUtil.HintWidgetParam.Data, TreeNodeId
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `function(string): number`
|
||||
* `function(string, number)`
|
||||
* `boolean`
|
||||
* `function(boolean)`
|
||||
* `{string}`
|
||||
* `boolean`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `MenuIconReactUtil.HintWidgetParam.Data`
|
||||
2. `TreeNodeId`
|
||||
|
||||
### ScriptParamUtil.wrap[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.wrap)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.wrap(string, boolean, TreeNodeId, boolean, function(boolean), string): TreeNodeId
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `boolean`
|
||||
* `TreeNodeId`
|
||||
* `boolean`
|
||||
* `function(boolean)`
|
||||
* `string`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `TreeNodeId`
|
||||
|
||||
### ScriptParamUtil.getScriptParam[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.getScriptParam)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.getScriptParam(string, {string}): ScriptParam
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `{string}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `ScriptParam`
|
||||
|
||||
### ScriptParamUtil.clampScriptParamToDiscreteValue[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.clampScriptParamToDiscreteValue)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.clampScriptParamToDiscreteValue(number, ScriptParam): number
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `number`
|
||||
* `ScriptParam`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `number`
|
||||
|
||||
### ScriptParamUtil.clampScriptParamValueIndex[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.clampScriptParamValueIndex)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.clampScriptParamValueIndex(number, ScriptParam): integer
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `number`
|
||||
* `ScriptParam`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `integer`
|
||||
|
||||
### ScriptParamUtil.getScriptParamDefaultValue[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.getScriptParamDefaultValue)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.getScriptParamDefaultValue({number}, integer): number
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `{number}`
|
||||
* `integer`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `number`
|
||||
|
||||
### ScriptParamUtil.getScriptParamDefaultValueIndex[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.getScriptParamDefaultValueIndex)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.getScriptParamDefaultValueIndex({number}, integer): integer
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `{number}`
|
||||
* `integer`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `integer`
|
||||
|
||||
### ScriptParamUtil.getScriptParamLabel[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.getScriptParamLabel)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.getScriptParamLabel(string, number, {string}): string
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `number`
|
||||
* `{string}`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string`
|
||||
|
||||
### ScriptParamUtil.getScriptParamLabelUnfiltered[🔗](#$content.gui.main.script_param_util~ScriptParamUtil.getScriptParamLabelUnfiltered)
|
||||
|
||||
```
|
||||
function ScriptParamUtil.getScriptParamLabelUnfiltered(string, number): string
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
* `string`
|
||||
* `number`
|
||||
|
||||
**Returns**
|
||||
|
||||
1. `string`
|
||||
Reference in new issue
Block a user