mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
basic sprites sorting validation
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -25,7 +25,7 @@ module Settings
|
|||||||
CUSTOM_BATTLERS_FOLDER_INDEXED = "Graphics/CustomBattlers/indexed"
|
CUSTOM_BATTLERS_FOLDER_INDEXED = "Graphics/CustomBattlers/indexed"
|
||||||
BATTLERS_FOLDER = "Graphics/Battlers/"
|
BATTLERS_FOLDER = "Graphics/Battlers/"
|
||||||
FRONTSPRITE_POSITION_OFFSET = 20
|
FRONTSPRITE_POSITION_OFFSET = 20
|
||||||
FRONTSPRITE_SCALE = 0.6666666
|
FRONTSPRITE_SCALE = 0.6666666666
|
||||||
BACKRPSPRITE_SCALE = 1
|
BACKRPSPRITE_SCALE = 1
|
||||||
EGGSPRITE_SCALE = 1
|
EGGSPRITE_SCALE = 1
|
||||||
BACKSPRITE_POSITION_OFFSET = 20
|
BACKSPRITE_POSITION_OFFSET = 20
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class Game_Temp
|
|||||||
attr_accessor :fadestate # for sprite hashes
|
attr_accessor :fadestate # for sprite hashes
|
||||||
attr_accessor :background_bitmap
|
attr_accessor :background_bitmap
|
||||||
attr_accessor :mart_prices
|
attr_accessor :mart_prices
|
||||||
|
attr_accessor :unimportedSprites
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# * Object Initialization
|
# * Object Initialization
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -908,7 +908,7 @@ end
|
|||||||
|
|
||||||
def pbShowCommands(msgwindow, commands = nil, cmdIfCancel = 0, defaultCmd = 0)
|
def pbShowCommands(msgwindow, commands = nil, cmdIfCancel = 0, defaultCmd = 0)
|
||||||
return 0 if !commands
|
return 0 if !commands
|
||||||
if defaultCmd == 0 && $game_variables[VAR_COMMAND_WINDOW_INDEX] != 0
|
if defaultCmd == 0 && ($game_variables && $game_variables[VAR_COMMAND_WINDOW_INDEX] != 0)
|
||||||
defaultCmd = $game_variables[VAR_COMMAND_WINDOW_INDEX]
|
defaultCmd = $game_variables[VAR_COMMAND_WINDOW_INDEX]
|
||||||
end
|
end
|
||||||
cmdwindow = Window_CommandPokemonEx.new(commands)
|
cmdwindow = Window_CommandPokemonEx.new(commands)
|
||||||
|
|||||||
@@ -299,6 +299,9 @@ class PokemonLoadScreen
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbStartLoadScreen
|
def pbStartLoadScreen
|
||||||
|
if($game_temp.unimportedSprites.size >0)
|
||||||
|
handleReplaceExistingSprites()
|
||||||
|
end
|
||||||
copyKeybindings()
|
copyKeybindings()
|
||||||
save_file_list = SaveData::AUTO_SLOTS + SaveData::MANUAL_SLOTS
|
save_file_list = SaveData::AUTO_SLOTS + SaveData::MANUAL_SLOTS
|
||||||
first_time = true
|
first_time = true
|
||||||
|
|||||||
@@ -8,6 +8,37 @@ class Scene_DebugIntro
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def handleReplaceExistingSprites()
|
||||||
|
spritesToReplaceList= $game_temp.unimportedSprites
|
||||||
|
$game_temp.unimportedSprites=nil
|
||||||
|
return if spritesToReplaceList.size==0
|
||||||
|
commands = []
|
||||||
|
#commands << "Pick which sprites to use as mains"
|
||||||
|
commands << "Replace all the old sprites with the new ones"
|
||||||
|
#commands << "Import all the new sprites as alts"
|
||||||
|
commands << "Do not import the new sprites"
|
||||||
|
|
||||||
|
messageSingular = "While importing custom sprites, the game has detected that {1} new custom sprite already has a version that exist in the game."
|
||||||
|
messagePlural = "While importing custom sprites, the game has detected that {1} new custom sprites already have versions that exist in the game."
|
||||||
|
|
||||||
|
messageText = spritesToReplaceList.size==1 ? messageSingular : messagePlural
|
||||||
|
message = _INTL(messageText,spritesToReplaceList.length.to_s)
|
||||||
|
pbMessage(message)
|
||||||
|
|
||||||
|
command = pbMessage("What to do with the new sprites?",commands,commands.size-1)
|
||||||
|
case command
|
||||||
|
when 0 #Replace olds
|
||||||
|
spritesToReplaceList.each do |oldPath, newPath|
|
||||||
|
File.rename(oldPath, newPath)
|
||||||
|
echo "\nSorted " + oldPath + " into " + newPath
|
||||||
|
end
|
||||||
|
#when 1 #Keep olds (rename new as alts)
|
||||||
|
when 1 #Do not import
|
||||||
|
pbMessage("You can manually sort the new sprites in the /indexed folder to choose which ones you want to keep.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def pbCallTitle
|
def pbCallTitle
|
||||||
return Scene_DebugIntro.new if $DEBUG
|
return Scene_DebugIntro.new if $DEBUG
|
||||||
return Scene_Intro.new
|
return Scene_Intro.new
|
||||||
@@ -22,8 +53,11 @@ def mainFunction
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def sortCustomBattlers()
|
def sortCustomBattlers()
|
||||||
echo "Sorting CustomBattlers files..."
|
echo "Sorting CustomBattlers files..."
|
||||||
|
alreadyExists = {}
|
||||||
Dir.foreach(Settings::CUSTOM_BATTLERS_FOLDER) do |filename|
|
Dir.foreach(Settings::CUSTOM_BATTLERS_FOLDER) do |filename|
|
||||||
next if filename == '.' or filename == '..'
|
next if filename == '.' or filename == '..'
|
||||||
next if !filename.end_with?(".png")
|
next if !filename.end_with?(".png")
|
||||||
@@ -31,19 +65,25 @@ def sortCustomBattlers()
|
|||||||
oldPath = Settings::CUSTOM_BATTLERS_FOLDER + "/" + filename
|
oldPath = Settings::CUSTOM_BATTLERS_FOLDER + "/" + filename
|
||||||
newPath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + "/" + headNum.to_s + "/" +filename
|
newPath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + "/" + headNum.to_s + "/" +filename
|
||||||
begin
|
begin
|
||||||
File.rename(oldPath, newPath)
|
if File.file?(newPath)
|
||||||
echo "\nSorted " + filename + " into " + newPath
|
alreadyExists[oldPath] = newPath
|
||||||
|
echo "\nFile " + newPath + " already exists... Skipping."
|
||||||
|
|
||||||
|
else
|
||||||
|
File.rename(oldPath, newPath)
|
||||||
|
echo "\nSorted " + filename + " into " + newPath
|
||||||
|
end
|
||||||
rescue
|
rescue
|
||||||
echo "\nCould not sort "+ filename
|
echo "\nCould not sort "+ filename
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
echo "\nFinished sorting"
|
echo "\nFinished sorting"
|
||||||
|
$game_temp.unimportedSprites=alreadyExists
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def mainFunctionDebug
|
def mainFunctionDebug
|
||||||
begin
|
begin
|
||||||
sortCustomBattlers()
|
|
||||||
MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
|
MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
|
||||||
PluginManager.runPlugins
|
PluginManager.runPlugins
|
||||||
Compiler.main
|
Compiler.main
|
||||||
@@ -51,6 +91,8 @@ def mainFunctionDebug
|
|||||||
Game.set_up_system
|
Game.set_up_system
|
||||||
Graphics.update
|
Graphics.update
|
||||||
Graphics.freeze
|
Graphics.freeze
|
||||||
|
sortCustomBattlers()
|
||||||
|
|
||||||
$scene = pbCallTitle
|
$scene = pbCallTitle
|
||||||
$scene.main until $scene.nil?
|
$scene.main until $scene.nil?
|
||||||
Graphics.transition(20)
|
Graphics.transition(20)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user