Artia Posted April 18, 2007 Share Posted April 18, 2007 Nome ScriptDescrizioneE' un menu... niente di cheAutoreTibudaIstruzioni per l'usoAvete bisogno dell'SDK 2.2 e del Advanced Command Window di Tibuda, che fra poco posto. Mettetelo come sempre sopra a main.. credo che vada #============================================================================ # ** Tibuda CMS #---------------------------------------------------------------------------- # Tibuda # 1.00 # 04.11.07 # SDK Version : 2.20 full #============================================================================ #------------------------------------------------------------------------------ # * SDK Log Script #------------------------------------------------------------------------------ SDK.log('Tibuda CMS 01', 'Tibuda', 1.00, '04.11.07') #-------------------------------------------------------------------------- # SDK Requirement Check #-------------------------------------------------------------------------- SDK.check_requirements(2.2, [1, 2, 3, 4], ['Map Info', 'Adv Command Window']) #-------------------------------------------------------------------------- # Begin SDK Enabled Check : Tibuda CMS #-------------------------------------------------------------------------- if SDK.enabled?('Tibuda CMS 01') #============================================================================== module CMS #-------------------------------------------------------------------------- # 2: Bottom # 4: Left # 6: Right # 8: Top #-------------------------------------------------------------------------- Position = 8 #-------------------------------------------------------------------------- # #-------------------------------------------------------------------------- Data = {} if SDK.enabled?('Time System') Data['Time'] = proc { $game_time.time } else Data['Elapsed'] = proc { total_sec = Graphics.frame_count / Graphics.frame_rate sprintf("%02d:%02d", total_sec / 60 / 60, total_sec / 60 % 60) } end Data['Gold'] = proc { $game_party.gold } Data['Location'] = proc { $game_map.name } #-------------------------------------------------------------------------- end #============================================================================== class Window_Base #---------------------------------------------------------------------------- def clear_sprites if SDK.enabled?('Window Sprites') while @window_sprites.size > 0 @window_sprites[0].dispose @window_sprites.delete_at(0) end if SDK.enabled?('Animated Chars') @actor_sprites.each { |id, sprite| @actor_sprites[id] = nil } end if SDK.enabled?('Animated Gradient Bars') @hp_bar_sprites.each { |id, sprite| @hp_bar_sprites[id] = nil } @sp_bar_sprites.each { |id, sprite| @sp_bar_sprites[id] = nil } @exp_bar_sprites.each { |id, sprite| @exp_bar_sprites[id] = nil } end end end #---------------------------------------------------------------------------- def draw_actor_battler(actor, x, y, opacity = 255, h = nil) bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) return if bitmap.nil? src_rect = Rect.new(0, 0, bitmap.width, h.nil? ? bitmap.height : h) self.contents.blt(x, y, bitmap, src_rect, opacity) end #---------------------------------------------------------------------------- end #========================================================================== class Window_Data < Window_Base #-------------------------------------------------------------------------- def initialize(label, value) width, height = 160, 64 if label == 'Location' if [2,8].include?(CMS::Position) height += 32 else width += 96 label = '' end end super(0, 0, width, height) self.contents = Bitmap.new(width - 32, height - 32) @label = label @value = value refresh end #-------------------------------------------------------------------------- def refresh self.contents.clear cx = [contents.text_size(@label).width, (width-32)/2].min self.contents.font.color = normal_color cx = 0 if height > 64 @text = @value.call.to_s self.contents.draw_text(4+cx, height > 64 ? 32 : 0, width-40-cx, 32, @text, @label == '' ? 1 : 2) cx = width - 40 if height > 64 self.contents.font.color = system_color self.contents.draw_text(4, 0, cx, 32, @label, 0) end #-------------------------------------------------------------------------- def update super refresh unless @text == @value.call.to_s end #-------------------------------------------------------------------------- end #============================================================================== class Window_Gold < Window_Data def initialize super($data_system.words.gold, proc { $game_party.gold }) end end #============================================================================== class Game_Map def name $data_mapinfos[@map_id].name end end #============================================================================== class Window_MenuStatus #-------------------------------------------------------------------------- def oh 64 end #-------------------------------------------------------------------------- SDK.log_overwrite(:Window_MenuStatus, :initialize) def initialize super(0, 0, 480, 288) self.contents = Bitmap.new(width - 32, $game_party.actors.size * oh) refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- SDK.log_overwrite(:Window_MenuStatus, :refresh) def refresh self.contents.clear clear_sprites @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 64 y = i * oh actor = $game_party.actors[i] draw_actor_battler(actor, x, y, 128, oh) draw_actor_graphic(actor, x - 40, y + 60) draw_actor_level(actor, x + 144, y) draw_actor_name(actor, x, y) draw_actor_exp(actor, x, y + 32) draw_actor_hp(actor, x + 236, y) draw_actor_sp(actor, x + 236, y + 32) end end #-------------------------------------------------------------------------- SDK.log_overwrite(:Window_MenuStatus, :update_cursor_rect) def update_cursor_rect super end #-------------------------------------------------------------------------- end #============================================================================== class Window_Target < Window_Selectable #---------------------------------------------------------------------------- def oh return 64 end #---------------------------------------------------------------------------- SDK.log_overwrite(:Window_Target, :initialize) def initialize super(0, 160, 320, 288) self.contents = Bitmap.new(width - 32, $game_party.actors.size * oh) @item_max = $game_party.actors.size @column_max = 1 refresh end #---------------------------------------------------------------------------- def actor return $game_party.actors[@index] end #---------------------------------------------------------------------------- SDK.log_overwrite(:Window_Target, :refresh) def refresh self.contents.clear clear_sprites for i in 0...$game_party.actors.size x = 64 y = i * oh actor = $game_party.actors[i] x = 64 + i % @column_max * self.width / @column_max y = i * oh / @column_max draw_actor_battler(actor, x, y, 128, oh) draw_actor_graphic(actor, x - 40, y + 60) draw_actor_name(actor, x - 16, y) draw_actor_level(actor, x - 16, y + 32) draw_actor_hp(actor, x + 80, y) draw_actor_sp(actor, x + 80, y + 32) end end #---------------------------------------------------------------------------- SDK.log_overwrite(:Window_Target, :update_cursor_rect) def update_cursor_rect if self.index <= -2 self.cursor_rect.set(0, (self.index + 10) * oh, self.width - 32, 96) elsif self.index == -1 self.cursor_rect.set(-16, -16, self.width, self.height) else super end end #---------------------------------------------------------------------------- end #========================================================================== class Window_Help #-------------------------------------------------------------------------- SDK.log_overwrite(:Window_Help, :initialize) def initialize super(32, 0, 640-64, 64) self.contents = Bitmap.new(width - 32, height - 32) end #-------------------------------------------------------------------------- end #========================================================================== class Scene_Menu #-------------------------------------------------------------------------- SDK.log_overwrite(:Scene_Menu, :main_command_window) def main_command_window # Make command window if [8,2].include?(CMS::Position) width, height, column_max = 640, 96, 4 else width, height, column_max = 160, 32*9, 1 end commands = SDK::Scene_Commands::Scene_Menu::Commands.dup @command_window = Window_Command.new(width, commands, column_max) @command_window.index = $menu_index.is_a?(Numeric) ? $menu_index : 0 @command_window.height = height @command_window.text_align = 0 @command_window.icon_align = 0 @command_window.x = [8,2,4].include?(CMS::Position) ? 0 : 640-160 case CMS::Position when 2 @command_window.y = 480 - 128 when 4 @command_window.y = 96 when 6 @command_window.y = 96 when 8 @command_window.y = 32 end end #-------------------------------------------------------------------------- SDK.log_overwrite(:Scene_Menu, :main_window) def main_window super # Make main command window main_command_window # Make help window if [4,6].include?(CMS::Position) @help_window = Window_Help.new @help_window.y = 32 @command_window.help_window = @help_window end # Make status window @status_window = Window_MenuStatus.new @status_window.x = CMS::Position == 6 ? 0 : 160 @status_window.y = @command_window.y if CMS::Position == 8 @status_window.y += @command_window.height elsif CMS::Position == 2 @status_window.y -= @status_window.height end # Make data windows i = 0 @data_windows = [] CMS::Data.each do |key, value| window = Window_Data.new(key, value) if [2,8].include?(CMS::Position) window.x, window.y = 0, i + @status_window.y i += window.height else window.x, window.y = 32 + i, 480-96 i += window.width end @data_windows << window end end #-------------------------------------------------------------------------- end #========================================================================== class Scene_Item #-------------------------------------------------------------------------- alias_method :tibuda_cms_scnitem_main_window, :main_window def main_window tibuda_cms_scnitem_main_window @item_window.height -= 64 @item_window.y += 32 @help_window.y += 32 if @help_window.y >= 0 if @group_window.is_a?(Window) @group_window.y += 32 @group_window.x += 32 @group_window.width -= 64 @group_window.c_spacing = (@group_window.width - 32) / @group_window.commands.size @group_window.refresh end if @detail_window.is_a?(Window) @detail_window.y += 32 @detail_window.height -= 64 end end #-------------------------------------------------------------------------- end #========================================================================== class Scene_Skill #-------------------------------------------------------------------------- alias_method :tibuda_cms_scnskill_main_window, :main_window def main_window tibuda_cms_scnskill_main_window @skill_window.height -= 64 @skill_window.y -= 32 @status_window.y = 480 - 96 @help_window.y += 32 if @help_window.y >= 0 if @group_window.is_a?(Window) @group_window.y += 32 @group_window.x += 32 @group_window.width -= 64 @group_window.c_spacing = (@group_window.width - 32) / @group_window.commands.size @group_window.refresh end if @detail_window.is_a?(Window) @detail_window.y -= 32 @detail_window.height -= 64 end end #-------------------------------------------------------------------------- end #========================================================================== class Scene_Shop #-------------------------------------------------------------------------- alias_method :tibuda_cms_scnshop_main_window, :main_window def main_window tibuda_cms_scnshop_main_window @buy_window.height -= 64 @buy_window.y += 32 @sell_window.height -= 64 @sell_window.y += 32 @status_window.height -= 64 @status_window.y += 32 @dummy_window.height -= 64 @dummy_window.y += 32 @number_window.height -= 64 @number_window.y += 32 @help_window.y += 32 if @help_window.y >= 0 @command_window.y += 32 @command_window.x += 32 @command_window.width -= 64 @command_window.c_spacing = (@command_window.width - 32) / @command_window.commands.size @command_window.refresh @gold_window.x -= 32 @gold_window.y += 32 if @detail_window.is_a?(Window) @detail_window.y += 32 @detail_window.height -= 64 end end #-------------------------------------------------------------------------- end #========================================================================== class Scene_Equip #-------------------------------------------------------------------------- alias_method :tibuda_cms_scnequip_main_window, :main_window def main_window tibuda_cms_scnequip_main_window if @detail_window.is_a?(Window) @detail_window.y += 32 @detail_window.height -= 64 end for i in 1..5 eval("@item_window#{i}.height -= 64") eval("@item_window#{i}.y += 32") end @help_window.y += 32 if @help_window.y >= 0 @left_window.height -= 64 if @item_window1.x > 0 @left_window.y += 32 @right_window.y += 32 end end #========================================================================== class Scene_File #-------------------------------------------------------------------------- def main_window super # Make help window @help_window = Window_Help.new @help_window.set_text(@help_text) @help_window.y = 64 # Make save file window @savefile_windows = [] for i in 0..2 @savefile_windows << Window_SaveFile.new(i, make_filename(i)) end @savefile_windows[@file_index].selected = true @party_window = Window_SaveParty.new @savefile_windows[@file_index].set_window(@party_window) end #-------------------------------------------------------------------------- def update super # If C button was pressed if Input.trigger?(Input::C) # Call method: on_decision (defined by the subclasses) on_decision(make_filename(@file_index)) $game_temp.last_file_index = @file_index return end # If B button was pressed if Input.trigger?(Input::B) # Call method: on_cancel (defined by the subclasses) on_cancel return end # If the down directional button was pressed if Input.repeat?(Input::DOWN) # If the down directional button pressed down is not a repeat, # or cursor position is more in front than 3 if Input.trigger?(Input::DOWN) or @file_index < 3 # Play cursor SE $game_system.se_play($data_system.cursor_se) # Move cursor down @savefile_windows[@file_index].selected = false @file_index = (@file_index + 1) % 3 @savefile_windows[@file_index].selected = true @savefile_windows[@file_index].set_window(@party_window) return end end # If the up directional button was pressed if Input.repeat?(Input::UP) # If the up directional button pressed down is not a repeat? # or cursor position is more in back than 0 if Input.trigger?(Input::UP) or @file_index > 0 # Play cursor SE $game_system.se_play($data_system.cursor_se) # Move cursor up @savefile_windows[@file_index].selected = false @file_index = (@file_index + 2) % 3 @savefile_windows[@file_index].selected = true @savefile_windows[@file_index].set_window(@party_window) return end end end #-------------------------------------------------------------------------- end #========================================================================== class Window_SaveFile #-------------------------------------------------------------------------- def initialize(file_index, filename) super(0, 128 + file_index % 4 * 96, 320, 96) self.contents = Bitmap.new(width - 32, height - 32) init_filename(file_index, filename) init_filedata(file_index) init_gamedata if @file_exist refresh end #-------------------------------------------------------------------------- def init_gamedata begin file = File.open(@filename, "r") @time_stamp = file.mtime @characters = Marshal.load(file) @frame_count = Marshal.load(file) @game_system = Marshal.load(file) @game_switches = Marshal.load(file) @game_variables = Marshal.load(file) @game_sswitches = 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) @total_sec = @frame_count / Graphics.frame_rate @file_bug = false file.close rescue @file_bug = true end end #-------------------------------------------------------------------------- def refresh self.contents.clear # Draw file number self.contents.font.color = normal_color name = "Slot #{@file_index + 1}" self.contents.draw_text(4, 0, 600, 32, name) @name_width = contents.text_size(name).width # If save file exists if @file_exist unless @file_bug # Draw character x = (self.width.to_f) / 2 - @characters.size.to_f * 32.0 for char in @characters bitmap = RPG::Cache.character(char[0], char[1]) cw = bitmap.rect.width / 4 ch = bitmap.rect.height / 4 src_rect = Rect.new(0, 0, cw, ch) # x -= cw.to_f / 2 self.contents.blt(x.to_i, 68 - ch, bitmap, src_rect, 128) x += 64 end self.contents.draw_text(4, 32, self.width - 40, 32, @game_map.name, 1) else self.contents.draw_text(4, 32, self.width - 40, 32, 'Corrupted', 1) @file_exist = false end # Draw timestamp self.contents.font.color = normal_color time_string = @time_stamp.strftime("%Y/%m/%d %H:%M") self.contents.draw_text(4, 0, self.width - 40, 32, time_string, 2) else self.contents.draw_text(4, 32, self.width - 40, 32, 'Empty', 1) end end #-------------------------------------------------------------------------- def update_cursor_rect if @selected self.cursor_rect.set(-16, -16, width, height) else self.cursor_rect.empty end end #-------------------------------------------------------------------------- def set_window(window) window.refresh(@game_party) end #-------------------------------------------------------------------------- end #============================================================================== class Window_SaveParty < Window_Base #---------------------------------------------------------------------------- def initialize super(320, 128, 320, 288) self.contents = Bitmap.new(width - 32, height - 32) refresh end #---------------------------------------------------------------------------- def refresh(party = nil) self.contents.clear clear_sprites return if party.nil? for i in 0...party.actors.size x = 64 y = i * 64 actor = party.actors[i] draw_actor_battler(actor, x, y, 128, 64) draw_actor_graphic(actor, x - 40, y + 60) draw_actor_name(actor, x - 16, y) draw_actor_level(actor, x - 16, y + 32) draw_actor_hp(actor, x + 80, y) draw_actor_sp(actor, x + 80, y + 32) end end #---------------------------------------------------------------------------- end #========================================================================== if SDK.enabled?('Trickster\'s Bestiary') #========================================================================== class Scene_Bestiary #---------------------------------------------------------------------------- alias_method :tibuda_cms_scnbest_main_window, :main_window def main_window tibuda_cms_scnbest_main_window @command_window.height -= 64 @command_window.y += 32 end #---------------------------------------------------------------------------- end #========================================================================== class Window_Bestiary #-------------------------------------------------------------------------- SDK.log_overwrite(:Window_Bestiary, :initialize) def initialize # Call Window Base#initialize super(160, 32, 480, 480-64) # Setup Contents self.contents = Bitmap.new(width - 32, height - 32) # Set Shadow self.contents.font.shadow = true # Setup Instance Variables @battler = nil # Refresh Window refresh end #-------------------------------------------------------------------------- end #========================================================================== end #========================================================================== if SDK.enabled?('Exseiken\'s Party Switcher') #========================================================================== class Scene_Switch #---------------------------------------------------------------------------- alias_method :tibuda_cms_scnswitch_main_window, :main_window def main_window tibuda_cms_scnswitch_main_window @status_window.visible = false @help_window = Window_Help.new @help_window.y = 64 end #---------------------------------------------------------------------------- alias_method :tibuda_cms_scnswitch_update, :update def update tibuda_cms_scnswitch_update if @party_window.active @help_window.set_text('Who will you replace?') else if @party_window.actor.nil? @help_window.set_text('Who will you add to your party?') else @help_window.set_text("Who will replace #{@party_window.actor.name}?") end end end #---------------------------------------------------------------------------- end #========================================================================== class Window_SwitchParty #---------------------------------------------------------------------------- def oh return 64 end #---------------------------------------------------------------------------- SDK.log_overwrite(:Window_SwitchParty, :initialize) def initialize(max) # Call Window Selectable Initialize super(0, 128, 320, 288) # Setup Item Max @item_max = max.nil? ? Switch_Setup::Party_Max : max # Create Contents self.contents = Bitmap.new(width - 32, @item_max * oh) # Shallow Copy the party @new_party = $game_party.actors.clone # Set Index self.index = 0 # Refresh refresh # Update the cursor rectangle update_cursor_rect end #---------------------------------------------------------------------------- SDK.log_overwrite(:Window_SwitchParty, :refresh) def refresh clear_sprites # Clear the contents of the bitmap self.contents.clear # Draw each non-null party member @new_party.each_with_index do |actor, i| # Skip if actor is nil next if actor == nil x = 64 + i % @column_max * self.width / @column_max y = i * oh / @column_max draw_actor_graphic(actor, x - 40, y + 60) draw_actor_name(actor, x - 16, y) draw_actor_level(actor, x - 16, y + 32) draw_actor_hp(actor, x + 80, y) draw_actor_sp(actor, x + 80, y + 32) @actor_sprites[actor].animate = !actor.mandatory # Skip if actor is mandatory next unless actor.mandatory if SDK.enabled?('Animated Chars') @actor_sprites[actor].tone = Tone.new(0,0,0,255) end # Set Color to Unswitchable Color # self.contents.font.color = Switch_Setup::Unswitchable_Color # Draw Unswitchable Text # self.contents.draw_text(0, y, 224, 32, Switch_Setup::Unswitchable_Text, 1) end end #---------------------------------------------------------------------------- SDK.log_overwrite(:Window_SwitchParty, :update_cursor_rect) def update_cursor_rect super end #---------------------------------------------------------------------------- end #========================================================================== class Window_SwitchReserve #---------------------------------------------------------------------------- def oh return 64 end #---------------------------------------------------------------------------- SDK.log_overwrite(:Window_SwitchReserve, :initialize) def initialize # initialize the window and its contents super(320, 128, 320, 288) # Initialize Actor List @actor_list = [] # Remove all actors that are unavailable (1...$data_actors.size).each do |actor_id| # Get Actor actor = $game_actors[actor_id] # Skip if actor is unavailable next if actor.unavailable or $game_party.actors.include?(actor) # Push Actor @actor_list << actor end # Set the maximum of characters the list can contain @item_max = @actor_list.size + $game_party.actors.size + 1 # 2 columns @column_max = 1 # Setup Contents self.contents = Bitmap.new(width - 32, row_max * oh) # Select the first item @index = 0 # Set to Not Active self.active = false # Refresh refresh # Draw the cursor rectangle update_cursor_rect end #---------------------------------------------------------------------------- SDK.log_overwrite(:Window_SwitchReserve, :refresh) def refresh if SDK.enabled?('Window Sprites') while @window_sprites.size > 0 @window_sprites[0].dispose @window_sprites.delete_at(0) end if SDK.enabled?('Animated Chars') @actor_sprites.each { |id, sprite| @actor_sprites[id] = nil } end if SDK.enabled?('Animated Gradient Bars') @hp_bar_sprites.each { |id, sprite| @hp_bar_sprites[id] = nil } @sp_bar_sprites.each { |id, sprite| @sp_bar_sprites[id] = nil } @exp_bar_sprites.each { |id, sprite| @exp_bar_sprites[id] = nil } end end # Clear the contents of the bitmap self.contents.clear # Run Through Values with index @actor_list.each_with_index do |actor, i| # Skip if actor is nil next if actor == nil x = 64 + i % @column_max * self.width / @column_max y = i * oh / @column_max draw_actor_graphic(actor, x - 40, y + 60) draw_actor_name(actor, x - 16, y) draw_actor_level(actor, x - 16, y + 32) draw_actor_hp(actor, x + 80, y) draw_actor_sp(actor, x + 80, y + 32) end end #---------------------------------------------------------------------------- SDK.log_overwrite(:Window_SwitchReserve, :update_cursor_rect) def update_cursor_rect if self.active super else self.cursor_rect.empty end end #---------------------------------------------------------------------------- end #========================================================================== end #========================================================================== end #-------------------------------------------------------------------------- # End SDK Enabled Test : Tibuda CMS #-------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
Deyan Posted April 20, 2007 Share Posted April 20, 2007 mi da questo errorehttp://img377.imageshack.us/img377/6425/immagineso2.jpg alla riga 13SDK.log('Tibuda CMS 01', 'Tibuda', 1.00, '04.11.07') http://img49.imageshack.us/img49/3363/deyan2pq3.jpg ~La mia skeda in Dragon Ball RPG [+]I miei ProgeTTi http://img266.imageshack.us/img266/2444/2977f117d51ip.gif Link to comment Share on other sites More sharing options...
Ally Posted April 21, 2007 Share Posted April 21, 2007 mi da questo errorehttp://img377.imageshack.us/img377/6425/immagineso2.jpg alla riga 13SDK.log('Tibuda CMS 01', 'Tibuda', 1.00, '04.11.07')Riporto ciò che ha detto artia -.-Avete bisogno dell'SDK 2.2 e del Advanced Command Window di Tibuda, che fra poco posto. Mettetelo come sempre sopra a main Molto carino come menù ^^ http://rpg2s.net/gif/SCContest3Oct.gif Link to comment Share on other sites More sharing options...
Ally Posted April 21, 2007 Share Posted April 21, 2007 mi da questo errorehttp://img377.imageshack.us/img377/6425/immagineso2.jpg alla riga 13SDK.log('Tibuda CMS 01', 'Tibuda', 1.00, '04.11.07') http://rpg2s.net/gif/SCContest3Oct.gif Link to comment Share on other sites More sharing options...
Ally Posted April 21, 2007 Share Posted April 21, 2007 (edited) Potete aggiustare i topic??non so perchè è successo sto casotto XD Edited April 21, 2007 by Ally http://rpg2s.net/gif/SCContest3Oct.gif 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