Adds description to option menus

This commit is contained in:
infinitefusion
2022-06-21 19:19:32 -04:00
parent 7ef57c7b8a
commit 94ef983ba8
19 changed files with 102 additions and 47 deletions

View File

@@ -837,8 +837,11 @@ class SpriteWindow_Selectable < SpriteWindow_Base
def refresh; end
def changedPosition; end
def update_cursor_rect
priv_update_cursor_rect
changedPosition
end
def update
@@ -1042,6 +1045,7 @@ end
class Window_DrawableCommand < SpriteWindow_SelectableEx
attr_reader :baseColor
attr_reader :shadowColor
attr_reader :index
def initialize(x,y,width,height,viewport=nil)
super(x,y,width,height)
@@ -1060,6 +1064,7 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
refresh
end
def dispose
@selarrow.dispose
super

View File

@@ -46,15 +46,25 @@ module PropertyMixin
end
end
class Option
attr_reader :description
def initialize(description)
@description=description
end
end
#===============================================================================
#
#===============================================================================
class EnumOption
class EnumOption < Option
include PropertyMixin
attr_reader :values
attr_reader :name
def initialize(name, options, getProc, setProc)
def initialize(name, options, getProc, setProc,description="")
super(description)
@name = name
@values = options
@getProc = getProc
@@ -137,13 +147,14 @@ end
#===============================================================================
#
#===============================================================================
class SliderOption
class SliderOption < Option
include PropertyMixin
attr_reader :name
attr_reader :optstart
attr_reader :optend
def initialize(name, optstart, optend, optinterval, getProc, setProc)
def initialize(name, optstart, optend, optinterval, getProc, setProc, description="")
super(description)
@name = name
@optstart = optstart
@optend = optend
@@ -172,8 +183,10 @@ end
#===============================================================================
class Window_PokemonOption < Window_DrawableCommand
attr_reader :mustUpdateOptions
attr_reader :mustUpdateDescription
def initialize(options, x, y, width, height)
@previous_Index=0
@options = options
@nameBaseColor = Color.new(24 * 8, 15 * 8, 0)
@nameShadowColor = Color.new(31 * 8, 22 * 8, 10 * 8)
@@ -181,12 +194,22 @@ class Window_PokemonOption < Window_DrawableCommand
@selShadowColor = Color.new(31 * 8, 17 * 8, 16 * 8)
@optvalues = []
@mustUpdateOptions = false
@mustUpdateDescription = false
for i in 0...@options.length
@optvalues[i] = 0
end
super(x, y, width, height)
end
def changedPosition
@mustUpdateDescription=true
super
end
def descriptionUpdated
@mustUpdateDescription=false
end
def nameBaseColor=(value)
@nameBaseColor=value
end
@@ -293,8 +316,16 @@ end
# Options main screen
#===============================================================================
class PokemonOption_Scene
def getDefaultDescription
return _INTL("Speech frame {1}.", 1 + $PokemonSystem.textskin)
end
def pbUpdate
pbUpdateSpriteHash(@sprites)
if @sprites["option"].mustUpdateDescription
updateDescription(@sprites["option"].index)
@sprites["option"].descriptionUpdated
end
end
def pbStartScene(inloadscreen = false)
@@ -328,6 +359,16 @@ class PokemonOption_Scene
pbDeactivateWindows(@sprites)
pbFadeInAndShow(@sprites) { pbUpdate }
end
def updateDescription(index)
index=0 if !index
begin
new_description = @PokemonOptions[index].description
new_description = getDefaultDescription if new_description == ""
@sprites["textbox"].text = _INTL(new_description)
rescue
@sprites["textbox"].text = getDefaultDescription
end
end
def pbGetOptions(inloadscreen = false)
options = []
@@ -342,7 +383,7 @@ class PokemonOption_Scene
$game_system.bgm_resume(playingBGM)
end
end
}
},"Sets the volume for background music"
)
options << SliderOption.new(_INTL("SE Volume"), 0, 100, 5,
@@ -358,7 +399,7 @@ class PokemonOption_Scene
end
pbPlayCursorSE
end
}
},"Sets the volume for sound effects"
)
if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) #beat the league
@@ -367,7 +408,7 @@ class PokemonOption_Scene
proc { |value|
$PokemonSystem.textspeed = value
MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
}
},"Sets the speed at which the text is displayed"
)
else
options << EnumOption.new(_INTL("Text Speed"), [_INTL("Normal"), _INTL("Fast")],
@@ -375,7 +416,7 @@ class PokemonOption_Scene
proc { |value|
$PokemonSystem.textspeed = value
MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
}
},"Sets the speed at which the text is displayed"
)
end
@@ -384,7 +425,8 @@ class PokemonOption_Scene
options <<
EnumOption.new(_INTL("Autosave"),[_INTL("On"),_INTL("Off")],
proc { $game_switches[AUTOSAVE_ENABLED_SWITCH] ? 0 : 1},
proc {|value| $game_switches[AUTOSAVE_ENABLED_SWITCH]=value==0 }
proc {|value| $game_switches[AUTOSAVE_ENABLED_SWITCH]=value==0 },
"Automatically saves when healing at Pokémon centers"
)
end
@@ -403,24 +445,27 @@ class PokemonOption_Scene
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [1, 1]
end
$PokemonSystem.battle_type=value
}
},"Sets the number of Pokémon sent out in battles (when possible)"
)
end
options << EnumOption.new(_INTL("Battle Effects"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.battlescene },
proc { |value| $PokemonSystem.battlescene = value }
proc { |value| $PokemonSystem.battlescene = value },
"Display move animations in battles"
)
options << EnumOption.new(_INTL("Battle Style"), [_INTL("Switch"), _INTL("Set")],
proc { $PokemonSystem.battlestyle },
proc { |value| $PokemonSystem.battlestyle = value }
proc { |value| $PokemonSystem.battlestyle = value },
"Prompts to switch Pokémon before the opponent sends out the next one"
)
options << EnumOption.new(_INTL("Default Movement"), [_INTL("Walking"), _INTL("Running")],
proc { $PokemonSystem.runstyle },
proc { |value| $PokemonSystem.runstyle = value }
proc { |value| $PokemonSystem.runstyle = value },
"Sets the movements when not holding the Run key"
)
options << NumberOption.new(_INTL("Speech Frame"), 1, Settings::SPEECH_WINDOWSKINS.length,
@@ -439,7 +484,8 @@ class PokemonOption_Scene
# ),
options << EnumOption.new(_INTL("Text Entry"), [_INTL("Cursor"), _INTL("Keyboard")],
proc { $PokemonSystem.textinput },
proc { |value| $PokemonSystem.textinput = value }
proc { |value| $PokemonSystem.textinput = value },
"Enter text by selecting letters or by typing on the keyboard"
)
EnumOption.new(_INTL("Screen Size"), [_INTL("S"), _INTL("M"), _INTL("L"), _INTL("XL"), _INTL("Full")],
proc { [$PokemonSystem.screensize, 4].min },
@@ -448,15 +494,14 @@ class PokemonOption_Scene
$PokemonSystem.screensize = value
pbSetResizeFactor($PokemonSystem.screensize)
end
}
},"Sets the size of the screen"
)
options << EnumOption.new(_INTL("Quick Surf"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.quicksurf },
proc { |value| $PokemonSystem.quicksurf = value }
proc { |value| $PokemonSystem.quicksurf = value },
"Start surfing automatically when interacting with water"
)
return options
end

View File

@@ -11,12 +11,16 @@ class RandomizerOptionsScene < PokemonOption_Scene
@openGymOptions = false
end
def getDefaultDescription
return _INTL("Set the randomizer settings")
end
def pbStartScene(inloadscreen = false)
super
@changedColor = true
@sprites["title"]=Window_UnformattedTextPokemon.newWithSize(
_INTL("Randomizer settings"),0,0,Graphics.width,64,@viewport)
@sprites["textbox"].text=_INTL("Set the randomizer settings")
@sprites["textbox"].text= getDefaultDescription
pbFadeInAndShow(@sprites) { pbUpdate }
end
@@ -26,7 +30,7 @@ class RandomizerOptionsScene < PokemonOption_Scene
proc { $game_switches[SWITCH_RANDOM_STARTERS] ? 0 : 1 },
proc { |value|
$game_switches[SWITCH_RANDOM_STARTERS] = value == 0
}
}, "Randomize the selection of starters to choose from at the start of the game"
),
EnumOption.new(_INTL("Trainers"), [_INTL("On"), _INTL("Off")],
@@ -37,7 +41,7 @@ class RandomizerOptionsScene < PokemonOption_Scene
openTrainerOptionsMenu()
end
$game_switches[SWITCH_RANDOM_TRAINERS] = value == 0
}
}, "Select the randomizer options for regular trainers"
),
EnumOption.new(_INTL("Gym trainers"), [_INTL("On"), _INTL("Off")],
@@ -48,7 +52,7 @@ class RandomizerOptionsScene < PokemonOption_Scene
openGymOptionsMenu()
end
$game_switches[SWITCH_RANDOMIZE_GYMS_SEPARATELY] = value == 0
}
}, "Randomize gym trainers/leaders separately from regular trainers (All Pokémon of a single type)"
),
EnumOption.new(_INTL("Wild Pokémon"), [_INTL("On"), _INTL("Off")],
@@ -61,19 +65,19 @@ class RandomizerOptionsScene < PokemonOption_Scene
openWildPokemonOptionsMenu()
end
$game_switches[SWITCH_RANDOM_WILD] = value == 0
}
},"Select the randomizer options for wild Pokémon"
),
EnumOption.new(_INTL("Items"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[SWITCH_RANDOM_ITEMS] ? 0 : 1 },
proc { |value|
$game_switches[SWITCH_RANDOM_ITEMS] = value == 0
}
}, "Randomize the items picked up on the ground"
),
EnumOption.new(_INTL("TMs"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[SWITCH_RANDOM_TMS] ? 0 : 1 },
proc { |value|
$game_switches[SWITCH_RANDOM_TMS] = value == 0
}
},"Randomize the TMs picked up on the ground"
),
]
return options
@@ -149,13 +153,14 @@ class RandomizerTrainerOptionsScene < PokemonOption_Scene
proc { $game_switches[RANDOM_TEAMS_CUSTOM_SPRITES] ? 0 : 1 },
proc { |value|
$game_switches[RANDOM_TEAMS_CUSTOM_SPRITES] = value == 0
}
},
"Use only Pokémon that have custom sprites in trainer teams"
),
EnumOption.new(_INTL("Trainer Held items"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[RANDOM_HELD_ITEMS] ? 0 : 1 },
proc { |value|
$game_switches[RANDOM_HELD_ITEMS] = value == 0
}
},"Give random held items to all trainers"
)
]
return options
@@ -225,20 +230,20 @@ class RandomizerWildPokemonOptionsScene < PokemonOption_Scene
proc { $game_switches[GIFT_POKEMON] ? 0 : 1 },
proc { |value|
$game_switches[GIFT_POKEMON] = value == 0
}
},"Randomize Pokémon that are gifted to the player"
),
EnumOption.new(_INTL("Fuse everything"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[REGULAR_TO_FUSIONS] ? 0 : 1 },
proc { |value|
$game_switches[REGULAR_TO_FUSIONS] = value == 0
}
},"Include fused Pokémon in the randomize pool for wild Pokémon"
),
EnumOption.new(_INTL("Custom sprites only (Slow)"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[SWITCH_RANDOM_WILD_ONLY_CUSTOMS] ? 0 : 1 },
proc { |value|
$game_switches[SWITCH_RANDOM_WILD_ONLY_CUSTOMS] = value == 0
}
}, "(When fuse everything option is on) Randomize only to Pokémon that have a custom sprite."
)
]
return options
@@ -280,20 +285,20 @@ class RandomizerGymOptionsScene < PokemonOption_Scene
proc { $game_switches[RANDOM_GYM_TYPES] ? 0 : 1 },
proc { |value|
$game_switches[RANDOM_GYM_TYPES] = value == 0
}
}, "Shuffle the gym types"
),
EnumOption.new(_INTL("Rerandomize each battle"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[SWITCH_GYM_RANDOM_EACH_BATTLE] ? 0 : 1 },
proc { |value|
$game_switches[SWITCH_GYM_RANDOM_EACH_BATTLE] = value == 0
$game_switches[SWITCH_RANDOM_GYM_PERSIST_TEAMS] = !$game_switches[SWITCH_GYM_RANDOM_EACH_BATTLE]
}
},"Gym trainers and leaders have a new team each try instead of keeping the same one"
),
EnumOption.new(_INTL("Custom sprites only"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[SWITCH_RANDOM_GYM_CUSTOMS] ? 0 : 1 },
proc { |value|
$game_switches[SWITCH_RANDOM_GYM_CUSTOMS] = value == 0
}
}, "Use only Pokémon that have custom sprites in gym trainers or gym leader teams"
)
]
return options

View File

@@ -747,7 +747,7 @@ class PokemonFusionScene
end
def setFusionMoves(fusedPoke, poke2)
choice = Kernel.pbMessage("What to do with the moveset?", [_INTL("Learn moves"), _INTL("Keep {1}'s moveset", fusedPoke.name), _INTL("Keep {1}'s moveset", poke2.name)], 2)
choice = Kernel.pbMessage("What to do with the moveset?", [_INTL("Learn moves"), _INTL("Keep {1}'s moveset", fusedPoke.name), _INTL("Keep {1}'s moveset", poke2.name)], 0)
if choice == 1
return
elsif choice == 2
@@ -806,7 +806,7 @@ def pbChooseAbility(poke, hidden1 = false, hidden2 = false)
ability1_name = GameData::Ability.get(abID1).name
ability2_name = GameData::Ability.get(abID2).name
if (Kernel.pbMessage("Choose an ability.", [_INTL("{1}", ability1_name), _INTL("{1}", ability2_name)], 2)) == 0
if (Kernel.pbMessage("Choose an ability. ???", [_INTL("{1}", ability1_name), _INTL("{1}", ability2_name)], 2)) == 0
return abID1 #hidden1 ? 4 : 0
end
return abID2 #hidden2 ? 5 : 1

View File

@@ -2,11 +2,11 @@ class PokemonPokedexInfo_Scene
#todo add indicator to show which one is the main sprite -
# also maybe add an indicator in main list for when a sprite has available alts
Y_POSITION_SMALL = 80#40
Y_POSITION_BIG = 50
X_POSITION_PREVIOUS = 20#-20
X_POSITION_SELECTED = 115
X_POSITION_NEXT = 380#340
Y_POSITION_SMALL = 40#90
Y_POSITION_BIG = 60
X_POSITION_PREVIOUS = -30#20
X_POSITION_SELECTED = 105
X_POSITION_NEXT = 340#380
Y_POSITION_BG_SMALL = 70
Y_POSITION_BG_BIG = 93
@@ -64,15 +64,15 @@ class PokemonPokedexInfo_Scene
@sprites["previousSprite"].x = X_POSITION_PREVIOUS
@sprites["previousSprite"].y = Y_POSITION_SMALL
@sprites["previousSprite"].visible = false
@sprites["previousSprite"].zoom_x = Settings::FRONTSPRITE_SCALE/2
@sprites["previousSprite"].zoom_y = Settings::FRONTSPRITE_SCALE/2
@sprites["previousSprite"].zoom_x = Settings::FRONTSPRITE_SCALE#/2
@sprites["previousSprite"].zoom_y = Settings::FRONTSPRITE_SCALE#/2
@sprites["nextSprite"] = IconSprite.new(0, 0, @viewport)
@sprites["nextSprite"].x = X_POSITION_NEXT
@sprites["nextSprite"].y = Y_POSITION_SMALL
@sprites["nextSprite"].visible = false
@sprites["nextSprite"].zoom_x = Settings::FRONTSPRITE_SCALE/2
@sprites["nextSprite"].zoom_y = Settings::FRONTSPRITE_SCALE/2
@sprites["nextSprite"].zoom_x = Settings::FRONTSPRITE_SCALE#/2
@sprites["nextSprite"].zoom_y = Settings::FRONTSPRITE_SCALE#/2
@sprites["selectedSprite"].z = 9999999
@sprites["previousSprite"].z = 9999999
@@ -99,9 +99,9 @@ class PokemonPokedexInfo_Scene
end
def hide_all_selected_windows
@sprites["bgSelected_previous"].visible = false
@sprites["bgSelected_center"].visible = false
@sprites["bgSelected_next"].visible = false
@sprites["bgSelected_previous"].visible = false if @sprites["bgSelected_previous"]
@sprites["bgSelected_center"].visible = false if @sprites["bgSelected_center"]
@sprites["bgSelected_next"].visible = false if @sprites["bgSelected_next"]
end
def update_selected