HPL3/SOMA/Scripting/Scripting Api/Button

From Frictional Wiki
< HPL3‎ | SOMA‎ | Scripting‎ | Scripting Api
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

  • asName (tString) — name of button.

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

  • asName (tString) — name of button.

Returns:

  • bool—true = disabled, false = enabled.

Button_IsLocked

bool Button_IsLocked(const tString &in asName)

Checks if the button is locked.

Parameters

  • asName (tString) — name of button.

Returns:

  • bool—true = locked, false = unlocked.

Button_IsSwitchedOn

bool Button_IsSwitchedOn(const tString &in asName)

Returns true if button is currently switched on.

Parameters

  • asName (tString) — name of button.

Returns:

  • 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) — name of button.
  • abState (bool) — true = can be switched off - false = can't be switched off.

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) — name of button.
  • abState (bool) — true = can be switched on - false = can't be switched on.

Returns:

  • void

Button_SetDisabled

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

Sets the buttons disabled state

Parameters

  • asName (tString) — name of button.
  • abState (bool) — true = disabled, false = not disabled
  • abUseEffects (bool) — if color should fade in or be set instantly.

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) — name of button.
  • abState (bool) — true = locked, false = unlocked.
  • abUseEffects (bool) — if color should fade in or be set instantly.

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) — name of button.
  • abState (bool) — true = on - false = off.
  • abEffects (bool) — if the change should activate effects associated with it. If false,

Returns:

  • void