Skip to content

gump

Opens the gumps of templates/gumps on players; their script gets the answer.

Source: src/Moongate.Server.Ultima/Modules/GumpModule.cs

gump.close(player, id) -> boolean

Closes the player's gump, from a script on the next turn of the game loop, so it gives true even for a gump that is not open; false for an unknown player.

ParameterTypeDefault
playerinteger
idstring

Returns boolean.

gump.close_all(player) -> integer

Closes every gump of the player, each script told with on_close and the reason server; gives how many were open. From a script it closes on the next turn of the game loop; 0 for an unknown player.

ParameterTypeDefault
playerinteger

Returns integer.

gump.create(id, x?, y?) -> table

Starts a gump built from Lua: add controls with g:text{...}, g:button{...}, g:paginate(...), ..., then gump.send. A button's on_click may be a function.

ParameterTypeDefault
idstring
x (optional)integer0
y (optional)integer0

Returns table.

gump.is_open(player, id) -> boolean

True when the player has the gump <id> open; false for a gump that is not open or an unknown player.

ParameterTypeDefault
playerinteger
idstring

Returns boolean.

gump.open(player, id, args?) -> boolean

Opens the gump templates/gumps/<id>.xml on the player, its ${name} filled from args; scripts/gumps/<id>.lua gets the answer. From a script it opens on the next turn of the game loop, so the true means queued: a gump that then fails to open is only in the log. False for an unknown player or gump.

ParameterTypeDefault
playerinteger
idstring
args (optional)tablenil

Returns boolean.

gump.portrait(body) -> integer?

The id of the item art that stands for a creature of that body in a gump (data/portraits.toml), or nil when there is none; draw it with g:item{ item = ... } or g:portrait{ x = ..., y = ..., body = ... }.

ParameterTypeDefault
bodyinteger

Returns integer?.

gump.send(player, gump, args?) -> boolean

Opens a gump built with gump.create on the player, from a script on the next turn of the game loop, so the true means queued: a gump that then fails to open is only in the log; false for an unknown player.

ParameterTypeDefault
playerinteger
gumptable
args (optional)tablenil

Returns boolean.

Made with ❤️ by Tom

Buy me a coffee