Remove Win32API calls & upgrade to modern Ruby (#96)

* Win32API removal + Ruby 3 updates
* Update binaries to match mkxp-z 2.1
This commit is contained in:
Roza
2021-02-25 17:09:59 -05:00
committed by GitHub
parent 87285a2a1f
commit 1f2309c4d2
36 changed files with 445 additions and 2224 deletions

View File

@@ -1,52 +0,0 @@
#===============================================================================
# ** Scene_Movie class, created by SoundSpawn, fixed by Popper.
#-------------------------------------------------------------------------------
# Instruction
# 1) Movies must be in a new folder called "Movies" in your directory.
# 2) If you call this script from an event, e.g.
# Call Script: $scene = Scene_Movie.new("INTRO")
# 3) Have fun playing movies with this script!
#===============================================================================
class Scene_Movie
def initialize(movie)
@movie_name = RTP.getPath("Movies\\"+movie+".avi").gsub(/\//,"\\")
end
def main
@temp = Win32API.pbFindRgssWindow.to_s
movie = Win32API.new('winmm','mciSendString','%w(p,p,l,l)','V')
movie.call("open \""+@movie_name+
"\" alias FILE style 1073741824 parent " + @temp.to_s,0,0,0)
@message = Win32API.new('user32','SendMessage','%w(l,l,l,l)','V')
@detector = Win32API.new('user32','GetSystemMetrics','%w(l)','L')
@width = @detector.call(0)
if @width == 640
#fullscreen
Graphics.update
sleep(0.1)
Graphics.update
sleep(0.1)
Graphics.update
sleep(0.1)
#fullscreen
end
status = " " * 255
movie.call("play FILE",0,0,0)
loop do
sleep(0.1)
@message.call(@temp.to_i,11,0,0)
Graphics.update
@message.call(@temp.to_i,11,1,0)
Input.update
movie.call("status FILE mode",status,255,0)
true_status = status.unpack("aaaa")
break if true_status.to_s != "play"
if Input.trigger?(Input::B)
movie.call("close FILE",0,0,0)
$scene = Scene_Map.new
break
end
end
$scene = Scene_Map.new
end
end