Belxebu Posted April 20, 2008 Share Posted April 20, 2008 Face Save Menu V.1.0DescrizioneAl posto dei Chara ci saranno i Face nel Save Menu AutoreRinnegatamante(Io,il mio primo script :D) Istruzioni per l'usoSostituite Window_SaveFile con lo script.I face andranno nella cartella Graphics/Pictures e si chiameranno $nome chara personaggio per esempio se il chara di un eroe di nome Leon si chiamerà leonida,il suo face sarà $leonida(è consigliato non sorpassare 96x96 di grandezza #============================================================================== # ** Window_SaveFile #------------------------------------------------------------------------------ # This window displays save files on the save and load screens. #============================================================================== #-------------------------------------------------------- class Window_Base < Window def draw_actor_face_graphic(actor, x, y) bitmap = Cache.face(actor) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw/2, y - ch/2, bitmap, src_rect) end end class Window_SaveFile < Window_Base #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :filename # filename attr_reader :file_exist # file existence flag attr_reader :time_stamp # timestamp attr_reader :selected # selected #-------------------------------------------------------------------------- # * Object Initialization # file_index : save file index (0-3) # filename : filename #-------------------------------------------------------------------------- def initialize(file_index, filename) super(0, 56 + file_index % 4 * 90, 544, 290) @file_index = file_index @filename = filename load_gamedata refresh @selected = false end #-------------------------------------------------------------------------- # * Load Partial Game Data # By default, switches and variables are not used (for expansion use, # such as displaying place names) #-------------------------------------------------------------------------- def load_gamedata @time_stamp = Time.at(0) @file_exist = FileTest.exist?(@filename) if @file_exist file = File.open(@filename, "r") @time_stamp = file.mtime begin @characters = Marshal.load(file) @frame_count = Marshal.load(file) @last_bgm = Marshal.load(file) @last_bgs = Marshal.load(file) @game_system = Marshal.load(file) @game_message = Marshal.load(file) @game_switches = Marshal.load(file) @game_variables = Marshal.load(file) @total_sec = @frame_count / Graphics.frame_rate rescue @file_exist = false ensure file.close end end end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = normal_color name = Vocab::File + " #{@file_index + 1}" self.contents.draw_text(4, 0, 400, WLH, name) @name_width = contents.text_size(name).width if @file_exist draw_party_characters(2002, 1008) draw_playtime(0, 34, contents.width - 4, 2) end end #-------------------------------------------------------------------------- # * Draw Party Characters # x : Draw spot X coordinate # y : Draw spot Y coordinate #-------------------------------------------------------------------------- def draw_party_characters(x, y) for i in 0...@characters.size for i in 0...@characters.size x = 150 + i * 70 draw_actor_face_graphic ("$" + @characters[i][0], x, 30) end #-------------------------------------------------------------------------- # * Draw Play Time # x : Draw spot X coordinate # y : Draw spot Y coordinate # width : Width # align : Alignment #-------------------------------------------------------------------------- def draw_playtime(x, y, width, align) hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 time_string = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.draw_text(x, y, width, WLH, time_string, 2) 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(0, 0, @name_width + 8, WLH) else self.cursor_rect.empty end end end end end Bugs e Conflitti NotiPurtroppo non è compatibile con lo script dei 99 Salvataggi(Taglia alcuni face troppo grandi se si usa anche questo script) Screenshothttp://img379.imageshack.us/img379/7434/facesavemeniumv9.png Link to comment Share on other sites More sharing options...
LeoPS Posted November 12, 2008 Share Posted November 12, 2008 quando vado a salvare mi dà questo errore: "Script 'Scene_File' line 34: NoMethodError occured. undefined method 'selected=' for #<Window_SaveFile:0x171cbe8>" PROGETTI IN CORSO:-Tales of Dragons Link to comment Share on other sites More sharing options...
Ultras Mike Posted February 7, 2010 Share Posted February 7, 2010 quando vado a salvare mi dà questo errore: "Script 'Scene_File' line 34: NoMethodError occured. undefined method 'selected=' for #<Window_SaveFile:0x171cbe8>" Dà lo stesso errore anche a me Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now