Turned Town Map PBS data into a GameData class

This commit is contained in:
Maruno17
2022-11-20 21:44:53 +00:00
parent f33eb4d896
commit 4d147a7bf7
27 changed files with 127 additions and 205 deletions

View File

@@ -105,9 +105,8 @@ class RegionMapSprite
end
def createRegionMap(map)
@mapdata = pbLoadTownMapData
@map = @mapdata[map]
bitmap = AnimatedBitmap.new("Graphics/UI/Town Map/#{@map[1]}").deanimate
town_map = GameData::TownMap.get(map)
bitmap = AnimatedBitmap.new("Graphics/UI/Town Map/#{town_map.filename}").deanimate
retbitmap = BitmapWrapper.new(bitmap.width / 2, bitmap.height / 2)
retbitmap.stretch_blt(
Rect.new(0, 0, bitmap.width / 2, bitmap.height / 2),

View File

@@ -769,15 +769,10 @@ module RegionMapCoordsProperty
selregion = regions[0][0]
else
cmds = []
regions.each do |region|
cmds.push(region[1])
end
regions.each { |region| cmds.push(region[1]) }
selcmd = pbMessage(_INTL("Choose a region map."), cmds, -1)
if selcmd >= 0
selregion = regions[selcmd][0]
else
return oldsetting
end
return oldsetting if selcmd < 0
selregion = regions[selcmd][0]
end
mappoint = chooseMapPoint(selregion, true)
return (mappoint) ? [selregion, mappoint[0], mappoint[1]] : oldsetting
@@ -788,12 +783,8 @@ module RegionMapCoordsProperty
end
def self.getMapNameList
mapdata = pbLoadTownMapData
ret = []
mapdata.length.times do |i|
next if !mapdata[i]
ret.push([i, pbGetMessage(MessageTypes::RegionNames, i)])
end
GameData::TownMap.each { |town_map| ret.push([town_map.id, town_map.name]) }
return ret
end
end