Trigger API Reference DCEI Functions UI0 - BLKTower/TestWiki 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 ShowFeedbackMessage(string message)

Description

Shows a in-game feedback message in the center of the player's screen.

Parameters

  • string message the message to display.

Example Usage

DCEI.ShowFeedbackMessage("Message")

void ShowSystemUi(int typeId) {void-ShowSystemUiint-typeId}

void ShowSystemUi(int typeId)

Description

Shows a specific built-in UI frame. These UI frames are shown by default.

Parameters

  • int typeId accepted values:
    0 for wave indicator
    1 for gold display
    2 for speed up button
    

Example Usage

DCEI.ShowSystemUi(0)

void HideSystemUi(int typeId) {void-HideSystemUiint-typeId}

void HideSystemUi(int typeId)

Description

Hides a specific built-in UI frame.

Parameters

  • int typeId accepted values:
    0 for wave indicator
    1 for gold display
    2 for speed up button
    

Example Usage

DCEI.HideSystemUi(1)

void ShowAbilitiesUi(int id, unit unit) {void-ShowAbilitiesUiint-id-unit-unit}

void ShowAbilitiesUi(int id, unit unit)

Description

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.

Parameters

  • int id the ID of the ability on the unit.
  • unit unit the unit that has the ability.

Example Usage

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)

Description

Shows the built-in UI for the specified ability on the given unit in a specific UI slot.

Parameters

  • 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.

Example Usage

DCEI.ShowAbilitiesUiInSlot(1, unit, 3)

void HideAbilitiesUi(int id, unit unit) {void-HideAbilitiesUiint-id-unit-unit}

void HideAbilitiesUi(int id, unit unit)

Description

Hides the built-in UI for the specified ability on the given unit.

Parameters

  • int id the ID of the ability on the unit.
  • unit unit the unit that has the ability.

Example Usage

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)

Description

Shows the built-in UI for the specified ability on the given unit for the given player.

Parameters

  • 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.

Example Usage

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)

Description

Hides the built-in UI for the specified ability on the given unit for the given player.

Parameters

  • 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.

Example Usage

DCEI.HideAbilitiesUiForPlayer(1, unit, 1)

void ShowUnitStatusUi(int id, unit unit) {void-ShowUnitStatusUiint-id-unit-unit}

void ShowUnitStatusUi(int id, unit unit)

Description

Shows the built-in status UI for the given unit.

Parameters

  • 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.

Example Usage

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)

Description

Shows the built-in status UI for the given unit for the given player.

Parameters

  • 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.

Example Usage

DCEI.ShowUnitStatusUi(9, unit, 1)

void SetUnitHealthBarUiScale(float scale) {void-SetUnitHealthBarUiScalefloat-scale}

void SetUnitHealthBarUiScale(float scale)

Description

Sets the scale of the unit health bar UI.

Parameters

  • float scale the scale of the unit health bar. A value of 0 will hide the health bar, useful when using ShowUnitStatusUi() or custom frames.

Example Usage

DCEI.SetUnitHealthBarUiScale(0.5)

void SetGoldRewardTextScale(float scale) {void-SetGoldRewardTextScalefloat-scale}

void SetGoldRewardTextScale(float scale)

Description

Sets the scale of the gold reward text, displayed when units with a bounty are killed.

Parameters

  • float scale the scale of the gold reward text. A value of 0 will hide the gold reward text.

Example Usage

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)

Description

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.

Parameters

  • 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.

Example Usage

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)

Description

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.

Parameters

  • 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.

Example Usage

local text_options = {offset = {right = 1, up = 10, front = 10}}
DCEI.ShowSpeechBubble(unit, 100, "Content", "Title", text_options)

void ShowUnitLabel(unit unit, string content) {void-ShowUnitLabelunit-unit-string-content}

void ShowUnitLabel(unit unit, string content)

Description

Shows a text tag attached to a unit. Will not overwrite existing labels.

Parameters

  • unit unit the unit show to a label for.
  • string content the text to display.

Example Usage

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)

Description

Shows a text tag attached to a unit. Will not overwrite existing labels.

Parameters

  • 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.

Example Usage

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) {void-HideUnitLabelunit-unit}

void HideUnitLabel(unit unit)

Description

Hides a text tag attached to a unit.

Parameters

  • unit unit the unit to hide the label on.

Example Usage

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)

Description

Displays floating text at the specified location. Text will immediately start to fade away.

Parameters

  • float x the X coordinate.
  • float y the Y coordinate.
  • float z the Z coordinate.
  • string content the content of the floating text.

Example Usage

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)

Description

Displays floating text at the specified location.

Parameters

  • 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 the animationDuration, 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 the stayDuration, this duration will be used.
  • TextOptions options the text options for floating text.

Example Usage

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)

Description

Displays floating text at the specified location.

Parameters

  • 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 the animationDuration, 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 the stayDuration, this duration will be used.
  • TextOptions options the text options for floating text.

Example Usage

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)

Description

Displays floating text at the specified unit.

Parameters

  • 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 the animationDuration, 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 the stayDuration, 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.

Example Usage

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) {void-HideSpeechBubbleunit-unit}

void HideSpeechBubble(unit unit)

Description

Hides a speech bubble attached to the given unit.

Parameters

  • unit unit the unit to hide the speech bubble for.

Example Usage

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)

Description

Shows the built-in status UI for the given unit in the specified slot.

Parameters

  • 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.

Example Usage

DCEI.ShowUnitStatusUiInSlot(4, unit, 1)

void SetHeroStatusUiVisibility(bool visible) {void-SetHeroStatusUiVisibilitybool-visible}

void SetHeroStatusUiVisibility(bool visible)

Description

Set Hero Status UI visible or not

Parameters

Example Usage

void HideUnitStatusUi(int id, unit unit) {void-HideUnitStatusUiint-id-unit-unit}

void HideUnitStatusUi(int id, unit unit)

Description

Hides the given built-in status UI for a given unit.

Parameters

  • 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.

Example Usage

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)

Description

Hides the given built-in status UI for a given unit, for the given player.

Parameters

  • 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.

Example Usage

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)

Description

Displays a pop-up message with a button. Displays up to 3 images.

Parameters

  • 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.

Example Usage

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)

Description

Displays a "big head" message. You can view a list of accepted images here.

Parameters

  • 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.

Example Usage

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)

Description

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.

Parameters

  • 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.

Example Usage

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() {void-HideBigHeadMessage}

void HideBigHeadMessage()

Description

Hides any big head messages.

Example Usage

DCEI.HideBigHeadMessage()

⚠️ **GitHub.com Fallback** ⚠️