mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-23 23:06:00 +00:00
Implemented usage of GameData::Item
This commit is contained in:
@@ -490,16 +490,17 @@ def pbDebugMenuActions(cmd="",sprites=nil,viewport=nil)
|
||||
# Item options
|
||||
#=============================================================================
|
||||
when "additem"
|
||||
pbListScreenBlock(_INTL("ADD ITEM"),ItemLister.new(0)) { |button,item|
|
||||
if button==Input::C && item && item>0
|
||||
pbListScreenBlock(_INTL("ADD ITEM"),ItemLister.new) { |button,item|
|
||||
if button==Input::C && item
|
||||
params = ChooseNumberParams.new
|
||||
params.setRange(1,BAG_MAX_PER_SLOT)
|
||||
params.setInitialValue(1)
|
||||
params.setCancelValue(0)
|
||||
qty = pbMessageChooseNumber(_INTL("Choose the number of items."),params)
|
||||
qty = pbMessageChooseNumber(_INTL("Add how many {1}?",
|
||||
GameData::Item.get(item).name_plural), params)
|
||||
if qty>0
|
||||
$PokemonBag.pbStoreItem(item,qty)
|
||||
pbMessage(_INTL("Gave {1}x {2}.",qty,PBItems.getName(item)))
|
||||
pbMessage(_INTL("Gave {1}x {2}.",qty,GameData::Item.get(item).name))
|
||||
end
|
||||
end
|
||||
}
|
||||
@@ -510,14 +511,7 @@ def pbDebugMenuActions(cmd="",sprites=nil,viewport=nil)
|
||||
params.setCancelValue(0)
|
||||
qty = pbMessageChooseNumber(_INTL("Choose the number of items."),params)
|
||||
if qty>0
|
||||
itemconsts = []
|
||||
for i in PBItems.constants
|
||||
itemconsts.push(PBItems.const_get(i))
|
||||
end
|
||||
itemconsts.sort! { |a,b| a<=>b }
|
||||
for i in itemconsts
|
||||
$PokemonBag.pbStoreItem(i,qty)
|
||||
end
|
||||
GameData::Item.each { |i| $PokemonBag.pbStoreItem(i.id, qty) }
|
||||
pbMessage(_INTL("The Bag was filled with {1} of each item.",qty))
|
||||
end
|
||||
when "emptybag"
|
||||
@@ -731,6 +725,7 @@ def pbDebugMenuActions(cmd="",sprites=nil,viewport=nil)
|
||||
#=============================================================================
|
||||
when "setmetadata"
|
||||
pbMetadataScreen(pbDefaultMap)
|
||||
# TODO: Only need to reload the metadata.
|
||||
pbClearData
|
||||
when "mapconnections"
|
||||
pbFadeOutIn { pbConnectionsEditor }
|
||||
@@ -745,8 +740,9 @@ def pbDebugMenuActions(cmd="",sprites=nil,viewport=nil)
|
||||
pbEncounterEditorMap(encdata,map)
|
||||
end
|
||||
save_data(encdata,"Data/encounters.dat")
|
||||
# TODO: Only need to reload the encounters data.
|
||||
pbClearData
|
||||
pbSaveEncounterData
|
||||
pbSaveEncounterData # Rewrite PBS file encounters.txt
|
||||
when "trainertypes"
|
||||
pbFadeOutIn { pbTrainerTypeEditor }
|
||||
when "edittrainers"
|
||||
|
||||
Reference in New Issue
Block a user