gump
Opens the gumps of templates/gumps on players; their script gets the answer.
Source: src/Moongate.Server.Ultima/Modules/GumpModule.cs
Functions
Section titled “Functions”gump.close(player, id) -> booleanCloses 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.
| Parameter | Type | Default |
|---|---|---|
player | integer | |
id | string |
Returns boolean.
close_all
Section titled “close_all”gump.close_all(player) -> integerCloses 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.
| Parameter | Type | Default |
|---|---|---|
player | integer |
Returns integer.
create
Section titled “create”gump.create(id, x?, y?) -> tableStarts 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.
| Parameter | Type | Default |
|---|---|---|
id | string | |
x (optional) | integer | 0 |
y (optional) | integer | 0 |
Returns table.
is_open
Section titled “is_open”gump.is_open(player, id) -> booleanTrue when the player has the gump <id> open; false for a gump that is not open or an unknown player.
| Parameter | Type | Default |
|---|---|---|
player | integer | |
id | string |
Returns boolean.
gump.open(player, id, args?) -> booleanOpens 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.
| Parameter | Type | Default |
|---|---|---|
player | integer | |
id | string | |
args (optional) | table | nil |
Returns boolean.
portrait
Section titled “portrait”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 = ... }.
| Parameter | Type | Default |
|---|---|---|
body | integer |
Returns integer?.
gump.send(player, gump, args?) -> booleanOpens 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.
| Parameter | Type | Default |
|---|---|---|
player | integer | |
gump | table | |
args (optional) | table | nil |
Returns boolean.
Made with ❤️ by Tom
