FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

CCDirectLink/input-api: CrossCode mod which allows other mods to add rebindable key bindings. · GitHub

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

input-api

This mod allows other mods to add rebindable key bindings.

Guide for modders

Adding your input actions is incredibly simple. Firstly, you have to define an option in sc.OPTIONS_DEFINITION (as you normally would) which will be written to the save file and show up in the "Controls" tab:

// it is recommended to do this in either `postload` or `prestart`
sc.OPTIONS_DEFINITION['keys-jump'] = {
  type: 'CONTROLS',
  init: { key1: ig.KEY.CTRL, key2: undefined },
  cat: sc.OPTION_CATEGORY.CONTROLS,
};

And after that you have to add a localized label for your key binding:

// there are other ways to do this, but here is the simplest
// you have to put this in `main`
ig.lang.labels.sc.gui.options.controls.keys.jump = 'Jump';

A good example of using this mod can be seen in the Jetpack mod.

About

CrossCode mod which allows other mods to add rebindable key bindings.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL