Infotext Manager

The infotext manager provides an interface for setting and managing infotext. This is the text panel that appears below the advisor and hosts text breaking down the advisor string into game terms.

Loaded in Campaign Loaded in Campaign
Loaded in Battle Loaded in Battle
Loaded in Frontend Loaded in Frontend
Back to top

Creation

infotext_manager:new()

Creates an infotext manager. It should never be necessary for client scripts to call this directly, for an infotext manager is automatically set up whenever a battle_manager or campaign_manager is created.

Returns:

  1. infotext_manager

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 52

Back to top

Usage

Once a infotext_manager object has been created with infotext_manager:new, functions on it may be called in the form showed below.

Example - Specification:

<infotext_manager_object>:<function_name>(<args>)

Example - Creation and Usage:

local im = infotext_manager:new()                        -- set up automatically by campaign or battle managers
local uic_advice_interface = im:get_uicomponent()        -- calling a function on the object once created
Back to top

UI Component

infotext_manager:get_uicomponent()

Gets a uicomponent handle to the advisor interface panel.

Returns:

  1. uicomponent uicomponent

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 186

infotext_manager:get_infotext_panel()

Gets a uicomponent handle to the infotext panel.

Returns:

  1. uicomponent uicomponent

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 194

Back to top

Attach to Advisor

infotext_manager:attach_to_advisor([boolean should attach])

Attaches or detaches the infotext panel from the advisor panel. When detached, infotext may be triggered independently of advice, and the infotext panel will not close when the advisor panel is closed.

Parameters:

1

boolean

optional, default value=true

should attach

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 211

infotext_manager:is_attached_to_advisor()

Returns whether the infotext panel is attached to the advisor.

Returns:

  1. boolean infotext is attached

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 221

infotext_manager:cache_and_set_detached_infotext_priority()

After the infotext panel is undocked, sets the priority to the supplied value, and caches the value previously set. The infotext priority can later be restored with restore_detatched_infotext_priority.
The register_topmost flag can also be set to force the infotext to topmost.

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 229

infotext_manager:restore_detatched_infotext_priority()

Restores the advisor priority to a value previously cached with cache_and_set_detached_infotext_priority.

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 252

Back to top

State Overrides

State overrides allow calling scripts to map a given line of infotext to being shown in a different component state. This is to allow certain lines of infotext to be shown in a different configuration, or with images, such as an image of WASD keys along with text instructing the player how to move the camera.

infotext_manager:set_state_override(string infotext key, string component state override)

Maps a state override to a infotext key. When an infotext entry with this key is shown, the state of the infotext line component is overriden to that supplied here. This is generally called somewhere at the start of the calling script, with the actual infotext line being shown later.

Parameters:

1

string

Infotext key

2

string

Component state override. This much match the name of a state on the infotext line component (editable in UIEd)

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 285

infotext_manager:set_button_state_override(
  
string infotext key,
  function
on-click callback,
  [function
on-display callback],
  [string
event name to disable button on]
)

Marks a advice infotext key with an override that causes a button to be shown if or when it's later displayed. After a particular infotext key is marked with this function, should that infotext be later displayed with infotext_manager:add_infotext then that infotext line will display a button instead of normal text. When the player clicks that button the supplied on-click callback is called.
Should an on-display callback be supplied to this function, that callback is called each time the infotext entry is added i.e. when the button is shown. It is passed the button uicomponent as a single argument. This callback can do processing to determine if it wants to change the state of the button e.g. make it inactive.
Should an event be supplied to this function, the button will disable when the event is received.

Parameters:

1

string

infotext key

2

function

on-click callback

3

function

optional, default value=nil

on-display callback

4

string

optional, default value=nil

event name to disable button on

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 305

Back to top

Manipulation

infotext_manager:add_infotext(... infotext string)

Adds one or more lines of infotext to the infotext panel. The infotext box will expand to the final required size and then individual infotext lines are faded on sequentially with an interval between each.

Parameters:

1

...

A vararg of one or more infotext strings to be shown. Each should be a key from the advice_info_texts database table. Alternatively, a function may be supplied, which will be called as the infotext is finished displaying.

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 356

infotext_manager:add_infotext_with_leader(... infotext string)

Adds one or more lines of infotext to the infotext panel, with a topic_leader. The first string argument will be used as the topic leader text.
The infotext box will expand to the final required size and then individual infotext lines are faded on sequentially with an interval between each.

Parameters:

1

...

A vararg of one or more infotext strings to be shown. Each should be a key from the advice_info_texts database table. Alternatively, a function may be supplied, which will be called as the infotext is finished displaying.

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 364

infotext_manager:add_infotext_simultaneously(... infotext string)

Adds one or more lines of infotext to the infotext panel. All text will appear on the infotext panel simultaneously, rather than animating on one entry at a time. The infotext box will expand to the final required size and then all infotext lines are faded on at the same time.

Parameters:

1

...

A vararg of one or more infotext strings to be shown. Each should be a key from the advice_info_texts database table. Alternatively, a function may be supplied, which will be called as the infotext is finished displaying.

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 373

infotext_manager:add_infotext_simultaneously_with_leader(... infotext string)

Adds one or more lines of infotext to the infotext panel, with a topic_leader. All text will appear on the infotext panel simultaneously, rather than animating on one entry at a time. The first string argument will be used as the topic leader text.
The infotext box will expand to the final required size and then individual infotext lines are faded on sequentially with an interval between each.

Parameters:

1

...

A vararg of one or more infotext strings to be shown. Each should be a key from the advice_info_texts database table. Alternatively, a function may be supplied, which will be called as the infotext is finished displaying.

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 381

infotext_manager:remove_infotext(string infotext key)

Removes a line of infotext from the infotext panel, by key.

Parameters:

1

string

infotext key

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 679

infotext_manager:clear_infotext()

Clears all infotext from the infotext panel.

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 689

infotext_manager:set_auto_clear_timer(
  
number seconds,
  [boolean
should_dismiss_advice_on_infotext_auto_hide_time_elapsed]
)

Clears all infotexts after the specified time. Mouse over the infotext panel will freeze the timer. A value <= 0 will cancel any current timer

Parameters:

1

number

seconds

2

boolean

optional, default value=false

should_dismiss_advice_on_infotext_auto_hide_time_elapsed

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 700

infotext_manager:hide_infotext()

Hides all infotext from the infotext panel with an animation.

Returns:

  1. nil

defined in ../../Warhammer/working_data/script/_lib/lib_infotext.lua, line 713

Last updated 8/23/2024 4:55:15 PM