SimulationUtil

Meta utility functions for simulation layer.

AttemptToReplaceUnitWithUnitRef

function SimulationUtil.AttemptToReplaceUnitWithUnitRef(args: any, unit_key: any, unit_ref_key: any)

TalentPage

The UI page for a talent picking system similar to the one in Habby games like Archero.

AttemptDestroyTooltip

(method) TalentPage:AttemptDestroyTooltip()

GetLayout

(method) TalentPage:GetLayout()
  -> unknown

GetTalentList

(method) TalentPage:GetTalentList()
  -> unknown

GetTalentPurchaseCallback

(method) TalentPage:GetTalentPurchaseCallback()
  -> unknown

New

(method) TalentPage:New(args: any)
  -> unknown

SetProperties

(method) TalentPage:SetProperties(args: any)

layout

unknown

hookup interal properties

talent_list

unknown

talent_purchase_callback

unknown

tooltip_layout

unknown

hookup global reference


TalentSystem

The data systems for a talent picking system similar to the one in Habby games like Archero.

GetTalentCost

(method) TalentSystem:GetTalentCost(index: any)

GetTalentDataFromIndex

(method) TalentSystem:GetTalentDataFromIndex(index: any)
  -> unknown

Initialize

(method) TalentSystem:Initialize(args: any)

METHODS

data

unknown

is_initialized

boolean

progression

unknown

upgrade_cost

unknown

TutorialBigHand

Creates an animated big hand on either a unit or a frame.
Useful for creating in-game tutorials to prompt user input.
This module can be used in either Simulation or Presentation.

AnimateBetweenTargets

function TutorialBigHand.AnimateBetweenTargets(args: _BigHandBetweenTargetOptions)

Creates a big hand that animates between two objects (such as units, frames, or world positions).
This is useful for illustrating a "tap and drag" motion to users.

Create

function TutorialBigHand.Create(args: _BigHandOptions)

Creates an animated big hand on either a unit, frame, or world position.
Useful for creating in-game tutorials to prompt user input.
Example Usage:

-- big hand on free tutorial cosmetic
function TutorialSystem()
    GMUI.TutorialBigHand.DismissOldest()
    GMUI.RunPresentationFunction("BlockUserInput", "tutorial")

    -- wait a delay for pacing
    local delay = 0.125
    DCEI.TriggerAddTimerEventElapsed(function()
        -- set big hand on free tutorial cosmetic
        local frame_address = "ui.meta.profile_page.TutorialPurchaseButton"

        -- need to wait for UI update to set target frame in ProfilePage
        DCEI.WaitForUiUpdateToComplete(function()
            GMUI.RunPresentationFunction("BlockUserInputExcept", { whitelist_frame_address = frame_address })
            GMUI.TutorialBigHand.Create({ frame_address = frame_address, y_offset = -32 })
        end)
    end, delay, true, true)
end

DestroyOldest

function TutorialBigHand.DestroyOldest()

Instantly destroys the oldest big hand, without playing an animation.

DismissOldest

function TutorialBigHand.DismissOldest()

Dismisses the oldest big hand created, playing a disappearing animation.


TutorialSpotlight

Used for creating a spotlight effect on either a unit or a frame. Useful for creating in-game tutorials to focus user attention
This module can be used in either Simulation or Presentation.

Create

function TutorialSpotlight.Create(args: _SpotlightOptions, OnContinueCallback?: function)

Creates a spotlight effect on either a unit or a frame. Runs the 'OnContinueCallback' when any user input is given.
Useful for creating in-game tutorials to focus user attention

@param OnContinueCallback — Function to run when user taps to continue.


Util

Meta utility functions.

AssignListToTableByKey

function Util.AssignListToTableByKey(list: any, key: any)
  -> table

returns a reference table from a list using the provided list item key

GetNonLinearGrowthValue

function Util.GetNonLinearGrowthValue(growth_data: any, level: any)
  -> integer

returns a value from a non-linear growth table and level
ex, the following growth table would return
local upgrade_cost = { { level = 1, growth = 100 }, { level = 5, growth = 150 }, { level = 10, growth = 250 } }


_BigHandBetweenTargetOptions

duration

number

Used to set the duration of the animation. If no duration is specified, 1.5 seconds will be used.

end_frame

InGameUILayoutComponent

The frame to animate to.

end_frame_address

string

The address of the frame to animate to.

end_position

{ x: number, z: number }

The world position (using XZ coordinates such as {x = 16, z = 16}) to animate to.

end_unit

Unit

The unit to animate to.

end_x_offset

number

Horizontal end offset for the big hand.

end_y_offset

number

Vertical end offset for the big hand.

flip_x

boolean

Horizontal flip/mirror for the big hand.

flip_y

boolean

Vertical flip/mirror for the big hand.

loop_type

"Restart"|"Yoyo"

Choose the loop type. If no loop type is specified, Restart will be used. For loop types and how they function, see SetFrameAnimationLoops().

play_once

boolean

If true, the animation will only play once. If false, the animation will loop.

scale

number

Scale multiplier to increase/decrease the size of the big hand.

start_frame

InGameUILayoutComponent

The frame to animate from.

start_frame_address

string

The address of the frame to animate from.

start_position

{ x: number, z: number }

The world position (using XZ coordinates such as {x = 16, z = 16}) to animate from.

start_unit

Unit

The unit to animate from.

start_x_offset

number

Horizontal start offset for the big hand.

start_y_offset

number

Vertical start offset for the big hand.


_BigHandOptions

flip_x

boolean

Horizontal flip/mirror for the big hand.

flip_y

boolean

Vertical flip/mirror for the big hand.

frame

InGameUILayoutComponent

The frame to attach the big hand to (use this when calling from presentation).

frame_address

string

The path of a UI frame to attach the big hand to, Ex. "ui.meta.profile_page.TutorialPurchaseButton" (use this when calling from simulation).

scale

number

Scale multiplier to increase/decrease the size of the big hand.

skip_animation

boolean

By default, the big hand will move up and down pointing at the target frame or unit. If this is set to true, however, this animation won't play.

unit

Unit

Unit to attach the big hand to, if not attaching to a frame.

world_position

{ x: number, z: number }

The world position (using XZ coordinates such as {x = 16, z = 16}) to attach the big hand to, if not attaching to a frame or unit.

x_offset

number

Horizontal offset for the big hand.

y_offset

number

Vertical offset for the big hand.


_SpotlightOptions

frame

InGameUILayoutComponent

The frame to attach the big hand to (use this when calling from presentation).

frame_address

string

The path of a UI frame to attach the big hand to, Ex. "ui.meta.profile_page.TutorialPurchaseButton" (use this when calling from simulation).

scale

number

Multiplier to increase or decrease the size of the spotlight effect

spotlight_offset

number

y (vertical) offset for the spotlight effect

tap_to_continue_offset

number

y (vertical) offset for the "tap to continue"

tip_offset

number

y (vertical) offset for the spotlight tip text

tip_text

string

Text to display along with the spotlight effect

unit

Unit

A unit to attach the spotlight to, if not using frame_address