Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # • Menu Simples Icon
- #==============================================================================
- # Author: Dax
- # Version: 2.5
- # Site: www.dax-soft.weebly.com
- # Reqquired: Dax Core
- #==============================================================================
- # • Description.:
- #------------------------------------------------------------------------------
- # A simple menu who it works with the Mouse.
- #==============================================================================
- Dax.register(:scene_menu_mouse_teste, "Dax", 2.5) {
- Dax.remove(:Scene_Menu)
- #==============================================================================
- # • Bug : Corrections;
- #==============================================================================
- class Window_Base < Window
- def draw_face(face_name, face_index, x, y, enabled = true)
- bitmap = Cache.face(face_name)
- 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
- #==============================================================================
- # • MenuSampleIcon
- #==============================================================================
- module MenuSampleIcon
- extend self
- #----------------------------------------------------------------------------
- # • Settings of Simple Menu Icon.
- #----------------------------------------------------------------------------
- def simple_icon
- return {
- # Setting of the description of the options.
- desc: {
- 0 => "Show the inventory of itens.",
- 1 => "Show the skills of the characters.",
- 2 => "Show the equips of the characters.",
- 3 => "Show the status of the characters.",
- 4 => "Show the menu of save.",
- 5 => "Show the option of quit game.",
- 6 => "Click to change the character.",
- 7 => "You has %d of gold."
- },
- # Settings of the scenes.
- scene: [
- "Scene_Item", "Scene_Skill", "Scene_Equip", "Scene_Status",
- "Scene_Save", "Scene_End"
- ],
- # Settings of the icons.
- icon: [
- 260, 232, 270, 233, 230, 121
- ]
- }
- end
- end
- #==============================================================================
- # • Scene_Menu.
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
- #----------------------------------------------------------------------------
- # • Inicialização dos objetos.
- #----------------------------------------------------------------------------
- def start
- super
- @actor_id = 0
- @menu_background = []
- @menu_status = []
- MenuSampleIcon.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
- super
- @menu_background.each(&:dispose)
- @menu_status.each(&:dispose)
- [@gold, @info].each(&: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(MenuSampleIcon.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, MenuSampleIcon.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,MenuSampleIcon.simple_icon[:desc][i]) if @menu_background[i].opacity == 255
- @menu_background[i].if_mouse_click { eval("SceneManager.call(#{MenuSampleIcon.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