Delta Membre V.I.P.
Messages postés : 3126 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Problème visuel avec sous menu objet Jeu 16 Juil 2015 - 19:03 | |
| Bonjour, voilà j'ai un problème avec le sous menu objet sur un script modifié par kasbak. C'est la partie modifié ci dessous qui pose problème. En fait voilà le problème quand on veut attribuer un objet depuis le menu quand on selectionne le premier personnage aucun problème. Par contre le carré de sélection ne va pas à la ligne du coup on a un visuel vide qui permet d'utiliser l'objet sur le second personnage Pierre Et lorsque le carré de sélection est sur Pierre c'est Amanda sur laquelle on utilise l'objet 3eme perso. Pareil avec le quatrième perso carré vide deuxième ligne. Pour le visuel voilà le script qui le définie. J'ai essayé en vain de changer le visuel pour l'adapter. J'agrandis le curseur de sélection déplace les élements mais le problème persiste. Comme il s'agit de la démo de Sentinelles que l'on doit sortir pour les Alex et qu'il n'y a plus que quelques jours c'est urgent et ne sachant pas si je pourrai contacter kasbak à temps je fais appel à tout le monde. Merci. Voici la portion de code qui pose problème. - Code:
-
#============================================================================== # ¦ Window_Target #==============================================================================
class Window_Target < Window_Selectable #-------------------------------------------------------------------------- # ? initialize #-------------------------------------------------------------------------- def initialize super(0, 0, 336, 480) #336 480 #Kasbak #@column_max = 1#2 @column_max = 1 @item_max = $game_party.actors.size self.contents = Bitmap.new(width - 32, row_max * 112) self.contents.font.name = $fontface self.contents.font.size = 14#$fontsize/1.2 Font.default_size = 21 $fontface = "Arial"
self.z += 10 refresh end #-------------------------------------------------------------------------- # ? refresh #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...$game_party.actors.size x = i % 1 * 112 + 36 * @column_max y = i / 1 * 112 actor = $game_party.actors[i] #dessine un carré pour séparer les characters, changer couleur transparente par ce que vous voulez #coleur désirée... (methode pour faire un carré ci-dessous) draw_square(x, y, 111, disabled_color) draw_actor_battlegraphic(actor, x, y, 225) draw_actor_graphic(actor, x + 90, y + 50)
draw_actor_name(actor, x + 5, y)
self.contents.draw_text(x + 5, y + 20, 112, 32, "HP : #{actor.hp}") self.contents.draw_text(x + 5, y + 40, 112, 32, "MP : #{actor.sp}")
draw_actor_level(actor, x + 5, y + 60) draw_actor_state(actor, x + 5, y + 80) draw_actor_hp_meter_line(actor, x + 5, y + 23) draw_actor_sp_meter_line(actor, x + 5, y + 43) end end #-------------------------------------------------------------------------- # ? define the page's top row #-------------------------------------------------------------------------- def top_row return self.oy / 112 end #-------------------------------------------------------------------------- # ? define the page maximum rows #-------------------------------------------------------------------------- def page_row_max return (self.height - 32) / 112 end #-------------------------------------------------------------------------- # ? defines a method to change the page's top row #-------------------------------------------------------------------------- def top_row=(row) if row < 0 row = 0 end if row > row_max - 1 row = row_max - 1 end self.oy = row * 112 end #-------------------------------------------------------------------------- # ? update the cursor movement #-------------------------------------------------------------------------- def update_cursor_rect row = @index / @column_max if row < self.top_row self.top_row = row end if row > self.top_row + (self.page_row_max - 1) self.top_row = row - (self.page_row_max - 1) end if @index <= -2 self.cursor_rect.empty elsif @index == -1 self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20) else self.cursor_rect.set(@index % 2 * 112 + 36, @index / 2 * 112- self.oy, 112, 112) end end end Le code en entier gérant différents sous menus - Code:
-
#Menu custom by Kasbak #============================================================================== # ** Window_ShopCommand #------------------------------------------------------------------------------ # This window is used to choose your business on the shop screen. #==============================================================================
class Window_Menu < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(width, commands) super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @column_max = 4 @commands = commands refresh self.index = 0 end #-------------------------------------------------------------------------- # * Create Contents #-------------------------------------------------------------------------- def create_contents self.contents.clear if self.contents self.contents = Bitmap.new(width - 32, height - 32)
end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh create_contents for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # * Draw Item # index : item number #-------------------------------------------------------------------------- def draw_item(index) x = 4 + index * 160 y = index / 2 * 32 self.contents.draw_text(x, y, 128, 32, @commands[index]) end #-------------------------------------------------------------------------- # * Update Cursor Rect #-------------------------------------------------------------------------- def update_cursor_rect # ??????? 0 ????? if @index < 0 self.cursor_rect.empty return end # ??????? row = @index / @column_max # ??????????????????????? if row < self.top_row # ?????????????????? self.top_row = row end # ????????????????????????? if row > self.top_row + (self.page_row_max - 1) # ??????????????????? self.top_row = row - (self.page_row_max - 1) end # ?????????Calculer la largeur du point d'insertion #largeur de la colonne* cursor_width = self.width / @column_max - 85#262 20 38 # ??????????Calculer les coordonnées du curseur x = @index % @column_max * (cursor_width + 30)#ecart gauche a droite y = @index / @column_max * 105 - self.oy # ??????????Mise à jour le rectangle de curseur self.cursor_rect.set(x, y, cursor_width, 75)#75 end end
#============================================================================== # ¦ Game_Party #==============================================================================
class Game_Party #-------------------------------------------------------------------------- # ? define instance variable #-------------------------------------------------------------------------- attr_accessor :actors #-------------------------------------------------------------------------- # Vous pouvez changer le nombre rouge par celui de votre # choix: c'est le nombre max de personne pouvant integrer # votre équipe (par défaut: 20). #-------------------------------------------------------------------------- def add_actor(actor_id) actor = $game_actors[actor_id] if @actors.size < 30 and not @actors.include?(actor) @actors.push(actor) $game_player.refresh end end end
#============================================================================== # ¦ Window_Base #==============================================================================
class Window_Base < Window ##################
#-------------------------------------------------------------------------- # ? draw character's battle sprite #-------------------------------------------------------------------------- def draw_actor_battlegraphic(actor, x, y, opacity = 255) bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) src_rect = Rect.new(0, 0, 111, 111) self.contents.blt(x, y, bitmap, src_rect, opacity)
end #-------------------------------------------------------------------------- # ? draw character's HP meter #-------------------------------------------------------------------------- def refresh self.contents.clear # Window holds numerous graphics that are expensive to redraw for i in 0...$game_party.actors.size # Local Variables from Global for Storing and Positioning actor = $game_party.actors[i] actor_x = i * 160 + 21 #160 + 21 # Draw Actor Name self.contents.font.size = 22 self.contents.font.color = Color.new(255, 255, 255) draw_shadow_text(actor_x - 18, 34, 120, 40, actor.name, align = 0) # HP and SP Values from Stored Values hp = @actor_stats[i][0] maxhp = @actor_stats[i][1] sp = @actor_stats[i][2] maxsp = @actor_stats[i][3] # CP Black Background - Less Redraw in this Window than CP Window self.contents.fill_rect#(actor_x-18, 123, 122, 6, Color.new(0, 0, 0, 255)) # Draws the Sprite Characters and the Battlers draw_actor_graphic(actor, actor_x - 1, 116)#116 # Draw HP and SP Bars using Stored Values for Sync in Child Windows draw_actor_hp_meter_line(actor, actor_x, 72, 96, 12, hp) draw_actor_sp_meter_line(actor, actor_x, 94, 96, 12, sp)
# Draw HP and SP Labels Font.default_size = 12 self.contents.font.size = 12 self.contents.font.color = system_color draw_shadow_text(actor_x, 70, 96, 12, $data_system.words.hp) draw_shadow_text(actor_x, 92, 96, 12, $data_system.words.sp)
end end
#-------------------------------------------------------------------------- # ? define method to draw squares #-------------------------------------------------------------------------- def draw_square(x, y, width, color) self.contents.fill_rect(x, y, width, 1, color) self.contents.fill_rect(x, y, 1, width, color) self.contents.fill_rect(x + width, y, 1, width + 1, color) self.contents.fill_rect(x, y + width, width + 1, 1, color) end end
#======================================================= #Window_Location = Definition #=================================== # Insertion du nom de la map game title $map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end # Insertion du nom de la map game title
# Insertion du nom de la map game map def name
$map_infos[@map_id]
end # Insertion du nom de la map game map #=================================== # Window_Location = Apparance #=================================== class Window_Location < Window_Base #-------------------------------------------------------------------------- def initialize super(0, 0, 300, 180) # super(0, 0, 300, 180) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = "Arial" self.contents.font.size = 24#14 # Definir Windowskin self.windowskin = RPG::Cache.windowskin("") # Definir Windowskin refresh end #-------------------------------------------------------------------------- def refresh self.contents.clear bitmap = RPG::Cache.picture("") self.contents.blt(5, 5, bitmap, Rect.new(0, 0, 250, 130), 255) #self.contents.font.color = Color.new(255, 255, 255, 255) #self.contents.draw_text(10, 60, 120, 32,"Lieu:") #self.contents.font.color = system_color #self.contents.draw_text(20, 70, 200, 32, $game_map.name, 2) self.contents.font.size = 24#14 self.contents.font.color = Color.new(255, 255, 255, 255) self.contents.draw_text(10, 70, 120, 32,"") self.contents.font.color = normal_color #self.contents.font.color = purple2_color
# self.contents.draw_text(20, 70, 200, 32, $game_map.name, 2) self.contents.draw_text(20, 70, 200, 32, $game_map.name) end end ############################# #scene progress add ############################# class Scene_Progress
#--------------------------------------------------------------------------------- def initialize end #---------------------------------------------------------------------------------
def main @window1 = Window_Progress.new @window1.x =160#160 @window1.y =200#200 @window1.height =100 #100 @window1.width = 341#341 #@window1.z = 200 opacity = 0
Graphics.transition loop do Graphics.update Input.update if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # マップ画面に切り替え @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("", 0) $scene = Scene_Menu.new end #update if $scene != self break end end
Graphics.freeze @window1.dispose
end #---------------------------------------------------------------------------------
#--------------------------------------------------------------------------------- def update end #---------------------------------------------------------------------------------
end class Window_Progress < Window_Base
#--------------------------------------------------------------------------------- def initialize super(0, 0, 500,100)#(0, 0, 341,100) self.contents = Bitmap.new(width - 50, height - 32) self.contents.font.name = "Arial" self.contents.font.size = 24 self.contents.font.color = text_color(0) self.contents.draw_text(-80, 22, 33, 33, "")#(20, 0, 33, 33, "Prog") self.contents.draw_text(-45, 0, 33, 33, "")#(55, 0, 33, 33, "ress") self.contents.draw_text(88, 0, 33, 33, " ") #(88, 0, 33, 33, " ") self.contents.draw_text(-10, 0, 33, 33, "") #(110, 0, 33, 33, "% ") draw_actor_barz(0,20,35, "horizontal", 323, 21,$game_variables[100],100) #draw_actor_barz(0,20,35, "horizontal", 255, 28,$game_variables[1],100) @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("", 0)
# Definir Windowskin self.windowskin = RPG::Cache.windowskin("") # Definir Windowskin
end #---------------------------------------------------------------------------------
end
####scene progress end
#============================================================================== # ¦ Window_Gold #------------------------------------------------------------------------------ # le texte a été remplacé par une icone #==============================================================================
class Window_Gold < Window_Base #-------------------------------------------------------------------------- # ? initialize #-------------------------------------------------------------------------- def initialize
super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) #self.contents.font.name = $fontface
#self.contents.font.size = $fontsize
self.opacity = 0
self.contents.font.size = 12 refresh end #-------------------------------------------------------------------------- # ? refresh #-------------------------------------------------------------------------- def refresh self.contents.clear #cx = 24
self.contents.font.size = 20 bitmap = RPG::Cache.icon("") rect = Rect.new(0, 2, 24, 24) #self.contents.blt(124-cx, 0, bitmap, rect) ##add aos menu cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, -8, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = yellow_color self.contents.draw_text(124-cx, -8, cx, 32, $data_system.words.gold, 2) ##fin add end end
#============================================================================== # ¦ Window_PlayTime #------------------------------------------------------------------------------ # cette fenêtre a été compacté pour montrer toutes les commandes dans le menu #==============================================================================
class Window_PlayTime < Window_Base #-------------------------------------------------------------------------- # ? initialize #-------------------------------------------------------------------------- def initialize super (0, 0, 353, 900) #(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) #self.contents.font.name = $fontface self.contents.font.size = 16 #fenetre argent trans ,pour mettre y0 et x0 voir plus bas vers ligne 450... self.opacity = 0 #self.contents.font.size = 12 #self.contents.font.size = 20 refresh end
#-------------------------------------------------------------------------- # ? refresh #-------------------------------------------------------------------------- def refresh self.contents.clear @total_sec = Graphics.frame_count / Graphics.frame_rate hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 text = sprintf("%02d:%02d:%02d", hour, min, sec) #self.contents.font.color = bluepale2_color self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120, 32, text, 2) end #-------------------------------------------------------------------------- # ? redefine update method #-------------------------------------------------------------------------- def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end
#============================================================================== # ¦ Window_MenuStatus #==============================================================================
class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ? initialize #-------------------------------------------------------------------------- def initialize super(0, 0, 480, 480)#(0, 0, 480, 480)900 1440 #360 @column_max = 1#4 @item_max = $game_party.actors.size self.contents = Bitmap.new(width - 32, row_max * 112)#225 self.contents.font.name = $fontface
$fontsize = self.contents.font.size = 18 self.contents.font.size = $fontsize #Font.default_size = 12
#fenetre menu trans self.opacity = 0 #@img_fond = Sprite.new #@img_fond.bitmap = RPG::Cache.picture("Background")
refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- # ? refresh #-------------------------------------------------------------------------- def refresh self.contents.clear
for i in 0...$game_party.actors.size x = i % 1 * 112 #2 112 y = i / 1 * 112 actor = $game_party.actors[i] #dessine un carré pour séparer les characters, changer couleur transparente par ce que vous voulez #couleur désirée... (methode pour faire un carré ci-dessous)
draw_square(x, y, 110, black_color) #draw_actor_battlegraphic(actor, x, y, 255)#Rep #draw_actor_graphic(actor, x + 90, y + 50) #draw_actor_name(actor, x + 5, y) #self.contents.draw_text(x + 5, y + 20, 225, 32, "HP : #{actor.hp}") #self.contents.draw_text(x + 5, y + 40, 225, 32, "MP : #{actor.sp}") #draw_actor_level(actor, x + 5, y + 60) #draw_actor_state(actor, x + 5, y + 80) #draw_actor_hp_meter(actor, x + 5, y + 17) #draw_actor_sp_meter(actor, x + 5, y + 37)
#draw_square(x, y, 110, black_color)#(x, y, 110, black_color) draw_actor_battlegraphic(actor, x, y, 155)#Rep trans du faceset 100 115 155 draw_actor_graphic(actor, x + 88, y + 105)#(actor, x + 88, y + 95)
draw_actor_hp_meter_line(actor, x + 5, y + 66)#(actor, x + 5, y + 175) draw_actor_sp_meter_line(actor, x + 5, y + 86)#(actor, x + 150, y + 175)
#self.contents.font.color = yellow_color self.contents.draw_text(x + 7, y + 53, 225, 32, "HP : #{actor.hp}") #self.contents.font.color = green_color self.contents.draw_text(x + 5, y + 72, 225, 32, "MP : #{actor.sp}")
self.contents.font.color = purple3_color self.contents.font.color = yellow_color draw_actor_level(actor, x + 5, y + 85)
self.contents.font.color = normal_color draw_actor_name(actor, x + 5, y )
self.contents.font.color = purple3_color draw_actor_class(actor, x + 5, y + 14) draw_actor_state(actor, x + 5, y + 28)
end end #-------------------------------------------------------------------------- # ? define the page's top row #-------------------------------------------------------------------------- def top_row return self.oy / 112#225 end #-------------------------------------------------------------------------- # ? define the page maximum rows #-------------------------------------------------------------------------- def page_row_max return (self.height - 32) / 112#225 end #-------------------------------------------------------------------------- # ? defines a method to change the page's top row #-------------------------------------------------------------------------- def top_row=(row) if row < 0 row = 0 end if row > row_max - 1 row = row_max - 1 end self.oy = row * 112#225 end #-------------------------------------------------------------------------- # ? update the cursor movement #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty return end row = @index / @column_max if row < self.top_row self.top_row = row end if row > self.top_row + (self.page_row_max - 1) self.top_row = row - (self.page_row_max - 1) end #self.cursor_rect.set(@index % 4 * 112, @index / 4 * 112 - self.oy, 112, 112) self.cursor_rect.set(@index % 1 * 112, @index / 1 * 112 - self.oy, 112, 112)
end end
#============================================================================== # ¦ Window_Target #==============================================================================
class Window_Target < Window_Selectable #-------------------------------------------------------------------------- # ? initialize #-------------------------------------------------------------------------- def initialize super(0, 0, 336, 480) #336 480 #Kasbak #@column_max = 1#2 @column_max = 1 @item_max = $game_party.actors.size self.contents = Bitmap.new(width - 32, row_max * 112) self.contents.font.name = $fontface self.contents.font.size = 14#$fontsize/1.2 Font.default_size = 21 $fontface = "Arial"
self.z += 10 refresh end #-------------------------------------------------------------------------- # ? refresh #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...$game_party.actors.size x = i % 1 * 112 + 36 * @column_max y = i / 1 * 112 actor = $game_party.actors[i] #dessine un carré pour séparer les characters, changer couleur transparente par ce que vous voulez #coleur désirée... (methode pour faire un carré ci-dessous) draw_square(x, y, 111, disabled_color) draw_actor_battlegraphic(actor, x, y, 225) draw_actor_graphic(actor, x + 90, y + 50)
draw_actor_name(actor, x + 5, y)
self.contents.draw_text(x + 5, y + 20, 112, 32, "HP : #{actor.hp}") self.contents.draw_text(x + 5, y + 40, 112, 32, "MP : #{actor.sp}")
draw_actor_level(actor, x + 5, y + 60) draw_actor_state(actor, x + 5, y + 80) draw_actor_hp_meter_line(actor, x + 5, y + 23) draw_actor_sp_meter_line(actor, x + 5, y + 43) end end #-------------------------------------------------------------------------- # ? define the page's top row #-------------------------------------------------------------------------- def top_row return self.oy / 112 end #-------------------------------------------------------------------------- # ? define the page maximum rows #-------------------------------------------------------------------------- def page_row_max return (self.height - 32) / 112 end #-------------------------------------------------------------------------- # ? defines a method to change the page's top row #-------------------------------------------------------------------------- def top_row=(row) if row < 0 row = 0 end if row > row_max - 1 row = row_max - 1 end self.oy = row * 112 end #-------------------------------------------------------------------------- # ? update the cursor movement #-------------------------------------------------------------------------- def update_cursor_rect row = @index / @column_max if row < self.top_row self.top_row = row end if row > self.top_row + (self.page_row_max - 1) self.top_row = row - (self.page_row_max - 1) end if @index <= -2 self.cursor_rect.empty elsif @index == -1 self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20) else self.cursor_rect.set(@index % 2 * 112 + 36, @index / 2 * 112- self.oy, 112, 112) end end end
#============================================================================== # ¦ Scene_Menu #==============================================================================
class Scene_Menu #-------------------------------------------------------------------------- # ? initialize #--------------------------------------------------------------------------
def initialize(menu_index = 0) @menu_index = menu_index @actor_change = false
@img_fond = Sprite.new @img_fond.bitmap = RPG::Cache.picture("background")
if $game_switches[269] == true @img_fond = Sprite.new @img_fond.bitmap = RPG::Cache.picture("background3")
end
#if $game_switches[5] = true #@img_fond = Sprite.new #@img_fond.bitmap = RPG::Cache.picture("modelclassic")
#end
end
#-------------------- #-------------------------------------------------------------------------- # ? main #--------------------------------------------------------------------------
###########add a sup si bug
#----###################
def main s1 = ""#$data_system.words.item s2 = ""#$data_system.words.equip s3 = ""#$data_system.words.skill s4 = ""#"Status"
s5 = ""#"Clan" s6 = ""#"Biographie"
s7 = ""#"Objectifs" s8 = ""#"Ennemis" s9 = ""#"Statistiques"
s10 = ""#"Sauvegarder" s11 = ""#"Load" s12 = ""#"Quitter"
@command_window = Window_Menu.new(640, [s1, s2, s3, s4, s5, s6, s7,s8,s9,s10,s11,s12]) #160 ###debut test add menu emplacement menu select et opacite ###### @command_window.index = @menu_index @command_window.x = 50 @command_window.y = 60#10 61 @command_window.opacity = 0
#fenetre argent trans ,pour mettre y0 et x0 voir plus bas vers ligne 450... ###### ####fin test menu add menu
@command_window.index = @menu_index if $game_party.actors.size == 0 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) @command_window.disable_item(5)
end if $game_system.save_disabled @command_window.disable_item(4) end
#-----------add variable menu
@Window_Location = Window_Location.new # @location_window.x = 60 # @location_window.y = 280 @Window_Location.x =114# 150 #25 @Window_Location.y =303#365 # 287 #_______________ #@window1 = Window_Progress.new #@window1.x =262 #@window1.y =404
#---- # compteur de temp dans le menu X et y @playtime_window = Window_PlayTime.new @playtime_window.x = -12#122#328 @playtime_window.y = 430#410#218 #224
@gold_window = Window_Gold.new @gold_window.x = 370#428#81 @gold_window.y = 439#415#385#376
#@status_window = Window_MenuStatus.new #@status_window.x = 80 #@status_window.y = 25 #0
# @Meteo_window = Window_Meteo.new # @Meteo_window.x = 0 # @Meteo_window.y = 70
#@window1 = Window_Progress.new #@window1.x =262 #@window1.y =404
@window3 = Window_Progress3.new @window3.x =491 @window3.y =401
@Player_action_window_3 = Window_Player_Action_3.new @Player_action_window_3.x = 0 #295 @Player_action_window_3.y = 0
@status_window = Window_MenuStatus.new @status_window.x = 510 @status_window.y = -12#13#25 #0
Graphics.transition
loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze
@command_window.dispose @playtime_window.dispose #@window1.dispose # # @Meteo_window.dispose @window3.dispose
@status_window.dispose @Window_Location.dispose # @Player_action_window_3.dispose
@gold_window.dispose #@status_window.dispose end #-------------------------------------------------------------------------- # ? update the windows #-------------------------------------------------------------------------- def update @command_window.update
@playtime_window.update
@Window_Location.update
# @Meteo_window.update @window3.update #@window1.update @Player_action_window_3.update @gold_window.update #@status_window.update @status_window.update if @command_window.active update_command return end if @status_window.active update_status return end end #-------------------------------------------------------------------------- # ? update the command window #-------------------------------------------------------------------------- def update_command if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Input.trigger?(Input::C) if $game_party.actors.size == 0 and @command_window.index < 4 $game_system.se_play($data_system.buzzer_se) return end case @command_window.index when 0 # Item $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new
@img_fond = Sprite.new @img_fond.bitmap = RPG::Cache.picture("idee2") $fontsize = 24
when 1 # equip #$game_system.se_play($data_system.decision_se) #@command_window.active = false #@status_window.active = true #@status_window.index = 0 # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to equipment screen $scene = Scene_Equip.new#(@status_window.index) @img_fond = Sprite.new @img_fond.bitmap = RPG::Cache.picture("idee2") $fontsize = 24
when 2 # skill #$game_system.se_play($data_system.decision_se) @command_window.active = false #@status_window.active = true #@status_window.index = 0
# Play decision SE $game_system.se_play($data_system.decision_se) # Switch to skill screen $scene = Scene_Skill.new#(@status_window.index) @img_fond = Sprite.new @img_fond.bitmap = RPG::Cache.picture("idee2") $fontsize = 24
when 3 # Status #$game_system.se_play($data_system.decision_se) @command_window.active = false #@status_window.active = true #@status_window.index = 0 # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to status screen $scene = Scene_Status.new#(@status_window.index) @img_fond = Sprite.new @img_fond.bitmap = RPG::Cache.picture("idee2") $fontsize = 24 #when 4 #$game_system.se_play($data_system.buzzer_se) when 4 # objectifs
$game_system.se_play($data_system.decision_se) # #$scene = Scene_OBJECTIF.new
#$scene = Scene_ST4.new $scene = Scene_Quete.new
when 5 # team $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 #$game_system.se_play($data_system.decision_se) #$scene = Scene_Notebook.new #$scene = Scene_Picture_Gallery.new #$scene = Scene_Index_Action_2.new
# @img_fond = Sprite.new #@img_fond.bitmap = RPG::Cache.picture("Notebook") #when 10 #$game_system.se_play($data_system.buzzer_se) #when 15 # journal #$game_system.se_play($data_system.decision_se) #$scene = Scene_Book.new
when 6 # bio # $game_system.se_play($data_system.decision_se) #@command_window.active = false #@status_window.active = true #@status_window.index = 0
$scene = Scene_Biography.new
#$scene = Scene_PartySwitcher.new #$game_system.se_play($data_system.decision_se) #@command_window.active = false #@status_window.active = true #@status_window.index = 0
#$scene = Scene_Part2.new
when 7 # Ennemis $game_system.se_play($data_system.cancel_se) #$scene = Scene_REPUTATION.new $scene = Scene_Liste_Monstres.new $vientdumenu = 1
@img_fond = Sprite.new @img_fond.bitmap = RPG::Cache.picture("idee2")
when 8 # statistik $game_system.se_play($data_system.decision_se) #$scene = Scene_Biography.new $scene = Scene_End2.new $fontsize = 24
when 9 #help $game_system.se_play($data_system.decision_se) $scene = Scene_Aide.new #$scene = Scene_Quete.new #$scene = Scene_STATS.new #$scene = Scene_ST3.new when 10 # Artwork $game_system.se_play($data_system.decision_se) $scene = Scene_Picture_Gallery.new #if $game_system.save_disabled #$game_system.se_play($data_system.buzzer_se)
#return #end
#$game_system.se_play($data_system.decision_se) #$scene = Scene_Save.new
# @img_fond = Sprite.new #@img_fond.bitmap = RPG::Cache.picture("AOSSOA") #when 9 # $game_system.se_play($data_system.decision_se) # $scene = Scene_NewLoad.new # @img_fond = Sprite.new # @img_fond.bitmap = RPG::Cache.picture("AOSSOA") when 11 # End $game_system.se_play($data_system.decision_se) $scene = Scene_End.new
@img_fond = Sprite.new @img_fond.bitmap = RPG::Cache.picture("idee2")
$fontsize = 24 end return end end #-------------------------------------------------------------------------- # ? update the status window #-------------------------------------------------------------------------- def update_status if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @status_window.active = false
@actor_change = false
@status_window.index = 0 @status_window.index = -1 return end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) case @command_window.index
when 1 # Equip $game_system.se_play($data_system.decision_se) $scene = Scene_Equip.new(@status_window.index) when 2 # Skill 1 if $game_party.actors[@status_window.index].restriction >= 2 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Skill.new(@status_window.index) when 3 # Status $game_system.se_play($data_system.decision_se) $scene = Scene_Status.new(@status_window.index) when 5 # party actors switch if @actor_change == true $game_system.se_play($data_system.decision_se) $game_party.actors[@old_index] = $game_party.actors[@status_window.index] $game_party.actors[@status_window.index] = @new_actor $game_player.refresh @actor_change = false @status_window.refresh return end @old_index = @status_window.index @new_actor = $game_party.actors[@status_window.index] @actor_change = true end return end end end
#============================================================================== # ¦ Scene_Battle (Part 1) #==============================================================================
class Scene_Battle #-------------------------------------------------------------------------- # ? main #-------------------------------------------------------------------------- def main $game_temp.in_battle = true $game_temp.battle_turn = 0 $game_temp.battle_event_flags.clear $game_temp.battle_abort = false $game_temp.battle_main_phase = false $game_temp.battleback_name = $game_map.battleback_name $game_temp.forcing_battler = nil $game_system.battle_interpreter.setup(nil, 0) @troop_id = $game_temp.battle_troop_id $game_troop.setup(@troop_id) #memorize actors in party and cut the party down to 4 actors @party_mem = $game_party.actors $game_party.actors = $game_party.actors[0..3] s1 = $data_system.words.attack s2 = $data_system.words.skill s3 = $data_system.words.guard s4 = $data_system.words.item @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4]) @actor_command_window.y = 160 @actor_command_window.back_opacity = 160 @actor_command_window.active = false @actor_command_window.visible = false @party_command_window = Window_PartyCommand.new @help_window = Window_Help.new @help_window.back_opacity = 160 @help_window.visible = false @status_window = Window_BattleStatus.new @message_window = Window_Message.new @spriteset = Spriteset_Battle.new @wait_count = 0 if $data_system.battle_transition == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition) end start_phase1 loop do Graphics.update Input.update update if $scene != self break end end $game_map.refresh Graphics.freeze @actor_command_window.dispose @party_command_window.dispose @help_window.dispose @status_window.dispose @message_window.dispose if @skill_window != nil @skill_window.dispose end if @item_window != nil @item_window.dispose end if @result_window != nil @result_window.dispose end @spriteset.dispose if $scene.is_a?(Scene_Title) Graphics.transition Graphics.freeze end if $BTEST and not $scene.is_a?(Scene_Gameover) $scene = nil end end #-------------------------------------------------------------------------- # ? battle end #-------------------------------------------------------------------------- def battle_end(result) $game_temp.in_battle = false $game_party.clear_actions for actor in $game_party.actors actor.remove_states_battle end $game_troop.enemies.clear if $game_temp.battle_proc != nil $game_temp.battle_proc.call(result) $game_temp.battle_proc = nil end $game_party.actors = @party_mem $scene = Scene_Map.new end end
#============================================================================== # ■ Scene_NewLoad #==============================================================================
class Scene_NewLoad < Scene_File
def initialize
$game_temp = Game_Temp.new $game_temp.last_file_index = 0 latest_time = Time.at(0) for i in 0..3 filename = make_filename(i) if FileTest.exist?(filename) file = File.open(filename, "r") if file.mtime > latest_time latest_time = file.mtime $game_temp.last_file_index = i end file.close end end super("Which file do you wish to load from?") end
def on_decision(filename) unless FileTest.exist?(filename) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.load_se) file = File.open(filename, "rb") read_save_data(file) file.close $game_system.bgm_play($game_system.playing_bgm) $game_system.bgs_play($game_system.playing_bgs) $game_map.update $scene = Scene_Map.new end
def on_cancel $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(9) end ########retour case load def read_save_data(file) characters = Marshal.load(file) Graphics.frame_count = Marshal.load(file) $game_system = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = Marshal.load(file) $game_screen = Marshal.load(file) $game_actors = Marshal.load(file) $game_party = Marshal.load(file) $game_troop = Marshal.load(file) $game_map = Marshal.load(file) $game_player = Marshal.load(file) $game_time =Marshal.load(file) if $game_system.magic_number != $data_system.magic_number $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end $game_party.refresh end end
En sachant que comme le script gére beaucoup de choses et renvoit vers de multiples script il faudrait pas que ça détraque autre chose. |
|