mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-03-28 14:56:22 +01:00

* 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>
39 lines
929 B
Ruby
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
|