Giter VIP home page Giter VIP logo

deltaxplugin's Introduction

Delta Version X Plugin Library

This is the Delta X APIs for your custom features.

You can view the sample code here.

Getting Started

To access it, we have exposed a global table called delta. You can use getgenv().delta or simply delta to access it.

getgenv().delta
-- This is table that can be use to access the plugin functions.

This table contains sections and methods that can be called.

Adding a Tab

To add a tab to the main menu, you can use the following code:

delta:AddTab("Name", "--Text In Textbox")

Example:

example

Note: New tab will auto focussed/opened

Adding a Suggestion Script

In Delta, we have a script suggestion feature in the main menu, but you can customize it. Here's an example:

delta:SetCurrentSuggestionScript("Name", "Description", function()
  print("Clicked!")
end)

Example:

example

NOTE: Currently not available.

Saved Scripts (Adding a Script to the Local Script Section)

To add a script to the local saved script section, you can use the following code:

delta:SaveScript("Name", "print('hi')", "Tag")

Example:

example

NOTE: This only adds the script in Delta local script menu and it won't be saved. To save it, use writefile() to create a file and add it to local storage. The saved scripts file should be placed in workspace/d_android_script_dir.

Settings

This section is for configuring the plugin settings.

Adding a Button

To add a button for your plugin, you can include the following code in your plugin:

delta.Settings:AddButton("Print Hello", "Prints 'Hello' in your console.", function()
  print("Hello")
end)

Example:

example

Adding a Switch

To add a switch for your plugin, you can include the following code in your plugin:

delta.Settings:AddSwitch("Toggle", "Just a toggle.", false, function(state)
  if state then
    print("Enabled")
  else
    print("Disabled")
  end
end)

Example:

example

NOTE: The state argument in the function is a boolean that represents whether it is enabled or not. The false boolean at the third argument represents whether it is enabled by default or not.

Adding an Input

To add an input for your plugin, you can include the following code in your plugin:

delta.Settings:AddInput("Print Input", "Prints what you put in your textbox.", function(text)
  print(text)
end)

Example:

example

NOTE: The text argument represents the text from the user input.

Adding a Dropdown

To add a dropdown for your plugin, you can include the following code in your plugin:

delta.Settings:AddDropdown("Dropdown", "Just custom features for the plugin", "Nothing!", {"1", "2", "3"}, function(selected)
  if selected == "1" then
    print("It's One!")
  elseif selected == "2" then
    print("It's Two!")
  elseif selected == "3" then
    print("It's Three!")
  end
end)

Example:

example

How to Install the Plugin?

It's simple. The plugin code is executed, so anything inside your plugin code will be executed.

Where is the Folder for the Delta Plugin Saved and Executed?

The folder for the Delta Plugin is saved and executed at workspace/DeltaPlugins. Anything that was file in that folder going to executed.

Credits

This was made by the DeltaTeam, especially 1tsfvckinglxnny and .chill.z..

deltaxplugin's People

Contributors

azysgithub avatar

Stargazers

 avatar  avatar dragon xz cay avatar  avatar EULER  avatar

Watchers

 avatar  avatar

Forkers

jayshubi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.