Advertisement
DaxSoft

Menu Sample Icon 2.5 [ENG]

Jan 13th, 2015
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.62 KB | None | 0 0
  1. #==============================================================================
  2. # • Menu Simples Icon
  3. #==============================================================================
  4. # Author: Dax
  5. # Version: 2.5
  6. # Site: www.dax-soft.weebly.com
  7. # Reqquired: Dax Core
  8. #==============================================================================
  9. # • Description.:
  10. #------------------------------------------------------------------------------
  11. # A simple menu who it works with the Mouse.
  12. #==============================================================================
  13. Dax.register(:scene_menu_mouse_teste, "Dax", 2.5) {
  14. Dax.remove(:Scene_Menu)
  15. #==============================================================================
  16. # • Bug : Corrections;
  17. #==============================================================================
  18. class Window_Base < Window
  19. def draw_face(face_name, face_index, x, y, enabled = true)
  20. bitmap = Cache.face(face_name)
  21. rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
  22. contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  23. end
  24. end
  25. #==============================================================================
  26. # • MenuSampleIcon
  27. #==============================================================================
  28. module MenuSampleIcon
  29. extend self
  30. #----------------------------------------------------------------------------
  31. # • Settings of Simple Menu Icon.
  32. #----------------------------------------------------------------------------
  33. def simple_icon
  34. return {
  35. # Setting of the description of the options.
  36. desc: {
  37. 0 => "Show the inventory of itens.",
  38. 1 => "Show the skills of the characters.",
  39. 2 => "Show the equips of the characters.",
  40. 3 => "Show the status of the characters.",
  41. 4 => "Show the menu of save.",
  42. 5 => "Show the option of quit game.",
  43. 6 => "Click to change the character.",
  44. 7 => "You has %d of gold."
  45. },
  46. # Settings of the scenes.
  47. scene: [
  48. "Scene_Item", "Scene_Skill", "Scene_Equip", "Scene_Status",
  49. "Scene_Save", "Scene_End"
  50. ],
  51. # Settings of the icons.
  52. icon: [
  53. 260, 232, 270, 233, 230, 121
  54. ]
  55. }
  56. end
  57. end
  58. #==============================================================================
  59. # • Scene_Menu.
  60. #==============================================================================
  61. class Scene_Menu < Scene_MenuBase
  62. #----------------------------------------------------------------------------
  63. # • Inicialização dos objetos.
  64. #----------------------------------------------------------------------------
  65. def start
  66. super
  67. @actor_id = 0
  68. @menu_background = []
  69. @menu_status = []
  70. MenuSampleIcon.simple_icon[:icon].each_with_index do |value, index|
  71. @menu_background[index] = Window_Base.new(0, 0, 48, 48)
  72. @menu_background[index].x = 544/1.50 - (50 * index)
  73. @menu_background[index].y = DMath.get_y_center_screen(26)
  74. @menu_background[index].draw_icon(value, 0, 0)
  75. @menu_background[index].opacity = 128
  76. end
  77. @menu_status[0] = Window_Base.new(@menu_background[5].x + 4,
  78. @menu_background[5].y - 104, 108, 98)
  79. @menu_status[0].draw_actor_face($game_party.members[@actor_id],0,0)
  80. @menu_status[1] = Window_Base.new(@menu_status[0].x + 112, @menu_status[0].y,
  81. 176, 98)
  82. @info = Window_Base.new(@menu_background[5].x,@menu_background[0].y + 54,
  83. 296, 44)
  84. @menu_status[0].opacity = 128
  85. @gold = Sprite.new([24,24])
  86. @gold.x = @info.x + 260
  87. @gold.y = @info.y + 8
  88. @gold.z = 200
  89. @gold.opacity = 128
  90. @gold.bitmap.draw_icon(262, 0, 0)
  91. end
  92. #----------------------------------------------------------------------------
  93. # • Renovação dos objetos.
  94. #----------------------------------------------------------------------------
  95. def terminate
  96. super
  97. @menu_background.each(&:dispose)
  98. @menu_status.each(&:dispose)
  99. [@gold, @info].each(&:dispose)
  100. end
  101. #----------------------------------------------------------------------------
  102. # • Atualização dos objetos.
  103. #----------------------------------------------------------------------------
  104. def update
  105. super
  106. @info.contents.clear
  107. @menu_status.each { |i| i.contents.clear }
  108. trigger?(:B) {SceneManager.return}
  109. @gold.if_mouse_over { |over|
  110. @gold.opacity = over ? 255 : 128
  111. @info.draw_text_ex(0, 0, sprintf(MenuSampleIcon.simple_icon[:desc][7], $game_party.gold)) if over
  112. }
  113. @menu_status[0].if_mouse_over { |over|
  114. @menu_status[0].opacity = over ? 255 : 128
  115. @info.draw_text_ex(0, 0, MenuSampleIcon.simple_icon[:desc][6]) if over
  116. }
  117. @menu_status[0].if_mouse_click { @actor_id += 1; @actor_id = 0 if @actor_id >= $game_party.members.size}
  118. @menu_status[1].draw_actor_hp($game_party.members[@actor_id], 4, 4, 124)
  119. @menu_status[1].draw_actor_mp($game_party.members[@actor_id], 4, 26, 124)
  120. @menu_status[1].draw_actor_name($game_party.members[@actor_id], 4, 48, 112)
  121. @menu_status[0].draw_actor_face($game_party.members[@actor_id],0,0)
  122. (0..@menu_background.size-1).each do |i|
  123. @menu_background[i].if_mouse_over { |over|
  124. if over
  125. @menu_background[i].opacity = 255
  126. @info.draw_text_ex(0, 0,MenuSampleIcon.simple_icon[:desc][i]) if @menu_background[i].opacity == 255
  127. @menu_background[i].if_mouse_click { eval("SceneManager.call(#{MenuSampleIcon.simple_icon[:scene][i]})") }
  128. else
  129. @info.draw_text_ex(0, 0, "")
  130. @menu_background[i].opacity = 128
  131. end
  132. }
  133. end
  134. end
  135. end
  136. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement