mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-10 12:02:53 +02:00
Add more Essentials overrides
This commit is contained in:
parent
f91bc5bf33
commit
adeb1b2f88
4 changed files with 46 additions and 3 deletions
|
@ -64,7 +64,7 @@ extern const char module_rpg3[];
|
|||
// Scripts to run at some point during Ruby execution
|
||||
|
||||
#ifdef EASY_POKE
|
||||
#include "EssentialsTilemapHack.rb.xxd"
|
||||
#include "EssentialsCompatibility.rb.xxd"
|
||||
#endif
|
||||
|
||||
static void mriBindingExecute();
|
||||
|
@ -630,7 +630,7 @@ static void runRMXPScripts(BacktraceData &btData) {
|
|||
if (i + 2 == scriptCount){
|
||||
#ifdef EASY_POKE
|
||||
if (minimonsters > 0 && !RTEST(rb_gv_get("Z_NOPOKEFIX"))){
|
||||
EVALFILE(EssentialsTilemapHack);
|
||||
EVALFILE(EssentialsCompatibility);
|
||||
minimonsters = -1;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -273,6 +273,11 @@ void graphicsBindingInit()
|
|||
_rb_define_module_function(module, "fadein", graphicsFadein);
|
||||
_rb_define_module_function(module, "snap_to_bitmap", graphicsSnapToBitmap);
|
||||
_rb_define_module_function(module, "resize_screen", graphicsResizeScreen);
|
||||
#ifdef EASY_POKE
|
||||
// The other two are overridden by default, which is super
|
||||
_rb_define_module_function(module, "mkxp_snap_to_bitmap", graphicsSnapToBitmap);
|
||||
_rb_define_module_function(module, "mkxp_resize_screen", graphicsResizeScreen);
|
||||
#endif
|
||||
_rb_define_module_function(module, "center", graphicsCenter);
|
||||
|
||||
INIT_GRA_PROP_BIND( Brightness, "brightness" );
|
||||
|
|
|
@ -107,3 +107,41 @@ if $MKXP == true
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
# =================================================================
|
||||
# Any extra overrides to fix a bunch of break-y things.
|
||||
# This should allow someone to load up games on Windows just fine.
|
||||
# Maybe not perfect compatibility, but better.
|
||||
# =================================================================
|
||||
|
||||
module Graphics
|
||||
def self.snap_to_bitmap
|
||||
return Graphics.mkxp_snap_to_bitmap
|
||||
end
|
||||
def self.resize_screen(w,h)
|
||||
return Graphics.mkxp_resize_screen(w,h)
|
||||
end
|
||||
end
|
||||
|
||||
def pbScreenCapture
|
||||
capturefile = nil
|
||||
500.times{|i|
|
||||
filename = RTP.getSaveFileName(sprintf("capture%03d.bmp",i))
|
||||
if !safeExists?(filename)
|
||||
capturefile = filename
|
||||
break
|
||||
end
|
||||
}
|
||||
begin
|
||||
Graphics.screenshot(capturefile)
|
||||
pbSEPlay("expfull") if FileTest.audio_exist?("Audio/SE/expfull")
|
||||
rescue
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
alias old_pbDrawTextPositions pbDrawTextPositions
|
||||
def pbDrawTextPositions(bitmap,textpos)
|
||||
old_pbDrawTextPositions(bitmap,textpos.map{|n|n+4})
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
embedded_scripts = [
|
||||
'EssentialsTilemapHack.rb'
|
||||
'EssentialsCompatibility.rb'
|
||||
]
|
||||
|
||||
embedded_scripts_f = files(embedded_scripts)
|
||||
|
|
Loading…
Add table
Reference in a new issue