Apps Lua API: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
(Created page with "<!-- This file is auto generated, please don't edit manually! --> = Animator = == Description == Allows the user to set properties of a mission objects Unity animator The...")
 
mNo edit summary
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!-- This file is auto generated, please don't edit manually! -->
<!-- This file is auto generated, please don't edit manually! -->
= Animator =
= Apps =
== Description ==
== Description ==
Allows the user to set properties of a mission objects Unity animator
The Apps API allows modders to control Apps
The animator allows users to set key keyframe-able animations to control a large amount of components.
See [[https://docs.unity3d.com/Manual/class-Animator.html Unity's documentation]] for more details
== Functions ==
== Functions ==
=== SetBool ===
=== RequestAppState ===
<syntaxhighlight source lang="lua">Animator.SetBool(missionObjectName, parameterName, value)</syntaxhighlight>
<syntaxhighlight source lang="lua">Apps.RequestAppState(appName, newState)</syntaxhighlight>
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
Line 13: Line 11:
! Name !! Type
! Name !! Type
|-
|-
| missionObjectName || string
| appName || string
|-
|-
| parameterName || string
| newState || OffGridApp+AppStates
|-
| value || bool
|}
|}
'''Description''': Sets a bool parameter by name
'''Description''': Ask an App to change it's state


'''Returns''': Nothing
'''Returns''': Nothing


=== SetFloat ===
== Global Functions ==
<syntaxhighlight source lang="lua">Animator.SetFloat(missionObjectName, parameterName, value)</syntaxhighlight>
=== SetState ===
<syntaxhighlight source lang="lua">SetState(newState)</syntaxhighlight>
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
Line 30: Line 27:
! Name !! Type
! Name !! Type
|-
|-
| missionObjectName || string
| newState || OffGridApp+AppStates
|-
| parameterName || string
|-
| value || number
|}
|}
'''Description''': Sets a float parameter by name
'''Description''': Sets the App's state.


'''Returns''': Nothing
'''Returns''': Nothing


=== SetInt ===
=== CreateStatusWindow ===
<syntaxhighlight source lang="lua">Animator.SetInt(missionObjectName, parameterName, value)</syntaxhighlight>
<syntaxhighlight source lang="lua">CreateStatusWindow()</syntaxhighlight>
'''Expected parameter types'''
'''Description''': Create the status window
{| class="wikitable"
 
|-
'''Returns''': Nothing
! Name !! Type
 
|-
=== RemoveStatusWindow ===
| missionObjectName || string
<syntaxhighlight source lang="lua">RemoveStatusWindow()</syntaxhighlight>
|-
'''Description''': Remove this app's status window
| parameterName || string
|-
| value || number
|}
'''Description''': Sets a int parameter by name


'''Returns''': Nothing
'''Returns''': Nothing


=== SetTrigger ===
=== DisplayStatusWindow ===
<syntaxhighlight source lang="lua">Animator.SetTrigger(missionObjectName, parameterName)</syntaxhighlight>
<syntaxhighlight source lang="lua">DisplayStatusWindow(enabled)</syntaxhighlight>
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
Line 64: Line 52:
! Name !! Type
! Name !! Type
|-
|-
| missionObjectName || string
| enabled || bool
|-
| parameterName || string
|}
|}
'''Description''': Begins a trigger parameter by name
'''Description''': Show or hide the app's status window.


'''Returns''': Nothing
'''Returns''': Nothing


=== GetBool ===
'''Notes''': Make sure to to create the window first ;)
<syntaxhighlight source lang="lua">Animator.GetBool(missionObjectName, parameterName)</syntaxhighlight>
=== UpdateStatusWindow ===
<syntaxhighlight source lang="lua">UpdateStatusWindow(text)</syntaxhighlight>
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
Line 79: Line 66:
! Name !! Type
! Name !! Type
|-
|-
| missionObjectName || string
| text || string
|-
| parameterName || string
|}
|}
'''Description''': Gets the current value of a bool parameter by name
'''Description''': Update the text content of the app's status window


'''Returns''': The current bool value of the parameter
'''Returns''': Nothing


=== GetFloat ===
=== SetStatusIcon ===
<syntaxhighlight source lang="lua">Animator.GetFloat(missionObjectName, parameterName)</syntaxhighlight>
<syntaxhighlight source lang="lua">SetStatusIcon(id)</syntaxhighlight>
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
Line 94: Line 79:
! Name !! Type
! Name !! Type
|-
|-
| missionObjectName || string
| id || number
|-
| parameterName || string
|}
|}
'''Description''': Gets the current value of a float parameter by name
'''Description''': Set the icon used for the app's status window


'''Returns''': The current float value of the parameter
'''Returns''': Nothing


=== GetInt ===
'''Notes''': ID should match with an image in your app definition's 'statusIcons' table.
<syntaxhighlight source lang="lua">Animator.GetInt(missionObjectName, parameterName)</syntaxhighlight>
=== SetStatusIconColor ===
<syntaxhighlight source lang="lua">SetStatusIconColor(color)</syntaxhighlight>
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
Line 109: Line 93:
! Name !! Type
! Name !! Type
|-
|-
| missionObjectName || string
| color || Lua Type
|-
| parameterName || string
|}
|}
'''Description''': Gets the current value of a int parameter by name
'''Description''': Set the color of the status window icon


'''Returns''': The current int value of the parameter
'''Returns''': Nothing




Line 121: Line 103:
This file is auto generated, please don't edit manually!
This file is auto generated, please don't edit manually!


'''Docs last hacked together on''': 06/09/2018 14:53
'''Docs last hacked together on''': 23/07/2020 11:58
[[Category:Modding]][[Category:LuaAPI]]
[[Category:Modding]][[Category:LuaAPI]]

Revision as of 12:21, 23 July 2020

Apps

Description

The Apps API allows modders to control Apps

Functions

RequestAppState

Apps.RequestAppState(appName, newState)

Expected parameter types

Name Type
appName string
newState OffGridApp+AppStates

Description: Ask an App to change it's state

Returns: Nothing

Global Functions

SetState

SetState(newState)

Expected parameter types

Name Type
newState OffGridApp+AppStates

Description: Sets the App's state.

Returns: Nothing

CreateStatusWindow

CreateStatusWindow()

Description: Create the status window

Returns: Nothing

RemoveStatusWindow

RemoveStatusWindow()

Description: Remove this app's status window

Returns: Nothing

DisplayStatusWindow

DisplayStatusWindow(enabled)

Expected parameter types

Name Type
enabled bool

Description: Show or hide the app's status window.

Returns: Nothing

Notes: Make sure to to create the window first ;)

UpdateStatusWindow

UpdateStatusWindow(text)

Expected parameter types

Name Type
text string

Description: Update the text content of the app's status window

Returns: Nothing

SetStatusIcon

SetStatusIcon(id)

Expected parameter types

Name Type
id number

Description: Set the icon used for the app's status window

Returns: Nothing

Notes: ID should match with an image in your app definition's 'statusIcons' table.

SetStatusIconColor

SetStatusIconColor(color)

Expected parameter types

Name Type
color Lua Type

Description: Set the color of the status window icon

Returns: Nothing


This file is auto generated, please don't edit manually!

Docs last hacked together on: 23/07/2020 11:58