Fixing broken code

This commit is contained in:
Maruno17
2020-09-06 19:10:25 +01:00
parent 6252407160
commit f035200484
7 changed files with 13 additions and 13 deletions

View File

@@ -131,9 +131,9 @@ def getKnownFolder(guid)
packedGuid = guid.pack("VvvC*") packedGuid = guid.pack("VvvC*")
shGetKnownFolderPath = Win32API.new("shell32.dll","SHGetKnownFolderPath","pllp","i") rescue nil shGetKnownFolderPath = Win32API.new("shell32.dll","SHGetKnownFolderPath","pllp","i") rescue nil
coTaskMemFree = Win32API.new("ole32.dll","CoTaskMemFree","i","") rescue nil coTaskMemFree = Win32API.new("ole32.dll","CoTaskMemFree","i","") rescue nil
return "" if !(shGetKnownFolderPath && coTaskMemFree) return "" if !shGetKnownFolderPath || !coTaskMemFree
path = "\0"*4 path = "\0"*4
path = shGetKnownFolderPath.call(packedGuid,0,0,path) ret = shGetKnownFolderPath.call(packedGuid,0,0,path)
path = path.unpack("V")[0] path = path.unpack("V")[0]
ret = getUnicodeString(path) ret = getUnicodeString(path)
coTaskMemFree.call(path) coTaskMemFree.call(path)

View File

@@ -17,7 +17,7 @@ class IntroEventScene < EventScene
openPic(self,nil) openPic(self,nil)
end end
def openPic(_scene,_args) def openPic(_scene,*args)
onCTrigger.clear onCTrigger.clear
@pic.name = "Graphics/Titles/"+@pics[@index] @pic.name = "Graphics/Titles/"+@pics[@index]
# fade to opacity 255 in FADE_TICKS ticks after waiting 0 frames # fade to opacity 255 in FADE_TICKS ticks after waiting 0 frames
@@ -49,7 +49,7 @@ class IntroEventScene < EventScene
end end
end end
def openSplash(_scene,_args) def openSplash(_scene,*args)
onUpdate.clear onUpdate.clear
onCTrigger.clear onCTrigger.clear
@pic.name = "Graphics/Titles/"+@splash @pic.name = "Graphics/Titles/"+@splash
@@ -63,7 +63,7 @@ class IntroEventScene < EventScene
onCTrigger.set(method(:closeSplash)) # call closeSplash when C key is pressed onCTrigger.set(method(:closeSplash)) # call closeSplash when C key is pressed
end end
def closeSplash(scene,_args) def closeSplash(scene,*args)
onUpdate.clear onUpdate.clear
onCTrigger.clear onCTrigger.clear
# Play random cry # Play random cry
@@ -83,7 +83,7 @@ class IntroEventScene < EventScene
sscreen.pbStartLoadScreen sscreen.pbStartLoadScreen
end end
def closeSplashDelete(scene,_args) def closeSplashDelete(scene,*args)
onUpdate.clear onUpdate.clear
onCTrigger.clear onCTrigger.clear
# Play random cry # Play random cry

View File

@@ -37,7 +37,7 @@ class ButtonEventScene < EventScene
onCTrigger.set(method(:pbOnScreen1)) onCTrigger.set(method(:pbOnScreen1))
end end
def pbOnScreen1(scene,_args) def pbOnScreen1(scene,*args)
# End scene # End scene
Graphics.freeze Graphics.freeze
scene.dispose scene.dispose

View File

@@ -97,7 +97,7 @@ module PBDayNight
# Internal function # Internal function
def getToneInternal def self.getToneInternal
# Calculates the tone for the current frame, used for day/night effects # Calculates the tone for the current frame, used for day/night effects
realMinutes = pbGetDayNightMinutes realMinutes = pbGetDayNightMinutes
hour = realMinutes/60 hour = realMinutes/60

View File

@@ -902,7 +902,7 @@ end
#=============================================================================== #===============================================================================
# Choose an item from the Bag # Choose an item from the Bag
#=============================================================================== #===============================================================================
def pbChooseItem(var=0,_args) def pbChooseItem(var=0,*args)
ret = 0 ret = 0
pbFadeOutIn { pbFadeOutIn {
scene = PokemonBag_Scene.new scene = PokemonBag_Scene.new

View File

@@ -52,7 +52,7 @@ end
Events.onMapChange += proc { |_sender,_args| Events.onMapChange += proc { |_sender,*args|
pbSafariState.pbEnd if !pbInSafari? pbSafariState.pbEnd if !pbInSafari?
} }

View File

@@ -1,7 +1,7 @@
#=============================================================================== #===============================================================================
# Pokémon Organized Battle # Pokémon Organized Battle
#=============================================================================== #===============================================================================
def pbHasEligible?(_arg) def pbHasEligible?(*arg)
return pbBattleChallenge.rules.ruleset.hasValidTeam?($Trainer.party) return pbBattleChallenge.rules.ruleset.hasValidTeam?($Trainer.party)
end end
@@ -483,7 +483,7 @@ class BattleChallenge
pbWriteCup(id,rules) pbWriteCup(id,rules)
end end
def start(_args) def start(*args)
ensureType(@id) ensureType(@id)
@currentChallenge=@id # must appear before pbStart @currentChallenge=@id # must appear before pbStart
@bc.pbStart(t,@numRounds) @bc.pbStart(t,@numRounds)
@@ -716,7 +716,7 @@ def pbBattleChallengeBeginSpeech
end end
end end
def pbEntryScreen(_arg) def pbEntryScreen(*arg)
retval = false retval = false
pbFadeOutIn { pbFadeOutIn {
scene = PokemonParty_Scene.new scene = PokemonParty_Scene.new