Trigger API Reference DCEI Functions UI0 - BLKTower/TestWiki GitHub Wiki
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
typeIdaccepted 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
typeIdaccepted 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
idthe ID of the ability on the unit. -
unit
unitthe unit that has the ability. -
int
slotKeythe 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
idthe ID of the ability on the unit. -
unit
unitthe unit that has the ability. -
int
playerthe 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
idthe ID of the ability on the unit. -
unit
unitthe unit that has the ability. -
int
playerthe 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
idthe 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
unitthe 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
idthe 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
unitthe unit to show the status UI for. -
int
playerthe 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
scalethe scale of the unit health bar. A value of0will 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
unitthe unit to attach the speech bubble to. -
int
widththeoretically, the width of the speech bubble. Appears to instead control the offset of the bubble containing the text from the arrow. -
string
contentthe content of the speech bubble. -
string
titlethe 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
unitthe unit to attach the speech bubble to. -
int
widththeoretically, the width of the speech bubble. Appears to instead control the offset of the bubble containing the text from the arrow. -
string
contentthe content of the speech bubble. -
string
titlethe title of the speech bubble. Commonly used to show speaker name. -
TextOptions
optionsthe 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
unitthe unit show to a label for. -
string
contentthe text to display. -
UnitLabelOptions
optionsaccepted values:-
table
offsetthe offset of the label, default is{up = 0, front = 0, right = 0}. -
boolean
center_at_unit_originwhen true, uses the unit's origin point rather than status bar height for UI attachment. Default is true. -
boolean
center_at_unit_topwhen 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
xthe X coordinate. -
float
ythe Y coordinate. -
float
zthe Z coordinate. -
string
contentthe 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
posthe position for the floating text. -
string
contentthe content of the floating text. -
float
stayDurationthe 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
animationTypethe animation of the floating text:0 - Text pops in 1 - text slowly floats upwards -
float
animationDurationThe duration of the animation. If this duration is longer than thestayDuration, this duration will be used. -
TextOptions
optionsthe 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
posthe position for the floating text. -
string
contentthe content of the floating text. -
float
stayDurationthe 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
animationTypethe animation of the floating text:0 - Text pops in 1 - text slowly floats upwards -
float
animationDurationThe duration of the animation. If this duration is longer than thestayDuration, this duration will be used. -
TextOptions
optionsthe 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
unitthe unit to create the floating text at. -
string
contentthe content of the floating text. -
float
stayDurationthe 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
animationTypethe animation of the floating text:0 - Text pops in 1 - text slowly floats upwards -
float
animationDurationThe duration of the animation. If this duration is longer than thestayDuration, this duration will be used. -
UnitLabelOptions
optionsaccepted values:-
table
offsetthe offset of the label, default is{up = 0, front = 0, right = 0}. -
boolean
center_at_unit_originwhen true, uses the unit's origin point rather than status bar height for UI attachment. Default is true. -
boolean
center_at_unit_topwhen 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
idthe 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
unitthe unit to show the status UI for. -
int
slotKeythe 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
idthe 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
unitthe 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
idthe 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
unitthe unit to hide the status UI for. -
int
playerthe 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
titlethe title of the message pop-up. -
string
contentthe text of the message. -
string
buttonthe text on the button. -
string
image1the name or link to the first image. -
string
image2the name or link to the second image. -
string
image3the 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
titlethe title of the big head message. -
string
messagethe text of the big head message. -
string
imagethe 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
titlethe title of the big head message. -
string
messagethe text of the big head message. -
string
imagethe big head image. Note that specific big head images must be used. -
BigHeadMessageOptions
optionsthe 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()