Isto é uma pré-visualização de um tema em Hitskin.com
Instalar o tema • Voltar para a ficha do tema
Ícones no Menu !
2 participantes
Aldeia RPG :: RPG Maker :: Rpg Maker XP :: Scripts
Página 1 de 1
Ícones no Menu !
Icones no Menu
Acrescenta ícones ao lado de cada comando do menu e adiciona as opções "Carregar" e o "Local".
Screen
Script
Configurações:
No Script vc deve mudar os icones aqui:
Créditos:
Autor desconhecido
Tradução por LegendsX
Acrescenta ícones ao lado de cada comando do menu e adiciona as opções "Carregar" e o "Local".
Screen
- Spoiler:
Script
- Código:
#==============================================================================
# Icon Menu Command
# Criador : Desconhecido
# Tradução e Divulgação : LegendsX
#==============================================================================
# Acrescenta ícones ao lado de cada comando do menu e adiciona
# as opções "Carregar" e o "Local"
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
def initialize (menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
def main
#==============================================================================
$stepsicon = "020-Accessory05" #ícone dos passos
$goldicon = "034-Item03" #ícone do dinheiro
$itemicon = "032-Item01" #icone do item
$skillicon = "044-Skill01" #ícone da habilidade
$equipicon = "001-Weapon01" #ícone do equipamento
$statusicon = "013-Body01" #ícone do status
$saveicon = "047-Skill04" #ícone de salvar
$loadicon = "048-Skill05" #ícone de carregar
$exiticon = "046-Skill03" #ícone de sair
#==============================================================================
s1 = " " + $data_system.words.item
s2 = " " + $data_system.words.skill
s3 = " " + $data_system.words.equip
s4 = " " + " Status"
s5 = " " + " Salvar"
s6 = " " + " Carregar"
s7 = " " + " Sair"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
@command_window.x = 0
@command_window.y = 0
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(4)
end
@playtime_window = Window_PlayTime1.new
@playtime_window.x = 0
@playtime_window.y = 320
@steps_window = Window_Steps1.new
@steps_window.x = 0
@steps_window.y = 255
@gold_window = Window_Gold1.new
@gold_window.x = 0
@gold_window.y = 416
@status_window = Window_MenuStatus1.new
@status_window.x = 160
@status_window.y = 0
@icon_item = Sprite.new
@icon_item.bitmap = RPG::Cache.icon($itemicon)
@icon_item.x = 18
@icon_item.y = 20
@icon_item.z = 255
@icon_skill = Sprite.new
@icon_skill.bitmap = RPG::Cache.icon($skillicon)
@icon_skill.x = 19
@icon_skill.y = 52
@icon_skill.z = 255
@icon_equip = Sprite.new
@icon_equip.bitmap = RPG::Cache.icon($equipicon)
@icon_equip.x = 18
@icon_equip.y = 84
@icon_equip.z = 255
@icon_status = Sprite.new
@icon_status.bitmap = RPG::Cache.icon($statusicon)
@icon_status.x = 18
@icon_status.y = 116
@icon_status.z = 255
@icon_save = Sprite.new
@icon_save.bitmap = RPG::Cache.icon($saveicon)
@icon_save.x = 18
@icon_save.y = 148
@icon_save.z = 255
@icon_load = Sprite.new
@icon_load.bitmap = RPG::Cache.icon($loadicon)
@icon_load.x = 18
@icon_load.y = 180
@icon_load.z = 255
@icon_exit = Sprite.new
@icon_exit.bitmap = RPG::Cache.icon($exiticon)
@icon_exit.x = 19
@icon_exit.y = 212
@icon_exit.z = 255
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
@status_window.dispose
@steps_window.dispose
@icon_item.dispose
@icon_skill.dispose
@icon_equip.dispose
@icon_status.dispose
@icon_save.dispose
@icon_load.dispose
@icon_exit.dispose
end
#--------------------------------------------------------------------------
def update
@command_window.update
@playtime_window.update
@gold_window.update
@status_window.update
@steps_window.update
@icon_item.update
@icon_skill.update
@icon_equip.update
@icon_status.update
@icon_save.update
@icon_load.update
@icon_exit.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
$scene = Scene_Status.new
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_MenuSave.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_MenuLoad.new
when 6
$game_system.se_play($data_system.decision_se)
$scene = Scene_MenuEnd.new
end
return
end
end
#--------------------------------------------------------------------------
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
#==============================================================================
#Menu Status Window
#==============================================================================
class Window_MenuStatus1 < Window_Selectable
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
#==============================================================================
# Play Time Window
#==============================================================================
class Window_PlayTime1< Window_Base
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Tempo")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, text, 2)
end
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#==============================================================================
#Gold Window
#==============================================================================
class Window_Gold1 < Window_Base
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
def refresh
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon($goldicon)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end
#==============================================================================
#Scene Menu_Load
#==============================================================================
class Scene_MenuLoad < Scene_File
#--------------------------------------------------------------------------
def initialize
$game_temp = Game_Temp.new
$game_temp.last_file_index = 0
latest_time = Time.at(0)
for i in 0..3
filename = make_filename(i)
if FileTest.exist?(filename)
file = File.open(filename, "r")
if file.mtime > latest_time
latest_time = file.mtime
$game_temp.last_file_index = i
end
file.close
end
end
super("Carregar qual slot?")
end
#--------------------------------------------------------------------------
def on_decision(filename)
unless FileTest.exist?(filename)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.load_se)
file = File.open(filename, "rb")
read_save_data(file)
file.close
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
$game_map.update
$scene = Scene_Menu.new(5)
print "Jogo Carregado com sucesso!"
end
#--------------------------------------------------------------------------
def on_cancel
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(5)
end
#--------------------------------------------------------------------------
def read_save_data(file)
characters = Marshal.load(file)
Graphics.frame_count = Marshal.load(file)
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
if $game_system.magic_number != $data_system.magic_number
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
$game_party.refresh
end
end
#==============================================================================
#Steps Window
#==============================================================================
$data_mapinfos = load_data('Data/MapInfos.rxdata')
class Window_Steps1 < Window_Base
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 66) #96
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
def refresh
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon($stepsicon)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
contents.clear
contents.font.color = normal_color
name = $data_mapinfos[$game_map.map_id].name
contents.draw_text(0, 0, 128, 32, name)
end
end
#==============================================================================
# Menu End
#==============================================================================
class Scene_MenuEnd
#--------------------------------------------------------------------------
def main
s1 = "Tela de Título"
s2 = "Sair"
s3 = "Voltar"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 240 - @command_window.height / 2
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
def update
@command_window.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(6)
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
command_to_title
when 1
command_shutdown
when 2
command_cancel
end
return
end
end
#--------------------------------------------------------------------------
def command_to_title
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = Scene_Title.new
end
#--------------------------------------------------------------------------
def command_shutdown
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = nil
end
#--------------------------------------------------------------------------
def command_cancel
$game_system.se_play($data_system.decision_se)
$scene = Scene_Menu.new(6)
end
end
#==============================================================================
#Menu Save
#==============================================================================
class Scene_MenuSave < Scene_File
#--------------------------------------------------------------------------
def initialize
super("Salvar em qual slot?")
end
#--------------------------------------------------------------------------
def on_decision(filename)
$game_system.se_play($data_system.save_se)
file = File.open(filename, "wb")
write_save_data(file)
file.close
if $game_temp.save_calling
$game_temp.save_calling = false
$scene = Scene_Map.new
return
end
$scene = Scene_Menu.new(4)
print "Jogo Salvo com sucesso"
end
#--------------------------------------------------------------------------
def on_cancel
$game_system.se_play($data_system.cancel_se)
if $game_temp.save_calling
$game_temp.save_calling = false
$scene = Scene_Map.new
return
end
$scene = Scene_Menu.new(4)
end
#--------------------------------------------------------------------------
def write_save_data(file)
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
characters.push([actor.character_name, actor.character_hue])
end
Marshal.dump(characters, file)
Marshal.dump(Graphics.frame_count, file)
$game_system.save_count += 1
$game_system.magic_number = $data_system.magic_number
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end
end
Configurações:
No Script vc deve mudar os icones aqui:
- Código:
$stepsicon = "020-Accessory05" #ícone dos passos
$goldicon = "034-Item03" #ícone do dinheiro
$itemicon = "032-Item01" #icone do item
$skillicon = "044-Skill01" #ícone da habilidade
$equipicon = "001-Weapon01" #ícone do equipamento
$statusicon = "013-Body01" #ícone do status
$saveicon = "047-Skill04" #ícone de salvar
$loadicon = "048-Skill05" #ícone de carregar
$exiticon = "046-Skill03" #ícone de sair
Créditos:
Autor desconhecido
Tradução por LegendsX
_________________
Ninguém pode ser perfeito, mas todos podem ser melhores.
Satheios- Aldeia Friend
- Medalhas :
Mensagens : 1248
Créditos : 306
Re: Ícones no Menu !
Vishe, ta espiritado hein? Pessoalmente eu não gostei, pois esse tipo de menu é geralmente para iniciantes (acho que não sou mais hasuahsuashus) Mas concerteza vai ajudar alguém ;D
_________________
Que o pão de queijo esteja com vocês, até!
Reborn- Experiente
- Mensagens : 500
Créditos : 28
Aldeia RPG :: RPG Maker :: Rpg Maker XP :: Scripts
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|