Ring Menu



Ring

Protect your home & watch over what's important from your phone with video doorbells, indoor & outdoor security cameras, alarm systems & more. #BlackDesertOnline#Playstation4#XboxOneFollow Me on Social Media: Twitter:is: 5PM.

Ring Menu
Jun 19th, 2014
Never
Not a member of Pastebin yet?Sign Up, it unlocks many cool features!
Ring+2
  1. #
  2. # Ring Menu Addon (for PAC Main Menu Ace)
  3. # By Pacman
  4. #
  5. # This script is an addon for PAC Main Menu Ace. This script will only work
  6. # reliably if you have PAC Main Menu Ace version 1.2 or higher above it in the
  7. # scripts menu. (To get PAC Main Menu Ace - http://pastebin.com/Z7JN31gT)
  8. # This script will turn the main menu in to a ring menu reminiscent of SNES-era
  9. # This script allows for two different radii of the ring - an x-radius and a
  10. # y-radius. This means it has the capacity to produce ellipses as well as
  11. # This script can also scale the selected and deselected icons independently;
  12. #
  13. #
  14. modulePAC::MM::RING
  15. MENU_RADIUS_Y = 64# Y Radius
  16. MENU_TEXT = true# Show menu text? (true or false)
  17. MENU_TEXT_SIZE = 18# Menu Text size. integer or nil for default size
  18. BACKGROUND_ALPHA = 192# integer (0 - 255)
  19. SCALE_GAIN = 8# pixels gained in big icon scaling
  20. SCALE_LOSS = 4# pixels lost in small icon scaling
  21. #
  22. # END CONFIG
  23. #
  24. #------------------------------------------------------------------------------
  25. # A module that supports floating-point calculations.
  26. #
  27. moduleMath
  28. #--------------------------------------------------------------------------
  29. #--------------------------------------------------------------------------
  30. ['sin','cos','tan'].each{|type| trig_eval_code = %Q(
  31. returnself.#{type}(value * PI / 180)
  32. eval(trig_eval_code)
  33. end
  34. #
  35. #------------------------------------------------------------------------------
  36. #
  37. class Window_MenuCommand < Window_Command
  38. #--------------------------------------------------------------------------
  39. #--------------------------------------------------------------------------
  40. attr_reader :angle
  41. #--------------------------------------------------------------------------
  42. #--------------------------------------------------------------------------
  43. @gosh_dang_it = false
  44. super(0, 0)
  45. self.width = Graphics.width
  46. self.opacity = 0
  47. refresh
  48. #--------------------------------------------------------------------------
  49. #--------------------------------------------------------------------------
  50. return360/ item_max
  51. #--------------------------------------------------------------------------
  52. # enabled : Enabled flag. When false, draw semi-transparently.
  53. #--------------------------------------------------------------------------
  54. def draw_big_icon(icon_index, x, y, enabled = true)
  55. rect = Rect.new(icon_index %16*24, icon_index /16*24, 24, 24)
  56. dest.width = dest.height = (24+PAC::MM::RING::SCALE_GAIN)
  57. dest.y = y -PAC::MM::RING::SCALE_GAIN/2
  58. contents.stretch_blt(dest, bitmap, rect, enabled ? 255 : translucent_alpha)
  59. #--------------------------------------------------------------------------
  60. # enabled : Enabled flag. When false, draw semi-transparently.
  61. #--------------------------------------------------------------------------
  62. def draw_small_icon(icon_index, x, y, enabled = true)
  63. rect = Rect.new(icon_index %16*24, icon_index /16*24, 24, 24)
  64. dest.width = dest.height = (24-PAC::MM::RING::SCALE_LOSS)
  65. dest.y = y +PAC::MM::RING::SCALE_LOSS/2
  66. contents.stretch_blt(dest, bitmap, rect, translucent_alpha /2)
  67. #--------------------------------------------------------------------------
  68. #--------------------------------------------------------------------------
  69. radius = PAC::MM::RING::MENU_RADIUS_X
  70. yradius *= -1ifPAC::MM::RING::MENU_ICON_PLACEMENT:top
  71. n = (method_index -self.index)* angle_size +@angle
  72. cy = yradius *Math.cosd(n)+(Graphics.height/2)
  73. self.contents.font.color.alpha = enabled ? 255 : 128
  74. self.contents.font.size = PAC::MM::RING::MENU_TEXT_SIZE|| s
  75. self.contents.draw_text(Graphics.width/2-80, Graphics.height/2-
  76. line_height, 160, line_height, PAC::MM::COMMANDS[method_index][0], 1)if
  77. self.contents.font.size = s
  78. draw_big_icon(PAC::MM::COMMANDS[method_index][2], cx -12, cy -12,
  79. else# All other indexes
  80. draw_small_icon(PAC::MM::COMMANDS[method_index][2], cx -12, cy -12,
  81. end
  82. def okay
  83. end
  84. #--------------------------------------------------------------------------
  85. #--------------------------------------------------------------------------
  86. speed = PAC::MM::RING::MENU_SPEED
  87. @angle+= (reverse ? -angle_size : angle_size)/ speed.to_f
  88. refresh
  89. #--------------------------------------------------------------------------
  90. # aliasing is for chumps
  91. #--------------------------------------------------------------------------
  92. super
  93. end
  94. #--------------------------------------------------------------------------
  95. #--------------------------------------------------------------------------
  96. returnif !active
  97. if Input.trigger?(:LEFT)|| Input.repeat?(:LEFT)|| Input.trigger?(:UP)||
  98. Sound.play_cursor
  99. update_spin
  100. @index-= 1
  101. @angle = 0
  102. elsif Input.trigger?(:RIGHT)|| Input.repeat?(:RIGHT)||
  103. Sound.play_cursor
  104. update_spin(true)
  105. @index+= 1
  106. @angle = 0
  107. end
  108. #--------------------------------------------------------------------------
  109. #--------------------------------------------------------------------------
  110. cursor_right(*args)
  111. def cursor_up(*args)
  112. end
  113. end
  114. #
  115. #------------------------------------------------------------------------------
  116. # This window displays party member status on the menu screen.
  117. #
  118. class Window_MenuStatus < Window_Selectable
  119. #--------------------------------------------------------------------------
  120. #--------------------------------------------------------------------------
  121. def initialize(*args)
  122. self.x = (Graphics.width-self.width)/2
  123. end
  124. #
  125. #------------------------------------------------------------------------------
  126. #
  127. class Scene_Menu < Scene_MenuBase
  128. #--------------------------------------------------------------------------
  129. #--------------------------------------------------------------------------
  130. alias pac_mm_rm_cmdpnl command_personal
  131. alias pac_mm_rm_onfc on_formation_cancel
  132. #--------------------------------------------------------------------------
  133. #--------------------------------------------------------------------------
  134. pac_mm_rm_strt(*args)
  135. @command_window.index = (@@last_index ||= 0)
  136. @status_window.hideunless @@start_personal
  137. end
  138. #--------------------------------------------------------------------------
  139. #--------------------------------------------------------------------------
  140. @background_sprite = Sprite.new
  141. @background_sprite.bitmap = SceneManager.background_bitmap
  142. @background_sprite.color.set(16, 16, 16, PAC::MM::RING::BACKGROUND_ALPHA)
  143. #--------------------------------------------------------------------------
  144. #--------------------------------------------------------------------------
  145. @command_window.close
  146. @status_window.open
  147. end
  148. #--------------------------------------------------------------------------
  149. #--------------------------------------------------------------------------
  150. @command_window.close
  151. @status_window.open
  152. end
  153. #--------------------------------------------------------------------------
  154. #--------------------------------------------------------------------------
  155. pac_mm_opc(*args)
  156. @command_window.show
  157. @@start_personal = false
  158. #--------------------------------------------------------------------------
  159. #--------------------------------------------------------------------------
  160. pac_mm_rm_onfc(*args)
  161. @command_window.show
  162. @@start_personal = false
  163. #--------------------------------------------------------------------------
  164. #--------------------------------------------------------------------------
  165. @@last_index = @command_window.index
  166. end
  167. unless$pac[:main_menu]>= 1.2
  168. msgbox 'You require PAC Main Menu Ace for the Ring Menu script to work.'
  169. msgbox 'Find the script at http://pastebin.com/Z7JN31gT'; exit
  170. #
  171. # END OF SCRIPT
  172. #
Ring Menu
RAW Paste Data
Ring

Ring Menu For Mac