Giter VIP home page Giter VIP logo

swbf2-lua-api's Introduction

Lua API for Star Wars Battlefront II

Features

This repository includes documentation extensions for virtually every single built-in Lua function in Star Wars Battlefront II (2005). The only ones that are currently undocumented are many of the shell-exclusive callbacks, but there is pretty much no use for those anyway. Currently there exists an extension for Lua Development Tools (as a .doclua file) and Visual Studio Code (as a marketplace extension).

Because each IDE uses a different documentation framework, the features for each IDE differ slightly (see below).

Items that are bolded are identical across each IDE.

Lua Development Tools

Function snippet example

Currently included

  • IntelliSense-like function auto-completion. (finicky)
  • Each function includes a description of what it does - some include thorough use-case examples.
  • Functions with return values include descriptions of each return value.
  • Function parameters are documented with their name, data type, and description.
  • Snippets for all event callbacks (such as OnCharacterSpawn).

Not yet included

  • Nothing off the top of my head. ;-)

Visual Studio Code

Event callback snippet example

Currently included

  • IntelliSense-like function auto-completion.
  • Each function includes a description of what it does - some include thorough use-case examples.
  • Functions with parameters include auto-completion for each parameter.
  • Parameters with predetermined values have dropdown-based value auto-fill.
  • Functions with multiple return values include descriptions of each return value.
  • Snippets for all event callbacks (such as OnCharacterSpawn) - furthermore, each snippet includes auto-completion that sets up the callback's lambda function (e.g., 'function(object, killer)' for 'OnObjectKill') and instance values.

Not yet included

  • Parameter descriptions - this is largely because VSCode does not yet seem to support individual parameter descriptions.

Install

Lua Development Tools

Save API\LuaDevelopmentTools\Battlefront2API.doclua (v1.0.0, latest) (right-click link & Save As) to the root of your project's source folder (or data_***\Common\scripts).

When saving the file, make sure the file extension is .doclua and not .doclua.txt!

Visual Studio Code

  1. Go to the extension's page on the Visual Studio Marketplace
  2. Click the Install button
  3. If you're prompted to allow Visual Studio Code to open, confirm the prompt
  4. Once Visual Studio Code has opened, click the Install button, then the Enable button

OR

  1. Open Visual Studio Code
  2. Press Ctrl+P to open the Quick Open dialog
  3. Type ext install vscode-swbf2-lua-api to find the extension
  4. Click the Install button, then the Enable button

OR

  1. Press Ctrl+Shift+X to open the Extensions tab
  2. Type vscode-swbf2-lua-api to find the extension
  3. Click the Install button, then the Enable button

OR

  1. Open a command-line prompt
  2. Run code --install-extension aarongilbert2012.vscode-swbf2-lua-api

Issues

If you think there are any missing or incorrectly-documented functions/parameters/return values, please file a bug report.

Contributing

Please feel free to help out with the extensions if you'd like! Simply fork/clone the repo (.git link), make your changes, and submit a pull request.

Some notes:

  • The VSCode extension directory is at API\VSCode
  • The LDT extension directory is at API\LuaDevelopmentTools
  • The file containing all of the VSCode snippets is at API\VSCode\snippets\snippets.json
  • The file containing all of the LDT snippets is at API\LuaDevelopmentTools\Battlefront2API.doclua
  • Documentation for creating VSCode snippets can be found HERE
  • Documentation for creating LuaDoc (LDT) snippets can be found HERE

swbf2-lua-api's People

Contributors

bad-al avatar marth8880 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

yonilerner

swbf2-lua-api's Issues

Verify LuaDoc API is up-to-date

While documenting the functions for VSCode, I noticed a number of incorrect descriptions/parameter names with some functions. I've corrected some of them, but I need to do another pass over it again to make sure.

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.