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 170

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 180

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 199

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 210

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 219

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 242

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 274

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 294

Back to top

Manipulation

infotext_manager:add_infotext(object first param, ... additional infotext strings)

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. The first argument may optionally be an initial delay - this is useful when triggering infotext at the same time as advice, as it gives the advisor an amount of time to animate on-screen before infotext begins to display, which looks more refined.

Parameters:

1

object

Can be a string key from the advice_info_texts table, or a number specifying an initial delay (ms in battle, s in campaign) after the panel animates onscreen and the first infotext item is shown.

2

...

Additional infotext strings to be shown. add_infotext fades each of them on to the infotext panel in a visually-pleasing sequence.

Returns:

  1. nil

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

infotext_manager:add_infotext_with_leader(object first param, ... additional infotext strings)

Adds one or more lines of infotext to the infotext panel, with a topic_leader. The infotext box will expand to the final required size and then individual infotext lines are faded on sequentially with an interval between each. The first argument may optionally be an initial delay - this is useful when triggering infotext at the same time as advice, as it gives the advisor an amount of time to animate on-screen before infotext begins to display, which looks more refined.

Parameters:

1

object

Can be a string key from the advice_info_texts table, or a number specifying an initial delay (ms in battle, s in campaign) after the panel animates onscreen and the first infotext item is shown.

2

...

Additional infotext strings to be shown. add_infotext fades each of them on to the infotext panel in a visually-pleasing sequence.

Returns:

  1. nil

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

infotext_manager:add_infotext_simultaneously(object first param, ... additional infotext strings)

Adds one or more lines of infotext to the infotext panel, simultaneously. The infotext box will expand to the final required size and then all infotext lines are faded on at the same time. The first argument may optionally be an initial delay - this is useful when triggering infotext at the same time as advice, as it gives the advisor an amount of time to animate on-screen before infotext begins to display, which looks more refined.

Parameters:

1

object

Can be a string key from the advice_info_texts table, or a number specifying an initial delay (ms in battle, s in campaign) after the panel animates onscreen and the first infotext item is shown.

2

...

Additional infotext strings to be shown. add_infotext fades each of them on to the infotext panel in a visually-pleasing sequence.

Returns:

  1. nil

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

infotext_manager:add_infotext_simultaneously_with_leader(
  object
first param,
  ...
additional infotext strings
)

Adds one or more lines of infotext to the infotext panel, simultaneously, and with a topic_leader. The infotext box will expand to the final required size and then all infotext lines are faded on simultaneously. The first argument may optionally be an initial delay - this is useful when triggering infotext at the same time as advice, as it gives the advisor an amount of time to animate on-screen before infotext begins to display, which looks more refined.

Parameters:

1

object

Can be a string key from the advice_info_texts table, or a number specifying an initial delay (ms in battle, s in campaign) after the panel animates onscreen and the first infotext item is shown.

2

...

Additional infotext strings to be shown. add_infotext fades each of them on to the infotext panel in a visually-pleasing sequence.

Returns:

  1. nil

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

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 656

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 668

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 681

Last updated 12/08/2022 11:56:59