From 327d0de3349d5e2717282eeda14d6bffb4ef8125 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Thu, 8 Apr 2021 21:20:34 +0100 Subject: [PATCH] Redesigned controls help screen, added example of changing encounter version --- .../004_Game classes/009_Game_Player.rb | 2 +- Data/Scripts/010_Scenes/001_Transitions.rb | 44 ++++++++- .../005_Battle scene/006_PokeBattle_Scene.rb | 2 +- .../017_UI/001_Animations/002_UI_Controls.rb | 89 ++++++++++++------- Data/Scripts/017_UI/009_UI_RegionMap.rb | 2 +- .../001_Debug menus/002_Debug_MenuCommands.rb | 4 +- .../005_AnimEditor_Functions.rb | 2 +- Data/Scripts/021_Debug/004_Editor_Screens.rb | 2 +- .../010_Editor_TilesetTerrainTags.rb | 2 +- PBS/Gen 5/encounters.txt | 13 +++ PBS/Gen 7/encounters.txt | 13 +++ PBS/encounters.txt | 13 +++ 12 files changed, 148 insertions(+), 40 deletions(-) diff --git a/Data/Scripts/004_Game classes/009_Game_Player.rb b/Data/Scripts/004_Game classes/009_Game_Player.rb index 52db9af16..3343cd4ec 100644 --- a/Data/Scripts/004_Game classes/009_Game_Player.rb +++ b/Data/Scripts/004_Game classes/009_Game_Player.rb @@ -402,7 +402,7 @@ class Game_Player < Game_Character # No events triggered, try other event triggers upon finishing a step pbOnStepTaken(result) end - # If C button was pressed, try to manually interact with events + # Try to manually interact with events if Input.trigger?(Input::USE) && !$PokemonTemp.miniupdate # Same position and front event determinant check_event_trigger_here([0]) diff --git a/Data/Scripts/010_Scenes/001_Transitions.rb b/Data/Scripts/010_Scenes/001_Transitions.rb index 798e0baab..66dad2178 100644 --- a/Data/Scripts/010_Scenes/001_Transitions.rb +++ b/Data/Scripts/010_Scenes/001_Transitions.rb @@ -86,7 +86,8 @@ module Graphics when "wavyspinball" then @@transition = Transitions::WavySpinBall.new(duration) when "fourballburst" then @@transition = Transitions::FourBallBurst.new(duration) # Graphic transitions - when "" then @@transition = Transitions::FadeTransition.new(duration) + when "fadetoblack" then @@transition = Transitions::FadeToBlack.new(duration) + when "" then @@transition = Transitions::FadeFromBlack.new(duration) else ret = false end Graphics.frame_reset if ret @@ -585,7 +586,46 @@ module Transitions #============================================================================= # #============================================================================= - class FadeTransition + class FadeToBlack + def initialize(numframes) + @duration = numframes + @numframes = numframes + @disposed = false + if @duration<=0 + @disposed = true + return + end + @viewport = Viewport.new(0,0,Graphics.width,Graphics.height) + @viewport.z = 99999 + @sprite = BitmapSprite.new(Graphics.width,Graphics.height,@viewport) + @sprite.bitmap.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0)) + @sprite.opacity = 0 + end + + def disposed?; @disposed; end + + def dispose + return if disposed? + @sprite.dispose if @sprite + @viewport.dispose if @viewport + @disposed = true + end + + def update + return if disposed? + if @duration==0 + dispose + else + @sprite.opacity = (@numframes - @duration + 1) * 255 / @numframes + @duration -= 1 + end + end + end + + #============================================================================= + # + #============================================================================= + class FadeFromBlack def initialize(numframes) @duration = numframes @numframes = numframes diff --git a/Data/Scripts/012_Battle/005_Battle scene/006_PokeBattle_Scene.rb b/Data/Scripts/012_Battle/005_Battle scene/006_PokeBattle_Scene.rb index 227f2b75f..5d90ef0da 100644 --- a/Data/Scripts/012_Battle/005_Battle scene/006_PokeBattle_Scene.rb +++ b/Data/Scripts/012_Battle/005_Battle scene/006_PokeBattle_Scene.rb @@ -111,7 +111,7 @@ class PokeBattle_Scene end # NOTE: A regular message is displayed for 1 second after it fully appears (or - # less if B/C is pressed) and disappears automatically after that time. + # less if Back/Use is pressed). Disappears automatically after that time. def pbDisplayMessage(msg,brief=false) pbWaitMessage pbShowWindow(MESSAGE_BOX) diff --git a/Data/Scripts/017_UI/001_Animations/002_UI_Controls.rb b/Data/Scripts/017_UI/001_Animations/002_UI_Controls.rb index 58b2b1003..9e4f223a6 100644 --- a/Data/Scripts/017_UI/001_Animations/002_UI_Controls.rb +++ b/Data/Scripts/017_UI/001_Animations/002_UI_Controls.rb @@ -9,38 +9,67 @@ class ButtonEventScene < EventScene def initialize(viewport = nil) super Graphics.freeze - addImage(0, 0, "Graphics/Pictures/helpbg") - @labels = [ - addLabel(52 * 2, 13 * 2, Graphics.width * 3 / 4, _INTL("Moves the main character. Also used to scroll through list entries.")), - addLabel(52 * 2, 53 * 2, Graphics.width * 3 / 4, _INTL("Used to confirm a choice, check things, and talk to people.")), - addLabel(52 * 2, 93 * 2, Graphics.width * 3 / 4, _INTL("Used to exit, cancel a choice or mode, and open the pause menu.")), - addLabel(52 * 2, 133 * 2, Graphics.width * 3 / 4, _INTL("Hold down while walking to run.")), - addLabel(52 * 2, 157 * 2, Graphics.width * 3 / 4, _INTL("Press to use a registered Key Item.")) - ] - @keys = [ - addImage(26 * 2, 18 * 2, "Graphics/Pictures/helpArrowKeys"), - addImage(26 * 2, 59 * 2, "Graphics/Pictures/helpCkey"), - addImage(26 * 2, 99 * 2, "Graphics/Pictures/helpXkey"), - addImage(26 * 2, 130 * 2, "Graphics/Pictures/helpZkey"), - addImage(26 * 2, 154 * 2, "Graphics/Pictures/helpFkey") - ] - for key in @keys - key.origin = PictureOrigin::Top - end - for i in 0...5 # Make everything show (almost) immediately - @keys[i].setOrigin(0, PictureOrigin::Top) - @keys[i].setOpacity(0, 255) - end - pictureWait # Update event scene with the changes + @current_screen = 1 + addImage(0, 0, "Graphics/Pictures/help_bg") + @labels = [] + @label_screens = [] + @keys = [] + @key_screens = [] + + addImageForScreen(1, 16, 158, "Graphics/Pictures/help_arrows") + addLabelForScreen(1, 134, 100, 352, _INTL("Use the Arrow keys to move the main character.\r\n\r\nYou can also use the Arrow keys to select entries and navigate menus.")) + + addImageForScreen(2, 16, 106, "Graphics/Pictures/help_usekey") + addImageForScreen(2, 16, 236, "Graphics/Pictures/help_backkey") + addLabelForScreen(2, 134, 84, 352, _INTL("Used to confirm a choice, interact with people and things, and move through text. (Default: C)")) + addLabelForScreen(2, 134, 212, 352, _INTL("Used to exit, cancel a choice, and cancel a mode. Also used to open the Pause Menu. (Default: X)")) + + addImageForScreen(3, 16, 90, "Graphics/Pictures/help_specialkey") + addImageForScreen(3, 16, 252, "Graphics/Pictures/help_zkey") + addLabelForScreen(3, 134, 52, 352, _INTL("Has various functions depending on context. While moving around, hold to move at a different speed. (Default: Z)")) + addLabelForScreen(3, 134, 212, 352, _INTL("Press to open the Ready Menu, where registered items and available field moves can be used. (Default: D)")) + + set_up_screen(@current_screen) Graphics.transition(20) - # Go to next screen when user presses C - onCTrigger.set(method(:pbOnScreen1)) + # Go to next screen when user presses USE + onCTrigger.set(method(:pbOnScreenEnd)) end - def pbOnScreen1(scene,*args) - # End scene - Graphics.freeze - scene.dispose - Graphics.transition(20) + def addLabelForScreen(number, x, y, width, text) + @labels.push(addLabel(x, y, width, text)) + @label_screens.push(number) + @picturesprites[@picturesprites.length - 1].opacity = 0 + end + + def addImageForScreen(number, x, y, filename) + @keys.push(addImage(x, y, filename)) + @key_screens.push(number) + @picturesprites[@picturesprites.length - 1].opacity = 0 + end + + def set_up_screen(number) + @label_screens.each_with_index do |screen, i| + @labels[i].moveOpacity((screen == number) ? 10 : 0, 10, (screen == number) ? 255 : 0) + end + @key_screens.each_with_index do |screen, i| + @keys[i].moveOpacity((screen == number) ? 10 : 0, 10, (screen == number) ? 255 : 0) + end + pictureWait # Update event scene with the changes + end + + def pbOnScreenEnd(scene, *args) + last_screen = [@label_screens.max, @key_screens.max].max + if @current_screen >= last_screen + # End scene + Graphics.freeze + Graphics.transition(20, "fadetoblack") + scene.dispose + else + # Next screen + @current_screen += 1 + onCTrigger.clear + set_up_screen(@current_screen) + onCTrigger.set(method(:pbOnScreenEnd)) + end end end diff --git a/Data/Scripts/017_UI/009_UI_RegionMap.rb b/Data/Scripts/017_UI/009_UI_RegionMap.rb index 73182f33a..7c09e2efd 100644 --- a/Data/Scripts/017_UI/009_UI_RegionMap.rb +++ b/Data/Scripts/017_UI/009_UI_RegionMap.rb @@ -333,7 +333,7 @@ class PokemonRegionMap_Scene return healspot end end - elsif Input.trigger?(Input::USE) && @editor # Intentionally after other C input check + elsif Input.trigger?(Input::USE) && @editor # Intentionally after other USE input check pbChangeMapLocation(@mapX,@mapY) end end diff --git a/Data/Scripts/021_Debug/001_Debug menus/002_Debug_MenuCommands.rb b/Data/Scripts/021_Debug/001_Debug menus/002_Debug_MenuCommands.rb index 2006b134b..5440c9859 100644 --- a/Data/Scripts/021_Debug/001_Debug menus/002_Debug_MenuCommands.rb +++ b/Data/Scripts/021_Debug/001_Debug menus/002_Debug_MenuCommands.rb @@ -435,7 +435,7 @@ DebugMenuCommands.register("roamers", { DebugMenuCommands.register("encounterversion", { "parent" => "battlemenu", - "name" => _INTL("Set encounters version"), + "name" => _INTL("Set Encounters Version"), "description" => _INTL("Choose which version of wild encounters should be used."), "effect" => proc { params = ChooseNumberParams.new @@ -1083,7 +1083,7 @@ DebugMenuCommands.register("compiledata", { DebugMenuCommands.register("createpbs", { "parent" => "othermenu", - "name" => _INTL("Create PBS file(s)"), + "name" => _INTL("Create PBS File(s)"), "description" => _INTL("Choose one or all PBS files and create it."), "always_show" => true, "effect" => proc { diff --git a/Data/Scripts/021_Debug/002_Animation editor/005_AnimEditor_Functions.rb b/Data/Scripts/021_Debug/002_Animation editor/005_AnimEditor_Functions.rb index 3926f6c20..629e2fb97 100644 --- a/Data/Scripts/021_Debug/002_Animation editor/005_AnimEditor_Functions.rb +++ b/Data/Scripts/021_Debug/002_Animation editor/005_AnimEditor_Functions.rb @@ -125,7 +125,7 @@ def pbAnimList(animations,canvas,animwin) cmdwin.index=animations.selected cmdwin.viewport=canvas.viewport helpwindow=Window_UnformattedTextPokemon.newWithSize( - _INTL("C: Load/rename an animation\nEsc: Cancel"), + _INTL("Enter: Load/rename an animation\nEsc: Cancel"), 320,0,320,128,canvas.viewport) maxsizewindow=ControlWindow.new(0,416,320,32*3) maxsizewindow.addSlider(_INTL("Total Animations:"),1,2000,animations.length) diff --git a/Data/Scripts/021_Debug/004_Editor_Screens.rb b/Data/Scripts/021_Debug/004_Editor_Screens.rb index e97b3543c..c1f3b268a 100644 --- a/Data/Scripts/021_Debug/004_Editor_Screens.rb +++ b/Data/Scripts/021_Debug/004_Editor_Screens.rb @@ -1138,7 +1138,7 @@ def pbRegionalDexEditor(dex) viewport.z = 99999 cmd_window = pbListWindow([]) info = Window_AdvancedTextPokemon.newWithSize( - _INTL("Z+Up/Down: Rearrange entries\nZ+Right: Insert new entry\nZ+Left: Delete entry\nF: Clear entry"), + _INTL("Z+Up/Down: Rearrange entries\nZ+Right: Insert new entry\nZ+Left: Delete entry\nD: Clear entry"), Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport) info.z = 2 dex.compact! diff --git a/Data/Scripts/021_Debug/010_Editor_TilesetTerrainTags.rb b/Data/Scripts/021_Debug/010_Editor_TilesetTerrainTags.rb index 245968b4b..dd9dc96dd 100644 --- a/Data/Scripts/021_Debug/010_Editor_TilesetTerrainTags.rb +++ b/Data/Scripts/021_Debug/010_Editor_TilesetTerrainTags.rb @@ -18,7 +18,7 @@ class PokemonTilesetScene @tileset = @tilesets_data[1] @tilehelper = TileDrawingHelper.fromTileset(@tileset) @sprites = {} - @sprites["title"] = Window_UnformattedTextPokemon.newWithSize(_INTL("Tileset Editor\r\nPgUp/PgDn: SCROLL\r\nZ: MENU"), + @sprites["title"] = Window_UnformattedTextPokemon.newWithSize(_INTL("Tileset Editor\r\nQ/W: SCROLL\r\nZ: MENU"), TILESET_WIDTH, 0, Graphics.width - TILESET_WIDTH, 128, @viewport) @sprites["tileset"] = IconSprite.new(0, 0, @viewport) @sprites["tileset"].setBitmap("Graphics/Tilesets/#{@tileset.tileset_name}") diff --git a/PBS/Gen 5/encounters.txt b/PBS/Gen 5/encounters.txt index b8364c161..98601088a 100644 --- a/PBS/Gen 5/encounters.txt +++ b/PBS/Gen 5/encounters.txt @@ -33,6 +33,19 @@ LandNight,21 1,HOOTHOOT,14 1,RATTATA,15 #------------------------------- +[005,1] # Route 1 +Land,21 + 40,PIDGEY,15,18 + 40,RATTATA,14,18 + 10,SENTRET,13,17 + 5,PIDGEY,14,16 + 5,RATTATA,13,16 +LandNight,21 + 40,RATTATA,14,18 + 30,HOOTHOOT,14,17 + 20,SPINARAK,12,16 + 10,CLEFAIRY,11,15 +#------------------------------- [021] # Route 2 Land,21 50,RATTATA,12,15 diff --git a/PBS/Gen 7/encounters.txt b/PBS/Gen 7/encounters.txt index 8d07bb22f..821028696 100644 --- a/PBS/Gen 7/encounters.txt +++ b/PBS/Gen 7/encounters.txt @@ -33,6 +33,19 @@ LandNight,21 1,HOOTHOOT,14 1,RATTATA,15 #------------------------------- +[005,1] # Route 1 +Land,21 + 40,PIDGEY,15,18 + 40,RATTATA,14,18 + 10,SENTRET,13,17 + 5,PIDGEY,14,16 + 5,RATTATA,13,16 +LandNight,21 + 40,RATTATA,14,18 + 30,HOOTHOOT,14,17 + 20,SPINARAK,12,16 + 10,CLEFAIRY,11,15 +#------------------------------- [021] # Route 2 Land,21 50,RATTATA,12,15 diff --git a/PBS/encounters.txt b/PBS/encounters.txt index 8d07bb22f..821028696 100644 --- a/PBS/encounters.txt +++ b/PBS/encounters.txt @@ -33,6 +33,19 @@ LandNight,21 1,HOOTHOOT,14 1,RATTATA,15 #------------------------------- +[005,1] # Route 1 +Land,21 + 40,PIDGEY,15,18 + 40,RATTATA,14,18 + 10,SENTRET,13,17 + 5,PIDGEY,14,16 + 5,RATTATA,13,16 +LandNight,21 + 40,RATTATA,14,18 + 30,HOOTHOOT,14,17 + 20,SPINARAK,12,16 + 10,CLEFAIRY,11,15 +#------------------------------- [021] # Route 2 Land,21 50,RATTATA,12,15