Sujet: Demande script Menu KH Jeu 13 Mai 2010 - 10:54
Bonjour voila je fait une demande pour savoir si il est possible de réaliser un menu comme sur l'exemple que j'ai réaliser : Je ne suis pas du tout doué en script , c'est pas mon truc ,et je voulé savoir si quelqu'un est capable de réaliser un tel script A gauche se trouve les liens du menu et a droite les 3 personnage Avec la localisation en haut a droite la monnaies et le temps en bas a gauche avec les chiffres écrit sur les 2 lignes en pointillé
En espérant des réponse ...
Azuma-01
Poulet trizo Lv.3
Age : 32 Inscrit le : 18/11/2009 Messages : 42
Sujet: Re: Demande script Menu KH Jeu 13 Mai 2010 - 15:33
J'ai quelques : 1. Tu veux utiliser une image comme fond ou tu veux utiliser des windows? Si c'est une image, fait moi en une vierge. 2. T'affiche pas les problèmes de statut (paralysie, empoisonné...)? Si oui, où? 3. Les commandes des sous menus, sont dans des boîtes différante?(répond seulement si en 1 tu préfère les windows). 4. Veux-tu l'option Charger dans ton menu et dans quelle ordre sont les options? 5. À quoi sert la boîte en bas à droite, c'est l'aide? elle affiche quoi et quant? 6. Pas trop compris ton histoire de localisation, je remplace le mot "Localisation" par la map ou je le met en dessous, au dessus...? C'est vague 7. l'heure, tu l'affiche dans quelle format? 15:30:09, 15h 30m 09s...
Je crois que c'est tout...pour l'instant du moins.
Flo12
Poulet carnivore Lv.2
Age : 29 Inscrit le : 11/12/2009 Messages : 15
Sujet: Re: Demande script Menu KH Jeu 13 Mai 2010 - 18:38
Si c'est comme kh tu veux peut-être dire les windows bleus foncées, l'écran menu transparant... un peu comme ceci https://i.servimg.com/u/f60/15/20/60/15/sans_t11.png
Eri
Vagabond Lv.5
Inscrit le : 05/03/2010 Messages : 88
Sujet: Re: Demande script Menu KH Ven 14 Mai 2010 - 14:21
Azuma-01 merci de t'intéresser a ma demande 1 les rectangles noir sont des windows 2 heu non XD sans 3 des windows différent 4 l'Ordre : Objets Équipement compétences Etat Sauvegarder quitter le jeux 5 c'est l'aide normalement mais si se n'est pas possible , peut t'on laisser la windows vierge 6 remplacer localisation part le nom de la map 7 15:30:09
Merci pour l'exemple Flo12 mais c'est une image de Kingdom Hearts 1 , voila une image du 2
Azuma-01
Poulet trizo Lv.3
Age : 32 Inscrit le : 18/11/2009 Messages : 42
Sujet: Re: Demande script Menu KH Ven 14 Mai 2010 - 18:41
Ok ! Je te fais ça et il devrait être fonctionnel pour vendredi prochain max.
Édit: J'ai oublier de demandée où je place le curseur lors de la sélection des acteurs? J'englobe le tout, le nom, la face...
Eri
Vagabond Lv.5
Inscrit le : 05/03/2010 Messages : 88
Sujet: Re: Demande script Menu KH Dim 16 Mai 2010 - 17:25
Ok merci super ^o^ !!! Hum je dirait uniquement le nom du hero sélectionné
Azuma-01
Poulet trizo Lv.3
Age : 32 Inscrit le : 18/11/2009 Messages : 42
Sujet: Re: Demande script Menu KH Mar 18 Mai 2010 - 18:34
voici ton menu Eri
Spoiler:
Code:
=begin ############################# Eri's menu
Author: Azuma-01 Version: 2.0 Date: 18 / 05 / 2010 =end ############################## #----------------------------------------------------------- Instructions ------------------------------------------------------------ # pour ajouter des options au menu: # 1. Autour de la ligne 116, ajouter le nom de votre nouvelle commande # 2. Si le nouveau menu a besoin de choisir un acteur, ajouter "la position du menu -1 " a la ligne 176. # Sinon, autour de la ligne 182, ajouter ; when la position du menu -1; $scene = Nom_de la scene + .new # 3. Si le nouveau menu a besoin de choisir un acteur, autour de la ligne 224, ajouter : # when la position du menu -1; $scene = Nom_de la scene + .new(@status_window_index)
#============================================# # ● END Customization ● # #============================================# end end
$AzaScritps ||= {} $AzaScritps['Azuma-01_Menu_for_Eri'] = true #============================================================================== # ■ Scene Menu #============================================================================== class Scene_Menu #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window @commands = [ #----------------------------------------------- # "nom de la commande", Vocab.item, Vocab.equip, Vocab.skill, Vocab.status, Vocab.save, Vocab.game_end,
#----------------------------------------------- ] # <-- do not remove @command_windows = [] @commands.size.times{|i| @command_windows.push(Window_Eri_Command.new(@commands[i], 0, 82 + (i * 34))) @command_windows[i].z = 300 } show_command(@menu_index) @command_window_index = @menu_index @command_windows[@menu_index].x += 15 @command_windows[@menu_index].selected = true @max_item = @commands.size if $game_party.members.size == 0 # If number of party members is 0 draw_item(0, false) # Disable item draw_item(1, false) # Disable equipment draw_item(2, false) # Disable skill draw_item(3, false) # Disable status end if $game_system.save_disabled # If save is forbidden draw_item(4, false) # Disable save end # Si vous utiliser un menu de chargement, enlever le "#" des 3 lignes qui suis # if $game_system.load_disabled or !load_enabled? # If load is forbidden # draw_item(5, false) # Disable load # end end
#-------------------------------------------------------------------------- # * Update Command Selection #-------------------------------------------------------------------------- def update_command_selection last_actor = @command_window_index if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN) commands_down elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP) commands_up elsif Input.trigger?(Input::C) if $game_party.members.size == 0 and @command_window_index < 4 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window_index == 4 Sound.play_buzzer return # Si vous utiliser un menu de chargement, enlever le "#" des 3 lignes qui suis # elsif ($game_system.load_disabled or !load_enabled?) and @command_window_index == 5 # Sound.play_buzzer # return end Sound.play_decision case @command_window_index # #------------------------------------------------------ # when x # $scene = Nom_de la scene + .new when 0 # Item $scene = Scene_Item.new when 1,2,3 # equipment, Skill, status start_actor_selection when 4 # Save $scene = Scene_File.new(true, false, false) when 5 # End Game $scene = Scene_End.new
#------------------------------------------------------ # end end if last_actor != @command_window_index Sound.play_cursor @help_window.set_text(Aza::Eri_Menu::Help_Text[@commands[@command_window_index]]) @command_windows[@command_window_index].selected = true @command_windows[@command_window_index].x += 15 @command_windows[last_actor].selected = false @command_windows[last_actor].x -= 15 end end
#-------------------------------------------------------------------------- # * Update Actor Selection #-------------------------------------------------------------------------- def update_actor_selection last_actor = @status_window_index if Input.trigger?(Input::B) Sound.play_cancel end_actor_selection elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN) cursor_down elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP) cursor_up elsif Input.trigger?(Input::C) $game_party.last_actor_index = @status_window_index Sound.play_decision case @command_window_index # #------------------------------------------------------ # when x # $scene = Nom_de la scene + .new(@status_window_index) # en règle gégérale when 1 # equipment $scene = Scene_Equip.new(@status_window_index) when 2 # skill $scene = Scene_Skill.new(@status_window_index) when 3 # status $scene = Scene_Status.new(@status_window_index)
#------------------------------------------------------ # end end if last_actor != @status_window_index Sound.play_cursor @status_windows[@status_window_index].selected = true @status_windows[last_actor].selected = false end end
#-------------------------------------------------------------------------- # * Determine if Load is Enabled #-------------------------------------------------------------------------- def load_enabled? return true if !Aza::Eri_Menu::No_Save_Disabled_Load path = Aza::Eri_Menu::Save_Path == "" ? "" : Aza::Eri_Menu::Save_Path + "/" return (Dir.glob(path + 'Save*.rvdata').size > 0) end
def draw_item(index, enabled = true) @command_windows[index].refresh(enabled) end
#-------------------------------------------------------------------------- # * Create Status Windows #-------------------------------------------------------------------------- def create_status_windows @status_windows = [] members = $game_party.members if members.size < 3 and Aza::Eri_Menu::Empty_Windows (3 - members.size).times{members.push(nil)} end members.each_with_index{|actor, i| x = 160 + (i * 128) y = 66 @status_windows[i] = Window_Menu_Status.new(actor, x , y) } @fake_sprite = Window_Base.new(160, 82, 384 , 208) @fake_sprite.opacity = 0; @fake_sprite.z = 301 show_actor(0) create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * Move Commands Windows Untill The Active Commands Is Visible # index : Actor index #-------------------------------------------------------------------------- def show_command(index) loop do y = @command_windows[index].y if y < 80 @command_windows.each{|window| window.y += 34} elsif y > 285 @command_windows.each{|window| window.y -= 34} end break if @command_windows[index].y > 80 and @command_windows[index].y < 285 end @command_windows.each{|window| if window.y < 80 or window.y > 285 window.visible = false else; window.visible = true end } end
#-------------------------------------------------------------------------- # * Move Actors Windows Untill The Active Actor Is Visible # index : Actor index #-------------------------------------------------------------------------- def show_actor(index) loop do x = @status_windows[index].x if x < 150 @status_windows.each{|window| window.x += 128} elsif x > 540 @status_windows.each{|window| window.x -= 128} end break if @status_windows[index].x > 150 and @status_windows[index].x < 540 end @status_windows.each{|window| if window.x < 150 or window.x > 540 window.visible = false else; window.visible = true end } end
#-------------------------------------------------------------------------- # * Start Actor Selection #-------------------------------------------------------------------------- def start_actor_selection @command_window_active = false if $game_party.last_actor_index < $game_party.members.size @status_window_index = $game_party.last_actor_index else @status_window_index = 0 end @status_windows[@status_window_index].selected = true @status_window_active = true show_actor(@status_window_index) create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * End Actor Selection #-------------------------------------------------------------------------- def end_actor_selection @command_window_active = true @status_windows[@status_window_index].selected = false @status_window_active = false show_actor(0) if Aza::Eri_Menu::Reinitialize_Status_Window create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * Move commands down # wrap : Wraparound allowed #-------------------------------------------------------------------------- def commands_down(wrap = false) if (@command_window_index < @max_item - 1) or (wrap) @command_window_index = (@command_window_index + 1) % @max_item return if @command_windows[@command_window_index].visible show_command(@command_window_index) end create_fake_commands if @max_item > 6 end
#-------------------------------------------------------------------------- # * Move commands up # wrap : Wraparound allowed #-------------------------------------------------------------------------- def commands_up(wrap = false) if (@command_window_index >= 1) or (wrap) @command_window_index = (@command_window_index - 1 + @max_item) % @max_item return if @command_windows[@command_window_index].visible show_command(@command_window_index) end create_fake_commands if @max_item > 6 end
#-------------------------------------------------------------------------- # * Move cursor down # wrap : Wraparound allowed #-------------------------------------------------------------------------- def cursor_down(wrap = false) if (@status_window_index < $game_party.members.size - 1) or (wrap) @status_window_index = (@status_window_index + 1) % $game_party.members.size return if @status_windows[@status_window_index].visible show_actor(@status_window_index) end create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * Move cursor up # wrap : Wraparound allowed #-------------------------------------------------------------------------- def cursor_up(wrap = false) if (@status_window_index >= 1) or (wrap) @status_window_index = (@status_window_index - 1 + $game_party.members.size) % $game_party.members.size return if @status_windows[@status_window_index].visible show_actor(@status_window_index) end create_fake_contents if $game_party.members.size > 3 end
end #============================================================================== # ■ Game Map #============================================================================== class Game_Map #-------------------------------------------------------------------------- # * Alias Object Initialization #-------------------------------------------------------------------------- alias aza_djidane_menu_map initialize def initialize aza_djidane_menu_map @map_name = load_data("Data/MapInfos.rvdata") end
#-------------------------------------------------------------------------- # * Get Map Name #-------------------------------------------------------------------------- def map_name return "" if @map_id == 0 return @map_name[@map_id].name end
end
#============================================================================== # ■ Window Menu GoldTime #============================================================================== class Window_Menu_GoldTime < Window_Base #-------------------------------------------------------------------------- # * Object Initialization # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 128, 128) refresh end
#-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super refresh if Graphics.frame_count / Graphics.frame_rate != @total_sec end
end
#============================================================================== # ■ Window Menu Status #============================================================================== class Window_Menu_Status < Window_Base #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :selected
#-------------------------------------------------------------------------- # * Object Initialization # actor : actor # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(actor, x, y) @window = Window_Actor_Menu.new(x, y + 112, 128, 116) super(x, y, 128, 208) @actor = actor refresh self.opacity = 0 self.active = false end
#-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super @window.dispose end
#-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super @window.update end
#-------------------------------------------------------------------------- # * Set Window X Coordinate #-------------------------------------------------------------------------- def x=(new_x) super @window.x = new_x end
#-------------------------------------------------------------------------- # * Set Window Y Coordinate #-------------------------------------------------------------------------- def y=(new_y) super @window.y = new_y + 112 end
#-------------------------------------------------------------------------- # * Set Window Z Coordinate #-------------------------------------------------------------------------- def z=(new_z) super @window.z = new_z end
#-------------------------------------------------------------------------- # * Set Window Visibility #-------------------------------------------------------------------------- def visible=(flag) super @window.visible = flag end
#-------------------------------------------------------------------------- # * Set Selected # selected : new selected (true = selected, false = unselected) #-------------------------------------------------------------------------- def selected=(selected) @selected = selected update_cursor end
#-------------------------------------------------------------------------- # * Update cursor #-------------------------------------------------------------------------- def update_cursor if @selected @window.cursor_rect.set(0, 0, 96, 21) else @window.cursor_rect.empty end end
end
#============================================================================== # ■ Window Actor Menu #============================================================================== class Window_Actor_Menu < Window_Base #-------------------------------------------------------------------------- # * Draw Name # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- def draw_actor_name(actor, x, y) self.contents.font.color = hp_color(actor) self.contents.draw_text(x, y, 108, WLH, actor.name, 1) end
#-------------------------------------------------------------------------- # * Draw HP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 96) gw = width * actor.hp / actor.maxhp gc1 = hp_gauge_color1 gc2 = hp_gauge_color2 self.contents.fill_rect(x, y + WLH - 8, width, 4, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 4, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a) self.contents.font.color = hp_color(actor) last_font_size = self.contents.font.size self.contents.draw_text(30, y, 66, WLH, "#{actor.hp} / #{actor.maxhp}", 2) end
#-------------------------------------------------------------------------- # * Draw MP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_mp(actor, x, y, width = 120) gw = width * actor.mp / [actor.maxmp, 1].max gc1 = mp_gauge_color1 gc2 = mp_gauge_color2 self.contents.fill_rect(x, y + WLH - 8, width, 4, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 4, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a) self.contents.font.color = mp_color(actor) last_font_size = self.contents.font.size self.contents.draw_text(30, y, 66, WLH, "#{actor.mp} / #{actor.maxmp}", 2) end
end
#============================================================================== # ■ Window Eri Command #============================================================================== class Window_Eri_Command < Window_Base #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :selected
#-------------------------------------------------------------------------- # * Object Initialization # text : Text # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(text, x, y) @text = text @sprite = Sprite.new @sprite.bitmap = Bitmap.new(150, 24) refresh super(x, y, 160, 34) @selected = false end
#-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super @sprite.update end
#-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super @sprite.bitmap.dispose @sprite.dispose end
#-------------------------------------------------------------------------- # * Set Window X Coordinate #-------------------------------------------------------------------------- def x=(new_x) super @sprite.x = new_x + 5 end
#-------------------------------------------------------------------------- # * Set Window Y Coordinate #-------------------------------------------------------------------------- def y=(new_y) super @sprite.y = new_y + 5 end
#-------------------------------------------------------------------------- # * Set Window Z Coordinate #-------------------------------------------------------------------------- def z=(new_z) super @sprite.z = new_z end
#-------------------------------------------------------------------------- # * Set Window Visibility #-------------------------------------------------------------------------- def visible=(flag) super @sprite.visible = flag end
#-------------------------------------------------------------------------- # * Set Selected # selected : new selected (true = selected, false = unselected) #-------------------------------------------------------------------------- def selected=(selected) @selected = selected update_cursor end
#-------------------------------------------------------------------------- # * Update cursor #-------------------------------------------------------------------------- def update_cursor if @selected self.cursor_rect.set(-11, -11, 149, 23) else self.cursor_rect.empty end end
end
#============================================================================== # ■ Window Help4 #============================================================================== class Window_Help4 < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(x, y, w, h) super(x, y, w, h) end
#-------------------------------------------------------------------------- # * Set Text # text : character string displayed in window # align : alignment (0..flush left, 1..center, 2..flush right) #-------------------------------------------------------------------------- def set_text(text, align = 0) if text != @text or align != @align self.contents.clear return if text.nil? self.contents.font.color = Aza::Eri_Menu::Text_Color[:help_text] text.each_with_index{|message, i| self.contents.draw_text(4, WLH * i, self.width - 40, WLH, message.to_s, align)} @text = text @align = align end end
Un script de panneaux a la KH 358/2 Days ! Tout est expliquer dans le topic
merci d'avance !
Naru-Manga
Poulet carnivore Lv.2
Age : 31 Inscrit le : 24/04/2010 Messages : 27
Sujet: Re: Demande script Menu KH Mer 19 Mai 2010 - 13:06
Hop, je passe par là, car je me rends compte que ce menu est bien mieux que ce que je cherche (un menu façon legend of Dragoon). Mais, je suis une quiche en script et j'aimerais un quelque truc, si tu pouvais faire ça pour moi...
En fait, faudrait juste enlever la sauvegarde...
Ah, et au fait, quand je teste, on me dit qu'il y a un problème à la ligne 498... Attends, je cite...
Citation :
Script 'Menu_KH' line 498: NoMethodError occured. undefined method `[]' for nil:NilClass
Azuma-01
Poulet trizo Lv.3
Age : 32 Inscrit le : 18/11/2009 Messages : 42
Sujet: Re: Demande script Menu KH Mer 19 Mai 2010 - 15:05
@Naru-Manga : avec celui-ci le problème devrais être régler.
Spoiler:
Code:
=begin ############################# Eri's menu
Author: Azuma-01 Version: 2.0 Date: 18 / 05 / 2010 Last Update: 19 / 05 / 2010 =end ############################## #----------------------------------------------------------- Instructions ------------------------------------------------------------ # pour ajouter des options au menu: # 1. Autour de la ligne 113, ajouter le nom de votre nouvelle commande # 2. Si le nouveau menu a besoin de choisir un acteur, ajouter "la position du menu -1 " a la ligne 173. # Sinon, autour de la ligne 179, ajouter ; when la position du menu -1; $scene = Nom_de la scene + .new # 3. Si le nouveau menu a besoin de choisir un acteur, autour de la ligne 221, ajouter : # when la position du menu -1; $scene = Nom_de la scene + .new(@status_window_index) # 4. Ajouter le le text d'aide dans le module
#============================================# # ● END Customization ● # #============================================# end end
$AzaScritps ||= {} $AzaScritps['Azuma-01_Menu_for_Eri'] = true #============================================================================== # ■ Scene Menu #============================================================================== class Scene_Menu #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window @commands = [ #----------------------------------------------- # "nom de la commande", Vocab.item, Vocab.equip, Vocab.skill, Vocab.status, Vocab.save, Vocab.game_end,
#----------------------------------------------- ] # <-- do not remove @command_windows = [] @commands.size.times{|i| @command_windows.push(Window_Eri_Command.new(@commands[i], 0, 82 + (i * 34))) @command_windows[i].z = 300 } show_command(@menu_index) @command_window_index = @menu_index @command_windows[@menu_index].x += 15 @command_windows[@menu_index].selected = true @max_item = @commands.size if $game_party.members.size == 0 # If number of party members is 0 draw_item(0, false) # Disable item draw_item(1, false) # Disable equipment draw_item(2, false) # Disable skill draw_item(3, false) # Disable status end if $game_system.save_disabled # If save is forbidden draw_item(4, false) # Disable save end # Si vous utiliser un menu de chargement, enlever le "#" des 3 lignes qui suis # if $game_system.load_disabled or !load_enabled? # If load is forbidden # draw_item(5, false) # Disable load # end end
#-------------------------------------------------------------------------- # * Update Command Selection #-------------------------------------------------------------------------- def update_command_selection last_actor = @command_window_index if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN) commands_down elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP) commands_up elsif Input.trigger?(Input::C) if $game_party.members.size == 0 and @command_window_index < 4 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window_index == 4 Sound.play_buzzer return # Si vous utiliser un menu de chargement, enlever le "#" des 3 lignes qui suis # elsif ($game_system.load_disabled or !load_enabled?) and @command_window_index == 5 # Sound.play_buzzer # return end Sound.play_decision case @command_window_index # #------------------------------------------------------ # when x # $scene = Nom_de la scene + .new when 0 # Item $scene = Scene_Item.new when 1,2,3 # equipment, Skill, status start_actor_selection when 4 # Save $scene = Scene_File.new(true, false, false) when 5 # End Game $scene = Scene_End.new
#------------------------------------------------------ # end end if last_actor != @command_window_index Sound.play_cursor @help_window.set_text(Aza::Eri_Menu::Help_Text[@commands[@command_window_index]]) @command_windows[@command_window_index].selected = true @command_windows[@command_window_index].x += 15 @command_windows[last_actor].selected = false @command_windows[last_actor].x -= 15 end end
#-------------------------------------------------------------------------- # * Update Actor Selection #-------------------------------------------------------------------------- def update_actor_selection last_actor = @status_window_index if Input.trigger?(Input::B) Sound.play_cancel end_actor_selection elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN) cursor_down elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP) cursor_up elsif Input.trigger?(Input::C) $game_party.last_actor_index = @status_window_index Sound.play_decision case @command_window_index # #------------------------------------------------------ # when x # $scene = Nom_de la scene + .new(@status_window_index) # en règle gégérale when 1 # equipment $scene = Scene_Equip.new(@status_window_index) when 2 # skill $scene = Scene_Skill.new(@status_window_index) when 3 # status $scene = Scene_Status.new(@status_window_index)
#------------------------------------------------------ # end end if last_actor != @status_window_index Sound.play_cursor @status_windows[@status_window_index].selected = true @status_windows[last_actor].selected = false end end
#-------------------------------------------------------------------------- # * Determine if Load is Enabled #-------------------------------------------------------------------------- def load_enabled? return true if !Aza::Eri_Menu::No_Save_Disabled_Load path = Aza::Eri_Menu::Save_Path == "" ? "" : Aza::Eri_Menu::Save_Path + "/" return (Dir.glob(path + 'Save*.rvdata').size > 0) end
def draw_item(index, enabled = true) @command_windows[index].refresh(enabled) end
#-------------------------------------------------------------------------- # * Create Status Windows #-------------------------------------------------------------------------- def create_status_windows @status_windows = [] members = $game_party.members if members.size < 3 and Aza::Eri_Menu::Empty_Windows (3 - members.size).times{members.push(nil)} end members.each_with_index{|actor, i| x = 160 + (i * 128) y = 66 @status_windows[i] = Window_Menu_Status.new(actor, x , y) } @fake_sprite = Window_Base.new(160, 82, 384 , 208) @fake_sprite.opacity = 0; @fake_sprite.z = 301 show_actor(0) create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * Move Commands Windows Untill The Active Commands Is Visible # index : Actor index #-------------------------------------------------------------------------- def show_command(index) loop do y = @command_windows[index].y if y < 80 @command_windows.each{|window| window.y += 34} elsif y > 285 @command_windows.each{|window| window.y -= 34} end break if @command_windows[index].y > 80 and @command_windows[index].y < 285 end @command_windows.each{|window| if window.y < 80 or window.y > 285 window.visible = false else; window.visible = true end } end
#-------------------------------------------------------------------------- # * Move Actors Windows Untill The Active Actor Is Visible # index : Actor index #-------------------------------------------------------------------------- def show_actor(index) loop do x = @status_windows[index].x if x < 150 @status_windows.each{|window| window.x += 128} elsif x > 540 @status_windows.each{|window| window.x -= 128} end break if @status_windows[index].x > 150 and @status_windows[index].x < 540 end @status_windows.each{|window| if window.x < 150 or window.x > 540 window.visible = false else; window.visible = true end } end
#-------------------------------------------------------------------------- # * Start Actor Selection #-------------------------------------------------------------------------- def start_actor_selection @command_window_active = false if $game_party.last_actor_index < $game_party.members.size @status_window_index = $game_party.last_actor_index else @status_window_index = 0 end @status_windows[@status_window_index].selected = true @status_window_active = true show_actor(@status_window_index) create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * End Actor Selection #-------------------------------------------------------------------------- def end_actor_selection @command_window_active = true @status_windows[@status_window_index].selected = false @status_window_active = false show_actor(0) if Aza::Eri_Menu::Reinitialize_Status_Window create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * Move commands down # wrap : Wraparound allowed #-------------------------------------------------------------------------- def commands_down(wrap = false) if (@command_window_index < @max_item - 1) or (wrap) @command_window_index = (@command_window_index + 1) % @max_item return if @command_windows[@command_window_index].visible show_command(@command_window_index) end create_fake_commands if @max_item > 6 end
#-------------------------------------------------------------------------- # * Move commands up # wrap : Wraparound allowed #-------------------------------------------------------------------------- def commands_up(wrap = false) if (@command_window_index >= 1) or (wrap) @command_window_index = (@command_window_index - 1 + @max_item) % @max_item return if @command_windows[@command_window_index].visible show_command(@command_window_index) end create_fake_commands if @max_item > 6 end
#-------------------------------------------------------------------------- # * Move cursor down # wrap : Wraparound allowed #-------------------------------------------------------------------------- def cursor_down(wrap = false) if (@status_window_index < $game_party.members.size - 1) or (wrap) @status_window_index = (@status_window_index + 1) % $game_party.members.size return if @status_windows[@status_window_index].visible show_actor(@status_window_index) end create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * Move cursor up # wrap : Wraparound allowed #-------------------------------------------------------------------------- def cursor_up(wrap = false) if (@status_window_index >= 1) or (wrap) @status_window_index = (@status_window_index - 1 + $game_party.members.size) % $game_party.members.size return if @status_windows[@status_window_index].visible show_actor(@status_window_index) end create_fake_contents if $game_party.members.size > 3 end
end
#============================================================================== # ■ Game System #============================================================================== class Game_System #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :load_disabled
#-------------------------------------------------------------------------- # * Alias Object Initialization #-------------------------------------------------------------------------- alias aza_eri_menu_load_option initialize def initialize aza_eri_menu_load_option @load_disabled = false end
end
#============================================================================== # ■ Game Map #============================================================================== class Game_Map #-------------------------------------------------------------------------- # * Get Map Name #-------------------------------------------------------------------------- def map_name return "" if @map_id == 0 @map_name ||= load_data("Data/MapInfos.rvdata") return @map_name[@map_id].name end
end
#============================================================================== # ■ Window Menu GoldTime #============================================================================== class Window_Menu_GoldTime < Window_Base #-------------------------------------------------------------------------- # * Object Initialization # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 128, 128) refresh end
#-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super refresh if Graphics.frame_count / Graphics.frame_rate != @total_sec end
end
#============================================================================== # ■ Window Menu Status #============================================================================== class Window_Menu_Status < Window_Base #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :selected
#-------------------------------------------------------------------------- # * Object Initialization # actor : actor # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(actor, x, y) @window = Window_Actor_Menu.new(x, y + 112, 128, 116) super(x, y, 128, 208) @actor = actor refresh self.opacity = 0 self.active = false end
#-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super @window.dispose end
#-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super @window.update end
#-------------------------------------------------------------------------- # * Set Window X Coordinate #-------------------------------------------------------------------------- def x=(new_x) super @window.x = new_x end
#-------------------------------------------------------------------------- # * Set Window Y Coordinate #-------------------------------------------------------------------------- def y=(new_y) super @window.y = new_y + 112 end
#-------------------------------------------------------------------------- # * Set Window Z Coordinate #-------------------------------------------------------------------------- def z=(new_z) super @window.z = new_z end
#-------------------------------------------------------------------------- # * Set Window Visibility #-------------------------------------------------------------------------- def visible=(flag) super @window.visible = flag end
#-------------------------------------------------------------------------- # * Set Selected # selected : new selected (true = selected, false = unselected) #-------------------------------------------------------------------------- def selected=(selected) @selected = selected update_cursor end
#-------------------------------------------------------------------------- # * Update cursor #-------------------------------------------------------------------------- def update_cursor if @selected @window.cursor_rect.set(0, 0, 96, 21) else @window.cursor_rect.empty end end
end
#============================================================================== # ■ Window Actor Menu #============================================================================== class Window_Actor_Menu < Window_Base #-------------------------------------------------------------------------- # * Draw Name # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- def draw_actor_name(actor, x, y) self.contents.font.color = hp_color(actor) self.contents.draw_text(x, y, 108, WLH, actor.name, 1) end
#-------------------------------------------------------------------------- # * Draw HP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 96) gw = width * actor.hp / actor.maxhp gc1 = hp_gauge_color1 gc2 = hp_gauge_color2 self.contents.fill_rect(x, y + WLH - 8, width, 4, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 4, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a) self.contents.font.color = hp_color(actor) last_font_size = self.contents.font.size self.contents.draw_text(30, y, 66, WLH, "#{actor.hp} / #{actor.maxhp}", 2) end
#-------------------------------------------------------------------------- # * Draw MP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_mp(actor, x, y, width = 120) gw = width * actor.mp / [actor.maxmp, 1].max gc1 = mp_gauge_color1 gc2 = mp_gauge_color2 self.contents.fill_rect(x, y + WLH - 8, width, 4, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 4, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a) self.contents.font.color = mp_color(actor) last_font_size = self.contents.font.size self.contents.draw_text(30, y, 66, WLH, "#{actor.mp} / #{actor.maxmp}", 2) end
end
#============================================================================== # ■ Window Eri Command #============================================================================== class Window_Eri_Command < Window_Base #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :selected
#-------------------------------------------------------------------------- # * Object Initialization # text : Text # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(text, x, y) @text = text @sprite = Sprite.new @sprite.bitmap = Bitmap.new(150, 24) refresh super(x, y, 160, 34) @selected = false end
#-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super @sprite.update end
#-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super @sprite.bitmap.dispose @sprite.dispose end
#-------------------------------------------------------------------------- # * Set Window X Coordinate #-------------------------------------------------------------------------- def x=(new_x) super @sprite.x = new_x + 5 end
#-------------------------------------------------------------------------- # * Set Window Y Coordinate #-------------------------------------------------------------------------- def y=(new_y) super @sprite.y = new_y + 5 end
#-------------------------------------------------------------------------- # * Set Window Z Coordinate #-------------------------------------------------------------------------- def z=(new_z) super @sprite.z = new_z end
#-------------------------------------------------------------------------- # * Set Window Visibility #-------------------------------------------------------------------------- def visible=(flag) super @sprite.visible = flag end
#-------------------------------------------------------------------------- # * Set Selected # selected : new selected (true = selected, false = unselected) #-------------------------------------------------------------------------- def selected=(selected) @selected = selected update_cursor end
#-------------------------------------------------------------------------- # * Update cursor #-------------------------------------------------------------------------- def update_cursor if @selected self.cursor_rect.set(-11, -11, 149, 23) else self.cursor_rect.empty end end
end
#============================================================================== # ■ Window Help4 #============================================================================== class Window_Help4 < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(x, y, w, h) super(x, y, w, h) end
#-------------------------------------------------------------------------- # * Set Text # text : character string displayed in window # align : alignment (0..flush left, 1..center, 2..flush right) #-------------------------------------------------------------------------- def set_text(text, align = 0) if text != @text or align != @align self.contents.clear return if text.nil? self.contents.font.color = Aza::Eri_Menu::Text_Color[:help_text] text.each_with_index{|message, i| self.contents.draw_text(4, WLH * i, self.width - 40, WLH, message.to_s, align)} @text = text @align = align end end
end #============================================================================== # ■ Scene Equip #============================================================================== class Scene_Equip #-------------------------------------------------------------------------- # * Return to Original Screen #-------------------------------------------------------------------------- def return_scene $scene = Scene_Menu.new(1) end
end
#============================================================================== # ■ Scene Skill #============================================================================== class Scene_Skill #-------------------------------------------------------------------------- # * Return to Original Screen #-------------------------------------------------------------------------- def return_scene $scene = Scene_Menu.new(2) end
end
Et pour enlever l'option sauvegarder remplace les 193 premières lignes par
Spoiler:
Code:
=begin ############################# Eri's menu
Author: Azuma-01 Version: 1.0 Date: 18 / 05 / 2010 Last Update: 19 / 05 / 2010 =end ############################## #----------------------------------------------------------- Instructions ------------------------------------------------------------ # pour ajouter des options au menu: # 1. Autour de la ligne 116, ajouter le nom de votre nouvelle commande # 2. Si le nouveau menu a besoin de choisir un acteur, ajouter "la position du menu -1 " a la ligne 176. # Sinon, autour de la ligne 182, ajouter ; when la position du menu -1; $scene = Nom_de la scene + .new # 3. Si le nouveau menu a besoin de choisir un acteur, autour de la ligne 224, ajouter : # when la position du menu -1; $scene = Nom_de la scene + .new(@status_window_index) # 4. Ajouter le le text d'aide dans le module
#============================================# # ● END Customization ● # #============================================# end end
$AzaScritps ||= {} $AzaScritps['Azuma-01_Menu_for_Eri'] = true #============================================================================== # ■ Scene Menu #============================================================================== class Scene_Menu #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window @commands = [ #----------------------------------------------- # "nom de la commande", Vocab.item, Vocab.equip, Vocab.skill, Vocab.status, Vocab.game_end,
#----------------------------------------------- ] # <-- do not remove @command_windows = [] @commands.size.times{|i| @command_windows.push(Window_Eri_Command.new(@commands[i], 0, 82 + (i * 34))) @command_windows[i].z = 300 } show_command(@menu_index) @command_window_index = @menu_index @command_windows[@menu_index].x += 15 @command_windows[@menu_index].selected = true @max_item = @commands.size if $game_party.members.size == 0 # If number of party members is 0 draw_item(0, false) # Disable item draw_item(1, false) # Disable equipment draw_item(2, false) # Disable skill draw_item(3, false) # Disable status end if $game_system.save_disabled # If save is forbidden draw_item(4, false) # Disable save end # Si vous utiliser un menu de chargement, enlever le "#" des 3 lignes qui suis # if $game_system.load_disabled or !load_enabled? # If load is forbidden # draw_item(5, false) # Disable load # end end
#-------------------------------------------------------------------------- # * Update Command Selection #-------------------------------------------------------------------------- def update_command_selection last_actor = @command_window_index if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN) commands_down elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP) commands_up elsif Input.trigger?(Input::C) if $game_party.members.size == 0 and @command_window_index < 4 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window_index == 4 Sound.play_buzzer return # Si vous utiliser un menu de chargement, enlever le "#" des 3 lignes qui suis # elsif ($game_system.load_disabled or !load_enabled?) and @command_window_index == 5 # Sound.play_buzzer # return end Sound.play_decision case @command_window_index # #------------------------------------------------------ # when x # $scene = Nom_de la scene + .new when 0 # Item $scene = Scene_Item.new when 1,2,3 # equipment, Skill, status start_actor_selection when 4 # End Game $scene = Scene_End.new
#------------------------------------------------------ # end end if last_actor != @command_window_index Sound.play_cursor @help_window.set_text(Aza::Eri_Menu::Help_Text[@commands[@command_window_index]]) @command_windows[@command_window_index].selected = true @command_windows[@command_window_index].x += 15 @command_windows[last_actor].selected = false @command_windows[last_actor].x -= 15 end end
@Sylfurion: Désoler je ne crois pouvoir faire ça dans l'immédiat. Entre les examens de fin de session et que je n'aurais plus l'internet dès le 24 mai, il me sera compliquer de te faire parvenir.
Sylfurion
Mage Lv.11
Age : 27 Inscrit le : 02/03/2009 Messages : 513
Sujet: Re: Demande script Menu KH Mer 19 Mai 2010 - 15:12
Ok merci quand même Azuma
Eri
Vagabond Lv.5
Inscrit le : 05/03/2010 Messages : 88
Sujet: Re: Demande script Menu KH Mer 19 Mai 2010 - 22:56
Ouahhhooo O_O merci Azuma-01 c'est génial ^o^ ! trop cool !!!!!! OUUUUUEEEEEEEEEE !!!!!!! t'est trop fort ! merci ^^
C possible d'enlever le fond des faces ??? T_T parsqu'avec mes faces sa le fait pas mais par contre j'aime pas du tout les couleurs des écritures XD c possible de les modifié comme sa : (Si sa tembete tout blanc simplement )
Spoiler:
Menu Cyan => Blanc + Recentré l'écriture dans le rectangle Monnaie violet => Orange + effacer "G" + rennomer "Monnaie" par " Monnaie du lexique " Temps de jeux noir et rouge => Bleu Lieux Jaune=> Orange Texte d'AIde vert => Blue ciel
Azuma-01
Poulet trizo Lv.3
Age : 32 Inscrit le : 18/11/2009 Messages : 42
Sujet: Re: Demande script Menu KH Jeu 20 Mai 2010 - 13:25
C'est vrai, j'ai oublier de mettre le fond en option. Et pour ce qui est de l'alignement, une erreur d'inattention.
Spoiler:
Code:
=begin ############################# Eri's menu
Author: Azuma-01 Version: 2.0 Date: 18 / 05 / 2010 Last Update: 20 / 05 / 2010 =end ############################## #----------------------------------------------------------- Instructions ------------------------------------------------------------ # pour ajouter des options au menu: # 1. Autour de la ligne 124, ajouter le nom de votre nouvelle commande # 2. Si le nouveau menu a besoin de choisir un acteur, ajouter "la position du menu -1 " a la ligne 184. # Sinon, autour de la ligne 190, ajouter ; when la position du menu -1; $scene = Nom_de la scene + .new # 3. Si le nouveau menu a besoin de choisir un acteur, autour de la ligne 232, ajouter : # when la position du menu -1; $scene = Nom_de la scene + .new(@status_window_index) # 4. Ajouter le le text d'aide dans le module
#---------------------------------------------------------------------------------------------------------------------------------------- #==================================== History ==================================== # 1.0 (18/05/2010) # - sortie du menu # # 2.0 (20/05/2010) # - Fond pour les faces en option. # - Correction le l'alignement centré.
#============================================# # ● END Customization ● # #============================================# end end
$AzaScritps ||= {} $AzaScritps['Azuma-01_Menu_for_Eri'] = true #============================================================================== # ■ Scene Menu #============================================================================== class Scene_Menu #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window @commands = [ #----------------------------------------------- # "nom de la commande", Vocab.item, Vocab.equip, Vocab.skill, Vocab.status, Vocab.save, Vocab.game_end,
#----------------------------------------------- ] # <-- do not remove @command_windows = [] @commands.size.times{|i| @command_windows.push(Window_Eri_Command.new(@commands[i], 0, 82 + (i * 34))) @command_windows[i].z = 300 } show_command(@menu_index) @command_window_index = @menu_index @command_windows[@menu_index].x += 15 @command_windows[@menu_index].selected = true @max_item = @commands.size if $game_party.members.size == 0 # If number of party members is 0 draw_item(0, false) # Disable item draw_item(1, false) # Disable equipment draw_item(2, false) # Disable skill draw_item(3, false) # Disable status end if $game_system.save_disabled # If save is forbidden draw_item(4, false) # Disable save end # Si vous utiliser un menu de chargement, enlever le "#" des 3 lignes qui suis # if $game_system.load_disabled or !load_enabled? # If load is forbidden # draw_item(5, false) # Disable load # end end
#-------------------------------------------------------------------------- # * Update Command Selection #-------------------------------------------------------------------------- def update_command_selection last_actor = @command_window_index if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.repeat?(Input::RIGHT) or Input.repeat?(Input::DOWN) commands_down elsif Input.repeat?(Input::LEFT) or Input.repeat?(Input::UP) commands_up elsif Input.trigger?(Input::C) if $game_party.members.size == 0 and @command_window_index < 4 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window_index == 4 Sound.play_buzzer return # Si vous utiliser un menu de chargement, enlever le "#" des 3 lignes qui suis # elsif ($game_system.load_disabled or !load_enabled?) and @command_window_index == 5 # Sound.play_buzzer # return end Sound.play_decision case @command_window_index # #------------------------------------------------------ # when x # $scene = Nom_de la scene + .new when 0 # Item $scene = Scene_Item.new when 1,2,3 # equipment, Skill, status start_actor_selection when 4 # Save $scene = Scene_File.new(true, false, false) when 5 # End Game $scene = Scene_End.new
#------------------------------------------------------ # end end if last_actor != @command_window_index Sound.play_cursor @help_window.set_text(Aza::Eri_Menu::Help_Text[@commands[@command_window_index]]) @command_windows[@command_window_index].selected = true @command_windows[@command_window_index].x += 15 @command_windows[last_actor].selected = false @command_windows[last_actor].x -= 15 end end
#-------------------------------------------------------------------------- # * Update Actor Selection #-------------------------------------------------------------------------- def update_actor_selection last_actor = @status_window_index if Input.trigger?(Input::B) Sound.play_cancel end_actor_selection elsif Input.repeat?(Input::RIGHT) or Input.repeat?(Input::DOWN) cursor_down elsif Input.repeat?(Input::LEFT) or Input.repeat?(Input::UP) cursor_up elsif Input.trigger?(Input::C) $game_party.last_actor_index = @status_window_index Sound.play_decision case @command_window_index # #------------------------------------------------------ # when x # $scene = Nom_de la scene + .new(@status_window_index) # en règle gégérale when 1 # equipment $scene = Scene_Equip.new(@status_window_index) when 2 # skill $scene = Scene_Skill.new(@status_window_index) when 3 # status $scene = Scene_Status.new(@status_window_index)
#------------------------------------------------------ # end end if last_actor != @status_window_index Sound.play_cursor @status_windows[@status_window_index].selected = true @status_windows[last_actor].selected = false end end
#-------------------------------------------------------------------------- # * Determine if Load is Enabled #-------------------------------------------------------------------------- def load_enabled? return true if !Aza::Eri_Menu::No_Save_Disabled_Load path = Aza::Eri_Menu::Save_Path == "" ? "" : Aza::Eri_Menu::Save_Path + "/" return (Dir.glob(path + 'Save*.rvdata').size > 0) end
def draw_item(index, enabled = true) @command_windows[index].refresh(enabled) end
#-------------------------------------------------------------------------- # * Create Status Windows #-------------------------------------------------------------------------- def create_status_windows @status_windows = [] members = $game_party.members if members.size < 3 and Aza::Eri_Menu::Empty_Windows (3 - members.size).times{members.push(nil)} end members.each_with_index{|actor, i| x = 160 + (i * 128) y = 66 @status_windows[i] = Window_Menu_Status.new(actor, x , y) } @fake_sprite = Window_Base.new(160, 82, 384 , 208) @fake_sprite.opacity = 0; @fake_sprite.z = 301 show_actor(0) create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * Move Commands Windows Untill The Active Commands Is Visible # index : Actor index #-------------------------------------------------------------------------- def show_command(index) loop do y = @command_windows[index].y if y < 80 @command_windows.each{|window| window.y += 34} elsif y > 285 @command_windows.each{|window| window.y -= 34} end break if @command_windows[index].y > 80 and @command_windows[index].y < 285 end @command_windows.each{|window| if window.y < 80 or window.y > 285 window.visible = false else; window.visible = true end } end
#-------------------------------------------------------------------------- # * Move Actors Windows Untill The Active Actor Is Visible # index : Actor index #-------------------------------------------------------------------------- def show_actor(index) loop do x = @status_windows[index].x if x < 150 @status_windows.each{|window| window.x += 128} elsif x > 540 @status_windows.each{|window| window.x -= 128} end break if @status_windows[index].x > 150 and @status_windows[index].x < 540 end @status_windows.each{|window| if window.x < 150 or window.x > 540 window.visible = false else; window.visible = true end } end
#-------------------------------------------------------------------------- # * Start Actor Selection #-------------------------------------------------------------------------- def start_actor_selection @command_window_active = false if $game_party.last_actor_index < $game_party.members.size @status_window_index = $game_party.last_actor_index else @status_window_index = 0 end @status_windows[@status_window_index].selected = true @status_window_active = true show_actor(@status_window_index) create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * End Actor Selection #-------------------------------------------------------------------------- def end_actor_selection @command_window_active = true @status_windows[@status_window_index].selected = false @status_window_active = false show_actor(0) if Aza::Eri_Menu::Reinitialize_Status_Window create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * Move commands down # wrap : Wraparound allowed #-------------------------------------------------------------------------- def commands_down(wrap = false) if (@command_window_index < @max_item - 1) or (wrap) @command_window_index = (@command_window_index + 1) % @max_item return if @command_windows[@command_window_index].visible show_command(@command_window_index) end create_fake_commands if @max_item > 6 end
#-------------------------------------------------------------------------- # * Move commands up # wrap : Wraparound allowed #-------------------------------------------------------------------------- def commands_up(wrap = false) if (@command_window_index >= 1) or (wrap) @command_window_index = (@command_window_index - 1 + @max_item) % @max_item return if @command_windows[@command_window_index].visible show_command(@command_window_index) end create_fake_commands if @max_item > 6 end
#-------------------------------------------------------------------------- # * Move cursor down # wrap : Wraparound allowed #-------------------------------------------------------------------------- def cursor_down(wrap = false) if (@status_window_index < $game_party.members.size - 1) or (wrap) @status_window_index = (@status_window_index + 1) % $game_party.members.size return if @status_windows[@status_window_index].visible show_actor(@status_window_index) end create_fake_contents if $game_party.members.size > 3 end
#-------------------------------------------------------------------------- # * Move cursor up # wrap : Wraparound allowed #-------------------------------------------------------------------------- def cursor_up(wrap = false) if (@status_window_index >= 1) or (wrap) @status_window_index = (@status_window_index - 1 + $game_party.members.size) % $game_party.members.size return if @status_windows[@status_window_index].visible show_actor(@status_window_index) end create_fake_contents if $game_party.members.size > 3 end
end
#============================================================================== # ■ Game System #============================================================================== class Game_System #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :load_disabled
#-------------------------------------------------------------------------- # * Alias Object Initialization #-------------------------------------------------------------------------- alias aza_eri_menu_load_option initialize def initialize aza_eri_menu_load_option @load_disabled = false end
end
#============================================================================== # ■ Game Map #============================================================================== class Game_Map #-------------------------------------------------------------------------- # * Alias Object Initialization #-------------------------------------------------------------------------- alias aza_eri_menu_map initialize def initialize aza_eri_menu_map @map_name = load_data("Data/MapInfos.rvdata") end
#-------------------------------------------------------------------------- # * Get Map Name #-------------------------------------------------------------------------- def map_name return "" if @map_id == 0 @map_name ||= load_data("Data/MapInfos.rvdata") return @map_name[@map_id].name end
end
#============================================================================== # ■ Window Menu GoldTime #============================================================================== class Window_Menu_GoldTime < Window_Base #-------------------------------------------------------------------------- # * Object Initialization # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 128, 128) refresh end
#-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super refresh if Graphics.frame_count / Graphics.frame_rate != @total_sec end
end
#============================================================================== # ■ Window Menu Status #============================================================================== class Window_Menu_Status < Window_Base #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :selected
#-------------------------------------------------------------------------- # * Object Initialization # actor : actor # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(actor, x, y) @window = Window_Actor_Menu.new(x, y + 112, 128, 116) super(x, y, 128, 208) @actor = actor refresh self.opacity = 0 self.active = false end
#-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super @window.dispose end
#-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super @window.update end
#-------------------------------------------------------------------------- # * Set Window X Coordinate #-------------------------------------------------------------------------- def x=(new_x) super @window.x = new_x end
#-------------------------------------------------------------------------- # * Set Window Y Coordinate #-------------------------------------------------------------------------- def y=(new_y) super @window.y = new_y + 112 end
#-------------------------------------------------------------------------- # * Set Window Z Coordinate #-------------------------------------------------------------------------- def z=(new_z) super @window.z = new_z end
#-------------------------------------------------------------------------- # * Set Window Visibility #-------------------------------------------------------------------------- def visible=(flag) super @window.visible = flag end
#-------------------------------------------------------------------------- # * Set Selected # selected : new selected (true = selected, false = unselected) #-------------------------------------------------------------------------- def selected=(selected) @selected = selected update_cursor end
#-------------------------------------------------------------------------- # * Update cursor #-------------------------------------------------------------------------- def update_cursor if @selected @window.cursor_rect.set(0, 0, 96, 21) else @window.cursor_rect.empty end end
end
#============================================================================== # ■ Window Actor Menu #============================================================================== class Window_Actor_Menu < Window_Base #-------------------------------------------------------------------------- # * Draw Name # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- def draw_actor_name(actor, x, y) self.contents.font.color = hp_color(actor) self.contents.draw_text(x, y, 88, WLH, actor.name, 1) end
#-------------------------------------------------------------------------- # * Draw HP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 96) gw = width * actor.hp / actor.maxhp gc1 = hp_gauge_color1 gc2 = hp_gauge_color2 self.contents.fill_rect(x, y + WLH - 8, width, 4, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 4, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a) self.contents.font.color = hp_color(actor) last_font_size = self.contents.font.size self.contents.draw_text(30, y, 66, WLH, "#{actor.hp} / #{actor.maxhp}", 2) end
#-------------------------------------------------------------------------- # * Draw MP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_mp(actor, x, y, width = 96) gw = width * actor.mp / [actor.maxmp, 1].max gc1 = mp_gauge_color1 gc2 = mp_gauge_color2 self.contents.fill_rect(x, y + WLH - 8, width, 4, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 4, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a) self.contents.font.color = mp_color(actor) last_font_size = self.contents.font.size self.contents.draw_text(30, y, 66, WLH, "#{actor.mp} / #{actor.maxmp}", 2) end
end
#============================================================================== # ■ Window Eri Command #============================================================================== class Window_Eri_Command < Window_Base #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :selected
#-------------------------------------------------------------------------- # * Object Initialization # text : Text # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(text, x, y) @text = text @sprite = Sprite.new @sprite.bitmap = Bitmap.new(150, 24) refresh super(x, y, 160, 34) @selected = false end
#-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super @sprite.update end
#-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super @sprite.bitmap.dispose @sprite.dispose end
#-------------------------------------------------------------------------- # * Set Window X Coordinate #-------------------------------------------------------------------------- def x=(new_x) super @sprite.x = new_x + 5 end
#-------------------------------------------------------------------------- # * Set Window Y Coordinate #-------------------------------------------------------------------------- def y=(new_y) super @sprite.y = new_y + 5 end
#-------------------------------------------------------------------------- # * Set Window Z Coordinate #-------------------------------------------------------------------------- def z=(new_z) super @sprite.z = new_z end
#-------------------------------------------------------------------------- # * Set Window Visibility #-------------------------------------------------------------------------- def visible=(flag) super @sprite.visible = flag end
#-------------------------------------------------------------------------- # * Set Selected # selected : new selected (true = selected, false = unselected) #-------------------------------------------------------------------------- def selected=(selected) @selected = selected update_cursor end
#-------------------------------------------------------------------------- # * Update cursor #-------------------------------------------------------------------------- def update_cursor if @selected self.cursor_rect.set(-11, -11, 149, 23) else self.cursor_rect.empty end end
end
#============================================================================== # ■ Window Help4 #============================================================================== class Window_Help4 < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(x, y, w, h) super(x, y, w, h) end
#-------------------------------------------------------------------------- # * Set Text # text : character string displayed in window # align : alignment (0..flush left, 1..center, 2..flush right) #-------------------------------------------------------------------------- def set_text(text, align = 0) if text != @text or align != @align self.contents.clear return if text.nil? self.contents.font.color = Aza::Eri_Menu::Text_Color[:help_text] text.each_with_index{|message, i| self.contents.draw_text(4, WLH * i, self.width - 40, WLH, message.to_s, align)} @text = text @align = align end end
end #============================================================================== # ■ Scene Equip #============================================================================== class Scene_Equip #-------------------------------------------------------------------------- # * Return to Original Screen #-------------------------------------------------------------------------- def return_scene $scene = Scene_Menu.new(1) end
end
#============================================================================== # ■ Scene Skill #============================================================================== class Scene_Skill #-------------------------------------------------------------------------- # * Return to Original Screen #-------------------------------------------------------------------------- def return_scene $scene = Scene_Menu.new(2) end
end
Sinon toutes les couleurs sont modifiable dans le module. (la dernière section)
Tu choisi les couleur avec la forme "Color.new(rouge, vert, bleu)" où la couleur est un nombre entre 0 et 255 Color.new(255, 255, 255) => blanc Color.new(0, 0, 0) => noir Color.new(255, 0, 0) => rouge Color.new(0, 0, 255) => bleu ...
Naru-Manga
Poulet carnivore Lv.2
Age : 31 Inscrit le : 24/04/2010 Messages : 27
Sujet: Re: Demande script Menu KH Jeu 20 Mai 2010 - 16:47
Ouais, il est génial et marche parfaitement, merci beaucoup !
gelamine
Mage Lv.11
Age : 26 Avertissements : 3Inscrit le : 03/04/2010 Messages : 512
Sujet: Re: Demande script Menu KH Ven 21 Mai 2010 - 15:55
Merci ! Et lorsque tu auras internet, pourras-tu faire un truc d'options ? C'est Génial ! Quand je dis "Options", c'est pour le système.
EDIT : Quoique non il y a déjà des script il me suffit de rajouter au menu. Sinon, euh... peux-tu faire en sorte que le son du menu soit celui de la map mais que ce soit moins fort dans le menu ?