Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # • Menu Simples Icon
- #==============================================================================
- # Autor: Dax
- # Versão: 2.0
- # Site: www.dax-soft.weebly.com
- # Requerimento: Dax Core
- #==============================================================================
- # • Descrição:
- #------------------------------------------------------------------------------
- # Menu simples que funciona com o Mouse.
- #==============================================================================
- Dax.register(:scene_menu_mouse_teste, "Dax", 2.0, "07/09/13")
- Dax.remove(:Scene_Menu)
- #==============================================================================
- # • Bug : Correção;
- #==============================================================================
- class Window_Base < Window
- def draw_face(face_name, face_index, x, y, enabled = true)
- bitmap = "C:F:#{face_name}".script
- rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
- contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
- end
- end
- #==============================================================================
- # • Rpg::Menu
- #==============================================================================
- class << Rpg::Menu
- #----------------------------------------------------------------------------
- # • Configurações do Menu Simples Icon.
- #----------------------------------------------------------------------------
- def simple_icon
- return {
- # Configuração da descrição das opções.
- desc: {
- 0 => "Mostra o inventário de itens.",
- 1 => "Mostra as habilidades dos personagens.",
- 2 => "Mostra os equipamentos dos personagens.",
- 3 => "Mostra os status dos personagens.",
- 4 => "Mostra o menu de save.",
- 5 => "Mostra a opção de sair do jogo.",
- 6 => "Clique para mudar de personagem.",
- 7 => "Você tem %d de ouro."
- },
- # Configuração das scenes.
- scene: [
- "Scene_Item", "Scene_Skill", "Scene_Equip", "Scene_Status",
- "Scene_Save", "Scene_End"
- ],
- # Configuração dos ícones.
- icon: [
- 260, 232, 270, 233, 230, 121
- ]
- }
- end
- end
- #==============================================================================
- # • Scene_Menu.
- #==============================================================================
- class Scene_Menu < Scene_Base
- #----------------------------------------------------------------------------
- # • Inicialização dos objetos.
- #----------------------------------------------------------------------------
- def start
- super
- Background.default
- @actor_id = 0
- @menu_background = []
- @menu_status = []
- Rpg::Menu.simple_icon[:icon].each_with_index do |value, index|
- @menu_background[index] = Window_Base.new(0, 0, 48, 48)
- @menu_background[index].x = 544/1.50 - (50 * index)
- @menu_background[index].y = DMath.get_y_center_screen(26)
- @menu_background[index].draw_icon(value, 0, 0)
- @menu_background[index].opacity = 128
- end
- @menu_status[0] = Window_Base.new(@menu_background[5].x + 4,
- @menu_background[5].y - 104, 108, 98)
- @menu_status[0].draw_actor_face($game_party.members[@actor_id],0,0)
- @menu_status[1] = Window_Base.new(@menu_status[0].x + 112, @menu_status[0].y,
- 176, 98)
- @info = Window_Base.new(@menu_background[5].x,@menu_background[0].y + 54,
- 296, 44)
- @menu_status[0].opacity = 128
- @gold = Sprite.new([24,24])
- @gold.x = @info.x + 260
- @gold.y = @info.y + 8
- @gold.z = 200
- @gold.opacity = 128
- @gold.bitmap.draw_icon(262, 0, 0)
- end
- #----------------------------------------------------------------------------
- # • Renovação dos objetos.
- #----------------------------------------------------------------------------
- def terminate
- @menu_background.each(&:dispose)
- @menu_status.each(&:dispose)
- [@gold, @info].each(&:dispose)
- Background.default_dispose
- end
- #----------------------------------------------------------------------------
- # • Atualização dos objetos.
- #----------------------------------------------------------------------------
- def update
- super
- @info.contents.clear
- @menu_status.each { |i| i.contents.clear }
- trigger?(:B) {SceneManager.return}
- @gold.if_mouse_over { |over|
- @gold.opacity = over ? 255 : 128
- @info.draw_text_ex(0, 0, sprintf(Rpg::Menu.simple_icon[:desc][7], $game_party.gold)) if over
- }
- @menu_status[0].if_mouse_over { |over|
- @menu_status[0].opacity = over ? 255 : 128
- @info.draw_text_ex(0, 0, Rpg::Menu.simple_icon[:desc][6]) if over
- }
- @menu_status[0].if_mouse_click { @actor_id += 1; @actor_id = 0 if @actor_id >= $game_party.members.size}
- @menu_status[1].draw_actor_hp($game_party.members[@actor_id], 4, 4, 124)
- @menu_status[1].draw_actor_mp($game_party.members[@actor_id], 4, 26, 124)
- @menu_status[1].draw_actor_name($game_party.members[@actor_id], 4, 48, 112)
- @menu_status[0].draw_actor_face($game_party.members[@actor_id],0,0)
- (0..@menu_background.size-1).each do |i|
- @menu_background[i].if_mouse_over { |over|
- if over
- @menu_background[i].opacity = 255
- @info.draw_text_ex(0, 0,Rpg::Menu.simple_icon[:desc][i]) if @menu_background[i].opacity == 255
- @menu_background[i].if_mouse_click { SceneManager.symbol(Rpg::Menu.simple_icon[:scene][i]) }
- else
- @info.draw_text_ex(0, 0, "")
- @menu_background[i].opacity = 128
- end
- }
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement