diff --git a/Data/Scripts/001_Technical/001_Files, translation and logs/004_PBDebug.rb b/Data/Scripts/001_Technical/001_Debugging/001_PBDebug.rb similarity index 100% rename from Data/Scripts/001_Technical/001_Files, translation and logs/004_PBDebug.rb rename to Data/Scripts/001_Technical/001_Debugging/001_PBDebug.rb diff --git a/Data/Scripts/001_Technical/006_DebugConsole.rb b/Data/Scripts/001_Technical/001_Debugging/002_DebugConsole.rb similarity index 100% rename from Data/Scripts/001_Technical/006_DebugConsole.rb rename to Data/Scripts/001_Technical/001_Debugging/002_DebugConsole.rb diff --git a/Data/Scripts/001_Technical/007_Errors.rb b/Data/Scripts/001_Technical/001_Debugging/003_Errors.rb similarity index 100% rename from Data/Scripts/001_Technical/007_Errors.rb rename to Data/Scripts/001_Technical/001_Debugging/003_Errors.rb diff --git a/Data/Scripts/001_Technical/010_Validation.rb b/Data/Scripts/001_Technical/001_Debugging/004_Validation.rb similarity index 100% rename from Data/Scripts/001_Technical/010_Validation.rb rename to Data/Scripts/001_Technical/001_Debugging/004_Validation.rb diff --git a/Data/Scripts/001_Technical/009_Deprecation.rb b/Data/Scripts/001_Technical/001_Debugging/005_Deprecation.rb similarity index 100% rename from Data/Scripts/001_Technical/009_Deprecation.rb rename to Data/Scripts/001_Technical/001_Debugging/005_Deprecation.rb diff --git a/Data/Scripts/001_Technical/001_Files, translation and logs/001_FileTests.rb b/Data/Scripts/001_Technical/002_Files/001_FileTests.rb similarity index 100% rename from Data/Scripts/001_Technical/001_Files, translation and logs/001_FileTests.rb rename to Data/Scripts/001_Technical/002_Files/001_FileTests.rb diff --git a/Data/Scripts/001_Technical/001_Files, translation and logs/002_File_Mixins.rb b/Data/Scripts/001_Technical/002_Files/002_FileMixins.rb similarity index 100% rename from Data/Scripts/001_Technical/001_Files, translation and logs/002_File_Mixins.rb rename to Data/Scripts/001_Technical/002_Files/002_FileMixins.rb diff --git a/Data/Scripts/001_Technical/005_HTTPUtilities.rb b/Data/Scripts/001_Technical/002_Files/003_HTTP_Utilities.rb similarity index 100% rename from Data/Scripts/001_Technical/005_HTTPUtilities.rb rename to Data/Scripts/001_Technical/002_Files/003_HTTP_Utilities.rb diff --git a/Data/Scripts/001_Technical/001_Files, translation and logs/003_Intl_Messages.rb b/Data/Scripts/001_Technical/003_Intl_Messages.rb similarity index 100% rename from Data/Scripts/001_Technical/001_Files, translation and logs/003_Intl_Messages.rb rename to Data/Scripts/001_Technical/003_Intl_Messages.rb diff --git a/Data/Scripts/001_Technical/003_Input.rb b/Data/Scripts/001_Technical/004_Input.rb similarity index 100% rename from Data/Scripts/001_Technical/003_Input.rb rename to Data/Scripts/001_Technical/004_Input.rb diff --git a/Data/Scripts/001_Technical/008_Plugin_Manager.rb b/Data/Scripts/001_Technical/005_PluginManager.rb similarity index 100% rename from Data/Scripts/001_Technical/008_Plugin_Manager.rb rename to Data/Scripts/001_Technical/005_PluginManager.rb diff --git a/Data/Scripts/001_Technical/004_RPG__Sprite.rb b/Data/Scripts/001_Technical/006_RPG_Sprite.rb similarity index 100% rename from Data/Scripts/001_Technical/004_RPG__Sprite.rb rename to Data/Scripts/001_Technical/006_RPG_Sprite.rb diff --git a/Data/Scripts/002_Save data/002_Values.rb b/Data/Scripts/002_Save data/002_SaveData_Value.rb similarity index 100% rename from Data/Scripts/002_Save data/002_Values.rb rename to Data/Scripts/002_Save data/002_SaveData_Value.rb diff --git a/Data/Scripts/002_Save data/004_Conversion.rb b/Data/Scripts/002_Save data/003_SaveData_Conversion.rb similarity index 100% rename from Data/Scripts/002_Save data/004_Conversion.rb rename to Data/Scripts/002_Save data/003_SaveData_Conversion.rb diff --git a/Data/Scripts/002_Save data/003_BuiltinValues.rb b/Data/Scripts/002_Save data/004_Game_SaveValues.rb similarity index 100% rename from Data/Scripts/002_Save data/003_BuiltinValues.rb rename to Data/Scripts/002_Save data/004_Game_SaveValues.rb diff --git a/Data/Scripts/002_Save data/005_BuiltinConversions.rb b/Data/Scripts/002_Save data/005_Game_SaveConversions.rb similarity index 100% rename from Data/Scripts/002_Save data/005_BuiltinConversions.rb rename to Data/Scripts/002_Save data/005_Game_SaveConversions.rb diff --git a/Data/Scripts/003_Game processing/004_Scene_Map.rb b/Data/Scripts/003_Game processing/002_Scene_Map.rb similarity index 100% rename from Data/Scripts/003_Game processing/004_Scene_Map.rb rename to Data/Scripts/003_Game processing/002_Scene_Map.rb diff --git a/Data/Scripts/003_Game processing/002_Interpreter.rb b/Data/Scripts/003_Game processing/003_Interpreter.rb similarity index 100% rename from Data/Scripts/003_Game processing/002_Interpreter.rb rename to Data/Scripts/003_Game processing/003_Interpreter.rb diff --git a/Data/Scripts/003_Game processing/003_Interpreter_Commands.rb b/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb similarity index 100% rename from Data/Scripts/003_Game processing/003_Interpreter_Commands.rb rename to Data/Scripts/003_Game processing/004_Interpreter_Commands.rb diff --git a/Data/Scripts/003_Game processing/006_Event_FieldEvents.rb b/Data/Scripts/003_Game processing/006_Event_OverworldEvents.rb similarity index 100% rename from Data/Scripts/003_Game processing/006_Event_FieldEvents.rb rename to Data/Scripts/003_Game processing/006_Event_OverworldEvents.rb diff --git a/Data/Scripts/005_Sprites/004_Sprite_WaterReflection.rb b/Data/Scripts/005_Sprites/004_Sprite_Reflection.rb similarity index 100% rename from Data/Scripts/005_Sprites/004_Sprite_WaterReflection.rb rename to Data/Scripts/005_Sprites/004_Sprite_Reflection.rb diff --git a/Data/Scripts/005_Sprites/007_Spriteset_Global.rb b/Data/Scripts/005_Sprites/006_Spriteset_Global.rb similarity index 100% rename from Data/Scripts/005_Sprites/007_Spriteset_Global.rb rename to Data/Scripts/005_Sprites/006_Spriteset_Global.rb diff --git a/Data/Scripts/005_Sprites/006_Spriteset_Map.rb b/Data/Scripts/005_Sprites/007_Spriteset_Map.rb similarity index 100% rename from Data/Scripts/005_Sprites/006_Spriteset_Map.rb rename to Data/Scripts/005_Sprites/007_Spriteset_Map.rb diff --git a/Data/Scripts/007_Objects and windows/013_PictureEx.rb b/Data/Scripts/005_Sprites/011_PictureEx.rb similarity index 100% rename from Data/Scripts/007_Objects and windows/013_PictureEx.rb rename to Data/Scripts/005_Sprites/011_PictureEx.rb diff --git a/Data/Scripts/007_Objects and windows/014_Interpolators.rb b/Data/Scripts/005_Sprites/012_Interpolators.rb similarity index 100% rename from Data/Scripts/007_Objects and windows/014_Interpolators.rb rename to Data/Scripts/005_Sprites/012_Interpolators.rb diff --git a/Data/Scripts/006_Map renderer/004_TilemapLoader.rb b/Data/Scripts/006_Map renderer/001_TilemapLoader.rb similarity index 100% rename from Data/Scripts/006_Map renderer/004_TilemapLoader.rb rename to Data/Scripts/006_Map renderer/001_TilemapLoader.rb diff --git a/Data/Scripts/006_Map renderer/001_Tilemap_XP.rb b/Data/Scripts/006_Map renderer/002_Tilemap_XP.rb similarity index 100% rename from Data/Scripts/006_Map renderer/001_Tilemap_XP.rb rename to Data/Scripts/006_Map renderer/002_Tilemap_XP.rb diff --git a/Data/Scripts/006_Map renderer/002_Tilemap_Perspective.rb b/Data/Scripts/006_Map renderer/003_Tilemap_Perspective.rb similarity index 100% rename from Data/Scripts/006_Map renderer/002_Tilemap_Perspective.rb rename to Data/Scripts/006_Map renderer/003_Tilemap_Perspective.rb diff --git a/Data/Scripts/006_Map renderer/003_Tilemap_Original.rb b/Data/Scripts/006_Map renderer/004_Tilemap_Original.rb similarity index 100% rename from Data/Scripts/006_Map renderer/003_Tilemap_Original.rb rename to Data/Scripts/006_Map renderer/004_Tilemap_Original.rb diff --git a/Data/Scripts/007_Objects and windows/001_BitmapCache.rb b/Data/Scripts/007_Objects and windows/001_RPG_Cache.rb similarity index 100% rename from Data/Scripts/007_Objects and windows/001_BitmapCache.rb rename to Data/Scripts/007_Objects and windows/001_RPG_Cache.rb diff --git a/Data/Scripts/007_Objects and windows/010_DrawText.rb b/Data/Scripts/007_Objects and windows/010_DrawText.rb index 0c3bdc286..5b19f68ec 100644 --- a/Data/Scripts/007_Objects and windows/010_DrawText.rb +++ b/Data/Scripts/007_Objects and windows/010_DrawText.rb @@ -887,6 +887,64 @@ end #=============================================================================== # Draw text and images on a bitmap #=============================================================================== +def getLineBrokenText(bitmap,value,width,dims) + x=0 + y=0 + textheight=0 + ret=[] + if dims + dims[0]=0 + dims[1]=0 + end + line=0 + position=0 + column=0 + return ret if !bitmap || bitmap.disposed? || width<=0 + textmsg=value.clone + ret.push(["",0,0,0,bitmap.text_size("X").height,0,0,0,0]) + while ((c = textmsg.slice!(/\n|(\S*([ \r\t\f]?))/)) != nil) + break if c=="" + length=c.scan(/./m).length + ccheck=c + if ccheck=="\n" + ret.push(["\n",x,y,0,textheight,line,position,column,0]) + x=0 + y+=(textheight==0) ? bitmap.text_size("X").height : textheight + line+=1 + textheight=0 + column=0 + position+=length + ret.push(["",x,y,0,textheight,line,position,column,0]) + next + end + words=[ccheck] + for i in 0...words.length + word=words[i] + if word && word!="" + textSize=bitmap.text_size(word) + textwidth=textSize.width + if x>0 && x+textwidth>=width-2 + # Zero-length word break + ret.push(["",x,y,0,textheight,line,position,column,0]) + x=0 + column=0 + y+=(textheight==0) ? bitmap.text_size("X").height : textheight + line+=1 + textheight=0 + end + textheight=[textheight,textSize.height].max + ret.push([word,x,y,textwidth,textheight,line,position,column,length]) + x+=textwidth + dims[0]=x if dims && dims[0]=@charset.length - return ""; - else - return @charset[self.index] - end - end - - def command - return -1 if self.index==@charset.length - return -2 if self.index==@charset.length+1 - return -3 if self.index==@charset.length+2 - return self.index - end - - def itemCount - return @charset.length+3 - end - - def drawItem(index,_count,rect) - rect=drawCursor(index,rect) - if index==@charset.length # -1 - pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,"[ ]", - self.baseColor,self.shadowColor) - elsif index==@charset.length+1 # -2 - pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,@othercharset, - self.baseColor,self.shadowColor) - elsif index==@charset.length+2 # -3 - pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,_INTL("OK"), - self.baseColor,self.shadowColor) - else - pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,@charset[index], - self.baseColor,self.shadowColor) - end - end -end - - - #=============================================================================== # #=============================================================================== @@ -294,62 +226,35 @@ end #=============================================================================== # #=============================================================================== -def getLineBrokenText(bitmap,value,width,dims) - x=0 - y=0 - textheight=0 - ret=[] - if dims - dims[0]=0 - dims[1]=0 - end - line=0 - position=0 - column=0 - return ret if !bitmap || bitmap.disposed? || width<=0 - textmsg=value.clone - ret.push(["",0,0,0,bitmap.text_size("X").height,0,0,0,0]) - while ((c = textmsg.slice!(/\n|(\S*([ \r\t\f]?))/)) != nil) - break if c=="" - length=c.scan(/./m).length - ccheck=c - if ccheck=="\n" - ret.push(["\n",x,y,0,textheight,line,position,column,0]) - x=0 - y+=(textheight==0) ? bitmap.text_size("X").height : textheight - line+=1 - textheight=0 - column=0 - position+=length - ret.push(["",x,y,0,textheight,line,position,column,0]) - next - end - words=[ccheck] - for i in 0...words.length - word=words[i] - if word && word!="" - textSize=bitmap.text_size(word) - textwidth=textSize.width - if x>0 && x+textwidth>=width-2 - # Zero-length word break - ret.push(["",x,y,0,textheight,line,position,column,0]) - x=0 - column=0 - y+=(textheight==0) ? bitmap.text_size("X").height : textheight - line+=1 - textheight=0 - end - textheight=[textheight,textSize.height].max - ret.push([word,x,y,textwidth,textheight,line,position,column,length]) - x+=textwidth - dims[0]=x if dims && dims[0] 0 + @helper.cursor-=1 + @frame=0 + self.refresh end + return + elsif Input.triggerex?(:LEFT) || Input.repeatex?(:RIGHT) + if @helper.cursor < self.text.scan(/./m).length + @helper.cursor+=1 + @frame=0 + self.refresh + end + return + elsif Input.triggerex?(:BACKSPACE) || Input.repeatex?(:BACKSPACE) + self.delete if @helper.cursor>0 + return + elsif Input.triggerex?(:RETURN) || Input.triggerex?(:ESCAPE) + return end - position+=length - column+=length + Input.gets.each_char { |c| insert(c) } end - dims[1]=y+textheight if dims - return ret end @@ -657,810 +562,3 @@ class Window_MultilineTextEntry < SpriteWindow_Base end end end - - - -#=============================================================================== -# -#=============================================================================== -class Window_TextEntry_Keyboard < Window_TextEntry - def update - @frame+=1 - @frame%=20 - self.refresh if ((@frame%10)==0) - return if !self.active - # Moving cursor - if Input.triggerex?(:LEFT) || Input.repeatex?(:LEFT) - if @helper.cursor > 0 - @helper.cursor-=1 - @frame=0 - self.refresh - end - return - elsif Input.triggerex?(:LEFT) || Input.repeatex?(:RIGHT) - if @helper.cursor < self.text.scan(/./m).length - @helper.cursor+=1 - @frame=0 - self.refresh - end - return - elsif Input.triggerex?(:BACKSPACE) || Input.repeatex?(:BACKSPACE) - self.delete if @helper.cursor>0 - return - elsif Input.triggerex?(:RETURN) || Input.triggerex?(:ESCAPE) - return - end - Input.gets.each_char{|c|insert(c)} - end -end - - - -#=============================================================================== -# Text entry screen - free typing. -#=============================================================================== -class PokemonEntryScene - @@Characters=[ - [("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").scan(/./),"[*]"], - [("0123456789 !@\#$%^&*() ~`-_+={}[] :;'\"<>,.?/ ").scan(/./),"[A]"], - ] - USEKEYBOARD=true - - def pbStartScene(helptext,minlength,maxlength,initialText,subject=0,pokemon=nil) - @sprites={} - @viewport=Viewport.new(0,0,Graphics.width,Graphics.height) - @viewport.z=99999 - if USEKEYBOARD - @sprites["entry"]=Window_TextEntry_Keyboard.new(initialText, - 0,0,400-112,96,helptext,true) - Input.text_input = true - else - @sprites["entry"]=Window_TextEntry.new(initialText,0,0,400,96,helptext,true) - end - @sprites["entry"].x=(Graphics.width/2)-(@sprites["entry"].width/2)+32 - @sprites["entry"].viewport=@viewport - @sprites["entry"].visible=true - @minlength=minlength - @maxlength=maxlength - @symtype=0 - @sprites["entry"].maxlength=maxlength - if !USEKEYBOARD - @sprites["entry2"]=Window_CharacterEntry.new(@@Characters[@symtype][0]) - @sprites["entry2"].setOtherCharset(@@Characters[@symtype][1]) - @sprites["entry2"].viewport=@viewport - @sprites["entry2"].visible=true - @sprites["entry2"].x=(Graphics.width/2)-(@sprites["entry2"].width/2) - end - if minlength==0 - @sprites["helpwindow"]=Window_UnformattedTextPokemon.newWithSize( - _INTL("Enter text using the keyboard. Press\nEnter to confirm, or Esc to cancel."), - 32,Graphics.height-96,Graphics.width-64,96,@viewport - ) - else - @sprites["helpwindow"]=Window_UnformattedTextPokemon.newWithSize( - _INTL("Enter text using the keyboard.\nPress Enter to confirm."), - 32,Graphics.height-96,Graphics.width-64,96,@viewport - ) - end - @sprites["helpwindow"].letterbyletter=false - @sprites["helpwindow"].viewport=@viewport - @sprites["helpwindow"].visible=USEKEYBOARD - @sprites["helpwindow"].baseColor=Color.new(16,24,32) - @sprites["helpwindow"].shadowColor=Color.new(168,184,184) - addBackgroundPlane(@sprites,"background","Naming/bg_2",@viewport) - case subject - when 1 # Player - meta=GameData::Metadata.get_player($Trainer.character_ID) - if meta - @sprites["shadow"]=IconSprite.new(0,0,@viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") - @sprites["shadow"].x=33*2 - @sprites["shadow"].y=32*2 - filename=pbGetPlayerCharset(meta,1,nil,true) - @sprites["subject"]=TrainerWalkingCharSprite.new(filename,@viewport) - charwidth=@sprites["subject"].bitmap.width - charheight=@sprites["subject"].bitmap.height - @sprites["subject"].x = 44*2 - charwidth/8 - @sprites["subject"].y = 38*2 - charheight/4 - end - when 2 # Pokémon - if pokemon - @sprites["shadow"]=IconSprite.new(0,0,@viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") - @sprites["shadow"].x=33*2 - @sprites["shadow"].y=32*2 - @sprites["subject"]=PokemonIconSprite.new(pokemon,@viewport) - @sprites["subject"].setOffset(PictureOrigin::Center) - @sprites["subject"].x=88 - @sprites["subject"].y=54 - @sprites["gender"]=BitmapSprite.new(32,32,@viewport) - @sprites["gender"].x=430 - @sprites["gender"].y=54 - @sprites["gender"].bitmap.clear - pbSetSystemFont(@sprites["gender"].bitmap) - textpos=[] - if pokemon.male? - textpos.push([_INTL("♂"),0,-6,false,Color.new(0,128,248),Color.new(168,184,184)]) - elsif pokemon.female? - textpos.push([_INTL("♀"),0,-6,false,Color.new(248,24,24),Color.new(168,184,184)]) - end - pbDrawTextPositions(@sprites["gender"].bitmap,textpos) - end - when 3 # NPC - @sprites["shadow"]=IconSprite.new(0,0,@viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") - @sprites["shadow"].x=33*2 - @sprites["shadow"].y=32*2 - @sprites["subject"]=TrainerWalkingCharSprite.new(pokemon.to_s,@viewport) - charwidth=@sprites["subject"].bitmap.width - charheight=@sprites["subject"].bitmap.height - @sprites["subject"].x = 44*2 - charwidth/8 - @sprites["subject"].y = 38*2 - charheight/4 - when 4 # Storage box - @sprites["subject"]=TrainerWalkingCharSprite.new(nil,@viewport) - @sprites["subject"].altcharset="Graphics/Pictures/Naming/icon_storage" - @sprites["subject"].animspeed=4 - charwidth=@sprites["subject"].bitmap.width - charheight=@sprites["subject"].bitmap.height - @sprites["subject"].x = 44*2 - charwidth/8 - @sprites["subject"].y = 26*2 - charheight/2 - end - pbFadeInAndShow(@sprites) - end - - def pbEntry1 - ret="" - loop do - Graphics.update - Input.update - if Input.triggerex?(:ESCAPE) && @minlength==0 - ret="" - break - elsif Input.triggerex?(:RETURN) && @sprites["entry"].text.length>=@minlength - ret=@sprites["entry"].text - break - end - @sprites["helpwindow"].update - @sprites["entry"].update - @sprites["subject"].update if @sprites["subject"] - end - Input.update - return ret - end - - def pbEntry2 - ret="" - loop do - Graphics.update - Input.update - @sprites["helpwindow"].update - @sprites["entry"].update - @sprites["entry2"].update - @sprites["subject"].update if @sprites["subject"] - if Input.trigger?(Input::USE) - index=@sprites["entry2"].command - if index==-3 # Confirm text - ret=@sprites["entry"].text - if ret.length<@minlength || ret.length>@maxlength - pbPlayBuzzerSE() - else - pbPlayDecisionSE() - break - end - elsif index==-1 # Insert a space - if @sprites["entry"].insert(" ") - pbPlayDecisionSE() - else - pbPlayBuzzerSE() - end - elsif index==-2 # Change character set - pbPlayDecisionSE() - @symtype+=1 - @symtype=0 if @symtype>=@@Characters.length - @sprites["entry2"].setCharset(@@Characters[@symtype][0]) - @sprites["entry2"].setOtherCharset(@@Characters[@symtype][1]) - else # Insert given character - if @sprites["entry"].insert(@sprites["entry2"].character) - pbPlayDecisionSE() - else - pbPlayBuzzerSE() - end - end - next - end - end - Input.update - return ret - end - - def pbEntry - return USEKEYBOARD ? pbEntry1 : pbEntry2 - end - - def pbEndScene - pbFadeOutAndHide(@sprites) - pbDisposeSpriteHash(@sprites) - @viewport.dispose - Input.text_input = false if USEKEYBOARD - end -end - - - -#=============================================================================== -# Text entry screen - arrows to select letter. -#=============================================================================== -class PokemonEntryScene2 - @@Characters = [ - [("ABCDEFGHIJ ,."+"KLMNOPQRST '-"+"UVWXYZ ♂♀"+" "+"0123456789 ").scan(/./),_INTL("UPPER")], - [("abcdefghij ,."+"klmnopqrst '-"+"uvwxyz ♂♀"+" "+"0123456789 ").scan(/./),_INTL("lower")], - [(",.:;!? ♂♀ "+"\"'()<>[] "+"~@#%*&$ "+"+-=^_/\\| "+" ").scan(/./),_INTL("other")], - ] - ROWS = 13 - COLUMNS = 5 - MODE1 = -5 - MODE2 = -4 - MODE3 = -3 - BACK = -2 - OK = -1 - - class NameEntryCursor - def initialize(viewport) - @sprite = SpriteWrapper.new(viewport) - @cursortype = 0 - @cursor1 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_1") - @cursor2 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_2") - @cursor3 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_3") - @cursorPos = 0 - updateInternal - end - - def setCursorPos(value) - @cursorPos = value - end - - def updateCursorPos - value=@cursorPos - if value==PokemonEntryScene2::MODE1 # Upper case - @sprite.x=48 - @sprite.y=120 - @cursortype=1 - elsif value==PokemonEntryScene2::MODE2 # Lower case - @sprite.x=112 - @sprite.y=120 - @cursortype=1 - elsif value==PokemonEntryScene2::MODE3 # Other symbols - @sprite.x=176 - @sprite.y=120 - @cursortype=1 - elsif value==PokemonEntryScene2::BACK # Back - @sprite.x=312 - @sprite.y=120 - @cursortype=2 - elsif value==PokemonEntryScene2::OK # OK - @sprite.x=392 - @sprite.y=120 - @cursortype=2 - elsif value>=0 - @sprite.x=52+32*(value%PokemonEntryScene2::ROWS) - @sprite.y=180+38*(value/PokemonEntryScene2::ROWS) - @cursortype=0 - end - end - - def visible=(value) - @sprite.visible=value - end - - def visible - @sprite.visible - end - - def color=(value) - @sprite.color=value - end - - def color - @sprite.color - end - - def disposed? - @sprite.disposed? - end - - def updateInternal - @cursor1.update - @cursor2.update - @cursor3.update - updateCursorPos - case @cursortype - when 0 then @sprite.bitmap=@cursor1.bitmap - when 1 then @sprite.bitmap=@cursor2.bitmap - when 2 then @sprite.bitmap=@cursor3.bitmap - end - end - - def update - updateInternal - end - - def dispose - @cursor1.dispose - @cursor2.dispose - @cursor3.dispose - @sprite.dispose - end - end - - - - def pbStartScene(helptext,minlength,maxlength,initialText,subject=0,pokemon=nil) - @sprites={} - @viewport=Viewport.new(0,0,Graphics.width,Graphics.height) - @viewport.z=99999 - @helptext=helptext - @helper=CharacterEntryHelper.new(initialText) - @bitmaps=[ - AnimatedBitmap.new("Graphics/Pictures/Naming/overlay_tab_1"), - AnimatedBitmap.new("Graphics/Pictures/Naming/overlay_tab_2"), - AnimatedBitmap.new("Graphics/Pictures/Naming/overlay_tab_3") - ] - @bitmaps[3]=@bitmaps[0].bitmap.clone - @bitmaps[4]=@bitmaps[1].bitmap.clone - @bitmaps[5]=@bitmaps[2].bitmap.clone - for i in 0...3 - pos=0 - pbSetSystemFont(@bitmaps[i+3]) - textPos=[] - for y in 0...COLUMNS - for x in 0...ROWS - textPos.push([@@Characters[i][0][pos],44+x*32,12+y*38,2, - Color.new(16,24,32), Color.new(160,160,160)]) - pos+=1 - end - end - pbDrawTextPositions(@bitmaps[i+3],textPos) - end - @bitmaps[6]=BitmapWrapper.new(24,6) - @bitmaps[6].fill_rect(2,2,22,4,Color.new(168,184,184)) - @bitmaps[6].fill_rect(0,0,22,4,Color.new(16,24,32)) - @sprites["bg"]=IconSprite.new(0,0,@viewport) - @sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg") - case subject - when 1 # Player - meta=GameData::Metadata.get_player($Trainer.character_ID) - if meta - @sprites["shadow"]=IconSprite.new(0,0,@viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") - @sprites["shadow"].x=33*2 - @sprites["shadow"].y=32*2 - filename=pbGetPlayerCharset(meta,1,nil,true) - @sprites["subject"]=TrainerWalkingCharSprite.new(filename,@viewport) - charwidth=@sprites["subject"].bitmap.width - charheight=@sprites["subject"].bitmap.height - @sprites["subject"].x = 44*2 - charwidth/8 - @sprites["subject"].y = 38*2 - charheight/4 - end - when 2 # Pokémon - if pokemon - @sprites["shadow"]=IconSprite.new(0,0,@viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") - @sprites["shadow"].x=33*2 - @sprites["shadow"].y=32*2 - @sprites["subject"]=PokemonIconSprite.new(pokemon,@viewport) - @sprites["subject"].setOffset(PictureOrigin::Center) - @sprites["subject"].x=88 - @sprites["subject"].y=54 - @sprites["gender"]=BitmapSprite.new(32,32,@viewport) - @sprites["gender"].x=430 - @sprites["gender"].y=54 - @sprites["gender"].bitmap.clear - pbSetSystemFont(@sprites["gender"].bitmap) - textpos=[] - if pokemon.male? - textpos.push([_INTL("♂"),0,-6,false,Color.new(0,128,248),Color.new(168,184,184)]) - elsif pokemon.female? - textpos.push([_INTL("♀"),0,-6,false,Color.new(248,24,24),Color.new(168,184,184)]) - end - pbDrawTextPositions(@sprites["gender"].bitmap,textpos) - end - when 3 # NPC - @sprites["shadow"]=IconSprite.new(0,0,@viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") - @sprites["shadow"].x=33*2 - @sprites["shadow"].y=32*2 - @sprites["subject"]=TrainerWalkingCharSprite.new(pokemon.to_s,@viewport) - charwidth=@sprites["subject"].bitmap.width - charheight=@sprites["subject"].bitmap.height - @sprites["subject"].x = 44*2 - charwidth/8 - @sprites["subject"].y = 38*2 - charheight/4 - when 4 # Storage box - @sprites["subject"]=TrainerWalkingCharSprite.new(nil,@viewport) - @sprites["subject"].altcharset="Graphics/Pictures/Naming/icon_storage" - @sprites["subject"].animspeed=4 - charwidth=@sprites["subject"].bitmap.width - charheight=@sprites["subject"].bitmap.height - @sprites["subject"].x = 44*2 - charwidth/8 - @sprites["subject"].y = 26*2 - charheight/2 - end - @sprites["bgoverlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport) - pbDoUpdateOverlay - @blanks=[] - @mode=0 - @minlength=minlength - @maxlength=maxlength - @maxlength.times { |i| - @sprites["blank#{i}"]=SpriteWrapper.new(@viewport) - @sprites["blank#{i}"].bitmap=@bitmaps[6] - @sprites["blank#{i}"].x=160+24*i - @blanks[i]=0 - } - @sprites["bottomtab"]=SpriteWrapper.new(@viewport) # Current tab - @sprites["bottomtab"].x=22 - @sprites["bottomtab"].y=162 - @sprites["bottomtab"].bitmap=@bitmaps[0+3] - @sprites["toptab"]=SpriteWrapper.new(@viewport) # Next tab - @sprites["toptab"].x=22-504 - @sprites["toptab"].y=162 - @sprites["toptab"].bitmap=@bitmaps[1+3] - @sprites["controls"]=IconSprite.new(0,0,@viewport) - @sprites["controls"].setBitmap(_INTL("Graphics/Pictures/Naming/overlay_controls")) - @sprites["controls"].x=16 - @sprites["controls"].y=96 - @init=true - @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport) - pbDoUpdateOverlay2 - @sprites["cursor"]=NameEntryCursor.new(@viewport) - @cursorpos=0 - @refreshOverlay=true - @sprites["cursor"].setCursorPos(@cursorpos) - pbFadeInAndShow(@sprites) { pbUpdate } - end - - def pbUpdateOverlay - @refreshOverlay=true - end - - def pbDoUpdateOverlay2 - overlay=@sprites["overlay"].bitmap - overlay.clear - modeIcon=[[_INTL("Graphics/Pictures/Naming/icon_mode"),48+@mode*64,120,@mode*60,0,60,44]] - pbDrawImagePositions(overlay,modeIcon) - end - - def pbDoUpdateOverlay - return if !@refreshOverlay - @refreshOverlay=false - bgoverlay=@sprites["bgoverlay"].bitmap - bgoverlay.clear - pbSetSystemFont(bgoverlay) - textPositions=[ - [@helptext,160,6,false,Color.new(16,24,32),Color.new(168,184,184)] - ] - chars=@helper.textChars - x=166 - for ch in chars - textPositions.push([ch,x,42,false,Color.new(16,24,32),Color.new(168,184,184)]) - x+=24 - end - pbDrawTextPositions(bgoverlay,textPositions) - end - - def pbChangeTab(newtab=@mode+1) - pbSEPlay("GUI naming tab swap start") - @sprites["cursor"].visible = false - @sprites["toptab"].bitmap = @bitmaps[(newtab%3)+3] - # Move bottom (old) tab down off the screen, and move top (new) tab right - # onto the screen - deltaX = 48*20/Graphics.frame_rate - deltaY = 24*20/Graphics.frame_rate - loop do - if @sprites["bottomtab"].y<414 - @sprites["bottomtab"].y += deltaY - @sprites["bottomtab"].y = 414 if @sprites["bottomtab"].y>414 - end - if @sprites["toptab"].x<22 - @sprites["toptab"].x += deltaX - @sprites["toptab"].x = 22 if @sprites["toptab"].x>22 - end - Graphics.update - Input.update - pbUpdate - break if @sprites["toptab"].x>=22 && @sprites["bottomtab"].y>=414 - end - # Swap top and bottom tab around - @sprites["toptab"].x, @sprites["bottomtab"].x = @sprites["bottomtab"].x, @sprites["toptab"].x - @sprites["toptab"].y, @sprites["bottomtab"].y = @sprites["bottomtab"].y, @sprites["toptab"].y - @sprites["toptab"].bitmap, @sprites["bottomtab"].bitmap = @sprites["bottomtab"].bitmap, @sprites["toptab"].bitmap - Graphics.update - Input.update - pbUpdate - # Set the current mode - @mode = (newtab)%3 - # Set the top tab up to be the next tab - newtab = @bitmaps[((@mode+1)%3)+3] - @sprites["cursor"].visible = true - @sprites["toptab"].bitmap = newtab - @sprites["toptab"].x = 22-504 - @sprites["toptab"].y = 162 - pbSEPlay("GUI naming tab swap end") - pbDoUpdateOverlay2 - end - - def pbUpdate - for i in 0...3 - @bitmaps[i].update - end - if @init || Graphics.frame_count%5==0 - @init = false - cursorpos = @helper.cursor - cursorpos = @maxlength-1 if cursorpos>=@maxlength - cursorpos = 0 if cursorpos<0 - @maxlength.times { |i| - @blanks[i] = (i==cursorpos) ? 1 : 0 - @sprites["blank#{i}"].y = [78,82][@blanks[i]] - } - end - pbDoUpdateOverlay - pbUpdateSpriteHash(@sprites) - end - - def pbColumnEmpty?(m) - return false if m>=ROWS-1 - chset=@@Characters[@mode][0] - return ( - chset[m]==" " && - chset[m+((ROWS-1))]==" " && - chset[m+((ROWS-1)*2)]==" " && - chset[m+((ROWS-1)*3)]==" " - ) - end - - def wrapmod(x,y) - result=x%y - result+=y if result<0 - return result - end - - def pbMoveCursor - oldcursor=@cursorpos - cursordiv=@cursorpos/ROWS - cursormod=@cursorpos%ROWS - cursororigin=@cursorpos-cursormod - if Input.repeat?(Input::LEFT) - if @cursorpos<0 # Controls - @cursorpos-=1 - @cursorpos=OK if @cursorposOK - else - begin - cursormod=wrapmod((cursormod+1),ROWS) - @cursorpos=cursororigin+cursormod - end while pbColumnEmpty?(cursormod) - end - elsif Input.repeat?(Input::UP) - if @cursorpos<0 # Controls - case @cursorpos - when MODE1 then @cursorpos = ROWS*(COLUMNS-1) - when MODE2 then @cursorpos = ROWS*(COLUMNS-1)+2 - when MODE3 then @cursorpos = ROWS*(COLUMNS-1)+4 - when BACK then @cursorpos = ROWS*(COLUMNS-1)+8 - when OK then @cursorpos = ROWS*(COLUMNS-1)+11 - end - elsif @cursorpos=ROWS*(COLUMNS-1) # Bottom row of letters - case @cursorpos - when ROWS*(COLUMNS-1),ROWS*(COLUMNS-1)+1 - @cursorpos = MODE1 - when ROWS*(COLUMNS-1)+2,ROWS*(COLUMNS-1)+3 - @cursorpos = MODE2 - when ROWS*(COLUMNS-1)+4,ROWS*(COLUMNS-1)+5,ROWS*(COLUMNS-1)+6 - @cursorpos = MODE3 - when ROWS*(COLUMNS-1)+7,ROWS*(COLUMNS-1)+8,ROWS*(COLUMNS-1)+9,ROWS*(COLUMNS-1)+10 - @cursorpos = BACK - when ROWS*(COLUMNS-1)+11,ROWS*(COLUMNS-1)+12 - @cursorpos = OK - end - else - cursordiv=wrapmod((cursordiv+1),COLUMNS) - @cursorpos=(cursordiv*ROWS)+cursormod - end - end - if @cursorpos!=oldcursor # Cursor position changed - @sprites["cursor"].setCursorPos(@cursorpos) - pbPlayCursorSE() - return true - else - return false - end - end - - def pbEntry - ret="" - loop do - Graphics.update - Input.update - pbUpdate - next if pbMoveCursor - if Input.trigger?(Input::SPECIAL) - pbChangeTab - elsif Input.trigger?(Input::ACTION) - @cursorpos = OK - @sprites["cursor"].setCursorPos(@cursorpos) - elsif Input.trigger?(Input::BACK) - @helper.delete - pbPlayCancelSE() - pbUpdateOverlay - elsif Input.trigger?(Input::USE) - case @cursorpos - when BACK # Backspace - @helper.delete - pbPlayCancelSE() - pbUpdateOverlay - when OK # Done - pbSEPlay("GUI naming confirm") - if @helper.length>=@minlength - ret=@helper.text - break - end - when MODE1 - pbChangeTab(0) if @mode!=0 - when MODE2 - pbChangeTab(1) if @mode!=1 - when MODE3 - pbChangeTab(2) if @mode!=2 - else - cursormod=@cursorpos%ROWS - cursordiv=@cursorpos/ROWS - charpos=cursordiv*(ROWS)+cursormod - chset=@@Characters[@mode][0] - if @helper.length>=@maxlength - @helper.delete - end - @helper.insert(chset[charpos]) - pbPlayCursorSE() - if @helper.length>=@maxlength - @cursorpos=OK - @sprites["cursor"].setCursorPos(@cursorpos) - end - pbUpdateOverlay - end - end - end - Input.update - return ret - end - - def pbEndScene - pbFadeOutAndHide(@sprites) { pbUpdate } - for bitmap in @bitmaps - bitmap.dispose if bitmap - end - @bitmaps.clear - pbDisposeSpriteHash(@sprites) - @viewport.dispose - end -end - - - -class PokemonEntry - def initialize(scene) - @scene=scene - end - - def pbStartScreen(helptext,minlength,maxlength,initialText,mode=-1,pokemon=nil) - @scene.pbStartScene(helptext,minlength,maxlength,initialText,mode,pokemon) - ret=@scene.pbEntry - @scene.pbEndScene - return ret - end -end - - - -#=============================================================================== -# -#=============================================================================== -def pbEnterText(helptext,minlength,maxlength,initialText="",mode=0,pokemon=nil,nofadeout=false) - ret="" - if ($PokemonSystem.textinput==1 rescue false) # Keyboard - pbFadeOutIn(99999,nofadeout) { - sscene=PokemonEntryScene.new - sscreen=PokemonEntry.new(sscene) - ret=sscreen.pbStartScreen(helptext,minlength,maxlength,initialText,mode,pokemon) - } - else # Cursor - pbFadeOutIn(99999,nofadeout) { - sscene=PokemonEntryScene2.new - sscreen=PokemonEntry.new(sscene) - ret=sscreen.pbStartScreen(helptext,minlength,maxlength,initialText,mode,pokemon) - } - end - return ret -end - -def pbEnterPlayerName(helptext,minlength,maxlength,initialText="",nofadeout=false) - return pbEnterText(helptext,minlength,maxlength,initialText,1,nil,nofadeout) -end - -def pbEnterPokemonName(helptext,minlength,maxlength,initialText="",pokemon=nil,nofadeout=false) - return pbEnterText(helptext,minlength,maxlength,initialText,2,pokemon,nofadeout) -end - -def pbEnterNPCName(helptext,minlength,maxlength,initialText="",id=0,nofadeout=false) - return pbEnterText(helptext,minlength,maxlength,initialText,3,id,nofadeout) -end - -def pbEnterBoxName(helptext,minlength,maxlength,initialText="",nofadeout=false) - return pbEnterText(helptext,minlength,maxlength,initialText,4,nil,nofadeout) -end - -def pbFreeText(msgwindow,currenttext,passwordbox,maxlength,width=240) - window=Window_TextEntry_Keyboard.new(currenttext,0,0,width,64) - ret="" - window.maxlength=maxlength - window.visible=true - window.z=99999 - pbPositionNearMsgWindow(window,msgwindow,:right) - window.text=currenttext - window.passwordChar="*" if passwordbox - Input.text_input = true - loop do - Graphics.update - Input.update - if Input.triggerex?(:ESCAPE) - ret=currenttext - break - elsif Input.triggerex?(:RETURN) - ret=window.text - break - end - window.update - msgwindow.update if msgwindow - yield if block_given? - end - Input.text_input = false - window.dispose - Input.update - return ret -end - -def pbMessageFreeText(message,currenttext,passwordbox,maxlength,width=240,&block) - msgwindow=pbCreateMessageWindow - retval=pbMessageDisplay(msgwindow,message,true, - proc { |msgwindow| - next pbFreeText(msgwindow,currenttext,passwordbox,maxlength,width,&block) - },&block) - pbDisposeMessageWindow(msgwindow) - return retval -end diff --git a/Data/Scripts/010_Scenes/001_Transitions.rb b/Data/Scripts/009_Scenes/001_Transitions.rb similarity index 100% rename from Data/Scripts/010_Scenes/001_Transitions.rb rename to Data/Scripts/009_Scenes/001_Transitions.rb diff --git a/Data/Scripts/010_Scenes/002_EventScene.rb b/Data/Scripts/009_Scenes/002_EventScene.rb similarity index 100% rename from Data/Scripts/010_Scenes/002_EventScene.rb rename to Data/Scripts/009_Scenes/002_EventScene.rb diff --git a/Data/Scripts/011_Data/001_GameData.rb b/Data/Scripts/010_Data/001_GameData.rb similarity index 100% rename from Data/Scripts/011_Data/001_GameData.rb rename to Data/Scripts/010_Data/001_GameData.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/001_GrowthRate.rb b/Data/Scripts/010_Data/001_Hardcoded data/001_GrowthRate.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/001_GrowthRate.rb rename to Data/Scripts/010_Data/001_Hardcoded data/001_GrowthRate.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/002_GenderRatio.rb b/Data/Scripts/010_Data/001_Hardcoded data/002_GenderRatio.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/002_GenderRatio.rb rename to Data/Scripts/010_Data/001_Hardcoded data/002_GenderRatio.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/003_EggGroup.rb b/Data/Scripts/010_Data/001_Hardcoded data/003_EggGroup.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/003_EggGroup.rb rename to Data/Scripts/010_Data/001_Hardcoded data/003_EggGroup.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/004_BodyShape.rb b/Data/Scripts/010_Data/001_Hardcoded data/004_BodyShape.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/004_BodyShape.rb rename to Data/Scripts/010_Data/001_Hardcoded data/004_BodyShape.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/005_BodyColor.rb b/Data/Scripts/010_Data/001_Hardcoded data/005_BodyColor.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/005_BodyColor.rb rename to Data/Scripts/010_Data/001_Hardcoded data/005_BodyColor.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/006_Habitat.rb b/Data/Scripts/010_Data/001_Hardcoded data/006_Habitat.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/006_Habitat.rb rename to Data/Scripts/010_Data/001_Hardcoded data/006_Habitat.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/007_Evolution.rb b/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/007_Evolution.rb rename to Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/008_Stat.rb b/Data/Scripts/010_Data/001_Hardcoded data/008_Stat.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/008_Stat.rb rename to Data/Scripts/010_Data/001_Hardcoded data/008_Stat.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/009_Nature.rb b/Data/Scripts/010_Data/001_Hardcoded data/009_Nature.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/009_Nature.rb rename to Data/Scripts/010_Data/001_Hardcoded data/009_Nature.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/010_Status.rb b/Data/Scripts/010_Data/001_Hardcoded data/010_Status.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/010_Status.rb rename to Data/Scripts/010_Data/001_Hardcoded data/010_Status.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/011_TerrainTag.rb b/Data/Scripts/010_Data/001_Hardcoded data/011_TerrainTag.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/011_TerrainTag.rb rename to Data/Scripts/010_Data/001_Hardcoded data/011_TerrainTag.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/012_Weather.rb b/Data/Scripts/010_Data/001_Hardcoded data/012_Weather.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/012_Weather.rb rename to Data/Scripts/010_Data/001_Hardcoded data/012_Weather.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/013_EncounterType.rb b/Data/Scripts/010_Data/001_Hardcoded data/013_EncounterType.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/013_EncounterType.rb rename to Data/Scripts/010_Data/001_Hardcoded data/013_EncounterType.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/014_Environment.rb b/Data/Scripts/010_Data/001_Hardcoded data/014_Environment.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/014_Environment.rb rename to Data/Scripts/010_Data/001_Hardcoded data/014_Environment.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/015_BattleWeather.rb b/Data/Scripts/010_Data/001_Hardcoded data/015_BattleWeather.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/015_BattleWeather.rb rename to Data/Scripts/010_Data/001_Hardcoded data/015_BattleWeather.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/016_BattleTerrain.rb b/Data/Scripts/010_Data/001_Hardcoded data/016_BattleTerrain.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/016_BattleTerrain.rb rename to Data/Scripts/010_Data/001_Hardcoded data/016_BattleTerrain.rb diff --git a/Data/Scripts/011_Data/001_Hardcoded data/017_Target.rb b/Data/Scripts/010_Data/001_Hardcoded data/017_Target.rb similarity index 100% rename from Data/Scripts/011_Data/001_Hardcoded data/017_Target.rb rename to Data/Scripts/010_Data/001_Hardcoded data/017_Target.rb diff --git a/Data/Scripts/011_Data/002_PBS data/001_Misc PBS data.rb b/Data/Scripts/010_Data/002_PBS data/001_MiscPBSData.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/001_Misc PBS data.rb rename to Data/Scripts/010_Data/002_PBS data/001_MiscPBSData.rb diff --git a/Data/Scripts/011_Data/002_PBS data/002_PhoneDatabase.rb b/Data/Scripts/010_Data/002_PBS data/002_PhoneDatabase.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/002_PhoneDatabase.rb rename to Data/Scripts/010_Data/002_PBS data/002_PhoneDatabase.rb diff --git a/Data/Scripts/011_Data/002_PBS data/003_Type.rb b/Data/Scripts/010_Data/002_PBS data/003_Type.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/003_Type.rb rename to Data/Scripts/010_Data/002_PBS data/003_Type.rb diff --git a/Data/Scripts/011_Data/002_PBS data/004_Ability.rb b/Data/Scripts/010_Data/002_PBS data/004_Ability.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/004_Ability.rb rename to Data/Scripts/010_Data/002_PBS data/004_Ability.rb diff --git a/Data/Scripts/011_Data/002_PBS data/005_Move.rb b/Data/Scripts/010_Data/002_PBS data/005_Move.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/005_Move.rb rename to Data/Scripts/010_Data/002_PBS data/005_Move.rb diff --git a/Data/Scripts/011_Data/002_PBS data/006_Item.rb b/Data/Scripts/010_Data/002_PBS data/006_Item.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/006_Item.rb rename to Data/Scripts/010_Data/002_PBS data/006_Item.rb diff --git a/Data/Scripts/011_Data/002_PBS data/007_BerryPlant.rb b/Data/Scripts/010_Data/002_PBS data/007_BerryPlant.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/007_BerryPlant.rb rename to Data/Scripts/010_Data/002_PBS data/007_BerryPlant.rb diff --git a/Data/Scripts/011_Data/002_PBS data/008_Species.rb b/Data/Scripts/010_Data/002_PBS data/008_Species.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/008_Species.rb rename to Data/Scripts/010_Data/002_PBS data/008_Species.rb diff --git a/Data/Scripts/011_Data/002_PBS data/009_Species_Files.rb b/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/009_Species_Files.rb rename to Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb diff --git a/Data/Scripts/011_Data/002_PBS data/010_Ribbon.rb b/Data/Scripts/010_Data/002_PBS data/010_Ribbon.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/010_Ribbon.rb rename to Data/Scripts/010_Data/002_PBS data/010_Ribbon.rb diff --git a/Data/Scripts/011_Data/002_PBS data/011_Encounter.rb b/Data/Scripts/010_Data/002_PBS data/011_Encounter.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/011_Encounter.rb rename to Data/Scripts/010_Data/002_PBS data/011_Encounter.rb diff --git a/Data/Scripts/011_Data/002_PBS data/012_TrainerType.rb b/Data/Scripts/010_Data/002_PBS data/012_TrainerType.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/012_TrainerType.rb rename to Data/Scripts/010_Data/002_PBS data/012_TrainerType.rb diff --git a/Data/Scripts/011_Data/002_PBS data/013_Trainer.rb b/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/013_Trainer.rb rename to Data/Scripts/010_Data/002_PBS data/013_Trainer.rb diff --git a/Data/Scripts/011_Data/002_PBS data/014_Metadata.rb b/Data/Scripts/010_Data/002_PBS data/014_Metadata.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/014_Metadata.rb rename to Data/Scripts/010_Data/002_PBS data/014_Metadata.rb diff --git a/Data/Scripts/011_Data/002_PBS data/015_MapMetadata.rb b/Data/Scripts/010_Data/002_PBS data/015_MapMetadata.rb similarity index 100% rename from Data/Scripts/011_Data/002_PBS data/015_MapMetadata.rb rename to Data/Scripts/010_Data/002_PBS data/015_MapMetadata.rb diff --git a/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb b/Data/Scripts/011_Battle/001_Battler/001_PokeBattle_Battler.rb similarity index 100% rename from Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb rename to Data/Scripts/011_Battle/001_Battler/001_PokeBattle_Battler.rb diff --git a/Data/Scripts/012_Battle/001_Battler/002_Battler_Initialize.rb b/Data/Scripts/011_Battle/001_Battler/002_Battler_Initialize.rb similarity index 100% rename from Data/Scripts/012_Battle/001_Battler/002_Battler_Initialize.rb rename to Data/Scripts/011_Battle/001_Battler/002_Battler_Initialize.rb diff --git a/Data/Scripts/012_Battle/001_Battler/003_Battler_ChangeSelf.rb b/Data/Scripts/011_Battle/001_Battler/003_Battler_ChangeSelf.rb similarity index 100% rename from Data/Scripts/012_Battle/001_Battler/003_Battler_ChangeSelf.rb rename to Data/Scripts/011_Battle/001_Battler/003_Battler_ChangeSelf.rb diff --git a/Data/Scripts/012_Battle/001_Battler/004_Battler_Statuses.rb b/Data/Scripts/011_Battle/001_Battler/004_Battler_Statuses.rb similarity index 100% rename from Data/Scripts/012_Battle/001_Battler/004_Battler_Statuses.rb rename to Data/Scripts/011_Battle/001_Battler/004_Battler_Statuses.rb diff --git a/Data/Scripts/012_Battle/001_Battler/005_Battler_StatStages.rb b/Data/Scripts/011_Battle/001_Battler/005_Battler_StatStages.rb similarity index 100% rename from Data/Scripts/012_Battle/001_Battler/005_Battler_StatStages.rb rename to Data/Scripts/011_Battle/001_Battler/005_Battler_StatStages.rb diff --git a/Data/Scripts/012_Battle/001_Battler/006_Battler_AbilityAndItem.rb b/Data/Scripts/011_Battle/001_Battler/006_Battler_AbilityAndItem.rb similarity index 100% rename from Data/Scripts/012_Battle/001_Battler/006_Battler_AbilityAndItem.rb rename to Data/Scripts/011_Battle/001_Battler/006_Battler_AbilityAndItem.rb diff --git a/Data/Scripts/012_Battle/001_Battler/007_Battler_UseMove.rb b/Data/Scripts/011_Battle/001_Battler/007_Battler_UseMove.rb similarity index 100% rename from Data/Scripts/012_Battle/001_Battler/007_Battler_UseMove.rb rename to Data/Scripts/011_Battle/001_Battler/007_Battler_UseMove.rb diff --git a/Data/Scripts/012_Battle/001_Battler/008_Battler_UseMove_Targeting.rb b/Data/Scripts/011_Battle/001_Battler/008_Battler_UseMove_Targeting.rb similarity index 100% rename from Data/Scripts/012_Battle/001_Battler/008_Battler_UseMove_Targeting.rb rename to Data/Scripts/011_Battle/001_Battler/008_Battler_UseMove_Targeting.rb diff --git a/Data/Scripts/012_Battle/001_Battler/009_Battler_UseMove_SuccessChecks.rb b/Data/Scripts/011_Battle/001_Battler/009_Battler_UseMove_SuccessChecks.rb similarity index 100% rename from Data/Scripts/012_Battle/001_Battler/009_Battler_UseMove_SuccessChecks.rb rename to Data/Scripts/011_Battle/001_Battler/009_Battler_UseMove_SuccessChecks.rb diff --git a/Data/Scripts/012_Battle/001_Battler/010_Battler_UseMove_TriggerEffects.rb b/Data/Scripts/011_Battle/001_Battler/010_Battler_UseMove_TriggerEffects.rb similarity index 100% rename from Data/Scripts/012_Battle/001_Battler/010_Battler_UseMove_TriggerEffects.rb rename to Data/Scripts/011_Battle/001_Battler/010_Battler_UseMove_TriggerEffects.rb diff --git a/Data/Scripts/012_Battle/005_PBEffects.rb b/Data/Scripts/011_Battle/001_PBEffects.rb similarity index 100% rename from Data/Scripts/012_Battle/005_PBEffects.rb rename to Data/Scripts/011_Battle/001_PBEffects.rb diff --git a/Data/Scripts/012_Battle/006_BattleHandlers.rb b/Data/Scripts/011_Battle/002_BattleHandlers.rb similarity index 100% rename from Data/Scripts/012_Battle/006_BattleHandlers.rb rename to Data/Scripts/011_Battle/002_BattleHandlers.rb diff --git a/Data/Scripts/012_Battle/002_Move/001_PokeBattle_Move.rb b/Data/Scripts/011_Battle/002_Move/001_PokeBattle_Move.rb similarity index 100% rename from Data/Scripts/012_Battle/002_Move/001_PokeBattle_Move.rb rename to Data/Scripts/011_Battle/002_Move/001_PokeBattle_Move.rb diff --git a/Data/Scripts/012_Battle/002_Move/002_Move_Usage.rb b/Data/Scripts/011_Battle/002_Move/002_Move_Usage.rb similarity index 100% rename from Data/Scripts/012_Battle/002_Move/002_Move_Usage.rb rename to Data/Scripts/011_Battle/002_Move/002_Move_Usage.rb diff --git a/Data/Scripts/012_Battle/002_Move/003_Move_Usage_Calculations.rb b/Data/Scripts/011_Battle/002_Move/003_Move_Usage_Calculations.rb similarity index 100% rename from Data/Scripts/012_Battle/002_Move/003_Move_Usage_Calculations.rb rename to Data/Scripts/011_Battle/002_Move/003_Move_Usage_Calculations.rb diff --git a/Data/Scripts/012_Battle/002_Move/004_Move_Effects_Generic.rb b/Data/Scripts/011_Battle/002_Move/004_Move_Effects_Generic.rb similarity index 100% rename from Data/Scripts/012_Battle/002_Move/004_Move_Effects_Generic.rb rename to Data/Scripts/011_Battle/002_Move/004_Move_Effects_Generic.rb diff --git a/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb b/Data/Scripts/011_Battle/002_Move/005_Move_Effects_000-07F.rb similarity index 100% rename from Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb rename to Data/Scripts/011_Battle/002_Move/005_Move_Effects_000-07F.rb diff --git a/Data/Scripts/012_Battle/002_Move/006_Move_Effects_080-0FF.rb b/Data/Scripts/011_Battle/002_Move/006_Move_Effects_080-0FF.rb similarity index 100% rename from Data/Scripts/012_Battle/002_Move/006_Move_Effects_080-0FF.rb rename to Data/Scripts/011_Battle/002_Move/006_Move_Effects_080-0FF.rb diff --git a/Data/Scripts/012_Battle/002_Move/007_Move_Effects_100-17F.rb b/Data/Scripts/011_Battle/002_Move/007_Move_Effects_100-17F.rb similarity index 100% rename from Data/Scripts/012_Battle/002_Move/007_Move_Effects_100-17F.rb rename to Data/Scripts/011_Battle/002_Move/007_Move_Effects_100-17F.rb diff --git a/Data/Scripts/012_Battle/003_Battle/001_PokeBattle_BattleCommon.rb b/Data/Scripts/011_Battle/003_Battle/001_PokeBattle_BattleCommon.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/001_PokeBattle_BattleCommon.rb rename to Data/Scripts/011_Battle/003_Battle/001_PokeBattle_BattleCommon.rb diff --git a/Data/Scripts/012_Battle/003_Battle/002_PokeBattle_Battle.rb b/Data/Scripts/011_Battle/003_Battle/002_PokeBattle_Battle.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/002_PokeBattle_Battle.rb rename to Data/Scripts/011_Battle/003_Battle/002_PokeBattle_Battle.rb diff --git a/Data/Scripts/012_Battle/003_Battle/003_Battle_StartAndEnd.rb b/Data/Scripts/011_Battle/003_Battle/003_Battle_StartAndEnd.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/003_Battle_StartAndEnd.rb rename to Data/Scripts/011_Battle/003_Battle/003_Battle_StartAndEnd.rb diff --git a/Data/Scripts/012_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb b/Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb rename to Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb diff --git a/Data/Scripts/012_Battle/003_Battle/005_Battle_Action_AttacksPriority.rb b/Data/Scripts/011_Battle/003_Battle/005_Battle_Action_AttacksPriority.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/005_Battle_Action_AttacksPriority.rb rename to Data/Scripts/011_Battle/003_Battle/005_Battle_Action_AttacksPriority.rb diff --git a/Data/Scripts/012_Battle/003_Battle/006_Battle_Action_Switching.rb b/Data/Scripts/011_Battle/003_Battle/006_Battle_Action_Switching.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/006_Battle_Action_Switching.rb rename to Data/Scripts/011_Battle/003_Battle/006_Battle_Action_Switching.rb diff --git a/Data/Scripts/012_Battle/003_Battle/007_Battle_Action_UseItem.rb b/Data/Scripts/011_Battle/003_Battle/007_Battle_Action_UseItem.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/007_Battle_Action_UseItem.rb rename to Data/Scripts/011_Battle/003_Battle/007_Battle_Action_UseItem.rb diff --git a/Data/Scripts/012_Battle/003_Battle/008_Battle_Action_Running.rb b/Data/Scripts/011_Battle/003_Battle/008_Battle_Action_Running.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/008_Battle_Action_Running.rb rename to Data/Scripts/011_Battle/003_Battle/008_Battle_Action_Running.rb diff --git a/Data/Scripts/012_Battle/003_Battle/009_Battle_Action_Other.rb b/Data/Scripts/011_Battle/003_Battle/009_Battle_Action_Other.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/009_Battle_Action_Other.rb rename to Data/Scripts/011_Battle/003_Battle/009_Battle_Action_Other.rb diff --git a/Data/Scripts/012_Battle/003_Battle/010_Battle_Phase_Command.rb b/Data/Scripts/011_Battle/003_Battle/010_Battle_Phase_Command.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/010_Battle_Phase_Command.rb rename to Data/Scripts/011_Battle/003_Battle/010_Battle_Phase_Command.rb diff --git a/Data/Scripts/012_Battle/003_Battle/011_Battle_Phase_Attack.rb b/Data/Scripts/011_Battle/003_Battle/011_Battle_Phase_Attack.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/011_Battle_Phase_Attack.rb rename to Data/Scripts/011_Battle/003_Battle/011_Battle_Phase_Attack.rb diff --git a/Data/Scripts/012_Battle/003_Battle/012_Battle_Phase_EndOfRound.rb b/Data/Scripts/011_Battle/003_Battle/012_Battle_Phase_EndOfRound.rb similarity index 100% rename from Data/Scripts/012_Battle/003_Battle/012_Battle_Phase_EndOfRound.rb rename to Data/Scripts/011_Battle/003_Battle/012_Battle_Phase_EndOfRound.rb diff --git a/Data/Scripts/012_Battle/007_BattleHandlers_Abilities.rb b/Data/Scripts/011_Battle/003_BattleHandlers_Abilities.rb similarity index 100% rename from Data/Scripts/012_Battle/007_BattleHandlers_Abilities.rb rename to Data/Scripts/011_Battle/003_BattleHandlers_Abilities.rb diff --git a/Data/Scripts/012_Battle/004_AI/001_PokeBattle_AI.rb b/Data/Scripts/011_Battle/004_AI/001_PokeBattle_AI.rb similarity index 100% rename from Data/Scripts/012_Battle/004_AI/001_PokeBattle_AI.rb rename to Data/Scripts/011_Battle/004_AI/001_PokeBattle_AI.rb diff --git a/Data/Scripts/012_Battle/004_AI/002_AI_Item.rb b/Data/Scripts/011_Battle/004_AI/002_AI_Item.rb similarity index 100% rename from Data/Scripts/012_Battle/004_AI/002_AI_Item.rb rename to Data/Scripts/011_Battle/004_AI/002_AI_Item.rb diff --git a/Data/Scripts/012_Battle/004_AI/003_AI_Switch.rb b/Data/Scripts/011_Battle/004_AI/003_AI_Switch.rb similarity index 100% rename from Data/Scripts/012_Battle/004_AI/003_AI_Switch.rb rename to Data/Scripts/011_Battle/004_AI/003_AI_Switch.rb diff --git a/Data/Scripts/012_Battle/004_AI/004_AI_Move.rb b/Data/Scripts/011_Battle/004_AI/004_AI_Move.rb similarity index 100% rename from Data/Scripts/012_Battle/004_AI/004_AI_Move.rb rename to Data/Scripts/011_Battle/004_AI/004_AI_Move.rb diff --git a/Data/Scripts/012_Battle/004_AI/005_AI_Move_EffectScores.rb b/Data/Scripts/011_Battle/004_AI/005_AI_Move_EffectScores.rb similarity index 100% rename from Data/Scripts/012_Battle/004_AI/005_AI_Move_EffectScores.rb rename to Data/Scripts/011_Battle/004_AI/005_AI_Move_EffectScores.rb diff --git a/Data/Scripts/012_Battle/004_AI/006_AI_Move_Utilities.rb b/Data/Scripts/011_Battle/004_AI/006_AI_Move_Utilities.rb similarity index 100% rename from Data/Scripts/012_Battle/004_AI/006_AI_Move_Utilities.rb rename to Data/Scripts/011_Battle/004_AI/006_AI_Move_Utilities.rb diff --git a/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb b/Data/Scripts/011_Battle/004_BattleHandlers_Items.rb similarity index 100% rename from Data/Scripts/012_Battle/008_BattleHandlers_Items.rb rename to Data/Scripts/011_Battle/004_BattleHandlers_Items.rb diff --git a/Data/Scripts/012_Battle/009_BallHandlers_PokeBallEffects.rb b/Data/Scripts/011_Battle/005_BallHandlers_PokeBallEffects.rb similarity index 100% rename from Data/Scripts/012_Battle/009_BallHandlers_PokeBallEffects.rb rename to Data/Scripts/011_Battle/005_BallHandlers_PokeBallEffects.rb diff --git a/Data/Scripts/012_Battle/005_Battle scene/001_PokeBattle_Animation.rb b/Data/Scripts/011_Battle/005_Battle scene/001_PokeBattle_Animation.rb similarity index 100% rename from Data/Scripts/012_Battle/005_Battle scene/001_PokeBattle_Animation.rb rename to Data/Scripts/011_Battle/005_Battle scene/001_PokeBattle_Animation.rb diff --git a/Data/Scripts/012_Battle/005_Battle scene/002_PokeBattle_SceneAnimations.rb b/Data/Scripts/011_Battle/005_Battle scene/002_PokeBattle_SceneAnimations.rb similarity index 100% rename from Data/Scripts/012_Battle/005_Battle scene/002_PokeBattle_SceneAnimations.rb rename to Data/Scripts/011_Battle/005_Battle scene/002_PokeBattle_SceneAnimations.rb diff --git a/Data/Scripts/012_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb b/Data/Scripts/011_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb similarity index 100% rename from Data/Scripts/012_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb rename to Data/Scripts/011_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb diff --git a/Data/Scripts/012_Battle/005_Battle scene/004_PokeBattle_SceneElements.rb b/Data/Scripts/011_Battle/005_Battle scene/004_PokeBattle_SceneElements.rb similarity index 100% rename from Data/Scripts/012_Battle/005_Battle scene/004_PokeBattle_SceneElements.rb rename to Data/Scripts/011_Battle/005_Battle scene/004_PokeBattle_SceneElements.rb diff --git a/Data/Scripts/012_Battle/005_Battle scene/005_PokeBattle_SceneMenus.rb b/Data/Scripts/011_Battle/005_Battle scene/005_PokeBattle_SceneMenus.rb similarity index 100% rename from Data/Scripts/012_Battle/005_Battle scene/005_PokeBattle_SceneMenus.rb rename to Data/Scripts/011_Battle/005_Battle scene/005_PokeBattle_SceneMenus.rb diff --git a/Data/Scripts/012_Battle/005_Battle scene/006_PokeBattle_Scene.rb b/Data/Scripts/011_Battle/005_Battle scene/006_PokeBattle_Scene.rb similarity index 100% rename from Data/Scripts/012_Battle/005_Battle scene/006_PokeBattle_Scene.rb rename to Data/Scripts/011_Battle/005_Battle scene/006_PokeBattle_Scene.rb diff --git a/Data/Scripts/012_Battle/005_Battle scene/007_Scene_Initialize.rb b/Data/Scripts/011_Battle/005_Battle scene/007_Scene_Initialize.rb similarity index 100% rename from Data/Scripts/012_Battle/005_Battle scene/007_Scene_Initialize.rb rename to Data/Scripts/011_Battle/005_Battle scene/007_Scene_Initialize.rb diff --git a/Data/Scripts/012_Battle/005_Battle scene/008_Scene_Commands.rb b/Data/Scripts/011_Battle/005_Battle scene/008_Scene_Commands.rb similarity index 100% rename from Data/Scripts/012_Battle/005_Battle scene/008_Scene_Commands.rb rename to Data/Scripts/011_Battle/005_Battle scene/008_Scene_Commands.rb diff --git a/Data/Scripts/012_Battle/005_Battle scene/009_Scene_Animations.rb b/Data/Scripts/011_Battle/005_Battle scene/009_Scene_Animations.rb similarity index 100% rename from Data/Scripts/012_Battle/005_Battle scene/009_Scene_Animations.rb rename to Data/Scripts/011_Battle/005_Battle scene/009_Scene_Animations.rb diff --git a/Data/Scripts/012_Battle/006_Other battle types/001_PokeBattle_AnimationPlayer.rb b/Data/Scripts/011_Battle/006_Other battle types/001_PokeBattle_AnimationPlayer.rb similarity index 100% rename from Data/Scripts/012_Battle/006_Other battle types/001_PokeBattle_AnimationPlayer.rb rename to Data/Scripts/011_Battle/006_Other battle types/001_PokeBattle_AnimationPlayer.rb diff --git a/Data/Scripts/012_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb b/Data/Scripts/011_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb similarity index 100% rename from Data/Scripts/012_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb rename to Data/Scripts/011_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb diff --git a/Data/Scripts/012_Battle/006_Other battle types/003_PokeBattle_BugContest.rb b/Data/Scripts/011_Battle/006_Other battle types/003_PokeBattle_BugContest.rb similarity index 100% rename from Data/Scripts/012_Battle/006_Other battle types/003_PokeBattle_BugContest.rb rename to Data/Scripts/011_Battle/006_Other battle types/003_PokeBattle_BugContest.rb diff --git a/Data/Scripts/012_Battle/006_Other battle types/004_PokeBattle_BattlePalace.rb b/Data/Scripts/011_Battle/006_Other battle types/004_PokeBattle_BattlePalace.rb similarity index 100% rename from Data/Scripts/012_Battle/006_Other battle types/004_PokeBattle_BattlePalace.rb rename to Data/Scripts/011_Battle/006_Other battle types/004_PokeBattle_BattlePalace.rb diff --git a/Data/Scripts/012_Battle/006_Other battle types/005_PokeBattle_BattleArena.rb b/Data/Scripts/011_Battle/006_Other battle types/005_PokeBattle_BattleArena.rb similarity index 100% rename from Data/Scripts/012_Battle/006_Other battle types/005_PokeBattle_BattleArena.rb rename to Data/Scripts/011_Battle/006_Other battle types/005_PokeBattle_BattleArena.rb diff --git a/Data/Scripts/012_Battle/006_Other battle types/006_PokeBattle_BattleRecord.rb b/Data/Scripts/011_Battle/006_Other battle types/006_PokeBattle_BattleRecord.rb similarity index 100% rename from Data/Scripts/012_Battle/006_Other battle types/006_PokeBattle_BattleRecord.rb rename to Data/Scripts/011_Battle/006_Other battle types/006_PokeBattle_BattleRecord.rb diff --git a/Data/Scripts/012_Battle/006_Other battle types/007_PokeBattle_DebugScene.rb b/Data/Scripts/011_Battle/006_Other battle types/007_PokeBattle_DebugScene.rb similarity index 100% rename from Data/Scripts/012_Battle/006_Other battle types/007_PokeBattle_DebugScene.rb rename to Data/Scripts/011_Battle/006_Other battle types/007_PokeBattle_DebugScene.rb diff --git a/Data/Scripts/012_Battle/006_Other battle types/008_PokeBattle_BattlePeer.rb b/Data/Scripts/011_Battle/006_Other battle types/008_PokeBattle_BattlePeer.rb similarity index 100% rename from Data/Scripts/012_Battle/006_Other battle types/008_PokeBattle_BattlePeer.rb rename to Data/Scripts/011_Battle/006_Other battle types/008_PokeBattle_BattlePeer.rb diff --git a/Data/Scripts/012_Battle/006_Other battle types/009_PokeBattle_Clauses.rb b/Data/Scripts/011_Battle/006_Other battle types/009_PokeBattle_Clauses.rb similarity index 100% rename from Data/Scripts/012_Battle/006_Other battle types/009_PokeBattle_Clauses.rb rename to Data/Scripts/011_Battle/006_Other battle types/009_PokeBattle_Clauses.rb diff --git a/Data/Scripts/012_Battle/001_PokeBattle_ActiveField.rb b/Data/Scripts/011_Battle/006_PokeBattle_ActiveField.rb similarity index 100% rename from Data/Scripts/012_Battle/001_PokeBattle_ActiveField.rb rename to Data/Scripts/011_Battle/006_PokeBattle_ActiveField.rb diff --git a/Data/Scripts/012_Battle/002_PokeBattle_DamageState.rb b/Data/Scripts/011_Battle/007_PokeBattle_DamageState.rb similarity index 100% rename from Data/Scripts/012_Battle/002_PokeBattle_DamageState.rb rename to Data/Scripts/011_Battle/007_PokeBattle_DamageState.rb diff --git a/Data/Scripts/013_Overworld/001_Overworld.rb b/Data/Scripts/012_Overworld/001_Overworld.rb similarity index 100% rename from Data/Scripts/013_Overworld/001_Overworld.rb rename to Data/Scripts/012_Overworld/001_Overworld.rb diff --git a/Data/Scripts/013_Overworld/001_Animations/001_Overworld_Weather.rb b/Data/Scripts/012_Overworld/001_Visuals/001_Overworld_Weather.rb similarity index 100% rename from Data/Scripts/013_Overworld/001_Animations/001_Overworld_Weather.rb rename to Data/Scripts/012_Overworld/001_Visuals/001_Overworld_Weather.rb diff --git a/Data/Scripts/013_Overworld/001_Animations/002_Overworld_Overlays.rb b/Data/Scripts/012_Overworld/001_Visuals/002_Overworld_Overlays.rb similarity index 100% rename from Data/Scripts/013_Overworld/001_Animations/002_Overworld_Overlays.rb rename to Data/Scripts/012_Overworld/001_Visuals/002_Overworld_Overlays.rb diff --git a/Data/Scripts/013_Overworld/001_Animations/003_Overworld_MapTransitionAnims.rb b/Data/Scripts/012_Overworld/001_Visuals/003_Overworld_MapTransitionAnims.rb similarity index 100% rename from Data/Scripts/013_Overworld/001_Animations/003_Overworld_MapTransitionAnims.rb rename to Data/Scripts/012_Overworld/001_Visuals/003_Overworld_MapTransitionAnims.rb diff --git a/Data/Scripts/013_Overworld/002_Battles/001_Overworld_BattleStarting.rb b/Data/Scripts/012_Overworld/002_Battles/001_Overworld_BattleStarting.rb similarity index 100% rename from Data/Scripts/013_Overworld/002_Battles/001_Overworld_BattleStarting.rb rename to Data/Scripts/012_Overworld/002_Battles/001_Overworld_BattleStarting.rb diff --git a/Data/Scripts/013_Overworld/002_Battles/002_Overworld_BattleIntroAnim.rb b/Data/Scripts/012_Overworld/002_Battles/002_Overworld_BattleIntroAnim.rb similarity index 100% rename from Data/Scripts/013_Overworld/002_Battles/002_Overworld_BattleIntroAnim.rb rename to Data/Scripts/012_Overworld/002_Battles/002_Overworld_BattleIntroAnim.rb diff --git a/Data/Scripts/013_Overworld/002_Battles/003_Overworld_WildEncounters.rb b/Data/Scripts/012_Overworld/002_Battles/003_Overworld_WildEncounters.rb similarity index 100% rename from Data/Scripts/013_Overworld/002_Battles/003_Overworld_WildEncounters.rb rename to Data/Scripts/012_Overworld/002_Battles/003_Overworld_WildEncounters.rb diff --git a/Data/Scripts/013_Overworld/002_Battles/004_Overworld_EncounterModifiers.rb b/Data/Scripts/012_Overworld/002_Battles/004_Overworld_EncounterModifiers.rb similarity index 100% rename from Data/Scripts/013_Overworld/002_Battles/004_Overworld_EncounterModifiers.rb rename to Data/Scripts/012_Overworld/002_Battles/004_Overworld_EncounterModifiers.rb diff --git a/Data/Scripts/013_Overworld/002_Battles/005_Overworld_RoamingPokemon.rb b/Data/Scripts/012_Overworld/002_Battles/005_Overworld_RoamingPokemon.rb similarity index 100% rename from Data/Scripts/013_Overworld/002_Battles/005_Overworld_RoamingPokemon.rb rename to Data/Scripts/012_Overworld/002_Battles/005_Overworld_RoamingPokemon.rb diff --git a/Data/Scripts/013_Overworld/002_Overworld_Metadata.rb b/Data/Scripts/012_Overworld/002_Overworld_Metadata.rb similarity index 100% rename from Data/Scripts/013_Overworld/002_Overworld_Metadata.rb rename to Data/Scripts/012_Overworld/002_Overworld_Metadata.rb diff --git a/Data/Scripts/013_Overworld/003_Overworld_Time.rb b/Data/Scripts/012_Overworld/003_Overworld_Time.rb similarity index 100% rename from Data/Scripts/013_Overworld/003_Overworld_Time.rb rename to Data/Scripts/012_Overworld/003_Overworld_Time.rb diff --git a/Data/Scripts/013_Overworld/004_Overworld_FieldMoves.rb b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb similarity index 100% rename from Data/Scripts/013_Overworld/004_Overworld_FieldMoves.rb rename to Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb diff --git a/Data/Scripts/013_Overworld/005_Overworld_Fishing.rb b/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb similarity index 100% rename from Data/Scripts/013_Overworld/005_Overworld_Fishing.rb rename to Data/Scripts/012_Overworld/005_Overworld_Fishing.rb diff --git a/Data/Scripts/013_Overworld/006_Overworld_BerryPlants.rb b/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb similarity index 100% rename from Data/Scripts/013_Overworld/006_Overworld_BerryPlants.rb rename to Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb diff --git a/Data/Scripts/013_Overworld/007_Overworld_DayCare.rb b/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb similarity index 100% rename from Data/Scripts/013_Overworld/007_Overworld_DayCare.rb rename to Data/Scripts/012_Overworld/007_Overworld_DayCare.rb diff --git a/Data/Scripts/013_Overworld/008_Overworld_RandomDungeons.rb b/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb similarity index 100% rename from Data/Scripts/013_Overworld/008_Overworld_RandomDungeons.rb rename to Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb diff --git a/Data/Scripts/016_Pokemon/001_Pokemon-related/002_FormHandlers.rb b/Data/Scripts/013_Pokemon/001_Pokemon-related/001_FormHandlers.rb similarity index 100% rename from Data/Scripts/016_Pokemon/001_Pokemon-related/002_FormHandlers.rb rename to Data/Scripts/013_Pokemon/001_Pokemon-related/001_FormHandlers.rb diff --git a/Data/Scripts/016_Pokemon/001_Pokemon-related/004_ShadowPokemon_Other.rb b/Data/Scripts/013_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb similarity index 100% rename from Data/Scripts/016_Pokemon/001_Pokemon-related/004_ShadowPokemon_Other.rb rename to Data/Scripts/013_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb diff --git a/Data/Scripts/016_Pokemon/001_Pokemon-related/008_Pokemon_Sprites.rb b/Data/Scripts/013_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb similarity index 100% rename from Data/Scripts/016_Pokemon/001_Pokemon-related/008_Pokemon_Sprites.rb rename to Data/Scripts/013_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb diff --git a/Data/Scripts/016_Pokemon/001_Pokemon-related/009_PokemonStorage.rb b/Data/Scripts/013_Pokemon/001_Pokemon-related/004_PokemonStorage.rb similarity index 100% rename from Data/Scripts/016_Pokemon/001_Pokemon-related/009_PokemonStorage.rb rename to Data/Scripts/013_Pokemon/001_Pokemon-related/004_PokemonStorage.rb diff --git a/Data/Scripts/016_Pokemon/001_Pokemon.rb b/Data/Scripts/013_Pokemon/001_Pokemon.rb similarity index 100% rename from Data/Scripts/016_Pokemon/001_Pokemon.rb rename to Data/Scripts/013_Pokemon/001_Pokemon.rb diff --git a/Data/Scripts/016_Pokemon/002_Pokemon_MegaEvolution.rb b/Data/Scripts/013_Pokemon/002_Pokemon_MegaEvolution.rb similarity index 100% rename from Data/Scripts/016_Pokemon/002_Pokemon_MegaEvolution.rb rename to Data/Scripts/013_Pokemon/002_Pokemon_MegaEvolution.rb diff --git a/Data/Scripts/016_Pokemon/003_Pokemon_ShadowPokemon.rb b/Data/Scripts/013_Pokemon/003_Pokemon_ShadowPokemon.rb similarity index 100% rename from Data/Scripts/016_Pokemon/003_Pokemon_ShadowPokemon.rb rename to Data/Scripts/013_Pokemon/003_Pokemon_ShadowPokemon.rb diff --git a/Data/Scripts/016_Pokemon/004_Pokemon_Move.rb b/Data/Scripts/013_Pokemon/004_Pokemon_Move.rb similarity index 100% rename from Data/Scripts/016_Pokemon/004_Pokemon_Move.rb rename to Data/Scripts/013_Pokemon/004_Pokemon_Move.rb diff --git a/Data/Scripts/016_Pokemon/006_Pokemon_Owner.rb b/Data/Scripts/013_Pokemon/005_Pokemon_Owner.rb similarity index 100% rename from Data/Scripts/016_Pokemon/006_Pokemon_Owner.rb rename to Data/Scripts/013_Pokemon/005_Pokemon_Owner.rb diff --git a/Data/Scripts/016_Pokemon/010_Pokemon_Deprecated.rb b/Data/Scripts/013_Pokemon/006_Pokemon_Deprecated.rb similarity index 100% rename from Data/Scripts/016_Pokemon/010_Pokemon_Deprecated.rb rename to Data/Scripts/013_Pokemon/006_Pokemon_Deprecated.rb diff --git a/Data/Scripts/015_Items/001_Item_Utilities.rb b/Data/Scripts/014_Items/001_Item_Utilities.rb similarity index 100% rename from Data/Scripts/015_Items/001_Item_Utilities.rb rename to Data/Scripts/014_Items/001_Item_Utilities.rb diff --git a/Data/Scripts/015_Items/002_Item_Effects.rb b/Data/Scripts/014_Items/002_Item_Effects.rb similarity index 100% rename from Data/Scripts/015_Items/002_Item_Effects.rb rename to Data/Scripts/014_Items/002_Item_Effects.rb diff --git a/Data/Scripts/015_Items/003_Item_BattleEffects.rb b/Data/Scripts/014_Items/003_Item_BattleEffects.rb similarity index 100% rename from Data/Scripts/015_Items/003_Item_BattleEffects.rb rename to Data/Scripts/014_Items/003_Item_BattleEffects.rb diff --git a/Data/Scripts/015_Items/004_Item_Phone.rb b/Data/Scripts/014_Items/004_Item_Phone.rb similarity index 100% rename from Data/Scripts/015_Items/004_Item_Phone.rb rename to Data/Scripts/014_Items/004_Item_Phone.rb diff --git a/Data/Scripts/015_Items/005_Item_PokeRadar.rb b/Data/Scripts/014_Items/005_Item_PokeRadar.rb similarity index 100% rename from Data/Scripts/015_Items/005_Item_PokeRadar.rb rename to Data/Scripts/014_Items/005_Item_PokeRadar.rb diff --git a/Data/Scripts/015_Items/006_Item_Mail.rb b/Data/Scripts/014_Items/006_Item_Mail.rb similarity index 100% rename from Data/Scripts/015_Items/006_Item_Mail.rb rename to Data/Scripts/014_Items/006_Item_Mail.rb diff --git a/Data/Scripts/015_Items/007_Item_Sprites.rb b/Data/Scripts/014_Items/007_Item_Sprites.rb similarity index 100% rename from Data/Scripts/015_Items/007_Item_Sprites.rb rename to Data/Scripts/014_Items/007_Item_Sprites.rb diff --git a/Data/Scripts/015_Items/008_PokemonBag.rb b/Data/Scripts/014_Items/008_PokemonBag.rb similarity index 100% rename from Data/Scripts/015_Items/008_PokemonBag.rb rename to Data/Scripts/014_Items/008_PokemonBag.rb diff --git a/Data/Scripts/014_Trainers/001_Trainer.rb b/Data/Scripts/015_Trainers and player/001_Trainer.rb similarity index 100% rename from Data/Scripts/014_Trainers/001_Trainer.rb rename to Data/Scripts/015_Trainers and player/001_Trainer.rb diff --git a/Data/Scripts/014_Trainers/002_Trainer_LoadAndNew.rb b/Data/Scripts/015_Trainers and player/002_Trainer_LoadAndNew.rb similarity index 100% rename from Data/Scripts/014_Trainers/002_Trainer_LoadAndNew.rb rename to Data/Scripts/015_Trainers and player/002_Trainer_LoadAndNew.rb diff --git a/Data/Scripts/014_Trainers/003_Trainer_Sprites.rb b/Data/Scripts/015_Trainers and player/003_Trainer_Sprites.rb similarity index 100% rename from Data/Scripts/014_Trainers/003_Trainer_Sprites.rb rename to Data/Scripts/015_Trainers and player/003_Trainer_Sprites.rb diff --git a/Data/Scripts/014_Trainers/004_Player.rb b/Data/Scripts/015_Trainers and player/004_Player.rb similarity index 100% rename from Data/Scripts/014_Trainers/004_Player.rb rename to Data/Scripts/015_Trainers and player/004_Player.rb diff --git a/Data/Scripts/014_Trainers/005_Player_Pokedex.rb b/Data/Scripts/015_Trainers and player/005_Player_Pokedex.rb similarity index 100% rename from Data/Scripts/014_Trainers/005_Player_Pokedex.rb rename to Data/Scripts/015_Trainers and player/005_Player_Pokedex.rb diff --git a/Data/Scripts/014_Trainers/006_Player_Deprecated.rb b/Data/Scripts/015_Trainers and player/006_Player_Deprecated.rb similarity index 100% rename from Data/Scripts/014_Trainers/006_Player_Deprecated.rb rename to Data/Scripts/015_Trainers and player/006_Player_Deprecated.rb diff --git a/Data/Scripts/017_UI/001_Non-interactive/001_UI_SplashesAndTitleScreen.rb b/Data/Scripts/016_UI/001_Non-interactive/001_UI_SplashesAndTitleScreen.rb similarity index 100% rename from Data/Scripts/017_UI/001_Non-interactive/001_UI_SplashesAndTitleScreen.rb rename to Data/Scripts/016_UI/001_Non-interactive/001_UI_SplashesAndTitleScreen.rb diff --git a/Data/Scripts/017_UI/001_Non-interactive/002_UI_Controls.rb b/Data/Scripts/016_UI/001_Non-interactive/002_UI_Controls.rb similarity index 100% rename from Data/Scripts/017_UI/001_Non-interactive/002_UI_Controls.rb rename to Data/Scripts/016_UI/001_Non-interactive/002_UI_Controls.rb diff --git a/Data/Scripts/017_UI/001_Non-interactive/020_UI_EggHatching.rb b/Data/Scripts/016_UI/001_Non-interactive/003_UI_EggHatching.rb similarity index 100% rename from Data/Scripts/017_UI/001_Non-interactive/020_UI_EggHatching.rb rename to Data/Scripts/016_UI/001_Non-interactive/003_UI_EggHatching.rb diff --git a/Data/Scripts/017_UI/001_Non-interactive/021_UI_Evolution.rb b/Data/Scripts/016_UI/001_Non-interactive/004_UI_Evolution.rb similarity index 100% rename from Data/Scripts/017_UI/001_Non-interactive/021_UI_Evolution.rb rename to Data/Scripts/016_UI/001_Non-interactive/004_UI_Evolution.rb diff --git a/Data/Scripts/017_UI/001_Non-interactive/022_UI_Trading.rb b/Data/Scripts/016_UI/001_Non-interactive/005_UI_Trading.rb similarity index 100% rename from Data/Scripts/017_UI/001_Non-interactive/022_UI_Trading.rb rename to Data/Scripts/016_UI/001_Non-interactive/005_UI_Trading.rb diff --git a/Data/Scripts/017_UI/001_Non-interactive/027_UI_HallOfFame.rb b/Data/Scripts/016_UI/001_Non-interactive/006_UI_HallOfFame.rb similarity index 100% rename from Data/Scripts/017_UI/001_Non-interactive/027_UI_HallOfFame.rb rename to Data/Scripts/016_UI/001_Non-interactive/006_UI_HallOfFame.rb diff --git a/Data/Scripts/017_UI/001_Non-interactive/003_UI_Credits.rb b/Data/Scripts/016_UI/001_Non-interactive/007_UI_Credits.rb similarity index 100% rename from Data/Scripts/017_UI/001_Non-interactive/003_UI_Credits.rb rename to Data/Scripts/016_UI/001_Non-interactive/007_UI_Credits.rb diff --git a/Data/Scripts/017_UI/001_UI_PauseMenu.rb b/Data/Scripts/016_UI/001_UI_PauseMenu.rb similarity index 100% rename from Data/Scripts/017_UI/001_UI_PauseMenu.rb rename to Data/Scripts/016_UI/001_UI_PauseMenu.rb diff --git a/Data/Scripts/017_UI/002_UI_PokedexMenu.rb b/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb similarity index 100% rename from Data/Scripts/017_UI/002_UI_PokedexMenu.rb rename to Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb diff --git a/Data/Scripts/017_UI/003_UI_PokedexMain.rb b/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb similarity index 100% rename from Data/Scripts/017_UI/003_UI_PokedexMain.rb rename to Data/Scripts/016_UI/003_UI_Pokedex_Main.rb diff --git a/Data/Scripts/017_UI/004_UI_PokedexEntry.rb b/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb similarity index 100% rename from Data/Scripts/017_UI/004_UI_PokedexEntry.rb rename to Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb diff --git a/Data/Scripts/017_UI/005_UI_Party.rb b/Data/Scripts/016_UI/005_UI_Party.rb similarity index 100% rename from Data/Scripts/017_UI/005_UI_Party.rb rename to Data/Scripts/016_UI/005_UI_Party.rb diff --git a/Data/Scripts/017_UI/006_UI_Summary.rb b/Data/Scripts/016_UI/006_UI_Summary.rb similarity index 100% rename from Data/Scripts/017_UI/006_UI_Summary.rb rename to Data/Scripts/016_UI/006_UI_Summary.rb diff --git a/Data/Scripts/017_UI/007_UI_Bag.rb b/Data/Scripts/016_UI/007_UI_Bag.rb similarity index 100% rename from Data/Scripts/017_UI/007_UI_Bag.rb rename to Data/Scripts/016_UI/007_UI_Bag.rb diff --git a/Data/Scripts/017_UI/008_UI_Pokegear.rb b/Data/Scripts/016_UI/008_UI_Pokegear.rb similarity index 100% rename from Data/Scripts/017_UI/008_UI_Pokegear.rb rename to Data/Scripts/016_UI/008_UI_Pokegear.rb diff --git a/Data/Scripts/017_UI/009_UI_RegionMap.rb b/Data/Scripts/016_UI/009_UI_RegionMap.rb similarity index 100% rename from Data/Scripts/017_UI/009_UI_RegionMap.rb rename to Data/Scripts/016_UI/009_UI_RegionMap.rb diff --git a/Data/Scripts/017_UI/010_UI_Phone.rb b/Data/Scripts/016_UI/010_UI_Phone.rb similarity index 100% rename from Data/Scripts/017_UI/010_UI_Phone.rb rename to Data/Scripts/016_UI/010_UI_Phone.rb diff --git a/Data/Scripts/017_UI/011_UI_Jukebox.rb b/Data/Scripts/016_UI/011_UI_Jukebox.rb similarity index 100% rename from Data/Scripts/017_UI/011_UI_Jukebox.rb rename to Data/Scripts/016_UI/011_UI_Jukebox.rb diff --git a/Data/Scripts/017_UI/012_UI_TrainerCard.rb b/Data/Scripts/016_UI/012_UI_TrainerCard.rb similarity index 100% rename from Data/Scripts/017_UI/012_UI_TrainerCard.rb rename to Data/Scripts/016_UI/012_UI_TrainerCard.rb diff --git a/Data/Scripts/017_UI/013_UI_Load.rb b/Data/Scripts/016_UI/013_UI_Load.rb similarity index 100% rename from Data/Scripts/017_UI/013_UI_Load.rb rename to Data/Scripts/016_UI/013_UI_Load.rb diff --git a/Data/Scripts/017_UI/014_UI_Save.rb b/Data/Scripts/016_UI/014_UI_Save.rb similarity index 100% rename from Data/Scripts/017_UI/014_UI_Save.rb rename to Data/Scripts/016_UI/014_UI_Save.rb diff --git a/Data/Scripts/017_UI/015_UI_Options.rb b/Data/Scripts/016_UI/015_UI_Options.rb similarity index 100% rename from Data/Scripts/017_UI/015_UI_Options.rb rename to Data/Scripts/016_UI/015_UI_Options.rb diff --git a/Data/Scripts/017_UI/016_UI_ReadyMenu.rb b/Data/Scripts/016_UI/016_UI_ReadyMenu.rb similarity index 100% rename from Data/Scripts/017_UI/016_UI_ReadyMenu.rb rename to Data/Scripts/016_UI/016_UI_ReadyMenu.rb diff --git a/Data/Scripts/017_UI/017_UI_PokemonStorage.rb b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb similarity index 100% rename from Data/Scripts/017_UI/017_UI_PokemonStorage.rb rename to Data/Scripts/016_UI/017_UI_PokemonStorage.rb diff --git a/Data/Scripts/017_UI/018_UI_ItemStorage.rb b/Data/Scripts/016_UI/018_UI_ItemStorage.rb similarity index 100% rename from Data/Scripts/017_UI/018_UI_ItemStorage.rb rename to Data/Scripts/016_UI/018_UI_ItemStorage.rb diff --git a/Data/Scripts/017_UI/019_UI_PC.rb b/Data/Scripts/016_UI/019_UI_PC.rb similarity index 100% rename from Data/Scripts/017_UI/019_UI_PC.rb rename to Data/Scripts/016_UI/019_UI_PC.rb diff --git a/Data/Scripts/017_UI/025_UI_PokeMart.rb b/Data/Scripts/016_UI/020_UI_PokeMart.rb similarity index 100% rename from Data/Scripts/017_UI/025_UI_PokeMart.rb rename to Data/Scripts/016_UI/020_UI_PokeMart.rb diff --git a/Data/Scripts/017_UI/023_UI_MoveRelearner.rb b/Data/Scripts/016_UI/021_UI_MoveRelearner.rb similarity index 100% rename from Data/Scripts/017_UI/023_UI_MoveRelearner.rb rename to Data/Scripts/016_UI/021_UI_MoveRelearner.rb diff --git a/Data/Scripts/017_UI/024_UI_PurifyChamber.rb b/Data/Scripts/016_UI/022_UI_PurifyChamber.rb similarity index 100% rename from Data/Scripts/017_UI/024_UI_PurifyChamber.rb rename to Data/Scripts/016_UI/022_UI_PurifyChamber.rb diff --git a/Data/Scripts/017_UI/026_UI_MysteryGift.rb b/Data/Scripts/016_UI/023_UI_MysteryGift.rb similarity index 100% rename from Data/Scripts/017_UI/026_UI_MysteryGift.rb rename to Data/Scripts/016_UI/023_UI_MysteryGift.rb diff --git a/Data/Scripts/016_UI/024_UI_TextEntry.rb b/Data/Scripts/016_UI/024_UI_TextEntry.rb new file mode 100644 index 000000000..656e2d9d5 --- /dev/null +++ b/Data/Scripts/016_UI/024_UI_TextEntry.rb @@ -0,0 +1,799 @@ +#=============================================================================== +# +#=============================================================================== +class Window_CharacterEntry < Window_DrawableCommand + XSIZE=13 + YSIZE=4 + + def initialize(charset,viewport=nil) + @viewport=viewport + @charset=charset + @othercharset="" + super(0,96,480,192) + colors=getDefaultTextColors(self.windowskin) + self.baseColor=colors[0] + self.shadowColor=colors[1] + self.columns=XSIZE + refresh + end + + def setOtherCharset(value) + @othercharset=value.clone + refresh + end + + def setCharset(value) + @charset=value.clone + refresh + end + + def character + if self.index<0 || self.index>=@charset.length + return "" + else + return @charset[self.index] + end + end + + def command + return -1 if self.index==@charset.length + return -2 if self.index==@charset.length+1 + return -3 if self.index==@charset.length+2 + return self.index + end + + def itemCount + return @charset.length+3 + end + + def drawItem(index,_count,rect) + rect=drawCursor(index,rect) + if index==@charset.length # -1 + pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,"[ ]", + self.baseColor,self.shadowColor) + elsif index==@charset.length+1 # -2 + pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,@othercharset, + self.baseColor,self.shadowColor) + elsif index==@charset.length+2 # -3 + pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,_INTL("OK"), + self.baseColor,self.shadowColor) + else + pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,@charset[index], + self.baseColor,self.shadowColor) + end + end +end + + + +#=============================================================================== +# Text entry screen - free typing. +#=============================================================================== +class PokemonEntryScene + @@Characters=[ + [("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").scan(/./),"[*]"], + [("0123456789 !@\#$%^&*() ~`-_+={}[] :;'\"<>,.?/ ").scan(/./),"[A]"], + ] + USEKEYBOARD=true + + def pbStartScene(helptext,minlength,maxlength,initialText,subject=0,pokemon=nil) + @sprites={} + @viewport=Viewport.new(0,0,Graphics.width,Graphics.height) + @viewport.z=99999 + if USEKEYBOARD + @sprites["entry"]=Window_TextEntry_Keyboard.new(initialText, + 0,0,400-112,96,helptext,true) + Input.text_input = true + else + @sprites["entry"]=Window_TextEntry.new(initialText,0,0,400,96,helptext,true) + end + @sprites["entry"].x=(Graphics.width/2)-(@sprites["entry"].width/2)+32 + @sprites["entry"].viewport=@viewport + @sprites["entry"].visible=true + @minlength=minlength + @maxlength=maxlength + @symtype=0 + @sprites["entry"].maxlength=maxlength + if !USEKEYBOARD + @sprites["entry2"]=Window_CharacterEntry.new(@@Characters[@symtype][0]) + @sprites["entry2"].setOtherCharset(@@Characters[@symtype][1]) + @sprites["entry2"].viewport=@viewport + @sprites["entry2"].visible=true + @sprites["entry2"].x=(Graphics.width/2)-(@sprites["entry2"].width/2) + end + if minlength==0 + @sprites["helpwindow"]=Window_UnformattedTextPokemon.newWithSize( + _INTL("Enter text using the keyboard. Press\nEnter to confirm, or Esc to cancel."), + 32,Graphics.height-96,Graphics.width-64,96,@viewport + ) + else + @sprites["helpwindow"]=Window_UnformattedTextPokemon.newWithSize( + _INTL("Enter text using the keyboard.\nPress Enter to confirm."), + 32,Graphics.height-96,Graphics.width-64,96,@viewport + ) + end + @sprites["helpwindow"].letterbyletter=false + @sprites["helpwindow"].viewport=@viewport + @sprites["helpwindow"].visible=USEKEYBOARD + @sprites["helpwindow"].baseColor=Color.new(16,24,32) + @sprites["helpwindow"].shadowColor=Color.new(168,184,184) + addBackgroundPlane(@sprites,"background","Naming/bg_2",@viewport) + case subject + when 1 # Player + meta=GameData::Metadata.get_player($Trainer.character_ID) + if meta + @sprites["shadow"]=IconSprite.new(0,0,@viewport) + @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") + @sprites["shadow"].x=33*2 + @sprites["shadow"].y=32*2 + filename=pbGetPlayerCharset(meta,1,nil,true) + @sprites["subject"]=TrainerWalkingCharSprite.new(filename,@viewport) + charwidth=@sprites["subject"].bitmap.width + charheight=@sprites["subject"].bitmap.height + @sprites["subject"].x = 44*2 - charwidth/8 + @sprites["subject"].y = 38*2 - charheight/4 + end + when 2 # Pokémon + if pokemon + @sprites["shadow"]=IconSprite.new(0,0,@viewport) + @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") + @sprites["shadow"].x=33*2 + @sprites["shadow"].y=32*2 + @sprites["subject"]=PokemonIconSprite.new(pokemon,@viewport) + @sprites["subject"].setOffset(PictureOrigin::Center) + @sprites["subject"].x=88 + @sprites["subject"].y=54 + @sprites["gender"]=BitmapSprite.new(32,32,@viewport) + @sprites["gender"].x=430 + @sprites["gender"].y=54 + @sprites["gender"].bitmap.clear + pbSetSystemFont(@sprites["gender"].bitmap) + textpos=[] + if pokemon.male? + textpos.push([_INTL("♂"),0,-6,false,Color.new(0,128,248),Color.new(168,184,184)]) + elsif pokemon.female? + textpos.push([_INTL("♀"),0,-6,false,Color.new(248,24,24),Color.new(168,184,184)]) + end + pbDrawTextPositions(@sprites["gender"].bitmap,textpos) + end + when 3 # NPC + @sprites["shadow"]=IconSprite.new(0,0,@viewport) + @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") + @sprites["shadow"].x=33*2 + @sprites["shadow"].y=32*2 + @sprites["subject"]=TrainerWalkingCharSprite.new(pokemon.to_s,@viewport) + charwidth=@sprites["subject"].bitmap.width + charheight=@sprites["subject"].bitmap.height + @sprites["subject"].x = 44*2 - charwidth/8 + @sprites["subject"].y = 38*2 - charheight/4 + when 4 # Storage box + @sprites["subject"]=TrainerWalkingCharSprite.new(nil,@viewport) + @sprites["subject"].altcharset="Graphics/Pictures/Naming/icon_storage" + @sprites["subject"].animspeed=4 + charwidth=@sprites["subject"].bitmap.width + charheight=@sprites["subject"].bitmap.height + @sprites["subject"].x = 44*2 - charwidth/8 + @sprites["subject"].y = 26*2 - charheight/2 + end + pbFadeInAndShow(@sprites) + end + + def pbEntry1 + ret="" + loop do + Graphics.update + Input.update + if Input.triggerex?(:ESCAPE) && @minlength==0 + ret="" + break + elsif Input.triggerex?(:RETURN) && @sprites["entry"].text.length>=@minlength + ret=@sprites["entry"].text + break + end + @sprites["helpwindow"].update + @sprites["entry"].update + @sprites["subject"].update if @sprites["subject"] + end + Input.update + return ret + end + + def pbEntry2 + ret="" + loop do + Graphics.update + Input.update + @sprites["helpwindow"].update + @sprites["entry"].update + @sprites["entry2"].update + @sprites["subject"].update if @sprites["subject"] + if Input.trigger?(Input::USE) + index=@sprites["entry2"].command + if index==-3 # Confirm text + ret=@sprites["entry"].text + if ret.length<@minlength || ret.length>@maxlength + pbPlayBuzzerSE() + else + pbPlayDecisionSE() + break + end + elsif index==-1 # Insert a space + if @sprites["entry"].insert(" ") + pbPlayDecisionSE() + else + pbPlayBuzzerSE() + end + elsif index==-2 # Change character set + pbPlayDecisionSE() + @symtype+=1 + @symtype=0 if @symtype>=@@Characters.length + @sprites["entry2"].setCharset(@@Characters[@symtype][0]) + @sprites["entry2"].setOtherCharset(@@Characters[@symtype][1]) + else # Insert given character + if @sprites["entry"].insert(@sprites["entry2"].character) + pbPlayDecisionSE() + else + pbPlayBuzzerSE() + end + end + next + end + end + Input.update + return ret + end + + def pbEntry + return USEKEYBOARD ? pbEntry1 : pbEntry2 + end + + def pbEndScene + pbFadeOutAndHide(@sprites) + pbDisposeSpriteHash(@sprites) + @viewport.dispose + Input.text_input = false if USEKEYBOARD + end +end + + + +#=============================================================================== +# Text entry screen - arrows to select letter. +#=============================================================================== +class PokemonEntryScene2 + @@Characters = [ + [("ABCDEFGHIJ ,."+"KLMNOPQRST '-"+"UVWXYZ ♂♀"+" "+"0123456789 ").scan(/./),_INTL("UPPER")], + [("abcdefghij ,."+"klmnopqrst '-"+"uvwxyz ♂♀"+" "+"0123456789 ").scan(/./),_INTL("lower")], + [(",.:;!? ♂♀ "+"\"'()<>[] "+"~@#%*&$ "+"+-=^_/\\| "+" ").scan(/./),_INTL("other")], + ] + ROWS = 13 + COLUMNS = 5 + MODE1 = -5 + MODE2 = -4 + MODE3 = -3 + BACK = -2 + OK = -1 + + class NameEntryCursor + def initialize(viewport) + @sprite = SpriteWrapper.new(viewport) + @cursortype = 0 + @cursor1 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_1") + @cursor2 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_2") + @cursor3 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_3") + @cursorPos = 0 + updateInternal + end + + def setCursorPos(value) + @cursorPos = value + end + + def updateCursorPos + value=@cursorPos + if value==PokemonEntryScene2::MODE1 # Upper case + @sprite.x=48 + @sprite.y=120 + @cursortype=1 + elsif value==PokemonEntryScene2::MODE2 # Lower case + @sprite.x=112 + @sprite.y=120 + @cursortype=1 + elsif value==PokemonEntryScene2::MODE3 # Other symbols + @sprite.x=176 + @sprite.y=120 + @cursortype=1 + elsif value==PokemonEntryScene2::BACK # Back + @sprite.x=312 + @sprite.y=120 + @cursortype=2 + elsif value==PokemonEntryScene2::OK # OK + @sprite.x=392 + @sprite.y=120 + @cursortype=2 + elsif value>=0 + @sprite.x=52+32*(value%PokemonEntryScene2::ROWS) + @sprite.y=180+38*(value/PokemonEntryScene2::ROWS) + @cursortype=0 + end + end + + def visible=(value) + @sprite.visible=value + end + + def visible + @sprite.visible + end + + def color=(value) + @sprite.color=value + end + + def color + @sprite.color + end + + def disposed? + @sprite.disposed? + end + + def updateInternal + @cursor1.update + @cursor2.update + @cursor3.update + updateCursorPos + case @cursortype + when 0 then @sprite.bitmap=@cursor1.bitmap + when 1 then @sprite.bitmap=@cursor2.bitmap + when 2 then @sprite.bitmap=@cursor3.bitmap + end + end + + def update + updateInternal + end + + def dispose + @cursor1.dispose + @cursor2.dispose + @cursor3.dispose + @sprite.dispose + end + end + + + + def pbStartScene(helptext,minlength,maxlength,initialText,subject=0,pokemon=nil) + @sprites={} + @viewport=Viewport.new(0,0,Graphics.width,Graphics.height) + @viewport.z=99999 + @helptext=helptext + @helper=CharacterEntryHelper.new(initialText) + @bitmaps=[ + AnimatedBitmap.new("Graphics/Pictures/Naming/overlay_tab_1"), + AnimatedBitmap.new("Graphics/Pictures/Naming/overlay_tab_2"), + AnimatedBitmap.new("Graphics/Pictures/Naming/overlay_tab_3") + ] + @bitmaps[3]=@bitmaps[0].bitmap.clone + @bitmaps[4]=@bitmaps[1].bitmap.clone + @bitmaps[5]=@bitmaps[2].bitmap.clone + for i in 0...3 + pos=0 + pbSetSystemFont(@bitmaps[i+3]) + textPos=[] + for y in 0...COLUMNS + for x in 0...ROWS + textPos.push([@@Characters[i][0][pos],44+x*32,12+y*38,2, + Color.new(16,24,32), Color.new(160,160,160)]) + pos+=1 + end + end + pbDrawTextPositions(@bitmaps[i+3],textPos) + end + @bitmaps[6]=BitmapWrapper.new(24,6) + @bitmaps[6].fill_rect(2,2,22,4,Color.new(168,184,184)) + @bitmaps[6].fill_rect(0,0,22,4,Color.new(16,24,32)) + @sprites["bg"]=IconSprite.new(0,0,@viewport) + @sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg") + case subject + when 1 # Player + meta=GameData::Metadata.get_player($Trainer.character_ID) + if meta + @sprites["shadow"]=IconSprite.new(0,0,@viewport) + @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") + @sprites["shadow"].x=33*2 + @sprites["shadow"].y=32*2 + filename=pbGetPlayerCharset(meta,1,nil,true) + @sprites["subject"]=TrainerWalkingCharSprite.new(filename,@viewport) + charwidth=@sprites["subject"].bitmap.width + charheight=@sprites["subject"].bitmap.height + @sprites["subject"].x = 44*2 - charwidth/8 + @sprites["subject"].y = 38*2 - charheight/4 + end + when 2 # Pokémon + if pokemon + @sprites["shadow"]=IconSprite.new(0,0,@viewport) + @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") + @sprites["shadow"].x=33*2 + @sprites["shadow"].y=32*2 + @sprites["subject"]=PokemonIconSprite.new(pokemon,@viewport) + @sprites["subject"].setOffset(PictureOrigin::Center) + @sprites["subject"].x=88 + @sprites["subject"].y=54 + @sprites["gender"]=BitmapSprite.new(32,32,@viewport) + @sprites["gender"].x=430 + @sprites["gender"].y=54 + @sprites["gender"].bitmap.clear + pbSetSystemFont(@sprites["gender"].bitmap) + textpos=[] + if pokemon.male? + textpos.push([_INTL("♂"),0,-6,false,Color.new(0,128,248),Color.new(168,184,184)]) + elsif pokemon.female? + textpos.push([_INTL("♀"),0,-6,false,Color.new(248,24,24),Color.new(168,184,184)]) + end + pbDrawTextPositions(@sprites["gender"].bitmap,textpos) + end + when 3 # NPC + @sprites["shadow"]=IconSprite.new(0,0,@viewport) + @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") + @sprites["shadow"].x=33*2 + @sprites["shadow"].y=32*2 + @sprites["subject"]=TrainerWalkingCharSprite.new(pokemon.to_s,@viewport) + charwidth=@sprites["subject"].bitmap.width + charheight=@sprites["subject"].bitmap.height + @sprites["subject"].x = 44*2 - charwidth/8 + @sprites["subject"].y = 38*2 - charheight/4 + when 4 # Storage box + @sprites["subject"]=TrainerWalkingCharSprite.new(nil,@viewport) + @sprites["subject"].altcharset="Graphics/Pictures/Naming/icon_storage" + @sprites["subject"].animspeed=4 + charwidth=@sprites["subject"].bitmap.width + charheight=@sprites["subject"].bitmap.height + @sprites["subject"].x = 44*2 - charwidth/8 + @sprites["subject"].y = 26*2 - charheight/2 + end + @sprites["bgoverlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport) + pbDoUpdateOverlay + @blanks=[] + @mode=0 + @minlength=minlength + @maxlength=maxlength + @maxlength.times { |i| + @sprites["blank#{i}"]=SpriteWrapper.new(@viewport) + @sprites["blank#{i}"].bitmap=@bitmaps[6] + @sprites["blank#{i}"].x=160+24*i + @blanks[i]=0 + } + @sprites["bottomtab"]=SpriteWrapper.new(@viewport) # Current tab + @sprites["bottomtab"].x=22 + @sprites["bottomtab"].y=162 + @sprites["bottomtab"].bitmap=@bitmaps[0+3] + @sprites["toptab"]=SpriteWrapper.new(@viewport) # Next tab + @sprites["toptab"].x=22-504 + @sprites["toptab"].y=162 + @sprites["toptab"].bitmap=@bitmaps[1+3] + @sprites["controls"]=IconSprite.new(0,0,@viewport) + @sprites["controls"].setBitmap(_INTL("Graphics/Pictures/Naming/overlay_controls")) + @sprites["controls"].x=16 + @sprites["controls"].y=96 + @init=true + @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport) + pbDoUpdateOverlay2 + @sprites["cursor"]=NameEntryCursor.new(@viewport) + @cursorpos=0 + @refreshOverlay=true + @sprites["cursor"].setCursorPos(@cursorpos) + pbFadeInAndShow(@sprites) { pbUpdate } + end + + def pbUpdateOverlay + @refreshOverlay=true + end + + def pbDoUpdateOverlay2 + overlay=@sprites["overlay"].bitmap + overlay.clear + modeIcon=[[_INTL("Graphics/Pictures/Naming/icon_mode"),48+@mode*64,120,@mode*60,0,60,44]] + pbDrawImagePositions(overlay,modeIcon) + end + + def pbDoUpdateOverlay + return if !@refreshOverlay + @refreshOverlay=false + bgoverlay=@sprites["bgoverlay"].bitmap + bgoverlay.clear + pbSetSystemFont(bgoverlay) + textPositions=[ + [@helptext,160,6,false,Color.new(16,24,32),Color.new(168,184,184)] + ] + chars=@helper.textChars + x=166 + for ch in chars + textPositions.push([ch,x,42,false,Color.new(16,24,32),Color.new(168,184,184)]) + x+=24 + end + pbDrawTextPositions(bgoverlay,textPositions) + end + + def pbChangeTab(newtab=@mode+1) + pbSEPlay("GUI naming tab swap start") + @sprites["cursor"].visible = false + @sprites["toptab"].bitmap = @bitmaps[(newtab%3)+3] + # Move bottom (old) tab down off the screen, and move top (new) tab right + # onto the screen + deltaX = 48*20/Graphics.frame_rate + deltaY = 24*20/Graphics.frame_rate + loop do + if @sprites["bottomtab"].y<414 + @sprites["bottomtab"].y += deltaY + @sprites["bottomtab"].y = 414 if @sprites["bottomtab"].y>414 + end + if @sprites["toptab"].x<22 + @sprites["toptab"].x += deltaX + @sprites["toptab"].x = 22 if @sprites["toptab"].x>22 + end + Graphics.update + Input.update + pbUpdate + break if @sprites["toptab"].x>=22 && @sprites["bottomtab"].y>=414 + end + # Swap top and bottom tab around + @sprites["toptab"].x, @sprites["bottomtab"].x = @sprites["bottomtab"].x, @sprites["toptab"].x + @sprites["toptab"].y, @sprites["bottomtab"].y = @sprites["bottomtab"].y, @sprites["toptab"].y + @sprites["toptab"].bitmap, @sprites["bottomtab"].bitmap = @sprites["bottomtab"].bitmap, @sprites["toptab"].bitmap + Graphics.update + Input.update + pbUpdate + # Set the current mode + @mode = (newtab)%3 + # Set the top tab up to be the next tab + newtab = @bitmaps[((@mode+1)%3)+3] + @sprites["cursor"].visible = true + @sprites["toptab"].bitmap = newtab + @sprites["toptab"].x = 22-504 + @sprites["toptab"].y = 162 + pbSEPlay("GUI naming tab swap end") + pbDoUpdateOverlay2 + end + + def pbUpdate + for i in 0...3 + @bitmaps[i].update + end + if @init || Graphics.frame_count%5==0 + @init = false + cursorpos = @helper.cursor + cursorpos = @maxlength-1 if cursorpos>=@maxlength + cursorpos = 0 if cursorpos<0 + @maxlength.times { |i| + @blanks[i] = (i==cursorpos) ? 1 : 0 + @sprites["blank#{i}"].y = [78,82][@blanks[i]] + } + end + pbDoUpdateOverlay + pbUpdateSpriteHash(@sprites) + end + + def pbColumnEmpty?(m) + return false if m>=ROWS-1 + chset=@@Characters[@mode][0] + return ( + chset[m]==" " && + chset[m+((ROWS-1))]==" " && + chset[m+((ROWS-1)*2)]==" " && + chset[m+((ROWS-1)*3)]==" " + ) + end + + def wrapmod(x,y) + result=x%y + result+=y if result<0 + return result + end + + def pbMoveCursor + oldcursor=@cursorpos + cursordiv=@cursorpos/ROWS + cursormod=@cursorpos%ROWS + cursororigin=@cursorpos-cursormod + if Input.repeat?(Input::LEFT) + if @cursorpos<0 # Controls + @cursorpos-=1 + @cursorpos=OK if @cursorposOK + else + begin + cursormod=wrapmod((cursormod+1),ROWS) + @cursorpos=cursororigin+cursormod + end while pbColumnEmpty?(cursormod) + end + elsif Input.repeat?(Input::UP) + if @cursorpos<0 # Controls + case @cursorpos + when MODE1 then @cursorpos = ROWS*(COLUMNS-1) + when MODE2 then @cursorpos = ROWS*(COLUMNS-1)+2 + when MODE3 then @cursorpos = ROWS*(COLUMNS-1)+4 + when BACK then @cursorpos = ROWS*(COLUMNS-1)+8 + when OK then @cursorpos = ROWS*(COLUMNS-1)+11 + end + elsif @cursorpos=ROWS*(COLUMNS-1) # Bottom row of letters + case @cursorpos + when ROWS*(COLUMNS-1),ROWS*(COLUMNS-1)+1 + @cursorpos = MODE1 + when ROWS*(COLUMNS-1)+2,ROWS*(COLUMNS-1)+3 + @cursorpos = MODE2 + when ROWS*(COLUMNS-1)+4,ROWS*(COLUMNS-1)+5,ROWS*(COLUMNS-1)+6 + @cursorpos = MODE3 + when ROWS*(COLUMNS-1)+7,ROWS*(COLUMNS-1)+8,ROWS*(COLUMNS-1)+9,ROWS*(COLUMNS-1)+10 + @cursorpos = BACK + when ROWS*(COLUMNS-1)+11,ROWS*(COLUMNS-1)+12 + @cursorpos = OK + end + else + cursordiv=wrapmod((cursordiv+1),COLUMNS) + @cursorpos=(cursordiv*ROWS)+cursormod + end + end + if @cursorpos!=oldcursor # Cursor position changed + @sprites["cursor"].setCursorPos(@cursorpos) + pbPlayCursorSE() + return true + else + return false + end + end + + def pbEntry + ret="" + loop do + Graphics.update + Input.update + pbUpdate + next if pbMoveCursor + if Input.trigger?(Input::SPECIAL) + pbChangeTab + elsif Input.trigger?(Input::ACTION) + @cursorpos = OK + @sprites["cursor"].setCursorPos(@cursorpos) + elsif Input.trigger?(Input::BACK) + @helper.delete + pbPlayCancelSE() + pbUpdateOverlay + elsif Input.trigger?(Input::USE) + case @cursorpos + when BACK # Backspace + @helper.delete + pbPlayCancelSE() + pbUpdateOverlay + when OK # Done + pbSEPlay("GUI naming confirm") + if @helper.length>=@minlength + ret=@helper.text + break + end + when MODE1 + pbChangeTab(0) if @mode!=0 + when MODE2 + pbChangeTab(1) if @mode!=1 + when MODE3 + pbChangeTab(2) if @mode!=2 + else + cursormod=@cursorpos%ROWS + cursordiv=@cursorpos/ROWS + charpos=cursordiv*(ROWS)+cursormod + chset=@@Characters[@mode][0] + if @helper.length>=@maxlength + @helper.delete + end + @helper.insert(chset[charpos]) + pbPlayCursorSE() + if @helper.length>=@maxlength + @cursorpos=OK + @sprites["cursor"].setCursorPos(@cursorpos) + end + pbUpdateOverlay + end + end + end + Input.update + return ret + end + + def pbEndScene + pbFadeOutAndHide(@sprites) { pbUpdate } + for bitmap in @bitmaps + bitmap.dispose if bitmap + end + @bitmaps.clear + pbDisposeSpriteHash(@sprites) + @viewport.dispose + end +end + + + +#=============================================================================== +# +#=============================================================================== +class PokemonEntry + def initialize(scene) + @scene=scene + end + + def pbStartScreen(helptext,minlength,maxlength,initialText,mode=-1,pokemon=nil) + @scene.pbStartScene(helptext,minlength,maxlength,initialText,mode,pokemon) + ret=@scene.pbEntry + @scene.pbEndScene + return ret + end +end + + + +#=============================================================================== +# +#=============================================================================== +def pbEnterText(helptext,minlength,maxlength,initialText="",mode=0,pokemon=nil,nofadeout=false) + ret="" + if ($PokemonSystem.textinput==1 rescue false) # Keyboard + pbFadeOutIn(99999,nofadeout) { + sscene=PokemonEntryScene.new + sscreen=PokemonEntry.new(sscene) + ret=sscreen.pbStartScreen(helptext,minlength,maxlength,initialText,mode,pokemon) + } + else # Cursor + pbFadeOutIn(99999,nofadeout) { + sscene=PokemonEntryScene2.new + sscreen=PokemonEntry.new(sscene) + ret=sscreen.pbStartScreen(helptext,minlength,maxlength,initialText,mode,pokemon) + } + end + return ret +end + +def pbEnterPlayerName(helptext,minlength,maxlength,initialText="",nofadeout=false) + return pbEnterText(helptext,minlength,maxlength,initialText,1,nil,nofadeout) +end + +def pbEnterPokemonName(helptext,minlength,maxlength,initialText="",pokemon=nil,nofadeout=false) + return pbEnterText(helptext,minlength,maxlength,initialText,2,pokemon,nofadeout) +end + +def pbEnterNPCName(helptext,minlength,maxlength,initialText="",id=0,nofadeout=false) + return pbEnterText(helptext,minlength,maxlength,initialText,3,id,nofadeout) +end + +def pbEnterBoxName(helptext,minlength,maxlength,initialText="",nofadeout=false) + return pbEnterText(helptext,minlength,maxlength,initialText,4,nil,nofadeout) +end diff --git a/Data/Scripts/018_Minigames/001_Minigame_Duel.rb b/Data/Scripts/017_Minigames/001_Minigame_Duel.rb similarity index 100% rename from Data/Scripts/018_Minigames/001_Minigame_Duel.rb rename to Data/Scripts/017_Minigames/001_Minigame_Duel.rb diff --git a/Data/Scripts/018_Minigames/002_Minigame_TripleTriad.rb b/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb similarity index 100% rename from Data/Scripts/018_Minigames/002_Minigame_TripleTriad.rb rename to Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb diff --git a/Data/Scripts/018_Minigames/003_Minigame_SlotMachine.rb b/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb similarity index 100% rename from Data/Scripts/018_Minigames/003_Minigame_SlotMachine.rb rename to Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb diff --git a/Data/Scripts/018_Minigames/004_Minigame_VoltorbFlip.rb b/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb similarity index 100% rename from Data/Scripts/018_Minigames/004_Minigame_VoltorbFlip.rb rename to Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb diff --git a/Data/Scripts/018_Minigames/005_Minigame_Lottery.rb b/Data/Scripts/017_Minigames/005_Minigame_Lottery.rb similarity index 100% rename from Data/Scripts/018_Minigames/005_Minigame_Lottery.rb rename to Data/Scripts/017_Minigames/005_Minigame_Lottery.rb diff --git a/Data/Scripts/018_Minigames/006_Minigame_Mining.rb b/Data/Scripts/017_Minigames/006_Minigame_Mining.rb similarity index 100% rename from Data/Scripts/018_Minigames/006_Minigame_Mining.rb rename to Data/Scripts/017_Minigames/006_Minigame_Mining.rb diff --git a/Data/Scripts/018_Minigames/007_Minigame_TilePuzzles.rb b/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb similarity index 100% rename from Data/Scripts/018_Minigames/007_Minigame_TilePuzzles.rb rename to Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb diff --git a/Data/Scripts/019_Alternate battle modes/001_PBattle_SafariZone.rb b/Data/Scripts/018_Alternate battle modes/001_SafariZone.rb similarity index 100% rename from Data/Scripts/019_Alternate battle modes/001_PBattle_SafariZone.rb rename to Data/Scripts/018_Alternate battle modes/001_SafariZone.rb diff --git a/Data/Scripts/019_Alternate battle modes/002_PBattle_BugContest.rb b/Data/Scripts/018_Alternate battle modes/002_BugContest.rb similarity index 100% rename from Data/Scripts/019_Alternate battle modes/002_PBattle_BugContest.rb rename to Data/Scripts/018_Alternate battle modes/002_BugContest.rb diff --git a/Data/Scripts/019_Alternate battle modes/003_PBattle_OrgBattle.rb b/Data/Scripts/018_Alternate battle modes/003_OrgBattle.rb similarity index 100% rename from Data/Scripts/019_Alternate battle modes/003_PBattle_OrgBattle.rb rename to Data/Scripts/018_Alternate battle modes/003_OrgBattle.rb diff --git a/Data/Scripts/019_Alternate battle modes/004_PBattle_OrgBattleRules.rb b/Data/Scripts/018_Alternate battle modes/004_OrgBattle_Rules.rb similarity index 100% rename from Data/Scripts/019_Alternate battle modes/004_PBattle_OrgBattleRules.rb rename to Data/Scripts/018_Alternate battle modes/004_OrgBattle_Rules.rb diff --git a/Data/Scripts/019_Alternate battle modes/005_PBattle_OrgBattleGenerator.rb b/Data/Scripts/018_Alternate battle modes/005_OrgBattle_Generator.rb similarity index 100% rename from Data/Scripts/019_Alternate battle modes/005_PBattle_OrgBattleGenerator.rb rename to Data/Scripts/018_Alternate battle modes/005_OrgBattle_Generator.rb diff --git a/Data/Scripts/019_Alternate battle modes/006_PBattle_BattleSwap.rb b/Data/Scripts/018_Alternate battle modes/006_BattleSwap.rb similarity index 100% rename from Data/Scripts/019_Alternate battle modes/006_PBattle_BattleSwap.rb rename to Data/Scripts/018_Alternate battle modes/006_BattleSwap.rb diff --git a/Data/Scripts/020_Utilities/001_Utilities.rb b/Data/Scripts/019_Utilities/001_Utilities.rb similarity index 100% rename from Data/Scripts/020_Utilities/001_Utilities.rb rename to Data/Scripts/019_Utilities/001_Utilities.rb diff --git a/Data/Scripts/020_Utilities/002_Utilities_Pokemon.rb b/Data/Scripts/019_Utilities/002_Utilities_Pokemon.rb similarity index 100% rename from Data/Scripts/020_Utilities/002_Utilities_Pokemon.rb rename to Data/Scripts/019_Utilities/002_Utilities_Pokemon.rb diff --git a/Data/Scripts/020_Utilities/003_Utilities_BattleAudio.rb b/Data/Scripts/019_Utilities/003_Utilities_BattleAudio.rb similarity index 100% rename from Data/Scripts/020_Utilities/003_Utilities_BattleAudio.rb rename to Data/Scripts/019_Utilities/003_Utilities_BattleAudio.rb diff --git a/Data/Scripts/021_Debug/004_Editor_Screens.rb b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb similarity index 100% rename from Data/Scripts/021_Debug/004_Editor_Screens.rb rename to Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb diff --git a/Data/Scripts/021_Debug/010_Editor_TilesetTerrainTags.rb b/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb similarity index 100% rename from Data/Scripts/021_Debug/010_Editor_TilesetTerrainTags.rb rename to Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb diff --git a/Data/Scripts/021_Debug/011_Editor_MapConnections.rb b/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb similarity index 100% rename from Data/Scripts/021_Debug/011_Editor_MapConnections.rb rename to Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb diff --git a/Data/Scripts/021_Debug/012_Editor_SpritePositioning.rb b/Data/Scripts/020_Debug/001_Editor screens/004_EditorScreens_SpritePositioning.rb similarity index 100% rename from Data/Scripts/021_Debug/012_Editor_SpritePositioning.rb rename to Data/Scripts/020_Debug/001_Editor screens/004_EditorScreens_SpritePositioning.rb diff --git a/Data/Scripts/021_Debug/009_Editor_Utilities.rb b/Data/Scripts/020_Debug/001_Editor_Utilities.rb similarity index 100% rename from Data/Scripts/021_Debug/009_Editor_Utilities.rb rename to Data/Scripts/020_Debug/001_Editor_Utilities.rb diff --git a/Data/Scripts/021_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb b/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb similarity index 100% rename from Data/Scripts/021_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb rename to Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb diff --git a/Data/Scripts/021_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb b/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb similarity index 100% rename from Data/Scripts/021_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb rename to Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb diff --git a/Data/Scripts/021_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb b/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb similarity index 100% rename from Data/Scripts/021_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb rename to Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb diff --git a/Data/Scripts/021_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb b/Data/Scripts/020_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb similarity index 100% rename from Data/Scripts/021_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb rename to Data/Scripts/020_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb diff --git a/Data/Scripts/021_Debug/002_Animation editor/005_AnimEditor_Functions.rb b/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb similarity index 100% rename from Data/Scripts/021_Debug/002_Animation editor/005_AnimEditor_Functions.rb rename to Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb diff --git a/Data/Scripts/021_Debug/007_Editor_DataTypes.rb b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb similarity index 100% rename from Data/Scripts/021_Debug/007_Editor_DataTypes.rb rename to Data/Scripts/020_Debug/002_Editor_DataTypes.rb diff --git a/Data/Scripts/021_Debug/001_Debug menus/001_Debug_Menus.rb b/Data/Scripts/020_Debug/003_Debug menus/001_Debug_Menus.rb similarity index 100% rename from Data/Scripts/021_Debug/001_Debug menus/001_Debug_Menus.rb rename to Data/Scripts/020_Debug/003_Debug menus/001_Debug_Menus.rb diff --git a/Data/Scripts/021_Debug/001_Debug menus/002_Debug_MenuCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb similarity index 100% rename from Data/Scripts/021_Debug/001_Debug menus/002_Debug_MenuCommands.rb rename to Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb diff --git a/Data/Scripts/021_Debug/001_Debug menus/003_Debug_MenuExtraCode.rb b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb similarity index 100% rename from Data/Scripts/021_Debug/001_Debug menus/003_Debug_MenuExtraCode.rb rename to Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb diff --git a/Data/Scripts/021_Debug/001_Debug menus/004_Debug_PokemonCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/004_Debug_PokemonCommands.rb similarity index 100% rename from Data/Scripts/021_Debug/001_Debug menus/004_Debug_PokemonCommands.rb rename to Data/Scripts/020_Debug/003_Debug menus/004_Debug_PokemonCommands.rb diff --git a/Data/Scripts/021_Debug/008_Editor_Listers.rb b/Data/Scripts/020_Debug/003_Editor_Listers.rb similarity index 100% rename from Data/Scripts/021_Debug/008_Editor_Listers.rb rename to Data/Scripts/020_Debug/003_Editor_Listers.rb diff --git a/Data/Scripts/022_Compiler/001_Compiler.rb b/Data/Scripts/021_Compiler/001_Compiler.rb similarity index 100% rename from Data/Scripts/022_Compiler/001_Compiler.rb rename to Data/Scripts/021_Compiler/001_Compiler.rb diff --git a/Data/Scripts/022_Compiler/002_Compiler_CompilePBS.rb b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb similarity index 100% rename from Data/Scripts/022_Compiler/002_Compiler_CompilePBS.rb rename to Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb diff --git a/Data/Scripts/022_Compiler/003_Compiler_WritePBS.rb b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb similarity index 100% rename from Data/Scripts/022_Compiler/003_Compiler_WritePBS.rb rename to Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb diff --git a/Data/Scripts/022_Compiler/004_Compiler_MapsAndEvents.rb b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb similarity index 100% rename from Data/Scripts/022_Compiler/004_Compiler_MapsAndEvents.rb rename to Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb diff --git a/Data/Scripts/022_Compiler/005_Compiler_SpriteRenamer.rb b/Data/Scripts/021_Compiler/005_Compiler_SpriteRenamer.rb similarity index 100% rename from Data/Scripts/022_Compiler/005_Compiler_SpriteRenamer.rb rename to Data/Scripts/021_Compiler/005_Compiler_SpriteRenamer.rb