INTRODUÇÃO
Bom galera, eu estou com um script para Rpg maker VX que gostaria de utilizar no meu projeto online de Rpg Maker XP. Se algum bom samaritano puder me ajudar a converter o script VX em XP eu ficarei muito agradecido, terá os créditos no meu projeto, e se quiser pode entrar pra equipe na área de scripter!
SCRIPT
Aqui está o script que quero converter:
- Código:
#==============================================================================
# Window Create Guild
#==============================================================================
class Window_CreateGuild < Window_Base
def initialize
super(10, (Graphics.height-278)/2, 192, 278)
@title.draw_outlined_text(@title.rect, Vocab::CreateGuild, 1)
@colors_x = 16
@colors_y = 182
@design_x = 12
@design_y = 32
@name = TextBox.new(self, 72, 18, 96, 12)
Button.new(self, 24, 244, Vocab::Create) { create }
Button.new(self, 114, 244, Vocab::Cancel) { on_close }
refresh
end
def update
super
return unless in_area?
get_color
set_color
end
def get_color
return unless Input.trigger?(Keys::MOUSEL)
if $mouse.in_area?(self.x+@colors_x+16, self.y+@colors_y+16, 16, 16)
@color = self.contents.get_pixel(@colors_x, @colors_y)
elsif $mouse.in_area?(self.x+@colors_x+(16*2)+3, self.y+@colors_y+16, 16, 16)
@color = self.contents.get_pixel(@colors_x+19, @colors_y)
elsif $mouse.in_area?(self.x+@colors_x+(16*3)+(3*2), self.y+@colors_y+16, 16, 16)
@color = self.contents.get_pixel(@colors_x+(16*2)+(3*2), @colors_y)
elsif $mouse.in_area?(self.x+@colors_x+(16*4)+(3*3), self.y+@colors_y+16, 16, 16)
@color = self.contents.get_pixel(@colors_x+(16*3)+(3*3), @colors_y)
elsif $mouse.in_area?(self.x+@colors_x+(16*5)+(3*4), self.y+@colors_y+16, 16, 16)
@color = self.contents.get_pixel(@colors_x+(16*4)+(3*4), @colors_y)
elsif $mouse.in_area?(self.x+@colors_x+(16*6)+(3*5), self.y+@colors_y+16, 16, 16)
@color = self.contents.get_pixel(@colors_x+(16*5)+(3*5), @colors_y)
elsif $mouse.in_area?(self.x+@colors_x+(16*7)+(3*6), self.y+@colors_y+16, 16, 16)
@color = self.contents.get_pixel(@colors_x+(16*6)+(3*6), @colors_y)
elsif $mouse.in_area?(self.x+@colors_x+16, self.y+@colors_y+35, 16, 16)
@color = self.contents.get_pixel(@colors_x, @colors_y+19)
elsif $mouse.in_area?(self.x+@colors_x+(16*2)+3, self.y+@colors_y+35, 16, 16)
@color = self.contents.get_pixel(@colors_x+19, @colors_y+19)
elsif $mouse.in_area?(self.x+@colors_x+(16*3)+(3*2), self.y+@colors_y+35, 16, 16)
@color = self.contents.get_pixel(@colors_x+(16*2)+(3*2), @colors_y+19)
elsif $mouse.in_area?(self.x+@colors_x+(16*4)+(3*3), self.y+@colors_y+16+19, 16, 16)
@color = self.contents.get_pixel(@colors_x+(16*3)+(3*3), @colors_y+19)
elsif $mouse.in_area?(self.x+@colors_x+(16*5)+(3*4), self.y+@colors_y+35, 16, 16)
@color = self.contents.get_pixel(@colors_x+(16*4)+(3*4), @colors_y+19)
elsif $mouse.in_area?(self.x+@colors_x+(16*6)+(3*5), self.y+@colors_y+35, 16, 16)
@color = self.contents.get_pixel(@colors_x+(16*5)+(3*5), @colors_y+19)
elsif $mouse.in_area?(self.x+@colors_x+(16*7)+(3*6), self.y+@colors_y+35, 16, 16)
@color = self.contents.get_pixel(@colors_x+(16*6)+(3*6), @colors_y+19)
end
end
def set_color
if Input.trigger?(Keys::MOUSEL)
for x in 0...64
for y in 0...64
next unless $mouse.in_area?(self.x+16+@design_x+(16*(x/8))+(1*(x/8)), self.y+16+@design_y+(16*(y/8))+(1*(y/8)), 16, 16)
self.contents.clear_rect(@design_x+(16*(x/8))+(1*(x/8)), @design_y+(16*(y/8))+(1*(y/8)), 16, 16)
self.contents.fill_rect(@design_x+(16*(x/8))+(1*(x/8)), @design_y+(16*(y/8))+(1*(y/8)), 16, 16, @color)
end
end
elsif Input.trigger?(Keys::MOUSER)
for x in 0...64
for y in 0...64
next unless $mouse.in_area?(self.x+16+@design_x+(16*(x/8))+(1*(x/8)), self.y+16+@design_y+(16*(y/8))+(1*(y/8)), 16, 16)
self.contents.clear_rect(@design_x+(16*(x/8))+(1*(x/8)), @design_y+(16*(y/8))+(1*(y/8)), 16, 16)
self.contents.fill_rect(@design_x+(16*(x/8))+(1*(x/8)), @design_y+(16*(y/8))+(1*(y/8)), 16, 16, Color.new(0,0,0,32))
end
end
end
end
def refresh
@color = Color.new(0,0,0,32)
self.contents.clear
for x in 0...64
for y in 0...64
self.contents.fill_rect(@design_x+(16*(x/8))+(1*(x/8)), @design_y+(16*(y/8))+(1*(y/8)), 16, 16, @color)
end
end
self.contents.fill_rect(@colors_x, @colors_y, 16, 16, Color.new(0,0,0))
self.contents.fill_rect(@colors_x+16+3, @colors_y, 16, 16, Color.new(160,160,160))
self.contents.fill_rect(@colors_x+(16*2)+(3*2), @colors_y, 16, 16, Color.new(255,255,255))
self.contents.fill_rect(@colors_x+(16*3)+(3*3), @colors_y, 16, 16, Color.new(255,0,0))
self.contents.fill_rect(@colors_x+(16*4)+(3*4), @colors_y, 16, 16, Color.new(255,100,0))
self.contents.fill_rect(@colors_x+(16*5)+(3*5), @colors_y, 16, 16, Color.new(255,255,0))
self.contents.fill_rect(@colors_x+(16*6)+(3*6), @colors_y, 16, 16, Color.new(0,255,0))
self.contents.fill_rect(@colors_x, @colors_y+19, 16, 16, Color.new(0,255,128))
self.contents.fill_rect(@colors_x+16+3, @colors_y+16+3, 16, 16, Color.new(0,160,0))
self.contents.fill_rect(@colors_x+(16*2)+(3*2), @colors_y+16+3, 16, 16, Color.new(0,255,255))
self.contents.fill_rect(@colors_x+(16*3)+(3*3), @colors_y+16+3, 16, 16, Color.new(0,128,255))
self.contents.fill_rect(@colors_x+(16*4)+(3*4), @colors_y+16+3, 16, 16, Color.new(128,0,255))
self.contents.fill_rect(@colors_x+(16*5)+(3*5), @colors_y+16+3, 16, 16, Color.new(255,0,255))
self.contents.fill_rect(@colors_x+(16*6)+(3*6), @colors_y+16+3, 16, 16, Color.new(255,0,128))
self.contents.draw_text(8, 0, 64, WLH, "Name:")
end
def create
if @name.text == ""
$window["alert"].open(Vocab::Invalid_Guild_Name)
elsif @name.text.length < 6
$window["alert"].open(Vocab::Guild_Name_Too_Short)
else
@a = []; @b = []; @c = []; @d = []
for i in 0...8
@a << @design_x+(16*i)+(3*i)
@b << @design_y+(16*i)+(3*i)
end
for x in @a
for y in @b
@c << [x, y]
end
end
@c.each { |i| @d << (self.contents.get_pixel(i[0], i[1]).to_s.gsub(".000000","").delete("(").delete(")")+"-") }
Network.create_guild(@name.text, @d.to_s)
end
end
def on_open
if $actor.guild > 0
$window["alert"].open(Vocab::GuildJoined)
return
end
super
end
def on_close
super
refresh
@name.text = ""
end
end