mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Minor tweaks
This commit is contained in:
@@ -91,8 +91,8 @@ end
|
|||||||
def pbWriteMail(item,pkmn,pkmnid,scene)
|
def pbWriteMail(item,pkmn,pkmnid,scene)
|
||||||
message = ""
|
message = ""
|
||||||
loop do
|
loop do
|
||||||
message = pbMessageFreeText(_INTL("Please enter a message (max. 256 characters)."),
|
message = pbMessageFreeText(_INTL("Please enter a message (max. 250 characters)."),
|
||||||
"",false,256,Graphics.width) { scene.pbUpdate }
|
"",false,250,Graphics.width) { scene.pbUpdate }
|
||||||
if message!=""
|
if message!=""
|
||||||
# Store mail if a message was written
|
# Store mail if a message was written
|
||||||
poke1 = poke2 = nil
|
poke1 = poke2 = nil
|
||||||
|
|||||||
@@ -136,8 +136,8 @@ class PokemonPartyBlankPanel < SpriteWrapper
|
|||||||
|
|
||||||
def initialize(_pokemon,index,viewport=nil)
|
def initialize(_pokemon,index,viewport=nil)
|
||||||
super(viewport)
|
super(viewport)
|
||||||
self.x = [0,256,0,256,0,256][index]
|
self.x = [0, Graphics.width/2][index%2]
|
||||||
self.y = [0,16,96,112,192,208][index]
|
self.y = [0, 16, 96, 112, 192, 208][index]
|
||||||
@panelbgsprite = AnimatedBitmap.new("Graphics/Pictures/Party/panel_blank")
|
@panelbgsprite = AnimatedBitmap.new("Graphics/Pictures/Party/panel_blank")
|
||||||
self.bitmap = @panelbgsprite.bitmap
|
self.bitmap = @panelbgsprite.bitmap
|
||||||
@text = nil
|
@text = nil
|
||||||
@@ -172,8 +172,8 @@ class PokemonPartyPanel < SpriteWrapper
|
|||||||
@pokemon = pokemon
|
@pokemon = pokemon
|
||||||
@active = (index==0) # true = rounded panel, false = rectangular panel
|
@active = (index==0) # true = rounded panel, false = rectangular panel
|
||||||
@refreshing = true
|
@refreshing = true
|
||||||
self.x = [0,256,0,256,0,256][index]
|
self.x = [0, Graphics.width/2][index%2]
|
||||||
self.y = [0,16,96,112,192,208][index]
|
self.y = [0, 16, 96, 112, 192, 208][index]
|
||||||
@panelbgsprite = ChangelingSprite.new(0,0,viewport)
|
@panelbgsprite = ChangelingSprite.new(0,0,viewport)
|
||||||
@panelbgsprite.z = self.z
|
@panelbgsprite.z = self.z
|
||||||
if @active # Rounded panel
|
if @active # Rounded panel
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ class PokemonRegionMap_Scene
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
currentname = pbMessageFreeText(_INTL("Set the name for this point."),currentname,false,256) { pbUpdate }
|
currentname = pbMessageFreeText(_INTL("Set the name for this point."),currentname,false,250) { pbUpdate }
|
||||||
if currentname
|
if currentname
|
||||||
if currentobj
|
if currentobj
|
||||||
currentobj[2] = currentname
|
currentobj[2] = currentname
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ def pbEditMysteryGift(type,item,id=0,giftname="")
|
|||||||
item.obtainText=commands[command]
|
item.obtainText=commands[command]
|
||||||
break
|
break
|
||||||
elsif command==commands.length-1
|
elsif command==commands.length-1
|
||||||
obtainname=pbMessageFreeText(_INTL("Enter a phrase."),"",false,32)
|
obtainname=pbMessageFreeText(_INTL("Enter a phrase."),"",false,30)
|
||||||
if obtainname!=""
|
if obtainname!=""
|
||||||
item.obtainText=obtainname
|
item.obtainText=obtainname
|
||||||
break
|
break
|
||||||
@@ -96,7 +96,7 @@ def pbEditMysteryGift(type,item,id=0,giftname="")
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
loop do
|
loop do
|
||||||
newgiftname=pbMessageFreeText(_INTL("Enter a name for the gift."),giftname,false,32)
|
newgiftname=pbMessageFreeText(_INTL("Enter a name for the gift."),giftname,false,250)
|
||||||
if newgiftname!=""
|
if newgiftname!=""
|
||||||
giftname=newgiftname
|
giftname=newgiftname
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -171,12 +171,12 @@ class VoltorbFlip
|
|||||||
@sprites["curtain"].opacity=0
|
@sprites["curtain"].opacity=0
|
||||||
@sprites["curtainL"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
|
@sprites["curtainL"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
|
||||||
@sprites["curtainL"].z=99999
|
@sprites["curtainL"].z=99999
|
||||||
@sprites["curtainL"].x=256
|
@sprites["curtainL"].x=Graphics.width/2
|
||||||
@sprites["curtainL"].angle=-90
|
@sprites["curtainL"].angle=-90
|
||||||
@sprites["curtainL"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0))
|
@sprites["curtainL"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0))
|
||||||
@sprites["curtainR"]=BitmapSprite.new(Graphics.width,Graphics.height*2,@viewport)
|
@sprites["curtainR"]=BitmapSprite.new(Graphics.width,Graphics.height*2,@viewport)
|
||||||
@sprites["curtainR"].z=99999
|
@sprites["curtainR"].z=99999
|
||||||
@sprites["curtainR"].x=256
|
@sprites["curtainR"].x=Graphics.width/2
|
||||||
@sprites["curtainR"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height*2,Color.new(0,0,0))
|
@sprites["curtainR"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height*2,Color.new(0,0,0))
|
||||||
@sprites["cursor"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
|
@sprites["cursor"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
|
||||||
@sprites["cursor"].z=99998
|
@sprites["cursor"].z=99998
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ def pbDebugVariableScreen(id)
|
|||||||
$game_variables[id] = [$game_variables[id],-99999999].max
|
$game_variables[id] = [$game_variables[id],-99999999].max
|
||||||
elsif $game_variables[id].is_a?(String)
|
elsif $game_variables[id].is_a?(String)
|
||||||
value = pbMessageFreeText(_INTL("Set variable {1}.",id),
|
value = pbMessageFreeText(_INTL("Set variable {1}.",id),
|
||||||
$game_variables[id],false,256,Graphics.width)
|
$game_variables[id],false,250,Graphics.width)
|
||||||
$game_variables[id] = value
|
$game_variables[id] = value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -175,16 +175,16 @@ def pbEncounterEditorMap(encdata,map)
|
|||||||
enccmd = pbListWindow([])
|
enccmd = pbListWindow([])
|
||||||
# This window displays the help text
|
# This window displays the help text
|
||||||
enchelp = Window_UnformattedTextPokemon.new("")
|
enchelp = Window_UnformattedTextPokemon.new("")
|
||||||
enchelp.x = 256
|
enchelp.x = Graphics.width/2
|
||||||
enchelp.y = 0
|
enchelp.y = 0
|
||||||
enchelp.width = 224
|
enchelp.width = Graphics.width/2 - 32
|
||||||
enchelp.height = 96
|
enchelp.height = 96
|
||||||
enchelp.z = 99999
|
enchelp.z = 99999
|
||||||
mapinfos = load_data("Data/MapInfos.rxdata")
|
mapinfos = load_data("Data/MapInfos.rxdata")
|
||||||
mapname = mapinfos[map].name
|
mapname = mapinfos[map].name
|
||||||
loop do
|
loop do
|
||||||
enc = encdata[map]
|
enc = encdata[map]
|
||||||
enchelp.text = mapname
|
enchelp.text = _ISPRINTF("{1:03d}: {2:s}\r\nChoose a method",map,mapname)
|
||||||
choice = pbEncounterEditorTypes(enc,enccmd)
|
choice = pbEncounterEditorTypes(enc,enccmd)
|
||||||
if !enc
|
if !enc
|
||||||
enc = [EncounterTypes::EnctypeDensities.clone,[]]
|
enc = [EncounterTypes::EnctypeDensities.clone,[]]
|
||||||
@@ -197,11 +197,11 @@ def pbEncounterEditorMap(encdata,map)
|
|||||||
elsif choice==-3
|
elsif choice==-3
|
||||||
ret = pbNewEncounterType(enc)
|
ret = pbNewEncounterType(enc)
|
||||||
if ret>=0
|
if ret>=0
|
||||||
enchelp.text = _INTL("{1}\r\n{2}",mapname,EncounterTypes::Names[ret])
|
enchelp.text = _ISPRINTF("{1:03d}: {2:s}\r\n{3:s}",map,mapname,EncounterTypes::Names[ret])
|
||||||
pbEditEncounterType(enc,ret)
|
pbEditEncounterType(enc,ret)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
enchelp.text = _INTL("{1}\r\n{2}",mapname,EncounterTypes::Names[choice])
|
enchelp.text = _ISPRINTF("{1:03d}: {2:s}\r\n{3:s}",map,mapname,EncounterTypes::Names[choice])
|
||||||
pbEditEncounterType(enc,choice)
|
pbEditEncounterType(enc,choice)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -228,7 +228,7 @@ def pbTrainerTypeEditorNew(trconst)
|
|||||||
end
|
end
|
||||||
trainertype = maxid+1
|
trainertype = maxid+1
|
||||||
trname = pbMessageFreeText(_INTL("Please enter the trainer type's name."),
|
trname = pbMessageFreeText(_INTL("Please enter the trainer type's name."),
|
||||||
(trconst) ? trconst.gsub(/_+/," ") : "",false,256)
|
(trconst) ? trconst.gsub(/_+/," ") : "",false,30)
|
||||||
return -1 if trname=="" && !trconst
|
return -1 if trname=="" && !trconst
|
||||||
# Create an internal name based on the trainer type's name if there is none.
|
# Create an internal name based on the trainer type's name if there is none.
|
||||||
trconst = trname if !trconst
|
trconst = trname if !trconst
|
||||||
@@ -432,7 +432,7 @@ def pbTrainerBattleEditor
|
|||||||
else
|
else
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
trainername = pbMessageFreeText(_INTL("Now enter the trainer's name."),"",false,32)
|
trainername = pbMessageFreeText(_INTL("Now enter the trainer's name."),"",false,30)
|
||||||
next if trainername==""
|
next if trainername==""
|
||||||
trainerparty = pbGetFreeTrainerParty(trainertype,trainername)
|
trainerparty = pbGetFreeTrainerParty(trainertype,trainername)
|
||||||
if trainerparty<0
|
if trainerparty<0
|
||||||
@@ -1086,9 +1086,9 @@ def pbRegionalDexEditor(dex)
|
|||||||
viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
||||||
viewport.z = 99999
|
viewport.z = 99999
|
||||||
info = Window_AdvancedTextPokemon.new(_INTL("Z+Up/Down: Rearrange entries\nZ+Right: Insert new entry\nZ+Left: Delete entry\nF: Clear entry"))
|
info = Window_AdvancedTextPokemon.new(_INTL("Z+Up/Down: Rearrange entries\nZ+Right: Insert new entry\nZ+Left: Delete entry\nF: Clear entry"))
|
||||||
info.x = 256
|
info.x = Graphics.width/2
|
||||||
info.y = 64
|
info.y = 64
|
||||||
info.width = Graphics.width-256
|
info.width = Graphics.width/2
|
||||||
info.height = Graphics.height-64
|
info.height = Graphics.height-64
|
||||||
info.viewport = viewport
|
info.viewport = viewport
|
||||||
info.z = 2
|
info.z = 2
|
||||||
@@ -1229,16 +1229,16 @@ def pbRegionalDexEditorMain
|
|||||||
cmdwin.viewport = viewport
|
cmdwin.viewport = viewport
|
||||||
cmdwin.z = 2
|
cmdwin.z = 2
|
||||||
title = Window_UnformattedTextPokemon.new(_INTL("Regional Dexes Editor"))
|
title = Window_UnformattedTextPokemon.new(_INTL("Regional Dexes Editor"))
|
||||||
title.x = 256
|
title.x = Graphics.width/2
|
||||||
title.y = 0
|
title.y = 0
|
||||||
title.width = Graphics.width-256
|
title.width = Graphics.width/2
|
||||||
title.height = 64
|
title.height = 64
|
||||||
title.viewport = viewport
|
title.viewport = viewport
|
||||||
title.z = 2
|
title.z = 2
|
||||||
info = Window_AdvancedTextPokemon.new(_INTL("Z+Up/Down: Rearrange Dexes"))
|
info = Window_AdvancedTextPokemon.new(_INTL("Z+Up/Down: Rearrange Dexes"))
|
||||||
info.x = 256
|
info.x = Graphics.width/2
|
||||||
info.y = 64
|
info.y = 64
|
||||||
info.width = Graphics.width-256
|
info.width = Graphics.width/2
|
||||||
info.height = Graphics.height-64
|
info.height = Graphics.height-64
|
||||||
info.viewport = viewport
|
info.viewport = viewport
|
||||||
info.z = 2
|
info.z = 2
|
||||||
@@ -1387,16 +1387,16 @@ def pbAnimationsOrganiser
|
|||||||
cmdwin.viewport = viewport
|
cmdwin.viewport = viewport
|
||||||
cmdwin.z = 2
|
cmdwin.z = 2
|
||||||
title = Window_UnformattedTextPokemon.new(_INTL("Animations Organiser"))
|
title = Window_UnformattedTextPokemon.new(_INTL("Animations Organiser"))
|
||||||
title.x = 256
|
title.x = Graphics.width/2
|
||||||
title.y = 0
|
title.y = 0
|
||||||
title.width = Graphics.width-256
|
title.width = Graphics.width/2
|
||||||
title.height = 64
|
title.height = 64
|
||||||
title.viewport = viewport
|
title.viewport = viewport
|
||||||
title.z = 2
|
title.z = 2
|
||||||
info = Window_AdvancedTextPokemon.new(_INTL("Z+Up/Down: Swap\nZ+Left: Delete\nZ+Right: Insert"))
|
info = Window_AdvancedTextPokemon.new(_INTL("Z+Up/Down: Swap\nZ+Left: Delete\nZ+Right: Insert"))
|
||||||
info.x = 256
|
info.x = Graphics.width/2
|
||||||
info.y = 64
|
info.y = 64
|
||||||
info.width = Graphics.width-256
|
info.width = Graphics.width/2
|
||||||
info.height = Graphics.height-64
|
info.height = Graphics.height-64
|
||||||
info.viewport = viewport
|
info.viewport = viewport
|
||||||
info.z = 2
|
info.z = 2
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ end
|
|||||||
module StringProperty
|
module StringProperty
|
||||||
def self.set(settingname,oldsetting)
|
def self.set(settingname,oldsetting)
|
||||||
return pbMessageFreeText(_INTL("Set the value for {1}.",settingname),
|
return pbMessageFreeText(_INTL("Set the value for {1}.",settingname),
|
||||||
(oldsetting) ? oldsetting : "",false,256,Graphics.width)
|
(oldsetting) ? oldsetting : "",false,250,Graphics.width)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.format(value)
|
def self.format(value)
|
||||||
@@ -720,7 +720,7 @@ end
|
|||||||
module ItemNameProperty
|
module ItemNameProperty
|
||||||
def self.set(settingname,oldsetting)
|
def self.set(settingname,oldsetting)
|
||||||
return pbMessageFreeText(_INTL("Set the value for {1}.",settingname),
|
return pbMessageFreeText(_INTL("Set the value for {1}.",settingname),
|
||||||
(oldsetting) ? oldsetting : "",false,12)
|
(oldsetting) ? oldsetting : "",false,30)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.defaultValue
|
def self.defaultValue
|
||||||
@@ -1120,7 +1120,7 @@ module FormNamesProperty
|
|||||||
if cmd[1]>=0
|
if cmd[1]>=0
|
||||||
entry = realcmds[cmd[1]]
|
entry = realcmds[cmd[1]]
|
||||||
if entry[1]<0 # Add new form
|
if entry[1]<0 # Add new form
|
||||||
newname = pbMessageFreeText(_INTL("Choose a form name (no commas)."),"",false,255)
|
newname = pbMessageFreeText(_INTL("Choose a form name (no commas)."),"",false,250)
|
||||||
if newname!=""
|
if newname!=""
|
||||||
realcmds.push([newname,realcmds.length-1])
|
realcmds.push([newname,realcmds.length-1])
|
||||||
refreshlist = true
|
refreshlist = true
|
||||||
@@ -1129,7 +1129,7 @@ module FormNamesProperty
|
|||||||
cmd2 = pbMessage(_INTL("\\ts[]Do what with this form name?"),
|
cmd2 = pbMessage(_INTL("\\ts[]Do what with this form name?"),
|
||||||
[_INTL("Rename"),_INTL("Delete"),_INTL("Cancel")],3)
|
[_INTL("Rename"),_INTL("Delete"),_INTL("Cancel")],3)
|
||||||
if cmd2==0
|
if cmd2==0
|
||||||
newname = pbMessageFreeText(_INTL("Choose a form name (no commas)."),entry[0],false,255)
|
newname = pbMessageFreeText(_INTL("Choose a form name (no commas)."),entry[0],false,250)
|
||||||
if newname!=""
|
if newname!=""
|
||||||
realcmds[cmd[1]][0] = newname
|
realcmds[cmd[1]][0] = newname
|
||||||
refreshlist = true
|
refreshlist = true
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ class GraphicsLister
|
|||||||
def initialize(folder,selection)
|
def initialize(folder,selection)
|
||||||
@sprite = IconSprite.new(0,0)
|
@sprite = IconSprite.new(0,0)
|
||||||
@sprite.bitmap = nil
|
@sprite.bitmap = nil
|
||||||
|
@sprite.x = Graphics.width * 3 / 4
|
||||||
|
@sprite.y = (Graphics.height - 64) / 2 + 64
|
||||||
@sprite.z = 2
|
@sprite.z = 2
|
||||||
@folder = folder
|
@folder = folder
|
||||||
@selection = selection
|
@selection = selection
|
||||||
@@ -179,23 +181,18 @@ class GraphicsLister
|
|||||||
def refresh(index)
|
def refresh(index)
|
||||||
return if index<0
|
return if index<0
|
||||||
@sprite.setBitmap(@folder+@commands[index])
|
@sprite.setBitmap(@folder+@commands[index])
|
||||||
ww = @sprite.bitmap.width
|
sprite_width = @sprite.bitmap.width
|
||||||
wh = @sprite.bitmap.height
|
sprite_height = @sprite.bitmap.height
|
||||||
sx = (Graphics.width-256).to_f/ww
|
@sprite.ox = sprite_width/2
|
||||||
sy = (Graphics.height-64).to_f/wh
|
@sprite.oy = sprite_height/2
|
||||||
if sx<1.0 || sy<1.0
|
scale_x = (Graphics.width/2).to_f/sprite_width
|
||||||
if sx>sy
|
scale_y = (Graphics.height-64).to_f/sprite_height
|
||||||
ww = sy*ww
|
if scale_x<1.0 || scale_y<1.0
|
||||||
wh = (Graphics.height-64).to_f
|
min_scale = [scale_x, scale_y].min
|
||||||
else
|
@sprite.zoom_x = @sprite.zoom_y = min_scale
|
||||||
wh = sx*wh
|
else
|
||||||
ww = (Graphics.width-256).to_f
|
@sprite.zoom_x = @sprite.zoom_y = 1.0
|
||||||
end
|
|
||||||
end
|
end
|
||||||
@sprite.x = (Graphics.width-((Graphics.width-256)/2))-(ww/2)
|
|
||||||
@sprite.y = (Graphics.height-((Graphics.height-64)/2))-(wh/2)
|
|
||||||
@sprite.zoom_x = ww*1.0/@sprite.bitmap.width
|
|
||||||
@sprite.zoom_y = wh*1.0/@sprite.bitmap.height
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -272,7 +269,9 @@ class MapLister
|
|||||||
def initialize(selmap,addGlobal=false)
|
def initialize(selmap,addGlobal=false)
|
||||||
@sprite = SpriteWrapper.new
|
@sprite = SpriteWrapper.new
|
||||||
@sprite.bitmap = nil
|
@sprite.bitmap = nil
|
||||||
@sprite.z = 2
|
@sprite.x = Graphics.width * 3 / 4
|
||||||
|
@sprite.y = (Graphics.height - 64) / 2 + 64
|
||||||
|
@sprite.z = -2
|
||||||
@commands = []
|
@commands = []
|
||||||
@maps = pbMapTree
|
@maps = pbMapTree
|
||||||
@addGlobalOffset = (addGlobal) ? 1 : 0
|
@addGlobalOffset = (addGlobal) ? 1 : 0
|
||||||
@@ -318,8 +317,8 @@ class MapLister
|
|||||||
return if index<0
|
return if index<0
|
||||||
return if index==0 && @addGlobalOffset==1
|
return if index==0 && @addGlobalOffset==1
|
||||||
@sprite.bitmap = createMinimap(@maps[index-@addGlobalOffset][0])
|
@sprite.bitmap = createMinimap(@maps[index-@addGlobalOffset][0])
|
||||||
@sprite.x = (Graphics.width-((Graphics.width-256)/2))-(@sprite.bitmap.width/2)
|
@sprite.ox = @sprite.bitmap.width/2
|
||||||
@sprite.y = (Graphics.height-((Graphics.height-64)/2))-(@sprite.bitmap.height/2)
|
@sprite.oy = @sprite.bitmap.height/2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -444,6 +443,8 @@ class TrainerTypeLister
|
|||||||
def initialize(selection,includeNew)
|
def initialize(selection,includeNew)
|
||||||
@sprite = IconSprite.new(0,0)
|
@sprite = IconSprite.new(0,0)
|
||||||
@sprite.bitmap = nil
|
@sprite.bitmap = nil
|
||||||
|
@sprite.x = Graphics.width * 3 / 4
|
||||||
|
@sprite.y = (Graphics.height - 64) / 2 + 64
|
||||||
@sprite.z = 2
|
@sprite.z = 2
|
||||||
@selection = selection
|
@selection = selection
|
||||||
@commands = []
|
@commands = []
|
||||||
@@ -499,23 +500,18 @@ class TrainerTypeLister
|
|||||||
rescue
|
rescue
|
||||||
@sprite.setBitmap(nil)
|
@sprite.setBitmap(nil)
|
||||||
end
|
end
|
||||||
ww = @sprite.bitmap.width
|
sprite_width = @sprite.bitmap.width
|
||||||
wh = @sprite.bitmap.height
|
sprite_height = @sprite.bitmap.height
|
||||||
sx = (Graphics.width-256).to_f()/ww
|
@sprite.ox = sprite_width/2
|
||||||
sy = (Graphics.height-64).to_f()/wh
|
@sprite.oy = sprite_height/2
|
||||||
if sx<1.0 || sy<1.0
|
scale_x = (Graphics.width/2).to_f/sprite_width
|
||||||
if sx>sy
|
scale_y = (Graphics.height-64).to_f/sprite_height
|
||||||
ww = sy*ww
|
if scale_x<1.0 || scale_y<1.0
|
||||||
wh = (Graphics.height-64).to_f()
|
min_scale = [scale_x, scale_y].min
|
||||||
else
|
@sprite.zoom_x = @sprite.zoom_y = min_scale
|
||||||
wh = sx*wh
|
else
|
||||||
ww = (Graphics.width-256).to_f()
|
@sprite.zoom_x = @sprite.zoom_y = 1.0
|
||||||
end
|
|
||||||
end
|
end
|
||||||
@sprite.x = (Graphics.width-((Graphics.width-256)/2))-(ww/2)
|
|
||||||
@sprite.y = (Graphics.height-((Graphics.height-64)/2))-(wh/2)
|
|
||||||
@sprite.zoom_x = ww*1.0/@sprite.bitmap.width
|
|
||||||
@sprite.zoom_y = wh*1.0/@sprite.bitmap.height
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -400,10 +400,10 @@ def pbCommands2(cmdwindow,commands,cmdIfCancel,defaultindex=-1,noresize=false)
|
|||||||
cmdwindow.index = defaultindex if defaultindex>=0
|
cmdwindow.index = defaultindex if defaultindex>=0
|
||||||
cmdwindow.x = 0
|
cmdwindow.x = 0
|
||||||
cmdwindow.y = 0
|
cmdwindow.y = 0
|
||||||
if !noresize
|
if noresize
|
||||||
cmdwindow.width = 256
|
|
||||||
else
|
|
||||||
cmdwindow.height = Graphics.height
|
cmdwindow.height = Graphics.height
|
||||||
|
else
|
||||||
|
cmdwindow.width = Graphics.width/2
|
||||||
end
|
end
|
||||||
cmdwindow.height = Graphics.height if cmdwindow.height>Graphics.height
|
cmdwindow.height = Graphics.height if cmdwindow.height>Graphics.height
|
||||||
cmdwindow.z = 99999
|
cmdwindow.z = 99999
|
||||||
@@ -437,10 +437,10 @@ def pbCommands3(cmdwindow,commands,cmdIfCancel,defaultindex=-1,noresize=false)
|
|||||||
cmdwindow.index = defaultindex if defaultindex>=0
|
cmdwindow.index = defaultindex if defaultindex>=0
|
||||||
cmdwindow.x = 0
|
cmdwindow.x = 0
|
||||||
cmdwindow.y = 0
|
cmdwindow.y = 0
|
||||||
if !noresize
|
if noresize
|
||||||
cmdwindow.width = 256
|
|
||||||
else
|
|
||||||
cmdwindow.height = Graphics.height
|
cmdwindow.height = Graphics.height
|
||||||
|
else
|
||||||
|
cmdwindow.width = Graphics.width/2
|
||||||
end
|
end
|
||||||
cmdwindow.height = Graphics.height if cmdwindow.height>Graphics.height
|
cmdwindow.height = Graphics.height if cmdwindow.height>Graphics.height
|
||||||
cmdwindow.z = 99999
|
cmdwindow.z = 99999
|
||||||
@@ -528,10 +528,10 @@ end
|
|||||||
|
|
||||||
def pbCommandsSortable(cmdwindow,commands,cmdIfCancel,defaultindex=-1,sortable=false)
|
def pbCommandsSortable(cmdwindow,commands,cmdIfCancel,defaultindex=-1,sortable=false)
|
||||||
cmdwindow.commands = commands
|
cmdwindow.commands = commands
|
||||||
cmdwindow.index = defaultindex if defaultindex>=0
|
cmdwindow.index = defaultindex if defaultindex >= 0
|
||||||
cmdwindow.x = 0
|
cmdwindow.x = 0
|
||||||
cmdwindow.y = 0
|
cmdwindow.y = 0
|
||||||
cmdwindow.width = 256 if cmdwindow.width<256
|
cmdwindow.width = Graphics.width / 2 if cmdwindow.width < Graphics.width / 2
|
||||||
cmdwindow.height = Graphics.height
|
cmdwindow.height = Graphics.height
|
||||||
cmdwindow.z = 99999
|
cmdwindow.z = 99999
|
||||||
cmdwindow.active = true
|
cmdwindow.active = true
|
||||||
|
|||||||
@@ -17,31 +17,34 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class PokemonTilesetScene
|
class PokemonTilesetScene
|
||||||
|
TILESET_WIDTH = 256
|
||||||
|
TILE_SIZE = 32
|
||||||
|
|
||||||
def pbUpdateTileset
|
def pbUpdateTileset
|
||||||
@sprites["overlay"].bitmap.clear
|
@sprites["overlay"].bitmap.clear
|
||||||
textpos = []
|
textpos = []
|
||||||
@sprites["tileset"].src_rect = Rect.new(0,@topy,256,Graphics.height-64)
|
@sprites["tileset"].src_rect = Rect.new(0,@topy,TILESET_WIDTH,Graphics.height)
|
||||||
tilesize = @tileset.terrain_tags.xsize
|
tilesize = @tileset.terrain_tags.xsize
|
||||||
for yy in 0...(Graphics.height-64)/32
|
for yy in 0...Graphics.height/TILE_SIZE
|
||||||
ypos = (yy+(@topy/32))*8+384
|
ypos = (yy+(@topy/TILE_SIZE))*8+384
|
||||||
next if ypos>=tilesize
|
next if ypos>=tilesize
|
||||||
for xx in 0...8
|
for xx in 0...8
|
||||||
terr = ypos<384 ? @tileset.terrain_tags[xx*48] : @tileset.terrain_tags[ypos+xx]
|
terr = ypos<384 ? @tileset.terrain_tags[xx*48] : @tileset.terrain_tags[ypos+xx]
|
||||||
if ypos<384
|
if ypos<384
|
||||||
@tilehelper.bltTile(@sprites["overlay"].bitmap,xx*32,yy*32,xx*48)
|
@tilehelper.bltTile(@sprites["overlay"].bitmap,xx*TILE_SIZE,yy*TILE_SIZE,xx*48)
|
||||||
end
|
end
|
||||||
textpos.push(["#{terr}",xx*32+16,yy*32,2,Color.new(80,80,80),Color.new(192,192,192)])
|
textpos.push(["#{terr}",xx*TILE_SIZE+TILE_SIZE/2,yy*TILE_SIZE,2,Color.new(80,80,80),Color.new(192,192,192)])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@sprites["overlay"].bitmap.fill_rect(@x,@y-@topy,32,4,Color.new(255,0,0))
|
@sprites["overlay"].bitmap.fill_rect(@x,@y-@topy,TILE_SIZE,4,Color.new(255,0,0))
|
||||||
@sprites["overlay"].bitmap.fill_rect(@x,@y-@topy,4,32,Color.new(255,0,0))
|
@sprites["overlay"].bitmap.fill_rect(@x,@y-@topy,4,TILE_SIZE,Color.new(255,0,0))
|
||||||
@sprites["overlay"].bitmap.fill_rect(@x,@y-@topy+28,32,4,Color.new(255,0,0))
|
@sprites["overlay"].bitmap.fill_rect(@x,@y-@topy+28,TILE_SIZE,4,Color.new(255,0,0))
|
||||||
@sprites["overlay"].bitmap.fill_rect(@x+28,@y-@topy,4,32,Color.new(255,0,0))
|
@sprites["overlay"].bitmap.fill_rect(@x+28,@y-@topy,4,TILE_SIZE,Color.new(255,0,0))
|
||||||
pbDrawTextPositions(@sprites["overlay"].bitmap,textpos)
|
pbDrawTextPositions(@sprites["overlay"].bitmap,textpos)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbGetSelected(x,y)
|
def pbGetSelected(x,y)
|
||||||
return (y<0) ? 48*(x/32) : (y/32)*8+384+(x/32)
|
return (y<0) ? 48*(x/TILE_SIZE) : (y/TILE_SIZE)*8+384+(x/TILE_SIZE)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbSetSelected(i,value)
|
def pbSetSelected(i,value)
|
||||||
@@ -66,8 +69,8 @@ class PokemonTilesetScene
|
|||||||
@tilehelper = TileDrawingHelper.fromTileset(@tileset)
|
@tilehelper = TileDrawingHelper.fromTileset(@tileset)
|
||||||
@sprites["tileset"].setBitmap("Graphics/Tilesets/#{@tileset.tileset_name}")
|
@sprites["tileset"].setBitmap("Graphics/Tilesets/#{@tileset.tileset_name}")
|
||||||
@x = 0
|
@x = 0
|
||||||
@y = -32
|
@y = -TILE_SIZE
|
||||||
@topy = -32
|
@topy = -TILE_SIZE
|
||||||
pbUpdateTileset
|
pbUpdateTileset
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -79,25 +82,25 @@ class PokemonTilesetScene
|
|||||||
@tileset = @tilesetwrapper.data[1]
|
@tileset = @tilesetwrapper.data[1]
|
||||||
@tilehelper = TileDrawingHelper.fromTileset(@tileset)
|
@tilehelper = TileDrawingHelper.fromTileset(@tileset)
|
||||||
@sprites = {}
|
@sprites = {}
|
||||||
@sprites["title"] = Window_UnformattedTextPokemon.new(_INTL("Tileset Editor (PgUp/PgDn: SCROLL; Z: MENU)"))
|
@sprites["title"] = Window_UnformattedTextPokemon.new(_INTL("Tileset Editor\r\nPgUp/PgDn: SCROLL\r\nZ: MENU"))
|
||||||
@sprites["title"].viewport = @viewport
|
@sprites["title"].viewport = @viewport
|
||||||
@sprites["title"].x = 0
|
@sprites["title"].x = TILESET_WIDTH
|
||||||
@sprites["title"].y = 0
|
@sprites["title"].y = 0
|
||||||
@sprites["title"].width = Graphics.width
|
@sprites["title"].width = Graphics.width - TILESET_WIDTH
|
||||||
@sprites["title"].height = 64
|
@sprites["title"].height = 128
|
||||||
@sprites["tileset"] = IconSprite.new(0,64,@viewport)
|
@sprites["tileset"] = IconSprite.new(0,0,@viewport)
|
||||||
@sprites["tileset"].setBitmap("Graphics/Tilesets/#{@tileset.tileset_name}")
|
@sprites["tileset"].setBitmap("Graphics/Tilesets/#{@tileset.tileset_name}")
|
||||||
@sprites["tileset"].src_rect = Rect.new(0,0,256,Graphics.height-64)
|
@sprites["tileset"].src_rect = Rect.new(0,0,TILESET_WIDTH,Graphics.height)
|
||||||
@sprites["overlay"] = BitmapSprite.new(256,Graphics.height-64,@viewport)
|
@sprites["overlay"] = BitmapSprite.new(TILESET_WIDTH,Graphics.height,@viewport)
|
||||||
@sprites["overlay"].x = 0
|
@sprites["overlay"].x = 0
|
||||||
@sprites["overlay"].y = 64
|
@sprites["overlay"].y = 0
|
||||||
pbSetSystemFont(@sprites["overlay"].bitmap)
|
pbSetSystemFont(@sprites["overlay"].bitmap)
|
||||||
@sprites["title"].visible = true
|
@sprites["title"].visible = true
|
||||||
@sprites["tileset"].visible = true
|
@sprites["tileset"].visible = true
|
||||||
@sprites["overlay"].visible = true
|
@sprites["overlay"].visible = true
|
||||||
@x = 0
|
@x = 0
|
||||||
@y = -32
|
@y = -TILE_SIZE
|
||||||
@topy = -32
|
@topy = -TILE_SIZE
|
||||||
pbUpdateTileset
|
pbUpdateTileset
|
||||||
pbFadeInAndShow(@sprites)
|
pbFadeInAndShow(@sprites)
|
||||||
height = @sprites["tileset"].bitmap.height
|
height = @sprites["tileset"].bitmap.height
|
||||||
@@ -106,37 +109,37 @@ class PokemonTilesetScene
|
|||||||
Graphics.update
|
Graphics.update
|
||||||
Input.update
|
Input.update
|
||||||
if Input.repeat?(Input::UP)
|
if Input.repeat?(Input::UP)
|
||||||
@y -= 32
|
@y -= TILE_SIZE
|
||||||
@y = -32 if @y<-32
|
@y = -TILE_SIZE if @y<-TILE_SIZE
|
||||||
@topy = @y if @y<@topy
|
@topy = @y if @y<@topy
|
||||||
pbUpdateTileset
|
pbUpdateTileset
|
||||||
elsif Input.repeat?(Input::DOWN)
|
elsif Input.repeat?(Input::DOWN)
|
||||||
@y += 32
|
@y += TILE_SIZE
|
||||||
@y = height-32 if @y>=height-32
|
@y = height-TILE_SIZE if @y>=height-TILE_SIZE
|
||||||
@topy = @y-(Graphics.height-64)+32 if @y-@topy>=Graphics.height-64
|
@topy = @y-Graphics.height+TILE_SIZE if @y-@topy>=Graphics.height
|
||||||
pbUpdateTileset
|
pbUpdateTileset
|
||||||
elsif Input.repeat?(Input::LEFT)
|
elsif Input.repeat?(Input::LEFT)
|
||||||
@x -= 32
|
@x -= TILE_SIZE
|
||||||
@x = 0 if @x<0
|
@x = 0 if @x<0
|
||||||
pbUpdateTileset
|
pbUpdateTileset
|
||||||
elsif Input.repeat?(Input::RIGHT)
|
elsif Input.repeat?(Input::RIGHT)
|
||||||
@x += 32
|
@x += TILE_SIZE
|
||||||
@x = 256-32 if @x>=256-32
|
@x = TILESET_WIDTH-TILE_SIZE if @x>=TILESET_WIDTH-TILE_SIZE
|
||||||
pbUpdateTileset
|
pbUpdateTileset
|
||||||
elsif Input.repeat?(Input::L)
|
elsif Input.repeat?(Input::L)
|
||||||
@y -= ((Graphics.height-64)/32)*32
|
@y -= (Graphics.height/TILE_SIZE)*TILE_SIZE
|
||||||
@topy -= ((Graphics.height-64)/32)*32
|
@topy -= (Graphics.height/TILE_SIZE)*TILE_SIZE
|
||||||
@y = -32 if @y<-32
|
@y = -TILE_SIZE if @y<-TILE_SIZE
|
||||||
@topy = @y if @y<@topy
|
@topy = @y if @y<@topy
|
||||||
@topy = -32 if @topy<-32
|
@topy = -TILE_SIZE if @topy<-TILE_SIZE
|
||||||
pbUpdateTileset
|
pbUpdateTileset
|
||||||
elsif Input.repeat?(Input::R)
|
elsif Input.repeat?(Input::R)
|
||||||
@y += ((Graphics.height-64)/32)*32
|
@y += (Graphics.height/TILE_SIZE)*TILE_SIZE
|
||||||
@topy += ((Graphics.height-64)/32)*32
|
@topy += (Graphics.height/TILE_SIZE)*TILE_SIZE
|
||||||
@y = height-32 if @y>=height-32
|
@y = height-TILE_SIZE if @y>=height-TILE_SIZE
|
||||||
@topy = @y-(Graphics.height-64)+32 if @y-@topy>=Graphics.height-64
|
@topy = @y-Graphics.height+TILE_SIZE if @y-@topy>=Graphics.height
|
||||||
if @topy>=height-(Graphics.height-64)
|
if @topy>=height-Graphics.height
|
||||||
@topy = height-(Graphics.height-64)
|
@topy = height-Graphics.height
|
||||||
end
|
end
|
||||||
pbUpdateTileset
|
pbUpdateTileset
|
||||||
elsif Input.trigger?(Input::A)
|
elsif Input.trigger?(Input::A)
|
||||||
@@ -149,11 +152,11 @@ class PokemonTilesetScene
|
|||||||
ret = pbShowCommands(nil,commands,-1)
|
ret = pbShowCommands(nil,commands,-1)
|
||||||
case ret
|
case ret
|
||||||
when 0
|
when 0
|
||||||
@y = height-32
|
@y = height-TILE_SIZE
|
||||||
@topy = @y-(Graphics.height-64)+32 if @y-@topy>=Graphics.height-64
|
@topy = @y-Graphics.height+TILE_SIZE if @y-@topy>=Graphics.height
|
||||||
pbUpdateTileset
|
pbUpdateTileset
|
||||||
when 1
|
when 1
|
||||||
@y = -32
|
@y = -TILE_SIZE
|
||||||
@topy = @y if @y<@topy
|
@topy = @y if @y<@topy
|
||||||
pbUpdateTileset
|
pbUpdateTileset
|
||||||
when 2
|
when 2
|
||||||
|
|||||||
Reference in New Issue
Block a user