Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hiraeeth/gamesense-menu
Object oriented gamesense menu system
https://github.com/hiraeeth/gamesense-menu
Last synced: about 2 months ago
JSON representation
Object oriented gamesense menu system
- Host: GitHub
- URL: https://github.com/hiraeeth/gamesense-menu
- Owner: hiraeeth
- License: gpl-3.0
- Created: 2024-01-02T01:36:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-23T00:34:40.000Z (9 months ago)
- Last Synced: 2024-04-23T01:45:00.115Z (9 months ago)
- Language: Lua
- Size: 28.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Object Oriented GameSense Menu System
The primary component is the `menu` table, which contains various functions and properties to handle menu elements.# How to use it?
> Import the library
```
local menu = require("menu")
```> Create an element
```
local test = menu.combobox("CONFIG", "LUA", "Hello", {"test", "hello", "baby"})
```> Acces the functions
```
print(test:contains("test"))
print(test.args) -- TABLE: {"CONFIG", "LUA", "Hello", {"test", "hello", "baby"}}
print(test) -- element::combobox[3](Hello)
```# get
> Returns the value of the menu element.
### Usage:
```
element:get()
```# set
> Sets the value of the menu element.
### Usage:
```
element:set(any: ...)
```# reference
> Returns a reference to the menu element.
### Usage:
```
element:reference()
```# set_visible
> Sets the visibility of the menu element.
### Usage:
```
element:set_visible(boolean: value_to_set)
```# set_enabled
> Sets the enabled status of the menu element.
### Usage:
```
element:set_enabled(boolean: value_to_set)
```# set_callback
> Sets a callback for the menu element.
### Usage:
```
element:set_callback(void: function(element: reference, number: original))
```# name
> Returns the name of the menu element.
### Usage:
```
element:name(boolean?: original)
```# type
> Returns the type of the menu element as a string.
### Usage:
```
element:type()
```# list
> Returns the list of values of the menu element or nil if not a table.
### Usage:
```
element:list()
```# depend
> Handles dependencies of the menu element.
### Usage:
```
element:depend(element: menu_element)
```
# update
> Updates the menu element with new values.
### Usage:
```
element:update(any: ...)
```# contains
> Checks if an element contains a specific value.
### Usage:
```
element:contains(any: value)
```---
*Note: These functions are accessed using the `:` operator.*
*You can also access other properties like **args**, **dependency** and **is_visible** by using the `.` operator.*