| Artisan (Nv 5) |
 |
Inscrit le: 22 Nov 2011, 22:01 Messages: 199 Niveau RPG Maker: Moyen Logiciel(s) préféré(s): RPG Maker XP Point(s) Fort(s): Scripts Sexe: Masculin Points d'aide: 17/60
Créations :
Voir ses créations
|
Salut Dream's,
Voilà le menu que tu as à peu près demandé. Je rajouterais deux trois trucs plus tard. Tu peux bidouiller ce que tu veux dans le module Config, j'ai tout commenté, ou presque.Screen:- Code: Tout sélectionner
# ============================================================================== # ■ Module Config # ----------------- # Auteur: Bad_maker # ============================================================================== module Config BACKGROUND = nil # Nom du fond d'écran à utiliser (Image à placer dans le # dossier Title). BACKGROUND = "nom de l'image" FONTNAME = "Arial" # Nom de la police utilisée FONTSIZE = 18 # Taille du texte des fenêtres WOFFOPACITY = 105 # Opacité des fenêtres désactivées WONOPACITY = 255 # Opacité des fenêtres activées WMULTINFOS9 = true # False pour désactiver la fenêtre informative (Or, Pas...) WMULTINFOSX = 0 # Position x de la fenêtre informative WMULTINFOSY = 384 # Position y de la fenêtre informative WMULTINFOSWIDTH = 192 # Largeur de la fenêtre informative WMULTINFOSHEIGHT = 96 # Hauteur de la fenêtre informative # ---------------------------------------------- # Modifications des éléments à l'intérieur de la fenêtre informative # ---------------------------------------------- WMSPTIME9 = true # False pour cacher le temps WMSPTIMEX = 32 # Position x du temps WMSPTIMEY = 0 # Position y du temps WMSPTIMEI9 = true # False pour cacher l'icône du temps WMSPTIMEINAME = "Sablier 1" # Nom de l'icône du temps WMSPTIMEIX = 0 # Position x de l'icône du temps WMSPTIMEIY = 0 # Position y de l'icône du temps WMSSTEPS9 = true # False pour cacher le nombre de pas WMSSTEPSX = 32 # Position x du nombre de pas WMSSTEPSY = 20 # Position y du nombre de pas WMSSTEPSI9 = true # False pour cacher l'icône du nombre de pas WMSSTEPSINAME = "020-Accessory05" # Nom de l'icône du nombre de pas WMSSTEPSIX = 0 # Position x de l'icône du nombre de pas WMSSTEPSIY = 20 # Position y de l'icône du nombre de pas WMSGOLD9 = true # False pour cacher la monnaie WMSGOLDX = 32 # Position x de la monnaie WMSGOLDY = 40 # Position y de la monnaie WMSGOLDI9 = true # False pour cacher l'icône de la monnaie WMSGOLDINAME = "032-Item01" # Nom de l'icône de la monnaie WMSGOLDIX = 0 # Position x de l'icône de la monnaie WMSGOLDIY = 40 # Position y de l'icône de la monnaie # ---------------------------------------------- WASSCROLL = true # false pour que les fenêtres des stats des personnages # soient reconnues comme étant verticales WASX = 0 # Position x des fenêtres des stats des personnages WASWIDTH = 640 # Largeur des fenêtres des stats des personnages WASHEIGHT = 96 # Hauteur des fenêtres des stats des personnages FIRSTWXPOS = 0 # Position x de la première fenêtre des stats des personnages FIRSTWYPOS = 0 # Position y de la première fenêtre des stats des personnages WXDISTANCE = 0 # Distance x entre chaque fenêtre des stats des personnages WYDISTANCE = 0 # Distance y entre chaque fenêtre des stats des personnages # ---------------------------------------------- # Modifications des éléments à l'intérieur de la fenêtre des stats # des personnages. # ---------------------------------------------- WASBATTLER9 = true # False pour cacher le battler WASBATTLERX = 0 # Position x du battler WASBATTLERY = -16 # Position y du battler WASCHARA9 = true # False pour cacher le character WASCHARAX = 320 # Position x du character WASCHARAY = 8 # Position y du character WASNAME9 = true # False pour cacher le nom WASNAMEX = 360 # Position x du nom WASNAMEY = 0 # Position y du nom WASCLAS9 = true # False pour cacher la classe WASCLASX = 360 # Position x de la classe WASCLASY = 20 # Position y de la classe WASLVL9 = true # False pour cacher le niveau WASLVLX = 360 # Position x du niveau WASLVLY = 40 # Position x du niveau WASEXP9 = false # True pour afficher l'expérience WASEXPX = 0 # Position x de l'expérience WASEXPY = 0 # Position y de l'expérience TXTCOLOR = true # False pour que la couleur des hp/sp ne changent pas COLOR1 = Color.new(50,255,50,255) # Couleur hp/sp quand ils sont au max COLOR2 = Color.new(150,150,255,255) # Couleur hp/sp quand ils sont <= à 15% WASOHP9 = true # True pour afficher les hp sans les hp max WASOHPX = 466 # Position x des hp sans les hp max WASOHPY = 0 # Position y des hp sans les hp max WASOSP9 = true # True pour afficher les sp sans les sp max WASOSPX = 466 # Position x des sp sans les sp max WASOSPY = 20 # Position y des sp sans les sp max WASHP9 = true # False pour cacher les hp WASHPX = 466 # Position x des hp WASHPY = 0 # Position y des hp WASSP9 = true # False pour cacher les sp WASSPX = 466 # Position x des sp WASSPY = 20 # Position y des sp WASSTATE9 = true # False pour cacher les statuts WASSTATEX = 466 # Position x des statuts WASSTATEY = 40 # Position y des statuts # ---------------------------------------------- WSMX = 192 # Position x de la fenêtre principale WSMY = 384 # Position y de la fenêtre principale WSMWIDTH = 448 # Largeur de la fenêtre principale WSMHEIGHT = 96 # Hauteur de la fenêtre principale WSMTEXTPOS = 1 # Position du texte de la fenêtre principale # 0: Aligné à gauche | 1: Centré | 2: Aligné à gauche # ---------------------------------------------- # Voilà les modifications que vous pouvez faire s'arrêtent ici, # ne toucher pas à ce qui suit. # ---------------------------------------------- WASHP9 = false if WASOHP9 == true WASSP9 = false if WASOSP9 == true end
# ============================================================================== # ● Window_Base # ============================================================================== class Window_Base < Window def draw_icon(name,x,y) bitmap = RPG::Cache.icon(name) src_rect = Rect.new(0,0,bitmap.width,bitmap.height) self.contents.blt(x,y,bitmap,src_rect) end def draw_actor_battler(actor,x,y) bitmap = RPG::Cache.battler(actor.character_name, actor.character_hue) src_rect = Rect.new(0,0,bitmap.width,bitmap.height) self.contents.blt(x,y,bitmap,src_rect) end def draw_actor_ohp(actor,x,y,width=144) self.contents.draw_text(x,y,32,32,$data_system.words.hp) self.contents.draw_text(x+10,y,48,32,actor.hp.to_s,2) end def draw_actor_osp(actor,x,y,width=144) self.contents.draw_text(x,y,32,32,$data_system.words.sp) self.contents.draw_text(x+10,y,48,32,actor.sp.to_s,2) end end
# ============================================================================== # ● Window_ActorsStatsMenu # ----------------- # Auteur: Bad_maker # ============================================================================== class Window_ActorsStatsMenu < Window_Base def initialize(actor,x,y) w = Config::WASWIDTH h = Config::WASHEIGHT super(x,y,w,h) self.contents = Bitmap.new(w-32,h-32) self.contents.font.name = Config::FONTNAME self.contents.font.size = Config::FONTSIZE refresh(actor) end def refresh(actor) self.contents.clear color1 = Config::COLOR1 color2 = Config::COLOR2 hpactormax = false ; spactormax = false hpactormin = false ; spactormin = false hpactormax = true if actor.hp == actor.maxhp spactormax = true if actor.sp == actor.maxsp hpactormin = true if actor.hp <= actor.maxhp*0.15 spactormin = true if actor.sp <= actor.maxsp*0.15 wasbatx = Config::WASBATTLERX ; wasbaty = Config::WASBATTLERY waschax = Config::WASCHARAX+16 ; waschay = Config::WASCHARAY+48 wasnamx = Config::WASNAMEX ; wasnamy = Config::WASNAMEY wasclsx = Config::WASCLASX ; wasclsy = Config::WASCLASY waslvlx = Config::WASLVLX ; waslvly = Config::WASLVLY wasexpx = Config::WASEXPX ; wasexpy = Config::WASEXPY wasohpx = Config::WASOHPX ; wasohpy = Config::WASOHPY wasospx = Config::WASOSPX ; wasospy = Config::WASOSPY washpx = Config::WASHPX ; washpy = Config::WASHPY wasspx = Config::WASSPX ; wasspy = Config::WASSPY wasstatex = Config::WASSTATEX ; wasstatey = Config::WASSTATEY self.draw_actor_battler(actor, wasbatx, wasbaty) if Config::WASBATTLER9 self.draw_actor_graphic(actor, waschax, waschay) if Config::WASCHARA9 self.draw_actor_name(actor, wasnamx, wasnamy) if Config::WASNAME9 self.draw_actor_class(actor, wasclsx, wasclsy) if Config::WASCLAS9 self.draw_actor_level(actor, waslvlx, waslvly) if Config::WASLVL9 self.draw_actor_exp(actor, wasexpx, wasexpy) if Config::WASEXP9 self.contents.font.color = color1 if Config::TXTCOLOR and hpactormax self.contents.font.color = color2 if Config::TXTCOLOR and hpactormin self.draw_actor_ohp(actor, wasohpx, wasohpy) if Config::WASOHP9 self.contents.font.color = normal_color self.contents.font.color = color1 if Config::TXTCOLOR and spactormax self.contents.font.color = color2 if Config::TXTCOLOR and spactormin self.draw_actor_osp(actor, wasospx, wasospy) if Config::WASOSP9 self.contents.font.color = normal_color self.contents.font.color = color1 if Config::TXTCOLOR and hpactormax self.contents.font.color = color2 if Config::TXTCOLOR and hpactormin self.draw_actor_hp(actor, washpx, washpy) if Config::WASHP9 self.contents.font.color = normal_color self.contents.font.color = color1 if Config::TXTCOLOR and spactormax self.contents.font.color = color2 if Config::TXTCOLOR and spactormin self.draw_actor_sp(actor, wasspx, wasspy) if Config::WASSP9 self.contents.font.color = normal_color self.draw_actor_state(actor, wasstatex, wasstatey) if Config::WASSTATE9 end end
# ============================================================================== # ● Window_MultInfos # ----------------- # Auteur: Bad_maker # ============================================================================== class Window_MultInfos < Window_Base def initialize x = Config::WMULTINFOSX y = Config::WMULTINFOSY w = Config::WMULTINFOSWIDTH h = Config::WMULTINFOSHEIGHT super(x,y,w,h) self.contents = Bitmap.new(w-32,h-32) self.contents.font.name = Config::FONTNAME self.contents.font.size = Config::FONTSIZE self.opacity = Config::WONOPACITY refresh end def refresh self.contents.clear self.contents.font.color = system_color @total_sec = Graphics.frame_count / Graphics.frame_rate hour = @total_sec / 60 / 60 ; min = @total_sec / 60 % 60 sec = @total_sec % 60 time = sprintf("Temps : %02d:%02d:%02d", hour, min, sec) steps = "Pas : #{$game_party.steps}" gold = "#{$data_system.words.gold} : #{$game_party.gold}" wmsptx = Config::WMSPTIMEX ; wmspty = Config::WMSPTIMEY wmsstx = Config::WMSSTEPSX ; wmssty = Config::WMSSTEPSY wmsgdx = Config::WMSGOLDX ; wmsgdy = Config::WMSGOLDY wmsptix = Config::WMSPTIMEIX ; wmsptiy = Config::WMSPTIMEIY wmsstix = Config::WMSSTEPSIX ; wmsstiy = Config::WMSSTEPSIY wmsgdix = Config::WMSGOLDIX ; wmsgdiy = Config::WMSGOLDIY ti=Config::WMSPTIMEINAME;si=Config::WMSSTEPSINAME;gi=Config::WMSGOLDINAME self.contents.draw_text(wmsptx,wmspty,120,32,time) if Config::WMSPTIME9 self.contents.draw_text(wmsstx,wmssty,120,32,steps) if Config::WMSSTEPS9 self.contents.draw_text(wmsgdx,wmsgdy,120,32,gold) if Config::WMSGOLD9 self.draw_icon(ti,wmsptix,wmsptiy) if Config::WMSPTIMEI9 self.draw_icon(si,wmsstix,wmsstiy) if Config::WMSSTEPSI9 self.draw_icon(gi,wmsgdix,wmsgdiy) if Config::WMSGOLDI9 end def update ; super refresh if Graphics.frame_count / Graphics.frame_rate != @total_sec end end
# ============================================================================== # ● Window_MenuSelection # ----------------- # Auteur: Bad_maker # ============================================================================== class Window_MenuSelection < Window_Selectable def initialize x = Config::WSMX y = Config::WSMY w = Config::WSMWIDTH h = Config::WSMHEIGHT super(x,y,w,h) self.contents = Bitmap.new(w-32,h-32) self.contents.font.name = Config::FONTNAME self.contents.font.size = Config::FONTSIZE self.opacity = Config::WONOPACITY self.active = true self.index = 0 a = "Objets" ; b = "Compétences" ; c = "Equipement" d = "Statuts" ; e = "Sauvegarder" ; f = "Quitter" @item = [a,b,c,d,e,f] unless $game_system.save_disabled @item = [a,b,c,d,f] if $game_system.save_disabled @c = Config::WSMTEXTPOS @sens = false @hue = 0 refresh end def refresh self.contents.clear x = 0 max = @item.size-1 @item1=@item[self.index-1] if self.index != 0 @item2=@item[self.index] @item3=@item[self.index+1] if self.index != max self.contents.draw_text(x,0,width-32,24,@item1,@c)if self.index != 0 self.contents.draw_text(x,20,width-32,24,@item2,@c) self.contents.draw_text(x,40,width-32,24,@item3,@c)if self.index != max end def update refresh update_cursor_rect max = @item.size-1 if Input.repeat?(Input::UP) and self.index != 0 $game_system.se_play($data_system.cursor_se) ; self.index -= 1 elsif Input.repeat?(Input::DOWN) and self.index != max $game_system.se_play($data_system.cursor_se) ; self.index += 1 end end def update_cursor_rect if @index < 0 ; self.cursor_rect.empty else ; self.cursor_rect.set(0,22,width-32,20) end end end
# ============================================================================== # ■ Scene_Menu # ----------------- # Auteur: Bad_maker # ============================================================================== class Scene_Menu def initialize(menu_index = 0) @menu_index = menu_index @actor_index = 0 end def main @savedisabled = false @savedisabled |= $game_system.save_disabled create_graphics perform_transition Input.update loop do Graphics.update Input.update update break if $scene != self end Graphics.update Graphics.freeze terminate end def create_graphics unless Config::BACKGROUND == nil @background = Sprite.new @background.bitmap = RPG::Cache.title(Config::BACKGROUND) end @actor_window = [] x = Config::FIRSTWXPOS y = Config::FIRSTWYPOS if Config::WASSCROLL == true for i in 0..$game_party.actors.size-1 actor = $game_party.actors[i] @actor_window[i] = Window_ActorsStatsMenu.new(actor,x,y) y += Config::WYDISTANCE + @actor_window[i].height @actor_window[i].opacity = Config::WOFFOPACITY end elsif Config::WASSCROLL == false for i in 0..$game_party.actors.size-1 actor = $game_party.actors[i] @actor_window[i] = Window_ActorsStatsMenu.new(actor,x,y) x += Config::WXDISTANCE + @actor_window[i].width @actor_window[i].opacity = Config::WOFFOPACITY end end @infos_window = Window_MultInfos.new if Config::WMULTINFOS9 @menu_window = Window_MenuSelection.new end def perform_transition Graphics.transition(20) end def update @infos_window.update if Config::WMULTINFOS9 update_menu_window if @menu_window.active update_actor_selection unless @menu_window.active end def update_menu_window @menu_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new elsif Input.trigger?(Input::C) Input.update if @menu_window.index < 4 $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new if @menu_window.index == 0 if @menu_window.index > 0 @menu_window.active = false @menu_window.opacity = Config::WOFFOPACITY @actor_window[@actor_index].opacity = Config::WONOPACITY end elsif @menu_window.index >= 4 if @savedisabled == false $game_system.se_play($data_system.decision_se) $scene = Scene_Save.new if @menu_window.index == 4 $scene = Scene_End.new if @menu_window.index == 5 elsif @savedisabled == true $game_system.se_play($data_system.decision_se) $scene = Scene_End.new if @menu_window.index == 4 end end end end def update_actor_selection for i in 0..$game_party.actors.size-1 @actor_window[i].opacity = Config::WONOPACITY if @actor_index == i @actor_window[i].opacity = Config::WOFFOPACITY unless @actor_index == i end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $scene = Scene_Skill.new(@actor_index) if @menu_window.index == 1 $scene = Scene_Equip.new(@actor_index) if @menu_window.index == 2 $scene = Scene_Status.new(@actor_index) if @menu_window.index == 3 elsif Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @actor_window[@actor_index].opacity = Config::WOFFOPACITY @menu_window.active = true @menu_window.opacity = Config::WONOPACITY end if Config::WASSCROLL == true if Input.repeat?(Input::UP) if @actor_index > 0 $game_system.se_play($data_system.cursor_se) @actor_index -= 1 end end if Input.repeat?(Input::DOWN) if @actor_index < $game_party.actors.size-1 $game_system.se_play($data_system.cursor_se) @actor_index += 1 end end elsif Config::WASSCROLL == false if Input.repeat?(Input::LEFT) if @actor_index > 0 $game_system.se_play($data_system.cursor_se) @actor_index -= 1 end end if Input.repeat?(Input::RIGHT) if @actor_index < $game_party.actors.size-1 $game_system.se_play($data_system.cursor_se) @actor_index += 1 end end end end def terminate @background.dispose unless Config::BACKGROUND == nil for i in 0..$game_party.actors.size-1 @actor_window[i].dispose end @infos_window.dispose if Config::WMULTINFOS9 @menu_window.dispose end end
_________________
--- Bad_maker ---
_________________
3 PA donné(s) par Samarium le 10 Fvrier 2012
Dernière édition par Bad_maker le 10 Fév 2012, 18:49, édité 1 fois au total.
|
|