Soroshiya Modérateur
Nombre de messages : 124 Age : 32 Date d'inscription : 16/11/2007
Feuille personnelle PAs (Points d'Aide): (0/130) Permis à Points: (40/40)
| Sujet: Ring menu 2 Sam 17 Nov - 4:40 | |
| Nom du script : Ring menu 2Auteur : InconnuFonction : Veuillez metre la description du scriptPareil que ring menu 1Image(s) : Ressource(s) : AucuneRemarque : Fonctionnel, affiche en plus l'argentInstallation : Allez dans l'éditeur de script ( F11 ) et suivez les instructions ci-dessous .Premièrement, Ouvrez le script : Scene_Load Ensuite, Copier se script au complet et collez le dans un nouveau script nommé : Scene_Load2 Dans le script : Scene_Load2 changez les lignes : - Citation :
- Code --- ligne 7
- Code:
-
class Scene_Load < Scene_File - Citation :
- Code --- ligne 62
- Code:
-
$scene = Scene_Title.new par: - Citation :
- Code --- ligne 7
- Code:
-
class Scene_Load2 < Scene_File - Citation :
- Code --- ligne 62
- Code:
-
$scene = Scene_Map.new Maintenant, Créez un nouveau script nommé : Window_RingMenu Copiez ceci dans ce script : - Code:
-
#============ # Window_RingMenu #----------------------------------------------------------------- # Translated And Fixed By Zieg **Added "Load" Option And Comments** #============ class Window_RingMenu < Window_Base #----------------------------------------------------------------- # Before Setup #----------------------------------------------------------------- # Setting the starting frame counts STARTUP_FRAMES = 20 MOVING_FRAMES = 5 RING_R = 64 # Setting the items (icons) ICON_ITEM = RPG::Cache.icon("032-Item01") ICON_SKILL = RPG::Cache.icon("050-Skill07") ICON_EQUIP = RPG::Cache.icon("034-Item03") ICON_STATUS = RPG::Cache.icon("049-Skill06") ICON_SAVE = RPG::Cache.icon("047-Skill04") ICON_LOAD = RPG::Cache.icon("048-Skill05") ICON_EXIT = RPG::Cache.icon("046-Skill03") # Setting the "blank" or "disabled" item (icon) ICON_DISABLE= RPG::Cache.icon("") # Setting the sound effect played when calling menu SE_STARTUP = "056-Right02" # Setting the starting values for; where the menu starts, wait before moving the cursor, # moving right, moving left. MODE_START = 1 MODE_WAIT = 2 MODE_MOVER = 3 MODE_MOVEL = 4 #----------------------------------------------------------------- # Setup #----------------------------------------------------------------- attr_accessor :index #----------------------------------------------------------------- # Initialize #----------------------------------------------------------------- def initialize( center_x, center_y ) # Drawing the menu super(0, 0, 640, 480) self.contents = Bitmap.new(width-32, height-32) self.contents.font.name = "Arial" self.opacity = 0 self.back_opacity = 0 # Setting menu text (default after #) s1 = "Inventory" # Items s2 = "Player Skills" # Skills s3 = "Equipment" # Equip s4 = "Player Status" # Stats s5 = "Save Game" # Save s6 = "Load Game" # Load s7 = "Quit Game" # Quit # Drawing the commands @commands = [ s1, s2, s3, s4, s5, s6, s7 ] @item_max = 7 @index = 0 # Drawing the items (icons) @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_LOAD, ICON_EXIT ] @disabled = [ false, false, false, false, false, false, false ] # Positioning the menu @cx = center_x - 16 @cy = center_y - 16 # Setting up script setup_move_start refresh end #----------------------------------------------------------------- # Update #----------------------------------------------------------------- def update super refresh end #----------------------------------------------------------------- # Refresh #----------------------------------------------------------------- def refresh # Clearing previous info self.contents.clear # Choosing setup path case @mode when MODE_START refresh_start when MODE_WAIT refresh_wait when MODE_MOVER refresh_move(1) when MODE_MOVEL refresh_move(0) end # Re-Drawing menu rect = Rect.new(@cx - 272, @cy + 24, self.contents.width-32, 32) self.contents.draw_text(rect, @commands[@index],1) end # *** The Next Few Parts Are The Actual Coding, And Do Not Need To Be Messed With!*** #----------------------------------------------------------------- # Refresh (path 1) #----------------------------------------------------------------- def refresh_start d1 = 2.0 * Math::PI / @item_max d2 = 1.0 * Math::PI / STARTUP_FRAMES r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES for i in [email]0...@item_max[/email] j = i - @index d = d1 * j + d2 * @steps x = @cx + ( r * Math.sin( d ) ).to_i y = @cy - ( r * Math.cos( d ) ).to_i draw_item(x, y, i) end @steps -= 1 if @steps < 1 @mode = MODE_WAIT end end #----------------------------------------------------------------- # Refresh (path 2) #----------------------------------------------------------------- def refresh_wait d = 2.0 * Math::PI / @item_max for i in [email]0...@item_max[/email] j = i - @index x = @cx + ( RING_R * Math.sin( d * j ) ).to_i y = @cy - ( RING_R * Math.cos( d * j ) ).to_i draw_item(x, y, i) end end #----------------------------------------------------------------- # Refresh (paths 3 & 4) #----------------------------------------------------------------- def refresh_move( mode ) d1 = 2.0 * Math::PI / @item_max d2 = d1 / MOVING_FRAMES d2 *= -1 if mode != 0 for i in [email]0...@item_max[/email] j = i - @index d = d1 * j + d2 * @steps x = @cx + ( RING_R * Math.sin( d ) ).to_i y = @cy - ( RING_R * Math.cos( d ) ).to_i draw_item(x, y, i) end @steps -= 1 if @steps < 1 @mode = MODE_WAIT end end #----------------------------------------------------------------- # Items (Icons) #----------------------------------------------------------------- def draw_item(x, y, i) rect = Rect.new(0, 0, @items[i].width, @items[i].height) if @index == i self.contents.blt( x, y, @items[i], rect ) if @disabled[@index] self.contents.blt( x, y, ICON_DISABLE, rect ) end else self.contents.blt( x, y, @items[i], rect, 128 ) if @disabled[@index] self.contents.blt( x, y, ICON_DISABLE, rect, 128 ) end end end #----------------------------------------------------------------- # When No Items (Icons) #----------------------------------------------------------------- def disable_item(index) @disabled[index] = true end #----------------------------------------------------------------- # Starting Menu #----------------------------------------------------------------- def setup_move_start @mode = MODE_START @steps = STARTUP_FRAMES # Playing startup SE if SE_STARTUP != nil and SE_STARTUP != "" Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100) end end #----------------------------------------------------------------- # Setup Movement #----------------------------------------------------------------- def setup_move_move(mode) if mode == MODE_MOVER @index -= 1 @index = @items.size - 1 if @index < 0 elsif mode == MODE_MOVEL @index += 1 @index = 0 if @index >= @items.size else return end @mode = mode @steps = MOVING_FRAMES end #----------------------------------------------------------------- # Animate #----------------------------------------------------------------- def animation? return @mode != MODE_WAIT end # End Of script # Add any "new" definitions under here. # Don't Add Anything Below Here end
Dernière édition par le Sam 17 Nov - 4:42, édité 1 fois | |
|
Soroshiya Modérateur
Nombre de messages : 124 Age : 32 Date d'inscription : 16/11/2007
Feuille personnelle PAs (Points d'Aide): (0/130) Permis à Points: (40/40)
| Sujet: Re: Ring menu 2 Sam 17 Nov - 4:41 | |
| Maintenant, créez un autre script nommé : Window_RingMenuStatus Copiez ceci a l'intérieur : - Code:
-
#=========================================================== # Window_RingMenuStatus #------------------------------------------------------------------------------------------------------- # Translated And Fixed By Zieg **Added "Load" Option And Comments** #=========================================================== class Window_RingMenuStatus < Window_Selectable #----------------------------------------------------------------- # Initialize #----------------------------------------------------------------- def initialize # Drawing the window super(204, 64, 232, 352) self.contents = Bitmap.new(width - 32, height - 32) # Refreshing the window refresh # Setting the window to unactive self.active = false # Setting the cursor over nothing (hideing the cursor) self.index = -1 end #----------------------------------------------------------------- # Refresh #----------------------------------------------------------------- def refresh # Deleteing the "old" info self.contents.clear # Setting font self.contents.font.name = "Arial" # Re-Drawing the window @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 80 y = 80 * i actor = $game_party.actors[i] draw_actor_graphic(actor, x - 40, y + 80) draw_actor_name(actor, x, y + 24) end end #----------------------------------------------------------------- # Update Cursor #----------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 80, self.width - 32, 80) end end # End Of script # Add any "new" definitions under here. # Don't Add Anything Below Here end Pour finir, allez retrouver le script : Scene_Menu et remplacer tout ce qu'il contien par ceci : Code --- ligne 7 - Code:
-
#=========================================================== # Scene_Menu #------------------------------------------------------------------------------------------------------- # Edited By Zieg **Edited To Match RingMenu, And Added "Load" Option** #=========================================================== class Scene_Menu #-------------------------------------------------------------------------- # Initialize #-------------------------------------------------------------------------- def initialize(menu_index = 0) # Setting up an index variable @menu_index = menu_index end #-------------------------------------------------------------------------- # Main #-------------------------------------------------------------------------- def main # Drawing the current map to the background @spriteset = Spriteset_Map.new # Setting "px" and "py" to the players current x nd y positions (minus 15x and 24y) px = $game_player.screen_x - 15 py = $game_player.screen_y - 24 # Drawing the gold window @gold = Window_Gold.new @gold.x = 480 @gold.y = 415 @gold.z = 9999 @gold.opacity = 100 # Drawing the command window (the ring) @command_window = Window_RingMenu.new(px,py) @command_window.index = @menu_index # Checking actions availablities 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 @command_window.z = 100 if $game_system.save_disabled @command_window.disable_item(4) end # Drawing the status window @status_window = Window_RingMenuStatus.new @status_window.x = 406 @status_window.y = 1 @status_window.z = 9999 @status_window.opacity = 100 # Hideing the status window @status_window.visible = false # Showing the menu Graphics.transition # Setting continiuos actions loop do Graphics.update Input.update update if $scene != self break end end # Closing menu Graphics.freeze @spriteset.dispose @gold.dispose @command_window.dispose @status_window.dispose end #-------------------------------------------------------------------------- # Update #-------------------------------------------------------------------------- def update # Updating the windows @command_window.update @gold.update @status_window.update if @command_window.active update_command return end if @status_window.active update_status return end end #-------------------------------------------------------------------------- # Update Command #-------------------------------------------------------------------------- def update_command # Setting commands #--------- Setting Esc button if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $game_system.save_disabled = true $scene = Scene_Map.new return end #--------- Setting Enter(Return) button 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 # Setting options case @command_window.index when 0 # Item $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new when 1 # Skills $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.visible = true @status_window.index = 0 when 2 # Equip $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.visible = true @status_window.index = 0 when 3 # Status $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.visible = true @status_window.index = 0 when 4 # Save 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_Save.new when 5 # Load $game_system.se_play($data_system.decision_se) $scene = Scene_Load2.new when 6 # Quit $game_system.se_play($data_system.decision_se) $scene = Scene_End.new end return end # Setting ring rotating right when pressing left or up return if @command_window.animation? if Input.press?(Input::UP) or Input.press?(Input::LEFT) $game_system.se_play($data_system.cursor_se) @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL) return end # Setting ring rotating left when pressing right or down if Input.press?(Input:: DOWN) or Input.press?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) @command_window.setup_move_move(Window_RingMenu::MODE_MOVER) return end end #-------------------------------------------------------------------------- # Update Status #-------------------------------------------------------------------------- def update_status # Setting commands #--------- Setting Esc button if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @status_window.active = false @status_window.visible = false @status_window.index = -1 return end #--------- Setting Enter(Return) button if Input.trigger?(Input::C) # Setting type case @command_window.index when 1 # Skills 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 # Equip $game_system.se_play($data_system.decision_se) $scene = Scene_Equip.new(@status_window.index) when 3 # Status $game_system.se_play($data_system.decision_se) $scene = Scene_Status.new(@status_window.index) end return end end # End Of script # Add any "new" definitions under here. # Don't Add Anything Below Here end | |
|