mkxp-z/scripts/preload/mkxp_wrap.rb
Splendide Imaginarius 7dd50c8546
Add preload scripts (#6)
* Add preload scripts

At least one game in the wild requires both of these preload scripts to run.

* Add Ancurio's win32 preload script

At least one game in the wild requires this preload script to run on Linux.

* Relicense my preload scripts under CC0

* Clarify preload script docs in mkxp.json

* Move preload scripts to "scripts/preload"

* Fix permissions on preload scripts

* Fix preloadScript paths in mkxp.json example

* Apply suggestions from code review

Co-authored-by: WaywardHeart <WaywardHeart@outlook.com>

---------

Co-authored-by: struma <ruffle-brasher-0r@icloud.com>
Co-authored-by: WaywardHeart <WaywardHeart@outlook.com>
2023-07-20 12:16:29 -04:00

39 lines
929 B
Ruby

# mkxp_wrap.rb
# Author: Splendide Imaginarius (2022)
# Creative Commons CC0: To the extent possible under law, Splendide Imaginarius
# has waived all copyright and related or neighboring rights to mkxp_wrap.rb.
# https://creativecommons.org/publicdomain/zero/1.0/
# This preload script provides functions that existed in Ancurio's mkxp, but
# were renamed in mkxp-z, so that games (or other preload scripts) that expect
# Ancurio's function names can find them.
module MKXP
class << self
def data_directory(*args)
System::data_directory(*args)
end
def puts(*args)
System::puts(*args)
end
def raw_key_states(*args)
states = Input::raw_key_states(*args)
class << states
def getbyte(byte)
self[byte] ? 1 : 0
end
def setbyte(byte, val)
self[byte] = val == 0 ? false : true
end
end
states
end
def mouse_in_window(*args)
Input::mouse_in_window(*args)
end
end
end