Trigger API Reference DCEI Functions UI0 - funovus/editor-wiki GitHub Wiki
Table of Contents
- [Trigger API Reference\DCEI Functions\UI (1/2)](#trigger-api-referencedcei-functionsui-12)
* [void ShowFeedbackMessage(string message)](#void-showfeedbackmessagestring-message)
* [void ShowSystemUi(int typeId)](#void-showsystemuiint-typeid)
* [void HideSystemUi(int typeId)](#void-hidesystemuiint-typeid)
* [void ShowAbilitiesUi(int id, unit unit)](#void-showabilitiesuiint-id-unit-unit)
* [void ShowAbilitiesUiInSlot(int id, unit unit, int slotKey)](#void-showabilitiesuiinslotint-id-unit-unit-int-slotkey)
* [void HideAbilitiesUi(int id, unit unit)](#void-hideabilitiesuiint-id-unit-unit)
* [void ShowAbilitiesUiForPlayer(int id, unit unit, int player)](#void-showabilitiesuiforplayerint-id-unit-unit-int-player)
* [void HideAbilitiesUiForPlayer(int id, unit unit, int player)](#void-hideabilitiesuiforplayerint-id-unit-unit-int-player)
* [void ShowUnitStatusUi(int id, unit unit)](#void-showunitstatusuiint-id-unit-unit)
* [void ShowUnitStatusUiForPlayer(int id, unit unit, int player)](#void-showunitstatusuiforplayerint-id-unit-unit-int-player)
* [void SetUnitHealthBarUiScale(float scale)](#void-setunithealthbaruiscalefloat-scale)
* [void SetGoldRewardTextScale(float scale)](#void-setgoldrewardtextscalefloat-scale)
* [void ShowSpeechBubble(unit unit, int width, string content, string title)](#void-showspeechbubbleunit-unit-int-width-string-content-string-title)
* [void ShowSpeechBubble(unit unit, int width, string content, string title, TextOptions options)](#void-showspeechbubbleunit-unit-int-width-string-content-string-title-textoptions-options)
* [void ShowUnitLabel(unit unit, string content)](#void-showunitlabelunit-unit-string-content)
* [void ShowUnitLabel(unit unit, string content, UnitLabelOptions options)](#void-showunitlabelunit-unit-string-content-unitlabeloptions-options)
* [void HideUnitLabel(unit unit)](#void-hideunitlabelunit-unit)
* [void ShowFloatingText(float x, float y, float z, string content)](#void-showfloatingtextfloat-x-float-y-float-z-string-content)
* [void ShowFloatingText(Float3 pos, string content, float stayDuration, int animationType, float animationDuration, TextOptions options)](#void-showfloatingtextfloat3-pos-string-content-float-stayduration-int-animationtype-float-animationduration-textoptions-options)
* [void ShowFloatingTextWithOptions(Float3 pos, string content, float stayDuration, int animationType, float animationDuration, TextOptions options)](#void-showfloatingtextwithoptionsfloat3-pos-string-content-float-stayduration-int-animationtype-float-animationduration-textoptions-options)
* [void ShowFloatingTextAtUnit(unit unit, string content, float stayDuration, int animationType, float animationDuration, UnitLabelOptions options)](#void-showfloatingtextatunitunit-unit-string-content-float-stayduration-int-animationtype-float-animationduration-unitlabeloptions-options)
* [void HideSpeechBubble(unit unit)](#void-hidespeechbubbleunit-unit)
* [void ShowUnitStatusUiInSlot(int id, unit unit, int slotKey)](#void-showunitstatusuiinslotint-id-unit-unit-int-slotkey)
* [void SetHeroStatusUiVisibility(bool visible)](#void-setherostatusuivisibilitybool-visible)
* [void HideUnitStatusUi(int id, unit unit)](#void-hideunitstatusuiint-id-unit-unit)
* [void HideUnitStatusUiForPlayer(int id, unit unit, int player)](#void-hideunitstatusuiforplayerint-id-unit-unit-int-player)
* [void ShowMessageWithButtonText(string title, string content, string button, string image1, string image2, string image3)](#void-showmessagewithbuttontextstring-title-string-content-string-button-string-image1-string-image2-string-image3)
* [void ShowBigHeadMessage(string title, string message, string image)](#void-showbigheadmessagestring-title-string-message-string-image)
* [void ShowBigHeadMessage(string title, string message, string image, BigHeadMessageOptions options)](#void-showbigheadmessagestring-title-string-message-string-image-bigheadmessageoptions-options)
* [void HideBigHeadMessage()](#void-hidebigheadmessage)
|
Trigger API Reference\DCEI Functions\UI (1/2) {Trigger-API-ReferenceDCEI-FunctionsUI-12}
void ShowFeedbackMessage(string message)
Shows a in-game feedback message in the center of the player's screen.
DCEI.ShowFeedbackMessage("Message")
void ShowSystemUi(int typeId)
Shows a specific built-in UI frame. These UI frames are shown by default.
-
int
typeId
accepted values:0 for wave indicator 1 for gold display 2 for speed up button
DCEI.ShowSystemUi(0)
void HideSystemUi(int typeId)
Hides a specific built-in UI frame.
-
int
typeId
accepted values:0 for wave indicator 1 for gold display 2 for speed up button
DCEI.HideSystemUi(1)
void ShowAbilitiesUi(int id, unit unit)
Shows the UI for the specified ability on the given unit. A specific ability can only be bound to one slot, even if multiple units have the ability.
DCEI.ShowAbilitiesUi(1, unit)
void ShowAbilitiesUiInSlot(int id, unit unit, int slotKey) {void-ShowAbilitiesUiInSlotint-id-unit-unit-int-slotKey}
void ShowAbilitiesUiInSlot(int id, unit unit, int slotKey)
Shows the built-in UI for the specified ability on the given unit in a specific UI slot.
-
int
id
the ID of the ability on the unit. -
unit
unit
the unit that has the ability. -
int
slotKey
the ability UI slot key.
DCEI.ShowAbilitiesUiInSlot(1, unit, 3)
void HideAbilitiesUi(int id, unit unit)
Hides the built-in UI for the specified ability on the given unit.
DCEI.HideAbilitiesUi(1, unit)
void ShowAbilitiesUiForPlayer(int id, unit unit, int player) {void-ShowAbilitiesUiForPlayerint-id-unit-unit-int-player}
void ShowAbilitiesUiForPlayer(int id, unit unit, int player)
Shows the built-in UI for the specified ability on the given unit for the given player.
-
int
id
the ID of the ability on the unit. -
unit
unit
the unit that has the ability. -
int
player
the player to show the UI for.
DCEI.ShowAbilitiesUiForPlayer(1, unit, 1)
void HideAbilitiesUiForPlayer(int id, unit unit, int player) {void-HideAbilitiesUiForPlayerint-id-unit-unit-int-player}
void HideAbilitiesUiForPlayer(int id, unit unit, int player)
Hides the built-in UI for the specified ability on the given unit for the given player.
-
int
id
the ID of the ability on the unit. -
unit
unit
the unit that has the ability. -
int
player
the player to hide the UI for.
DCEI.HideAbilitiesUiForPlayer(1, unit, 1)
void ShowUnitStatusUi(int id, unit unit)
Shows the built-in status UI for the given unit.
-
int
id
the status UI to show.2 - Large HP bar 3 - Slightly larger than default HP bar, bottom right corner "hero unit" UI 4 - Animated big hand pointer at the unit 5 - Top center HP bar with percent current HP 6 - Default speech bubble 7 - Nothing 8 - Yellow boxes/resource bar 9 - Yellow boxes as HP bar 10 - Nothing 11 - Top center HP bar with fractional current HP
-
unit
unit
the unit to show the status UI for.
DCEI.ShowUnitStatusUi(9, unit)
void ShowUnitStatusUiForPlayer(int id, unit unit, int player) {void-ShowUnitStatusUiForPlayerint-id-unit-unit-int-player}
void ShowUnitStatusUiForPlayer(int id, unit unit, int player)
Shows the built-in status UI for the given unit for the given player.
-
int
id
the status UI to show.2 - Large HP bar 3 - Slightly larger than default HP bar, bottom right corner status UI 4 - Animated big hand pointer at the unit 5 - Top center HP bar with percent current HP 6 - Default speech bubble 7 - Nothing 8 - Yellow boxes/resource bar 9 - Yellow boxes as HP bar 10 - Nothing 11 - Top center HP bar with fractional current HP
-
unit
unit
the unit to show the status UI for. -
int
player
the player to show the UI for.
DCEI.ShowUnitStatusUi(9, unit, 1)
void SetUnitHealthBarUiScale(float scale)
Sets the scale of the unit health bar UI.
-
float
scale
the scale of the unit health bar. A value of0
will hide the health bar, useful when using ShowUnitStatusUi() or custom frames.
DCEI.SetUnitHealthBarUiScale(0.5)
void SetGoldRewardTextScale(float scale)
Sets the scale of the gold reward text, displayed when units with a bounty are killed.
DCEI.SetGoldRewardTextScale(2)
void ShowSpeechBubble(unit unit, int width, string content, string title) {void-ShowSpeechBubbleunit-unit-int-width-string-content-string-title}
void ShowSpeechBubble(unit unit, int width, string content, string title)
Displays a speech bubble for the given unit. Speech bubble will disappear if the unit dies. Will not overwrite previous speech bubbles attached to the unit.
-
unit
unit
the unit to attach the speech bubble to. -
int
width
theoretically, the width of the speech bubble. Appears to instead control the offset of the bubble containing the text from the arrow. -
string
content
the content of the speech bubble. -
string
title
the title of the speech bubble. Commonly used to show speaker name.
DCEI.ShowSpeechBubble(unit, 100, "Content", "Title")
void ShowSpeechBubble(unit unit, int width, string content, string title, TextOptions options) {void-ShowSpeechBubbleunit-unit-int-width-string-content-string-title-TextOptions-options}
void ShowSpeechBubble(unit unit, int width, string content, string title, TextOptions options)
Displays a speech bubble for the given unit. Speech bubble will disappear if the unit dies. Will not overwrite previous speech bubbles attached to the unit.
-
unit
unit
the unit to attach the speech bubble to. -
int
width
theoretically, the width of the speech bubble. Appears to instead control the offset of the bubble containing the text from the arrow. -
string
content
the content of the speech bubble. -
string
title
the title of the speech bubble. Commonly used to show speaker name. -
TextOptions
options
the text options for the speech bubble. This controls the offset of the entire speech bubble.
local text_options = {offset = {right = 1, up = 10, front = 10}}
DCEI.ShowSpeechBubble(unit, 100, "Content", "Title", text_options)
void ShowUnitLabel(unit unit, string content)
Shows a text tag attached to a unit. Will not overwrite existing labels.
DCEI.ShowUnitLabel(unit, "Unit")
void ShowUnitLabel(unit unit, string content, UnitLabelOptions options) {void-ShowUnitLabelunit-unit-string-content-UnitLabelOptions-options}
void ShowUnitLabel(unit unit, string content, UnitLabelOptions options)
Shows a text tag attached to a unit. Will not overwrite existing labels.
-
unit
unit
the unit show to a label for. -
string
content
the text to display. -
UnitLabelOptions
options
accepted values:-
table
offset
the offset of the label, default is{up = 0, front = 0, right = 0}
. -
boolean
center_at_unit_origin
when true, uses the unit's origin point rather than status bar height for UI attachment. Default is true. -
boolean
center_at_unit_top
when true, uses the top of the unit rather than the bottom of the unit for UI attachment.
-
table
local label_options = {offset = {right = 1, up = 1, front = 1}, center_at_unit_origin = true, center_at_unit_top = true}
DCEI.ShowUnitLabel(unit, "Unit", label_options)
void HideUnitLabel(unit unit)
Hides a text tag attached to a unit.
DCEI.HideUnitLabel(unit)
void ShowFloatingText(float x, float y, float z, string content) {void-ShowFloatingTextfloat-x-float-y-float-z-string-content}
void ShowFloatingText(float x, float y, float z, string content)
Displays floating text at the specified location. Text will immediately start to fade away.
-
float
x
the X coordinate. -
float
y
the Y coordinate. -
float
z
the Z coordinate. -
string
content
the content of the floating text.
DCEI.ShowFloatingText(12, 4, 12, "Floating Text")
void ShowFloatingText(Float3 pos, string content, float stayDuration, int animationType, float animationDuration, TextOptions options) {void-ShowFloatingTextFloat3-pos-string-content-float-stayDuration-int-animationType-float-animationDuration-TextOptions-options}
void ShowFloatingText(Float3 pos, string content, float stayDuration, int animationType, float animationDuration, TextOptions options)
Displays floating text at the specified location.
-
Float3
pos
the position for the floating text. -
string
content
the content of the floating text. -
float
stayDuration
the duration of the floating text. There is a short, fixed fade in and our duration at the start and end, respectively. If duration this is longer than theanimationDuration
, this duration will be used. -
int
animationType
the animation of the floating text:0 - Text pops in 1 - text slowly floats upwards
-
float
animationDuration
The duration of the animation. If this duration is longer than thestayDuration
, this duration will be used. -
TextOptions
options
the text options for floating text.
local float_text_pos = {x = 20, y = 2, z = 20}
local text_options = {offset = {right = 1, up = 10, front = 10}}
DCEI.ShowFloatingText(float_text_pos, "Floating Text", 5, 1, 5, text_options)
void ShowFloatingTextWithOptions(Float3 pos, string content, float stayDuration, int animationType, float animationDuration, TextOptions options) {void-ShowFloatingTextWithOptionsFloat3-pos-string-content-float-stayDuration-int-animationType-float-animationDuration-TextOptions-options}
void ShowFloatingTextWithOptions(Float3 pos, string content, float stayDuration, int animationType, float animationDuration, TextOptions options)
Displays floating text at the specified location.
-
Float3
pos
the position for the floating text. -
string
content
the content of the floating text. -
float
stayDuration
the duration of the floating text. There is a short, fixed fade in and our duration at the start and end, respectively. If duration this is longer than theanimationDuration
, this duration will be used. -
int
animationType
the animation of the floating text:0 - Text pops in 1 - text slowly floats upwards
-
float
animationDuration
The duration of the animation. If this duration is longer than thestayDuration
, this duration will be used. -
TextOptions
options
the text options for floating text.
local float_text_pos = {x = 20, y = 2, z = 20}
local text_options = {offset = {right = 1, up = 10, front = 10}}
DCEI.ShowFloatingTextWithOptions(float_text_pos, "Floating Text", 5, 1, 5, text_options)
void ShowFloatingTextAtUnit(unit unit, string content, float stayDuration, int animationType, float animationDuration, UnitLabelOptions options) {void-ShowFloatingTextAtUnitunit-unit-string-content-float-stayDuration-int-animationType-float-animationDuration-UnitLabelOptions-options}
void ShowFloatingTextAtUnit(unit unit, string content, float stayDuration, int animationType, float animationDuration, UnitLabelOptions options)
Displays floating text at the specified unit.
-
unit
unit
the unit to create the floating text at. -
string
content
the content of the floating text. -
float
stayDuration
the duration of the floating text. There is a short, fixed fade in and our duration at the start and end, respectively. If duration this is longer than theanimationDuration
, this duration will be used. -
int
animationType
the animation of the floating text:0 - Text pops in 1 - text slowly floats upwards
-
float
animationDuration
The duration of the animation. If this duration is longer than thestayDuration
, this duration will be used. -
UnitLabelOptions
options
accepted values:-
table
offset
the offset of the label, default is{up = 0, front = 0, right = 0}
. -
boolean
center_at_unit_origin
when true, uses the unit's origin point rather than status bar height for UI attachment. Default is true. -
boolean
center_at_unit_top
when true, uses the top of the unit rather than the bottom of the unit for UI attachment.
-
table
local label_options = {offset = {right = 1, up = 1, front = 1}, center_at_unit_origin = true, center_at_unit_top = true}
DCEI.ShowFloatingTextAtUnit(unit, "Floating Text", 5, 0, 5, label_options)
void HideSpeechBubble(unit unit)
Hides a speech bubble attached to the given unit.
DCEI.HideSpeechBubble(unit)
void ShowUnitStatusUiInSlot(int id, unit unit, int slotKey) {void-ShowUnitStatusUiInSlotint-id-unit-unit-int-slotKey}
void ShowUnitStatusUiInSlot(int id, unit unit, int slotKey)
Shows the built-in status UI for the given unit in the specified slot.
-
int
id
the status UI to show.2 - Large HP bar 3 - Slightly larger than default HP bar, bottom right corner "hero unit" UI 4 - Animated big hand pointer at the unit 5 - Top center HP bar with percent current HP 6 - Default speech bubble 7 - Nothing 8 - Yellow boxes/resource bar 9 - Yellow boxes as HP bar 10 - Nothing 11 - Top center HP bar with fractional current HP
-
unit
unit
the unit to show the status UI for. -
int
slotKey
the slot key to bind the status UI to.
DCEI.ShowUnitStatusUiInSlot(4, unit, 1)
void SetHeroStatusUiVisibility(bool visible)
Set Hero Status UI visible or not
void HideUnitStatusUi(int id, unit unit)
Hides the given built-in status UI for a given unit.
-
int
id
the status UI to hide.2 - Large HP bar 3 - Slightly larger than default HP bar, bottom right corner "hero unit" UI 4 - Animated big hand pointer at the unit 5 - Top center HP bar with percent current HP 6 - Default speech bubble 7 - Nothing 8 - Yellow boxes/resource bar 9 - Yellow boxes as HP bar 10 - Nothing 11 - Top center HP bar with fractional current HP
-
unit
unit
the unit to hide the status UI for.
DCEI.HideUnitStatusUi(2, unit)
void HideUnitStatusUiForPlayer(int id, unit unit, int player) {void-HideUnitStatusUiForPlayerint-id-unit-unit-int-player}
void HideUnitStatusUiForPlayer(int id, unit unit, int player)
Hides the given built-in status UI for a given unit, for the given player.
-
int
id
the status UI to hide.2 - Large HP bar 3 - Slightly larger than default HP bar, bottom right corner "hero unit" UI 4 - Animated big hand pointer at the unit 5 - Top center HP bar with percent current HP 6 - Default speech bubble 7 - Nothing 8 - Yellow boxes/resource bar 9 - Yellow boxes as HP bar 10 - Nothing 11 - Top center HP bar with fractional current HP
-
unit
unit
the unit to hide the status UI for. -
int
player
the player to hide the status UI for.
DCEI.HideUnitStatusUiForPlayer(2, unit, 1)
void ShowMessageWithButtonText(string title, string content, string button, string image1, string image2, string image3) {void-ShowMessageWithButtonTextstring-title-string-content-string-button-string-image1-string-image2-string-image3}
void ShowMessageWithButtonText(string title, string content, string button, string image1, string image2, string image3)
Displays a pop-up message with a button. Displays up to 3 images.
-
string
title
the title of the message pop-up. -
string
content
the text of the message. -
string
button
the text on the button. -
string
image1
the name or link to the first image. -
string
image2
the name or link to the second image. -
string
image3
the name or link to the third image.
DCEI.ShowMessageWithButtonText("Title", "Content", "Button", "airship_onMap", "crown_gold", "icon_boss")
void ShowBigHeadMessage(string title, string message, string image) {void-ShowBigHeadMessagestring-title-string-message-string-image}
void ShowBigHeadMessage(string title, string message, string image)
Displays a "big head" message. You can view a list of accepted images here.
-
string
title
the title of the big head message. -
string
message
the text of the big head message. -
string
image
the big head image. Note that specific big head images must be used.
DCEI.ShowBigHeadMessage("Title", "Message", "bighead_hero_smith")
void ShowBigHeadMessage(string title, string message, string image, BigHeadMessageOptions options) {void-ShowBigHeadMessagestring-title-string-message-string-image-BigHeadMessageOptions-options}
void ShowBigHeadMessage(string title, string message, string image, BigHeadMessageOptions options)
Displays a "big head" message with additional options. Will not overwrite an existing big head message. You can view a list of accepted images here.
-
string
title
the title of the big head message. -
string
message
the text of the big head message. -
string
image
the big head image. Note that specific big head images must be used. -
BigHeadMessageOptions
options
the additional options for a big head message.
local big_head_options = {pause = true, on_dismiss = dismiss_func, delay = 5, message_box_color = {r = 255, g = 0, b = 255, a = 255}, title_box_color = {r = 255, g = 0, b = 255, a = 255}}
DCEI.ShowBigHeadMessage("Title", "Message", "bighead_hero_smith", big_head_options)
void HideBigHeadMessage()
DCEI.HideBigHeadMessage()