Difference between revisions of "Apps Lua API"

From Off Grid Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
<!-- This file is auto generated, please don't edit manually! -->
 
<!-- This file is auto generated, please don't edit manually! -->
= Apps =
+
= Apps_Lua_API =
 
== Description ==
 
== Description ==
App VM
+
The Apps API allows modders to control Apps
== Global Functions ==
+
== Functions ==
=== SetState ===
+
=== RequestAppState ===
<syntaxhighlight source lang="lua">SetState(newState)</syntaxhighlight>
+
<syntaxhighlight source lang="lua">Apps_Lua_API.RequestAppState(appName, newState)</syntaxhighlight>
 
'''Expected parameter types'''
 
'''Expected parameter types'''
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Name !! Type
 
! Name !! Type
 +
|-
 +
| appName || string
 
|-
 
|-
 
| newState || OffGridApp+AppStates
 
| newState || OffGridApp+AppStates
 
|}
 
|}
'''Description''': Sets the App's state.
+
'''Description''': Ask an App to change it's state
 
 
'''Returns''': Nothing
 
 
 
=== CreateStatusWindow ===
 
<syntaxhighlight source lang="lua">CreateStatusWindow()</syntaxhighlight>
 
'''Description''': Create the status window
 
 
 
'''Returns''': Nothing
 
 
 
=== RemoveStatusWindow ===
 
<syntaxhighlight source lang="lua">RemoveStatusWindow()</syntaxhighlight>
 
'''Description''': Remove this app's status window
 
 
 
'''Returns''': Nothing
 
 
 
=== DisplayStatusWindow ===
 
<syntaxhighlight source lang="lua">DisplayStatusWindow(enabled)</syntaxhighlight>
 
'''Expected parameter types'''
 
{| class="wikitable"
 
|-
 
! 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 ===
 
<syntaxhighlight source lang="lua">UpdateStatusWindow(text)</syntaxhighlight>
 
'''Expected parameter types'''
 
{| class="wikitable"
 
|-
 
! Name !! Type
 
|-
 
| text || string
 
|}
 
'''Description''': Update the text content of the app's status window
 
 
 
'''Returns''': Nothing
 
 
 
=== SetStatusIcon ===
 
<syntaxhighlight source lang="lua">SetStatusIcon(id)</syntaxhighlight>
 
'''Expected parameter types'''
 
{| class="wikitable"
 
|-
 
! 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 ===
 
<syntaxhighlight source lang="lua">SetStatusIconColor(color)</syntaxhighlight>
 
'''Expected parameter types'''
 
{| class="wikitable"
 
|-
 
! Name !! Type
 
|-
 
| color || Lua Type
 
|}
 
'''Description''': Set the color of the status window icon
 
  
 
'''Returns''': Nothing
 
'''Returns''': Nothing

Revision as of 15:29, 16 November 2019

Apps_Lua_API

Description

The Apps API allows modders to control Apps

Functions

RequestAppState

Apps_Lua_API.RequestAppState(appName, newState)

Expected parameter types

Name Type
appName string
newState OffGridApp+AppStates

Description: Ask an App to change it's state

Returns: Nothing


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

Docs last hacked together on: 15/11/2019 14:59