Olá pessoal a pedidos trago a vocês o sistema que mostra seus equipes na tela como no projeto [MMO] Fields Online espero que gostem poís não é sempre que disponibilizo os sistemas dos meus jogos rs
Abraço.
Abraço.
- Spoiler:
- Código:
#===============================================================================
# MOG Equpmap
#===============================================================================
module MOG
#Switch que desativa a janela de equipamentos.
EQPMAPVIS = 10
#Opacidade da janela.
EQPMAPOPA = 0
#Windows Skin da janela.
EQPMAPSKIN = "Windowskin_pergaminho22"
#Posição da janela na Horizontal.
EQPMAPX = 320
#Posição da janela na Vertical.
EQPMAPY = 70
end
###############
# Window_Base #
###############
class Window_Base < Window
def draw_equip_map(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x + 3, y + 12, bitmap, Rect.new(0, 0, 24, 24))
end
end
####################
# Window_Equip_Map #
####################
class Window_Equipmap < Window_Base
def initialize(actor)
super(0, 0, 165, 70)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 180
self.windowskin = RPG::Cache.windowskin("001-Blue01")
@actor = actor
refresh
end
def refresh
self.contents.clear
self.contents.font.size = 12
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(0,-7,100,20,"Equipamentos")
@data = []
@actor = $game_party.actors[0]
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
self.contents.font.color = Color.new(0,0,0)
draw_equip_map(@data[0], 32 * 0, 0)
draw_equip_map(@data[1], 32 * 1, 0)
draw_equip_map(@data[2], 32 * 2, 0)
draw_equip_map(@data[3], 32 * 3, 0)
draw_equip_map(@data[4], 32 * 4, 0)
end
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog8_main main
def main
@actor = $game_party.actors[0]
@eqmap = Window_Equipmap.new(@actor)
@eqmap.x = MOG::EQPMAPX+150
@eqmap.y = MOG::EQPMAPY-36
@eqmap.z = 1000
if $game_switches[MOG::EQPMAPVIS] == false
@eqmap.visible = true
else
@eqmap.visible = false
end
mog8_main
end
alias mog8_update update
def update
if $scene != self
@eqmap.dispose
end
$game_map.update
$game_player.update
Graphics.update
if $game_switches[MOG::EQPMAPVIS] == false
@eqmap.visible = true
else
@eqmap.visible = false
end
if $eref == true
@eqmap.refresh
$eref = false
end
mog8_update
end
end
############
# Game_Map #
############
class Game_Map
attr_accessor :eref
end
class Interpreter
def eref
$eref = true
end
alias mog319ref command_319
def command_319
eref
return mog319ref
end
end