Redesigned controls help screen, added example of changing encounter version

This commit is contained in:
Maruno17
2021-04-08 21:20:34 +01:00
parent 64d9b38605
commit 327d0de334
12 changed files with 148 additions and 40 deletions

View File

@@ -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])

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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 {

View File

@@ -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)

View File

@@ -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!

View File

@@ -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}")

View File

@@ -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

View File

@@ -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

View File

@@ -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