| Roi |
 |
 |
Inscrit le: 08 Mai 2005, 15:00 Messages: 2960 Localisation: Lyon Niveau RPG Maker: Expert Logiciel(s) préféré(s): RMXP ; IGM Point(s) Fort(s): HTML5, PHP, Javascript, Ruby Sexe: Masculin Points d'aide: Illimité
Créations :
- RPG JS : Votre RPG en ligne sur votre navigateur
Voir ses créations
|
Menu pour RMVX Suite à la demande : viewtopic.php?f=92&t=102448Auteur : Samarium Créé le : 02/10/09 Fonction : modifie le menu principal. Site du créateur : http://www.rpgcreative.netImage- Code: Tout sélectionner
#---------------------------------------------------- # Menu (RMVX) # # Créé par Samarium
# le 02/10/09
# Fonction : modifie le menu principal.
# Site du créateur : http://www.rpgcreative.net #----------------------------------------------------
class Scene_Menu def initialize(menu_index = 0) @index = menu_index end def main if $game_system.save_disabled @command_window.disable_item(4) end @gold_window = Window_Gold.new(410, 361) @place_window = Window_Place.new(0, 0) @status_window = Window_MenuStatus.new(0, 50) @select_window = Window_Select.new(0, 361) @sprite = [] m = 10 for i in 0...6 @sprite[i] = Sprite.new @sprite[i].bitmap = Cache.picture("select_0" + (i+1).to_s) @sprite[i].x = @sprite[i].width * i + m + 45 m += 10 @sprite[i].y = 370 end @sprite[0].y -= 10 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @gold_window.dispose @status_window.dispose @select_window.dispose @place_window.dispose for i in 0...@sprite.size @sprite[i].dispose end end def update @gold_window.update @status_window.update @select_window.update @place_window.update if @select_window.active update_command return end if @status_window.active update_status return end end def update_command if Input.trigger?(Input::LEFT) Sound.play_cursor @index -= 1 elsif Input.trigger?(Input::RIGHT) Sound.play_cursor @index += 1 end if @index < 0 @index = @sprite.size-1 elsif @index >= @sprite.size @index = 0 end for i in 0...@sprite.size @sprite[i].y = 370 end @sprite[@index].y = 360 if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new return end if Input.trigger?(Input::C) if $game_party.members.size == 0 and @index < 4 $game_system.se_play($data_system.buzzer_se) return end case @index when 0, 2, 3 # Equiper, Compétence, Statut choice_chara when 1 # Objets Sound.play_decision $scene = Scene_Item.new when 4 # Options Sound.play_decision $scene = Scene_Config.new # =>Nouvelle scène when 5 Sound.play_decision $scene = Scene_End.new end return end end def choice_chara Sound.play_decision @select_window.active = false @status_window.active = true @status_window.index = 0 end
def update_status if Input.trigger?(Input::B) Sound.play_cancel @select_window.active = true @status_window.active = false @status_window.index = -1 return end if Input.trigger?(Input::C) case @index when 0 Sound.play_decision $scene = Scene_Equip.new(@status_window.index) when 2 if $game_party.members[@status_window.index].restriction >= 2 Sound.play_cancel return end Sound.play_decision $scene = Scene_Skill.new(@status_window.index) when 3 Sound.play_decision $scene = Scene_Status.new(@status_window.index) end return end end end
class Window_Place < Window_Base def initialize(x, y) super(x, y, 544, 50) create_contents @map_infos = load_data("Data/MapInfos.rvdata") refresh end def refresh self.contents.clear self.contents.font.size = 17 self.contents.draw_text(0, 0, 544, 20, @map_infos[$game_map.map_id].name, 1) end end
class Window_Select < Window_Selectable def initialize(x, y) super(x, y, 410, WLH + 32) refresh end def refresh self.contents.clear end end
class Window_Gold < Window_Base def initialize(x, y) super(x, y, 134, WLH + 32) refresh end def refresh self.contents.clear draw_currency_value($game_party.gold, 4, 0, 92) end end
class Window_MenuStatus < Window_Selectable def initialize(x, y) super(x, y, 544, 313) refresh self.active = false self.index = -1 @item_max = 4 @column_max = 4 end def draw_actor_exp(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 24, 32, "E") self.contents.font.color = normal_color self.contents.draw_text(x + 24, y, 45, 32, actor.exp_s, 2) self.contents.draw_text(x + 70, y, 12, 32, "/", 1) self.contents.draw_text(x + 82, y, 84, 32, actor.next_exp_s) end def draw_icon_menu(item, x, y, enabled = true) if item != nil draw_icon(item.icon_index, x, y, enabled) end end def refresh self.contents.clear self.contents.font.size = 17 @item_max = $game_party.members.size marge = 25 for actor in $game_party.members x = 96 * actor.index + marge marge += 25 draw_actor_face(actor, x, 0, 96) draw_actor_name(actor, x, 98) draw_actor_class(actor, x , 120) draw_icon_menu(actor.equips[0], x, 160) draw_icon_menu(actor.equips[1], x + 64, 160) draw_actor_graphic(actor, x + 42, 192) draw_actor_hp(actor, x, 200, 100) draw_actor_mp(actor, x, 220, 100) draw_actor_level(actor, x, 240) draw_actor_exp(actor, x, 260) end end def update_cursor if @index < 0 self.cursor_rect.empty elsif @index < @item_max self.cursor_rect.set(@index * 120 + 18, 0, 110, contents.height + 8) else self.cursor_rect.set(0, 0, @item_max * 96 ,contents.width ) end end end
|
|