|
|
|
|
@@ -8,8 +8,8 @@ def pbDefaultMap
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def pbWarpToMap
|
|
|
|
|
mapid = pbListScreen(_INTL("WARP TO MAP"),MapLister.new(pbDefaultMap))
|
|
|
|
|
if mapid>0
|
|
|
|
|
mapid = pbListScreen(_INTL("WARP TO MAP"), MapLister.new(pbDefaultMap))
|
|
|
|
|
if mapid > 0
|
|
|
|
|
map = Game_Map.new
|
|
|
|
|
map.setup(mapid)
|
|
|
|
|
success = false
|
|
|
|
|
@@ -18,7 +18,7 @@ def pbWarpToMap
|
|
|
|
|
100.times do
|
|
|
|
|
x = rand(map.width)
|
|
|
|
|
y = rand(map.height)
|
|
|
|
|
next if !map.passableStrict?(x,y,0,$game_player)
|
|
|
|
|
next if !map.passableStrict?(x, y, 0, $game_player)
|
|
|
|
|
blocked = false
|
|
|
|
|
for event in map.events.values
|
|
|
|
|
if event.at_coordinate?(x, y) && !event.through
|
|
|
|
|
@@ -33,7 +33,7 @@ def pbWarpToMap
|
|
|
|
|
x = rand(map.width)
|
|
|
|
|
y = rand(map.height)
|
|
|
|
|
end
|
|
|
|
|
return [mapid,x,y]
|
|
|
|
|
return [mapid, x, y]
|
|
|
|
|
end
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
@@ -47,11 +47,11 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand
|
|
|
|
|
attr_reader :mode
|
|
|
|
|
|
|
|
|
|
def initialize(viewport)
|
|
|
|
|
super(0,0,Graphics.width,Graphics.height,viewport)
|
|
|
|
|
super(0, 0, Graphics.width, Graphics.height, viewport)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def itemCount
|
|
|
|
|
return (@mode==0) ? $data_system.switches.size-1 : $data_system.variables.size-1
|
|
|
|
|
return (@mode == 0) ? $data_system.switches.size - 1 : $data_system.variables.size - 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def mode=(mode)
|
|
|
|
|
@@ -59,30 +59,30 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand
|
|
|
|
|
refresh
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def shadowtext(x,y,w,h,t,align = 0,colors = 0)
|
|
|
|
|
def shadowtext(x, y, w, h, t, align = 0, colors = 0)
|
|
|
|
|
width = self.contents.text_size(t).width
|
|
|
|
|
if align==1 # Right aligned
|
|
|
|
|
x += (w-width)
|
|
|
|
|
elsif align==2 # Centre aligned
|
|
|
|
|
x += (w/2)-(width/2)
|
|
|
|
|
if align == 1 # Right aligned
|
|
|
|
|
x += (w - width)
|
|
|
|
|
elsif align == 2 # Centre aligned
|
|
|
|
|
x += (w / 2) - (width / 2)
|
|
|
|
|
end
|
|
|
|
|
base = Color.new(12*8,12*8,12*8)
|
|
|
|
|
if colors==1 # Red
|
|
|
|
|
base = Color.new(168,48,56)
|
|
|
|
|
elsif colors==2 # Green
|
|
|
|
|
base = Color.new(0,144,0)
|
|
|
|
|
base = Color.new(12 * 8, 12 * 8, 12 * 8)
|
|
|
|
|
if colors == 1 # Red
|
|
|
|
|
base = Color.new(168, 48, 56)
|
|
|
|
|
elsif colors == 2 # Green
|
|
|
|
|
base = Color.new(0, 144, 0)
|
|
|
|
|
end
|
|
|
|
|
pbDrawShadowText(self.contents,x,y,[width,w].max,h,t,base,Color.new(26*8,26*8,25*8))
|
|
|
|
|
pbDrawShadowText(self.contents, x, y, [width, w].max, h, t, base, Color.new(26 * 8, 26 * 8, 25 * 8))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def drawItem(index,_count,rect)
|
|
|
|
|
def drawItem(index, _count, rect)
|
|
|
|
|
pbSetNarrowFont(self.contents)
|
|
|
|
|
colors = 0
|
|
|
|
|
codeswitch = false
|
|
|
|
|
if @mode==0
|
|
|
|
|
name = $data_system.switches[index+1]
|
|
|
|
|
if @mode == 0
|
|
|
|
|
name = $data_system.switches[index + 1]
|
|
|
|
|
codeswitch = (name[/^s\:/])
|
|
|
|
|
val = (codeswitch) ? (eval($~.post_match) rescue nil) : $game_switches[index+1]
|
|
|
|
|
val = (codeswitch) ? (eval($~.post_match) rescue nil) : $game_switches[index + 1]
|
|
|
|
|
if val.nil?
|
|
|
|
|
status = "[-]"
|
|
|
|
|
colors = 0
|
|
|
|
|
@@ -95,31 +95,31 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand
|
|
|
|
|
colors = 1
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
name = $data_system.variables[index+1]
|
|
|
|
|
status = $game_variables[index+1].to_s
|
|
|
|
|
name = $data_system.variables[index + 1]
|
|
|
|
|
status = $game_variables[index + 1].to_s
|
|
|
|
|
status = "\"__\"" if nil_or_empty?(status)
|
|
|
|
|
end
|
|
|
|
|
name = '' if name==nil
|
|
|
|
|
id_text = sprintf("%04d:",index+1)
|
|
|
|
|
rect = drawCursor(index,rect)
|
|
|
|
|
name = '' if name == nil
|
|
|
|
|
id_text = sprintf("%04d:", index + 1)
|
|
|
|
|
rect = drawCursor(index, rect)
|
|
|
|
|
totalWidth = rect.width
|
|
|
|
|
idWidth = totalWidth*15/100
|
|
|
|
|
nameWidth = totalWidth*65/100
|
|
|
|
|
statusWidth = totalWidth*20/100
|
|
|
|
|
self.shadowtext(rect.x,rect.y,idWidth,rect.height,id_text)
|
|
|
|
|
self.shadowtext(rect.x+idWidth,rect.y,nameWidth,rect.height,name,0,(codeswitch) ? 1 : 0)
|
|
|
|
|
self.shadowtext(rect.x+idWidth+nameWidth,rect.y,statusWidth,rect.height,status,1,colors)
|
|
|
|
|
idWidth = totalWidth * 15 / 100
|
|
|
|
|
nameWidth = totalWidth * 65 / 100
|
|
|
|
|
statusWidth = totalWidth * 20 / 100
|
|
|
|
|
self.shadowtext(rect.x, rect.y, idWidth, rect.height, id_text)
|
|
|
|
|
self.shadowtext(rect.x + idWidth, rect.y, nameWidth, rect.height, name, 0, (codeswitch) ? 1 : 0)
|
|
|
|
|
self.shadowtext(rect.x + idWidth + nameWidth, rect.y, statusWidth, rect.height, status, 1, colors)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def pbDebugSetVariable(id,diff)
|
|
|
|
|
$game_variables[id] = 0 if $game_variables[id]==nil
|
|
|
|
|
def pbDebugSetVariable(id, diff)
|
|
|
|
|
$game_variables[id] = 0 if $game_variables[id] == nil
|
|
|
|
|
if $game_variables[id].is_a?(Numeric)
|
|
|
|
|
pbPlayCursorSE
|
|
|
|
|
$game_variables[id] = [$game_variables[id]+diff,99999999].min
|
|
|
|
|
$game_variables[id] = [$game_variables[id],-99999999].max
|
|
|
|
|
$game_variables[id] = [$game_variables[id] + diff, 99999999].min
|
|
|
|
|
$game_variables[id] = [$game_variables[id], -99999999].max
|
|
|
|
|
$game_map.need_refresh = true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
@@ -131,20 +131,20 @@ def pbDebugVariableScreen(id)
|
|
|
|
|
params.setDefaultValue(value)
|
|
|
|
|
params.setMaxDigits(8)
|
|
|
|
|
params.setNegativesAllowed(true)
|
|
|
|
|
value = pbMessageChooseNumber(_INTL("Set variable {1}.",id),params)
|
|
|
|
|
$game_variables[id] = [value,99999999].min
|
|
|
|
|
$game_variables[id] = [$game_variables[id],-99999999].max
|
|
|
|
|
value = pbMessageChooseNumber(_INTL("Set variable {1}.", id), params)
|
|
|
|
|
$game_variables[id] = [value, 99999999].min
|
|
|
|
|
$game_variables[id] = [$game_variables[id], -99999999].max
|
|
|
|
|
$game_map.need_refresh = true
|
|
|
|
|
elsif $game_variables[id].is_a?(String)
|
|
|
|
|
value = pbMessageFreeText(_INTL("Set variable {1}.",id),
|
|
|
|
|
$game_variables[id],false,250,Graphics.width)
|
|
|
|
|
value = pbMessageFreeText(_INTL("Set variable {1}.", id),
|
|
|
|
|
$game_variables[id], false, 250, Graphics.width)
|
|
|
|
|
$game_variables[id] = value
|
|
|
|
|
$game_map.need_refresh = true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def pbDebugVariables(mode)
|
|
|
|
|
viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
|
|
|
|
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
|
|
|
|
viewport.z = 99999
|
|
|
|
|
sprites = {}
|
|
|
|
|
sprites["right_window"] = SpriteWindow_DebugVariables.new(viewport)
|
|
|
|
|
@@ -159,25 +159,25 @@ def pbDebugVariables(mode)
|
|
|
|
|
pbPlayCancelSE
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
current_id = right_window.index+1
|
|
|
|
|
if mode==0 # Switches
|
|
|
|
|
current_id = right_window.index + 1
|
|
|
|
|
if mode == 0 # Switches
|
|
|
|
|
if Input.trigger?(Input::USE)
|
|
|
|
|
pbPlayDecisionSE
|
|
|
|
|
$game_switches[current_id] = !$game_switches[current_id]
|
|
|
|
|
right_window.refresh
|
|
|
|
|
$game_map.need_refresh = true
|
|
|
|
|
end
|
|
|
|
|
elsif mode==1 # Variables
|
|
|
|
|
elsif mode == 1 # Variables
|
|
|
|
|
if Input.repeat?(Input::LEFT)
|
|
|
|
|
pbDebugSetVariable(current_id,-1)
|
|
|
|
|
pbDebugSetVariable(current_id, -1)
|
|
|
|
|
right_window.refresh
|
|
|
|
|
elsif Input.repeat?(Input::RIGHT)
|
|
|
|
|
pbDebugSetVariable(current_id,1)
|
|
|
|
|
pbDebugSetVariable(current_id, 1)
|
|
|
|
|
right_window.refresh
|
|
|
|
|
elsif Input.trigger?(Input::ACTION)
|
|
|
|
|
if $game_variables[current_id]==0
|
|
|
|
|
if $game_variables[current_id] == 0
|
|
|
|
|
$game_variables[current_id] = ""
|
|
|
|
|
elsif $game_variables[current_id]==""
|
|
|
|
|
elsif $game_variables[current_id] == ""
|
|
|
|
|
$game_variables[current_id] = 0
|
|
|
|
|
elsif $game_variables[current_id].is_a?(Numeric)
|
|
|
|
|
$game_variables[current_id] = 0
|
|
|
|
|
@@ -353,7 +353,7 @@ end
|
|
|
|
|
#===============================================================================
|
|
|
|
|
class SpriteWindow_DebugRoamers < Window_DrawableCommand
|
|
|
|
|
def initialize(viewport)
|
|
|
|
|
super(0,0,Graphics.width,Graphics.height,viewport)
|
|
|
|
|
super(0, 0, Graphics.width, Graphics.height, viewport)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def roamerCount
|
|
|
|
|
@@ -361,44 +361,44 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def itemCount
|
|
|
|
|
return self.roamerCount+2
|
|
|
|
|
return self.roamerCount + 2
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def shadowtext(t,x,y,w,h,align = 0,colors = 0)
|
|
|
|
|
def shadowtext(t, x, y, w, h, align = 0, colors = 0)
|
|
|
|
|
width = self.contents.text_size(t).width
|
|
|
|
|
if align==1
|
|
|
|
|
x += (w-width) # Right aligned
|
|
|
|
|
elsif align==2
|
|
|
|
|
x += (w/2)-(width/2) # Centre aligned
|
|
|
|
|
if align == 1
|
|
|
|
|
x += (w - width) # Right aligned
|
|
|
|
|
elsif align == 2
|
|
|
|
|
x += (w / 2) - (width / 2) # Centre aligned
|
|
|
|
|
end
|
|
|
|
|
base = Color.new(12*8,12*8,12*8)
|
|
|
|
|
if colors==1
|
|
|
|
|
base = Color.new(168,48,56) # Red
|
|
|
|
|
elsif colors==2
|
|
|
|
|
base = Color.new(0,144,0) # Green
|
|
|
|
|
base = Color.new(12 * 8, 12 * 8, 12 * 8)
|
|
|
|
|
if colors == 1
|
|
|
|
|
base = Color.new(168, 48, 56) # Red
|
|
|
|
|
elsif colors == 2
|
|
|
|
|
base = Color.new(0, 144, 0) # Green
|
|
|
|
|
end
|
|
|
|
|
pbDrawShadowText(self.contents,x,y,[width,w].max,h,t,base,Color.new(26*8,26*8,25*8))
|
|
|
|
|
pbDrawShadowText(self.contents, x, y, [width, w].max, h, t, base, Color.new(26 * 8, 26 * 8, 25 * 8))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def drawItem(index,_count,rect)
|
|
|
|
|
def drawItem(index, _count, rect)
|
|
|
|
|
pbSetNarrowFont(self.contents)
|
|
|
|
|
rect = drawCursor(index,rect)
|
|
|
|
|
nameWidth = rect.width*50/100
|
|
|
|
|
statusWidth = rect.width*50/100
|
|
|
|
|
if index==self.itemCount-2
|
|
|
|
|
rect = drawCursor(index, rect)
|
|
|
|
|
nameWidth = rect.width * 50 / 100
|
|
|
|
|
statusWidth = rect.width * 50 / 100
|
|
|
|
|
if index == self.itemCount - 2
|
|
|
|
|
# Advance roaming
|
|
|
|
|
self.shadowtext(_INTL("[All roam to new locations]"),rect.x,rect.y,nameWidth,rect.height)
|
|
|
|
|
elsif index==self.itemCount-1
|
|
|
|
|
self.shadowtext(_INTL("[All roam to new locations]"), rect.x, rect.y, nameWidth, rect.height)
|
|
|
|
|
elsif index == self.itemCount - 1
|
|
|
|
|
# Advance roaming
|
|
|
|
|
self.shadowtext(_INTL("[Clear all current roamer locations]"),rect.x,rect.y,nameWidth,rect.height)
|
|
|
|
|
self.shadowtext(_INTL("[Clear all current roamer locations]"), rect.x, rect.y, nameWidth, rect.height)
|
|
|
|
|
else
|
|
|
|
|
pkmn = Settings::ROAMING_SPECIES[index]
|
|
|
|
|
name = GameData::Species.get(pkmn[0]).name + " (Lv. #{pkmn[1]})"
|
|
|
|
|
status = ""
|
|
|
|
|
statuscolor = 0
|
|
|
|
|
if pkmn[2]<=0 || $game_switches[pkmn[2]]
|
|
|
|
|
if pkmn[2] <= 0 || $game_switches[pkmn[2]]
|
|
|
|
|
status = $PokemonGlobal.roamPokemon[index]
|
|
|
|
|
if status==true
|
|
|
|
|
if status == true
|
|
|
|
|
if $PokemonGlobal.roamPokemonCaught[index]
|
|
|
|
|
status = "[CAUGHT]"
|
|
|
|
|
else
|
|
|
|
|
@@ -419,8 +419,8 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
|
|
|
|
|
else
|
|
|
|
|
status = "[NOT ROAMING][Switch #{pkmn[2]} is off]"
|
|
|
|
|
end
|
|
|
|
|
self.shadowtext(name,rect.x,rect.y,nameWidth,rect.height)
|
|
|
|
|
self.shadowtext(status,rect.x+nameWidth,rect.y,statusWidth,rect.height,1,statuscolor)
|
|
|
|
|
self.shadowtext(name, rect.x, rect.y, nameWidth, rect.height)
|
|
|
|
|
self.shadowtext(status, rect.x + nameWidth, rect.y, statusWidth, rect.height, 1, statuscolor)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
@@ -428,23 +428,23 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def pbDebugRoamers
|
|
|
|
|
viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
|
|
|
|
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
|
|
|
|
viewport.z = 99999
|
|
|
|
|
sprites = {}
|
|
|
|
|
sprites["cmdwindow"] = SpriteWindow_DebugRoamers.new(viewport)
|
|
|
|
|
cmdwindow = sprites["cmdwindow"]
|
|
|
|
|
cmdwindow.active = true
|
|
|
|
|
cmdwindow.active = true
|
|
|
|
|
loop do
|
|
|
|
|
Graphics.update
|
|
|
|
|
Input.update
|
|
|
|
|
pbUpdateSpriteHash(sprites)
|
|
|
|
|
if Input.trigger?(Input::ACTION) && cmdwindow.index<cmdwindow.roamerCount &&
|
|
|
|
|
(pkmn[2]<=0 || $game_switches[pkmn[2]]) &&
|
|
|
|
|
$PokemonGlobal.roamPokemon[cmdwindow.index]!=true
|
|
|
|
|
if Input.trigger?(Input::ACTION) && cmdwindow.index < cmdwindow.roamerCount &&
|
|
|
|
|
(pkmn[2] <= 0 || $game_switches[pkmn[2]]) &&
|
|
|
|
|
$PokemonGlobal.roamPokemon[cmdwindow.index] != true
|
|
|
|
|
# Roam selected Pokémon
|
|
|
|
|
pbPlayDecisionSE
|
|
|
|
|
if Input.press?(Input::CTRL) # Roam to current map
|
|
|
|
|
if $PokemonGlobal.roamPosition[cmdwindow.index]==pbDefaultMap
|
|
|
|
|
if $PokemonGlobal.roamPosition[cmdwindow.index] == pbDefaultMap
|
|
|
|
|
$PokemonGlobal.roamPosition[cmdwindow.index] = nil
|
|
|
|
|
else
|
|
|
|
|
$PokemonGlobal.roamPosition[cmdwindow.index] = pbDefaultMap
|
|
|
|
|
@@ -463,14 +463,14 @@ def pbDebugRoamers
|
|
|
|
|
pbPlayCancelSE
|
|
|
|
|
break
|
|
|
|
|
elsif Input.trigger?(Input::USE)
|
|
|
|
|
if cmdwindow.index<cmdwindow.roamerCount
|
|
|
|
|
if cmdwindow.index < cmdwindow.roamerCount
|
|
|
|
|
pbPlayDecisionSE
|
|
|
|
|
# Toggle through roaming, not roaming, defeated
|
|
|
|
|
pkmn = Settings::ROAMING_SPECIES[cmdwindow.index]
|
|
|
|
|
if pkmn[2]>0 && !$game_switches[pkmn[2]]
|
|
|
|
|
if pkmn[2] > 0 && !$game_switches[pkmn[2]]
|
|
|
|
|
# not roaming -> roaming
|
|
|
|
|
$game_switches[pkmn[2]] = true
|
|
|
|
|
elsif $PokemonGlobal.roamPokemon[cmdwindow.index]!=true
|
|
|
|
|
elsif $PokemonGlobal.roamPokemon[cmdwindow.index] != true
|
|
|
|
|
# roaming -> defeated
|
|
|
|
|
$PokemonGlobal.roamPokemon[cmdwindow.index] = true
|
|
|
|
|
$PokemonGlobal.roamPokemonCaught[cmdwindow.index] = false
|
|
|
|
|
@@ -478,15 +478,15 @@ def pbDebugRoamers
|
|
|
|
|
!$PokemonGlobal.roamPokemonCaught[cmdwindow.index]
|
|
|
|
|
# defeated -> caught
|
|
|
|
|
$PokemonGlobal.roamPokemonCaught[cmdwindow.index] = true
|
|
|
|
|
elsif pkmn[2]>0
|
|
|
|
|
elsif pkmn[2] > 0
|
|
|
|
|
# caught -> not roaming (or roaming if Switch ID is 0
|
|
|
|
|
$game_switches[pkmn[2]] = false if pkmn[2]>0
|
|
|
|
|
$game_switches[pkmn[2]] = false if pkmn[2] > 0
|
|
|
|
|
$PokemonGlobal.roamPokemon[cmdwindow.index] = nil
|
|
|
|
|
$PokemonGlobal.roamPokemonCaught[cmdwindow.index] = false
|
|
|
|
|
end
|
|
|
|
|
cmdwindow.refresh
|
|
|
|
|
elsif cmdwindow.index==cmdwindow.itemCount-2 # All roam
|
|
|
|
|
if Settings::ROAMING_SPECIES.length==0
|
|
|
|
|
elsif cmdwindow.index == cmdwindow.itemCount - 2 # All roam
|
|
|
|
|
if Settings::ROAMING_SPECIES.length == 0
|
|
|
|
|
pbPlayBuzzerSE
|
|
|
|
|
else
|
|
|
|
|
pbPlayDecisionSE
|
|
|
|
|
@@ -495,7 +495,7 @@ def pbDebugRoamers
|
|
|
|
|
cmdwindow.refresh
|
|
|
|
|
end
|
|
|
|
|
else # Clear all roaming locations
|
|
|
|
|
if Settings::ROAMING_SPECIES.length==0
|
|
|
|
|
if Settings::ROAMING_SPECIES.length == 0
|
|
|
|
|
pbPlayBuzzerSE
|
|
|
|
|
else
|
|
|
|
|
pbPlayDecisionSE
|
|
|
|
|
@@ -524,23 +524,23 @@ def pbExtractText
|
|
|
|
|
pbDisposeMessageWindow(msgwindow)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
pbMessageDisplay(msgwindow,_INTL("Please wait.\\wtnp[0]"))
|
|
|
|
|
pbMessageDisplay(msgwindow, _INTL("Please wait.\\wtnp[0]"))
|
|
|
|
|
MessageTypes.extract("intl.txt")
|
|
|
|
|
pbMessageDisplay(msgwindow,_INTL("All text in the game was extracted and saved to intl.txt.\1"))
|
|
|
|
|
pbMessageDisplay(msgwindow,_INTL("To localize the text for a particular language, translate every second line in the file.\1"))
|
|
|
|
|
pbMessageDisplay(msgwindow,_INTL("After translating, choose \"Compile Text.\""))
|
|
|
|
|
pbMessageDisplay(msgwindow, _INTL("All text in the game was extracted and saved to intl.txt.\1"))
|
|
|
|
|
pbMessageDisplay(msgwindow, _INTL("To localize the text for a particular language, translate every second line in the file.\1"))
|
|
|
|
|
pbMessageDisplay(msgwindow, _INTL("After translating, choose \"Compile Text.\""))
|
|
|
|
|
pbDisposeMessageWindow(msgwindow)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def pbCompileTextUI
|
|
|
|
|
msgwindow = pbCreateMessageWindow
|
|
|
|
|
pbMessageDisplay(msgwindow,_INTL("Please wait.\\wtnp[0]"))
|
|
|
|
|
pbMessageDisplay(msgwindow, _INTL("Please wait.\\wtnp[0]"))
|
|
|
|
|
begin
|
|
|
|
|
pbCompileText
|
|
|
|
|
pbMessageDisplay(msgwindow,_INTL("Successfully compiled text and saved it to intl.dat.\1"))
|
|
|
|
|
pbMessageDisplay(msgwindow,_INTL("To use the file in a game, place the file in the Data folder under a different name, and edit the Settings::LANGUAGES array in the scripts."))
|
|
|
|
|
pbMessageDisplay(msgwindow, _INTL("Successfully compiled text and saved it to intl.dat.\1"))
|
|
|
|
|
pbMessageDisplay(msgwindow, _INTL("To use the file in a game, place the file in the Data folder under a different name, and edit the Settings::LANGUAGES array in the scripts."))
|
|
|
|
|
rescue RuntimeError
|
|
|
|
|
pbMessageDisplay(msgwindow,_INTL("Failed to compile text: {1}",$!.message))
|
|
|
|
|
pbMessageDisplay(msgwindow, _INTL("Failed to compile text: {1}", $!.message))
|
|
|
|
|
end
|
|
|
|
|
pbDisposeMessageWindow(msgwindow)
|
|
|
|
|
end
|
|
|
|
|
@@ -555,28 +555,28 @@ def pbExportAllAnimations
|
|
|
|
|
if animations
|
|
|
|
|
msgwindow = pbCreateMessageWindow
|
|
|
|
|
for anim in animations
|
|
|
|
|
next if !anim || anim.length==0 || anim.name==""
|
|
|
|
|
pbMessageDisplay(msgwindow,anim.name,false)
|
|
|
|
|
next if !anim || anim.length == 0 || anim.name == ""
|
|
|
|
|
pbMessageDisplay(msgwindow, anim.name, false)
|
|
|
|
|
Graphics.update
|
|
|
|
|
safename = anim.name.gsub(/\W/,"_")
|
|
|
|
|
safename = anim.name.gsub(/\W/, "_")
|
|
|
|
|
Dir.mkdir("Animations/#{safename}") rescue nil
|
|
|
|
|
File.open("Animations/#{safename}/#{safename}.anm","wb") { |f|
|
|
|
|
|
File.open("Animations/#{safename}/#{safename}.anm", "wb") { |f|
|
|
|
|
|
f.write(dumpBase64Anim(anim))
|
|
|
|
|
}
|
|
|
|
|
if anim.graphic && anim.graphic!=""
|
|
|
|
|
graphicname = RTP.getImagePath("Graphics/Animations/"+anim.graphic)
|
|
|
|
|
pbSafeCopyFile(graphicname,"Animations/#{safename}/"+File.basename(graphicname))
|
|
|
|
|
if anim.graphic && anim.graphic != ""
|
|
|
|
|
graphicname = RTP.getImagePath("Graphics/Animations/" + anim.graphic)
|
|
|
|
|
pbSafeCopyFile(graphicname, "Animations/#{safename}/" + File.basename(graphicname))
|
|
|
|
|
end
|
|
|
|
|
for timing in anim.timing
|
|
|
|
|
if !timing.timingType || timing.timingType==0
|
|
|
|
|
if timing.name && timing.name!=""
|
|
|
|
|
audioName = RTP.getAudioPath("Audio/SE/Anim/"+timing.name)
|
|
|
|
|
pbSafeCopyFile(audioName,"Animations/#{safename}/"+File.basename(audioName))
|
|
|
|
|
if !timing.timingType || timing.timingType == 0
|
|
|
|
|
if timing.name && timing.name != ""
|
|
|
|
|
audioName = RTP.getAudioPath("Audio/SE/Anim/" + timing.name)
|
|
|
|
|
pbSafeCopyFile(audioName, "Animations/#{safename}/" + File.basename(audioName))
|
|
|
|
|
end
|
|
|
|
|
elsif timing.timingType==1 || timing.timingType==3
|
|
|
|
|
if timing.name && timing.name!=""
|
|
|
|
|
graphicname = RTP.getImagePath("Graphics/Animations/"+timing.name)
|
|
|
|
|
pbSafeCopyFile(graphicname,"Animations/#{safename}/"+File.basename(graphicname))
|
|
|
|
|
elsif timing.timingType == 1 || timing.timingType == 3
|
|
|
|
|
if timing.name && timing.name != ""
|
|
|
|
|
graphicname = RTP.getImagePath("Graphics/Animations/" + timing.name)
|
|
|
|
|
pbSafeCopyFile(graphicname, "Animations/#{safename}/" + File.basename(graphicname))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
@@ -587,7 +587,7 @@ def pbExportAllAnimations
|
|
|
|
|
pbMessage(_INTL("There are no animations to export."))
|
|
|
|
|
end
|
|
|
|
|
rescue
|
|
|
|
|
p $!.message,$!.backtrace
|
|
|
|
|
p $!.message, $!.backtrace
|
|
|
|
|
pbMessage(_INTL("The export failed."))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
@@ -596,59 +596,59 @@ def pbImportAllAnimations
|
|
|
|
|
animationFolders = []
|
|
|
|
|
if safeIsDirectory?("Animations")
|
|
|
|
|
Dir.foreach("Animations") { |fb|
|
|
|
|
|
f = "Animations/"+fb
|
|
|
|
|
if safeIsDirectory?(f) && fb!="." && fb!=".."
|
|
|
|
|
f = "Animations/" + fb
|
|
|
|
|
if safeIsDirectory?(f) && fb != "." && fb != ".."
|
|
|
|
|
animationFolders.push(f)
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
if animationFolders.length==0
|
|
|
|
|
if animationFolders.length == 0
|
|
|
|
|
pbMessage(_INTL("There are no animations to import. Put each animation in a folder within the Animations folder."))
|
|
|
|
|
else
|
|
|
|
|
msgwindow = pbCreateMessageWindow
|
|
|
|
|
animations = pbLoadBattleAnimations
|
|
|
|
|
animations = PBAnimations.new if !animations
|
|
|
|
|
for folder in animationFolders
|
|
|
|
|
pbMessageDisplay(msgwindow,folder,false)
|
|
|
|
|
pbMessageDisplay(msgwindow, folder, false)
|
|
|
|
|
Graphics.update
|
|
|
|
|
audios = []
|
|
|
|
|
files = Dir.glob(folder+"/*.*")
|
|
|
|
|
files = Dir.glob(folder + "/*.*")
|
|
|
|
|
%w[wav ogg mid wma].each { |ext| # mp3
|
|
|
|
|
upext = ext.upcase
|
|
|
|
|
audios.concat(files.find_all { |f| f[f.length-3,3]==ext })
|
|
|
|
|
audios.concat(files.find_all { |f| f[f.length-3,3]==upext })
|
|
|
|
|
audios.concat(files.find_all { |f| f[f.length - 3, 3] == ext })
|
|
|
|
|
audios.concat(files.find_all { |f| f[f.length - 3, 3] == upext })
|
|
|
|
|
}
|
|
|
|
|
for audio in audios
|
|
|
|
|
pbSafeCopyFile(audio,RTP.getAudioPath("Audio/SE/Anim/"+File.basename(audio)),"Audio/SE/Anim/"+File.basename(audio))
|
|
|
|
|
pbSafeCopyFile(audio, RTP.getAudioPath("Audio/SE/Anim/" + File.basename(audio)), "Audio/SE/Anim/" + File.basename(audio))
|
|
|
|
|
end
|
|
|
|
|
images = []
|
|
|
|
|
%w[png gif].each { |ext| # jpg jpeg bmp
|
|
|
|
|
upext = ext.upcase
|
|
|
|
|
images.concat(files.find_all { |f| f[f.length-3,3]==ext })
|
|
|
|
|
images.concat(files.find_all { |f| f[f.length-3,3]==upext })
|
|
|
|
|
images.concat(files.find_all { |f| f[f.length - 3, 3] == ext })
|
|
|
|
|
images.concat(files.find_all { |f| f[f.length - 3, 3] == upext })
|
|
|
|
|
}
|
|
|
|
|
for image in images
|
|
|
|
|
pbSafeCopyFile(image,RTP.getImagePath("Graphics/Animations/"+File.basename(image)),"Graphics/Animations/"+File.basename(image))
|
|
|
|
|
pbSafeCopyFile(image, RTP.getImagePath("Graphics/Animations/" + File.basename(image)), "Graphics/Animations/" + File.basename(image))
|
|
|
|
|
end
|
|
|
|
|
Dir.glob(folder+"/*.anm") { |f|
|
|
|
|
|
Dir.glob(folder + "/*.anm") { |f|
|
|
|
|
|
textdata = loadBase64Anim(IO.read(f)) rescue nil
|
|
|
|
|
if textdata && textdata.is_a?(PBAnimation)
|
|
|
|
|
index = pbAllocateAnimation(animations,textdata.name)
|
|
|
|
|
index = pbAllocateAnimation(animations, textdata.name)
|
|
|
|
|
missingFiles = []
|
|
|
|
|
textdata.name = File.basename(folder) if textdata.name==""
|
|
|
|
|
textdata.name = File.basename(folder) if textdata.name == ""
|
|
|
|
|
textdata.id = -1 # This is not an RPG Maker XP animation
|
|
|
|
|
pbConvertAnimToNewFormat(textdata)
|
|
|
|
|
if textdata.graphic && textdata.graphic!=""
|
|
|
|
|
if !safeExists?(folder+"/"+textdata.graphic) &&
|
|
|
|
|
!FileTest.image_exist?("Graphics/Animations/"+textdata.graphic)
|
|
|
|
|
if textdata.graphic && textdata.graphic != ""
|
|
|
|
|
if !safeExists?(folder + "/" + textdata.graphic) &&
|
|
|
|
|
!FileTest.image_exist?("Graphics/Animations/" + textdata.graphic)
|
|
|
|
|
textdata.graphic = ""
|
|
|
|
|
missingFiles.push(textdata.graphic)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
for timing in textdata.timing
|
|
|
|
|
if timing.name && timing.name!=""
|
|
|
|
|
if !safeExists?(folder+"/"+timing.name) &&
|
|
|
|
|
!FileTest.audio_exist?("Audio/SE/Anim/"+timing.name)
|
|
|
|
|
if timing.name && timing.name != ""
|
|
|
|
|
if !safeExists?(folder + "/" + timing.name) &&
|
|
|
|
|
!FileTest.audio_exist?("Audio/SE/Anim/" + timing.name)
|
|
|
|
|
timing.name = ""
|
|
|
|
|
missingFiles.push(timing.name)
|
|
|
|
|
end
|
|
|
|
|
@@ -658,7 +658,7 @@ def pbImportAllAnimations
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
save_data(animations,"Data/PkmnAnimations.rxdata")
|
|
|
|
|
save_data(animations, "Data/PkmnAnimations.rxdata")
|
|
|
|
|
$game_temp.battle_animations_data = nil
|
|
|
|
|
pbDisposeMessageWindow(msgwindow)
|
|
|
|
|
pbMessage(_INTL("All animations were imported."))
|
|
|
|
|
@@ -748,17 +748,17 @@ end
|
|
|
|
|
#===============================================================================
|
|
|
|
|
class PokemonDebugPartyScreen
|
|
|
|
|
def initialize
|
|
|
|
|
@viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
|
|
|
|
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
|
|
|
|
@viewport.z = 99999
|
|
|
|
|
@messageBox = Window_AdvancedTextPokemon.new("")
|
|
|
|
|
@messageBox.viewport = @viewport
|
|
|
|
|
@messageBox.visible = false
|
|
|
|
|
@messageBox.letterbyletter = true
|
|
|
|
|
pbBottomLeftLines(@messageBox,2)
|
|
|
|
|
pbBottomLeftLines(@messageBox, 2)
|
|
|
|
|
@helpWindow = Window_UnformattedTextPokemon.new("")
|
|
|
|
|
@helpWindow.viewport = @viewport
|
|
|
|
|
@helpWindow.visible = true
|
|
|
|
|
pbBottomLeftLines(@helpWindow,1)
|
|
|
|
|
pbBottomLeftLines(@helpWindow, 1)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def pbEndScreen
|
|
|
|
|
@@ -796,11 +796,11 @@ class PokemonDebugPartyScreen
|
|
|
|
|
@messageBox.text = text
|
|
|
|
|
@messageBox.visible = true
|
|
|
|
|
@helpWindow.visible = false
|
|
|
|
|
using(cmdwindow = Window_CommandPokemon.new([_INTL("Yes"),_INTL("No")])) {
|
|
|
|
|
using(cmdwindow = Window_CommandPokemon.new([_INTL("Yes"), _INTL("No")])) {
|
|
|
|
|
cmdwindow.visible = false
|
|
|
|
|
pbBottomRight(cmdwindow)
|
|
|
|
|
cmdwindow.y -= @messageBox.height
|
|
|
|
|
cmdwindow.z = @viewport.z+1
|
|
|
|
|
cmdwindow.z = @viewport.z + 1
|
|
|
|
|
loop do
|
|
|
|
|
Graphics.update
|
|
|
|
|
Input.update
|
|
|
|
|
@@ -812,7 +812,7 @@ class PokemonDebugPartyScreen
|
|
|
|
|
ret = false
|
|
|
|
|
break
|
|
|
|
|
elsif Input.trigger?(Input::USE) && @messageBox.resume
|
|
|
|
|
ret = (cmdwindow.index==0)
|
|
|
|
|
ret = (cmdwindow.index == 0)
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
@@ -823,14 +823,14 @@ class PokemonDebugPartyScreen
|
|
|
|
|
return ret
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def pbShowCommands(text,commands,index = 0)
|
|
|
|
|
def pbShowCommands(text, commands, index = 0)
|
|
|
|
|
ret = -1
|
|
|
|
|
@helpWindow.visible = true
|
|
|
|
|
using(cmdwindow = Window_CommandPokemonColor.new(commands)) {
|
|
|
|
|
cmdwindow.z = @viewport.z+1
|
|
|
|
|
cmdwindow.z = @viewport.z + 1
|
|
|
|
|
cmdwindow.index = index
|
|
|
|
|
pbBottomRight(cmdwindow)
|
|
|
|
|
@helpWindow.resizeHeightToFit(text,Graphics.width-cmdwindow.width)
|
|
|
|
|
@helpWindow.resizeHeightToFit(text, Graphics.width - cmdwindow.width)
|
|
|
|
|
@helpWindow.text = text
|
|
|
|
|
pbBottomLeft(@helpWindow)
|
|
|
|
|
loop do
|
|
|
|
|
@@ -852,16 +852,16 @@ class PokemonDebugPartyScreen
|
|
|
|
|
return ret
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def pbChooseMove(pkmn,text,index = 0)
|
|
|
|
|
def pbChooseMove(pkmn, text, index = 0)
|
|
|
|
|
moveNames = []
|
|
|
|
|
for i in pkmn.moves
|
|
|
|
|
if i.total_pp<=0
|
|
|
|
|
moveNames.push(_INTL("{1} (PP: ---)",i.name))
|
|
|
|
|
if i.total_pp <= 0
|
|
|
|
|
moveNames.push(_INTL("{1} (PP: ---)", i.name))
|
|
|
|
|
else
|
|
|
|
|
moveNames.push(_INTL("{1} (PP: {2}/{3})",i.name,i.pp,i.total_pp))
|
|
|
|
|
moveNames.push(_INTL("{1} (PP: {2}/{3})", i.name, i.pp, i.total_pp))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
return pbShowCommands(text,moveNames,index)
|
|
|
|
|
return pbShowCommands(text, moveNames, index)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def pbRefreshSingle(index); end
|
|
|
|
|
|