HPL3/Amnesia: Rebirth/Scripting/Scripting Api/Button

From Frictional Wiki
Jump to navigation Jump to search

Have some helpful descriptions to add to this class? Edit this page and add your insight to the Wiki!

Summary

Return Type Function and Description
void Button_Blink(const tString &in asName)
Makes the button blink in accordance to how it is set up in the ent file
bool Button_IsDisabled(const tString &in asName)
Checks if the button is disabled (will not light up or respond to presses)
bool Button_IsLocked(const tString &in asName)
Checks if the button is locked
bool Button_IsSwitchedOn(const tString &in asName)
Returns true if button is currently switched on
void Button_SetCanBeSwitchedOff(const tString &in asName, bool abState)
Sets if the button can be switched off by the player or not
void Button_SetCanBeSwitchedOn(const tString &in asName, bool abState)
Sets if the button can be switched on by the player or not
void Button_SetDisabled(const tString &in asName, bool abState, bool abUseEffects = true)
Sets the buttons disabled state
void Button_SetLocked(const tString &in asName, bool abState, bool abUseEffects = true)
Sets the button's locked state
void Button_SetSwitchedOn(const tString &in asName, bool abState, bool abEffects)
Switches a button on/off

Function Detail

Button_Blink

void Button_Blink(const tString &in asName)

Makes the button blink in accordance to how it is set up in the ent file.

Parameters

Returns:

  • void

Button_IsDisabled

bool Button_IsDisabled(const tString &in asName)

Checks if the button is disabled (will not light up or respond to presses).

Parameters

Returns:

  • bool—bool, true = disabled, false = enabled.

Button_IsLocked

bool Button_IsLocked(const tString &in asName)

Checks if the button is locked.

Parameters

Returns:

  • bool—bool, true = locked, false = unlocked.

Button_IsSwitchedOn

bool Button_IsSwitchedOn(const tString &in asName)

Returns true if button is currently switched on.

Parameters

Returns:

  • bool—bool, if the button is switched on.

Button_SetCanBeSwitchedOff

void Button_SetCanBeSwitchedOff(const tString &in asName,
                                bool abState)

Sets if the button can be switched off by the player or not

Parameters

  • asName (tString) —
  • abState (bool) —

Returns:

  • void

Button_SetCanBeSwitchedOn

void Button_SetCanBeSwitchedOn(const tString &in asName,
                               bool abState)

Sets if the button can be switched on by the player or not

Parameters

  • asName (tString) —
  • abState (bool) —

Returns:

  • void

Button_SetDisabled

void Button_SetDisabled(const tString &in asName,
                        bool abState,
                        bool abUseEffects = true)

Sets the buttons disabled state

Parameters

  • asName (tString) —
  • abState (bool) —
  • abUseEffects (bool) —

Returns:

  • void

Button_SetLocked

void Button_SetLocked(const tString &in asName,
                      bool abState,
                      bool abUseEffects = true)

Sets the button's locked state

Parameters

  • asName (tString) —
  • abState (bool) —
  • abUseEffects (bool) —

Returns:

  • void

Button_SetSwitchedOn

void Button_SetSwitchedOn(const tString &in asName,
                          bool abState,
                          bool abEffects)

Switches a button on/off.
the change will not be apparent to the player.

Parameters

  • asName (tString) —
  • abState (bool) —
  • abEffects (bool) —

Returns:

  • void