HPL3/SOMA/Scripting/Scripting Api/MovingButton

From Frictional Wiki
< HPL3‎ | SOMA‎ | Scripting‎ | Scripting Api
Revision as of 21:57, 24 August 2020 by Abion47 (talk | contribs) (Created page with "{{ScriptingStub}} Have some helpful descriptions to add to this class? Edit this page and add your insight to the Wiki! ==Summary== {{CodeDocSummaryTop}} {{CodeDocSummaryIte...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 MovingButton_Blink(const tString &in asName)
Makes the MovingButton blink in accordance to how it is set up in the ent file
float MovingButton_GetStateAmount(const tString &in asName)
Returns the current state of the MovingButton
bool MovingButton_IsDisabled(const tString &in asName)
Checks if the MovingButton is disabled (will not light up or respond to presses)
bool MovingButton_IsLocked(const tString &in asName)
Checks if the MovingButton is locked
bool MovingButton_IsSwitchedOn(const tString &in asName)
Returns the state of the button, on/off
void MovingButton_SetCanBeSwitchedOff(const tString &in asName, bool abState)
Sets if the moving button can be switched off by the player or not
void MovingButton_SetCanBeSwitchedOn(const tString &in asName, bool abState)
Sets if the moving button can be switched on by the player or not
void MovingButton_SetDisabled(const tString &in asName, bool abState, bool abUseEffects = true)
Sets the MovingButtons disabled state
void MovingButton_SetLocked(const tString &in asName, bool abState, bool abUseEffects = true)
Sets the MovingButtons locked state
void MovingButton_SetReturnToOffTime(const tString &in asName, float afTime)
Sets the time it should take for the button to return to its off state
void MovingButton_SetSwitchedOn(const tString &in asName, bool abState, bool abEffects)
Switches a button on/off

Function Detail

MovingButton_Blink

void MovingButton_Blink(const tString &in asName)

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

Parameters

  • asName (tString) — name of MovingButton.

Returns:

  • void

MovingButton_GetStateAmount

float MovingButton_GetStateAmount(const tString &in asName)

Returns the current state of the MovingButton

Parameters

  • asName (tString) — name of MovingButton.

Returns:

  • float

MovingButton_IsDisabled

bool MovingButton_IsDisabled(const tString &in asName)

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

Parameters

  • asName (tString) — name of MovingButton.

Returns:

  • bool—true = disabled, false = enabled.

MovingButton_IsLocked

bool MovingButton_IsLocked(const tString &in asName)

Checks if the MovingButton is locked.

Parameters

  • asName (tString) — name of MovingButton.

Returns:

  • bool—true = locked, false = unlocked.

MovingButton_IsSwitchedOn

bool MovingButton_IsSwitchedOn(const tString &in asName)

Returns the state of the button, on/off.

Parameters

  • asName (tString) — name of button.

Returns:

  • bool—true = on - false = off.

MovingButton_SetCanBeSwitchedOff

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

Sets if the moving 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

MovingButton_SetCanBeSwitchedOn

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

Sets if the moving 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

MovingButton_SetDisabled

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

Sets the MovingButtons disabled state

Parameters

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

Returns:

  • void

MovingButton_SetLocked

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

Sets the MovingButtons locked state

Parameters

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

Returns:

  • void

MovingButton_SetReturnToOffTime

void MovingButton_SetReturnToOffTime(const tString &in asName,
                                     float afTime)

Sets the time it should take for the button to return to its off state.

Parameters

  • asName (tString) — name of button.
  • afTime (float) — time to return to off state.

Returns:

  • void

MovingButton_SetSwitchedOn

void MovingButton_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