Apps Lua API: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
= Apps =
= Apps =
== Description ==
== Description ==
App VM
The Apps API allows modders to control Apps
== Functions ==
=== RequestAppState ===
<syntaxhighlight source lang="lua">Apps.RequestAppState(appName, newState)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| appName || string
|-
| newState || OffGridApp+AppStates
|}
'''Description''': Ask an App to change it's state
 
'''Returns''': Nothing
 
== Global Functions ==
== Global Functions ==
=== SetState ===
=== SetState ===
Line 87: 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''': 15/11/2019 14:59
'''Docs last hacked together on''': 13/10/2021 15:55
[[Category:Modding]][[Category:LuaAPI]]
[[Category:Modding]][[Category:LuaAPI]]

Revision as of 09:08, 14 October 2021

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: 13/10/2021 15:55