Editing Mod API Reference:UI
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 54: | Line 54: | ||
* '''Text''' ''string'': The text to display on the button. | * '''Text''' ''string'': The text to display on the button. | ||
* '''Color''' ''string'': The color of the button. Pass this as a string in #RRGGBB format. Only the following colors are supported for buttons: | * '''Color''' ''string'': The color of the button. Pass this as a string in #RRGGBB format. Only the following colors are supported for buttons: | ||
− | + | :: <code>#BABABC, #6C73D1, #FF00ED, #FFC200, #00A0FF, #00B5FF, #F3FFAE, #43C731, #43C631, #1274A4, #1274A5, #B03B3B, #0021FF, #359029, #00E9FF, #00FF21, #FFF700, #AA3A3A, #43C732, #00D4FF, #B03C3C, #00F4FF, #00BFFF, #4EC4FF, #615DDF, #100C08, #0000FF, #4EFFFF, #59009D, #008000, #FF7D00, #FF0000, #606060, #00FF05, #FF697A, #94652E, #00FF8C, #FF4700, #009B9D, #23A0FF, #AC0059, #FF87FF, #FFFF00, #943E3E, #FEFF9B, #AD7E7E, #B70AFF, #FFAF56, #FF00B1, #8EBE57, #DAA520, #990024, #00FFFF, #8F9779, #880085, #00755E, #FFE5B4, #4169E1, #FF43A4, #8DB600, #40826D, #C04000, #FFDDF4, #CD7F32, #C19A6B, #C09999, #B0BF1A, #3B7A57, #4B5320, #664C28, #893F45, #D2691E, #36454F, #FF00FF, #76FF7A</code> | |
* '''TextColor''' ''string'': The color of the text on the button. Pass this as a string in #RRGGBB format. | * '''TextColor''' ''string'': The color of the text on the button. Pass this as a string in #RRGGBB format. | ||
* '''OnClick''' ''function'': Pass the name of a lua function to be called whenever the player clicks the button. | * '''OnClick''' ''function'': Pass the name of a lua function to be called whenever the player clicks the button. | ||
Line 88: | Line 88: | ||
− | + | '''UI.Alert''': Pops up a dialog with a message and an Okay button to close the message. Call this as simply <code>UI.Alert(msg)</code> | |
− | + | ||
− | + | ||
− | '''UI.Alert''': Pops up a dialog with a message and an Okay button to close the message. Call this as simply <code>UI.Alert(msg)</code> | + | |
Line 100: | Line 97: | ||
'''UI.InterceptNextTerritoryClick''': Added in [[Mod_API_Reference:IsVersionOrHigher|5.17.0]]. After calling this function, the next time the player clicks a territory on the map, your mod will be notified of the click. After calling this, you should also instruct the player to click a territory, and it's also a good idea to let them know they can move dialogs out of the way to see the map. | '''UI.InterceptNextTerritoryClick''': Added in [[Mod_API_Reference:IsVersionOrHigher|5.17.0]]. After calling this function, the next time the player clicks a territory on the map, your mod will be notified of the click. After calling this, you should also instruct the player to click a territory, and it's also a good idea to let them know they can move dialogs out of the way to see the map. | ||
− | * '''Callback''' ''function'': Pass a function that will be called on the next click. This function will be passed a [[Mod_API_Reference:TerritoryDetails|TerritoryDetails]] object, which can be used to get the Territory ID or the name of the territory that was clicked. This function can also be called with nil if the intercept request is cancelled, which can happen if another mod calls UI.InterceptNextTerritoryClick before a territory is clicked | + | * '''Callback''' ''function'': Pass a function that will be called on the next click. This function will be passed a [[Mod_API_Reference:TerritoryDetails|TerritoryDetails]] object, which can be used to get the Territory ID or the name of the territory that was clicked. This function can also be called with nil if the intercept request is cancelled, which can happen if another mod calls UI.InterceptNextTerritoryClick before a territory is clicked. |
'''UI.InterceptNextBonusLinkClick''': Added in [[Mod_API_Reference:IsVersionOrHigher|5.17.0]]. After calling this function, the next time the player clicks a bonus link on the map, your mod will be notified of the click. After calling this, you should also instruct the player to click a bonus link, and it's also a good idea to let them know they can move dialogs out of the way to see the map. | '''UI.InterceptNextBonusLinkClick''': Added in [[Mod_API_Reference:IsVersionOrHigher|5.17.0]]. After calling this function, the next time the player clicks a bonus link on the map, your mod will be notified of the click. After calling this, you should also instruct the player to click a bonus link, and it's also a good idea to let them know they can move dialogs out of the way to see the map. | ||
− | * '''Callback''' ''function'': Pass a function that will be called on the next click. This function will be passed a [[Mod_API_Reference:BonusDetails|BonusDetails]] object, which can be used to get the bonus ID or the name of the bonus that was clicked. This function can also be called with nil if the intercept request is cancelled, which can happen if another mod calls UI.InterceptNextBonusLinkClick before a bonus link is clicked. | + | * '''Callback''' ''function'': Pass a function that will be called on the next click. This function will be passed a [[Mod_API_Reference:BonusDetails|BonusDetails]] object, which can be used to get the bonus ID or the name of the bonus that was clicked. This function can also be called with nil if the intercept request is cancelled, which can happen if another mod calls UI.InterceptNextBonusLinkClick before a bonus link is clicked. |
+ | |||
+ | InterceptNextTerritoryClick | ||
[[Category:Mod API Reference]] | [[Category:Mod API Reference]] |