From 5d38b1f81301ea29e28e554f716a43a865a590b9 Mon Sep 17 00:00:00 2001 From: Amaryllis Kulla Date: Sat, 6 Nov 2021 06:33:25 +0100 Subject: [PATCH] doc: Add MKXP.data_directory --- doc/extension_doc.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/extension_doc.md b/doc/extension_doc.md index eb13843..1e14f44 100644 --- a/doc/extension_doc.md +++ b/doc/extension_doc.md @@ -19,5 +19,16 @@ returns: Integer Returns the cumulative amount of scroll events (negative if down, positive if up) inbetween the current and last `Input.update` call. +## MKXP.data_directory() +returns: String + +Provides a PC-user-dependant, game-specific path to a writable directory, intended for save states, configuration and similar. +In `mkxp.conf`, both `dataPathOrg` and `dataPathApp` keys need to be set, otherwise it returns a generic directory shared by all mkxp games. It is recommended (though not required) to not put any spaces in the config strings. +Real life example: +``` +dataPathOrg=dancingdragon +dataPathApp=skyborn +``` + ## Arbitrary key states Use `MKXP.raw_key_states` to get the current byte array of keystates, then call `#getbyte(scancode)` with `scancode` being one of the constants defined in `SDL_scancode_map.rb`. **0** means the key is released, **1** that it is pressed.