############################################################################# # # ¸¸µçÀÌ : ÄÚ¾ÆÄÚ½ºÆ¬ # ½ºÅ©¸³Æ® ¹èÆ÷ ÆÄÀϸí : CoaMenu2Ver2.0.txt # # ¼öÁ¤µÈÁ¡ : ÀúÀå, ºÒ·¯¿À±â ¸Þ´º¸¦ ¼±ÅÃÇÑµÚ # Ãë¼ÒÇÏ¸é ´Ù¸¥°÷ÀÌ ¼±ÅõǾî ÀÖ´øÁ¡ ¼öÁ¤ # # # ############################################################################# class Window_Base < Window SYSTEM_WORD_EVA = "ȸÇÇ" # #-------------------------------------------------------------------------- # * Draw Parameter # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # type : parameter type (0-6) #-------------------------------------------------------------------------- def draw_actor_parameter(actor, x, y, type) case type when 0 parameter_name = $data_system.words.atk parameter_value = actor.atk when 1 parameter_name = $data_system.words.pdef parameter_value = actor.pdef when 2 parameter_name = $data_system.words.mdef parameter_value = actor.mdef when 3 parameter_name = $data_system.words.str parameter_value = actor.str when 4 parameter_name = $data_system.words.dex parameter_value = actor.dex when 5 parameter_name = $data_system.words.agi parameter_value = actor.agi when 6 parameter_name = $data_system.words.int parameter_value = actor.int when 7 # parameter_name = SYSTEM_WORD_EVA # parameter_value = actor.eva # end self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, parameter_name) self.contents.font.color = normal_color self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2) end end #============================================================================== # InfoWindow #============================================================================== class Window_Info < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(480, 0, 160, 220) #Create Bitmap self.contents = Bitmap.new(width - 32, height - 32) #Z-Pos self.z = 100 self.back_opacity = 160 #Refresh and add the contents to window refreshb refreshc refreshd end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refreshb #Draw Steps self.contents.font.color = system_color self.contents.draw_text(0,-5,120,32,'°ÉÀ½¼ö') self.contents.font.color = normal_color self.contents.draw_text(0,14, 120, 32, $game_party.steps.to_s, 2) end def refreshc #Draw Play Time self.contents.font.color = system_color self.contents.draw_text(0,63,120,32,'Ç÷¹ÀÌ ½Ã°£') @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 = normal_color self.contents.draw_text(0, 82, 120, 32, text) end def refreshd #Draw Gold #Advanced Gold Display mini-script by Dubealex. case $game_party.gold when 0..9999 gold = $game_party.gold when 10000..99999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+array[1].to_s+","+array[2].to_s+array[3].to_s+array[4].to_s when 100000..999999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+array[1].to_s+array[2].to_s+","+array[3].to_s+array[4].to_s+array[5].to_s when 1000000..9999999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+","+array[1].to_s+array[2].to_s+array[3].to_s+","+array[4].to_s+array[5].to_s+array[6].to_s end self.contents.font.color = system_color gold_word = $data_system.words.gold.to_s cx = contents.text_size(gold_word).width cx2=contents.text_size(gold.to_s).width self.contents.draw_text(0,101,200-cx-2,101,gold_word) self.contents.font.color = normal_color self.contents.draw_text(118-cx2+2, 120, cx2, 120, gold.to_s, 2) end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec self.contents.clear refreshb refreshc refreshd end end end #============================================================================== # Scene_Menu #============================================================================== class Scene_Menu def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # * Main - Handles drawing/disposing windows and the main loop #-------------------------------------------------------------------------- def main #Draw Windows main_draw #Execute transition Graphics.transition #Main Loop loop do #Main Loop main_loop break if main_scenechange? end #Prepare for transition Graphics.freeze #Dispose Windows main_dispose end #-------------------------------------------------------------------------- # * Main Draw - Handles drawing windows #-------------------------------------------------------------------------- def main_draw #Draw Background @background = Spriteset_Map.new #Draw Windows # InfoWindow @info_window = Window_Info.new # MenuStatus # MenuCommand s1='¾ÆÀÌÅÛ' s2='ÀúÀå' s3='ºÒ·¯¿À±â' s4='½Ã½ºÅÛ ¸Þ´º' o1='¸ÞÀθ޴º' o2='°ÔÀÓÁ¾·á' @command_window = Window_Command.new(160,[s1,s2,s3,s4]) @command_window.back_opacity = 160 @command_window.index = @menu_index @command_window.x = 480 @command_window.y = 220 @command_window.height = 260 # If number of party members is 0 if $game_party.actors.size == 0 # Disable items, skills, equipment, and status @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end @sys_command_window = Window_Command.new(128,[o1,o2]) @sys_command_window.back_opacity = 160 @sys_command_window.visible = false @sys_command_window.active = false @sys_command_window.x=353 @sys_command_window.y=300 if $game_system.save_disabled @sys_command_window.disable_item(0) end end #-------------------------------------------------------------------------- # * Main Scene Change #-------------------------------------------------------------------------- def main_scenechange? # Abort loop if screen is changed if $scene != self return true end return false end #-------------------------------------------------------------------------- # * Main Dispose #-------------------------------------------------------------------------- def main_dispose #Dispose Background @background.dispose # Dispose All Windows # Dispose InfoWindow @info_window.dispose # Dispose MenuStatus # Dispose MenuCommand @command_window.dispose @sys_command_window.dispose end #-------------------------------------------------------------------------- # * Main Loop #-------------------------------------------------------------------------- def main_loop # Update game screen Graphics.update # Update input information Input.update # Frame update update end #-------------------------------------------------------------------------- # * Update #-------------------------------------------------------------------------- def update # Update Windows update_windows if @sys_command_window.active @sys_command_window.z = +500 end # If command window is active: call update_command if @command_window.active update_command return end # If system menu window is active: call update_sys_command if @sys_command_window.active update_sys_command return end # If status window is active: call update_status if @status_window.active update_status return end end #-------------------------------------------------------------------------- # * Window Update #-------------------------------------------------------------------------- def update_windows # Update MenuCommand @command_window.update if @command_window.visible @sys_command_window.update if @sys_command_window.visible @info_window.update end #-------------------------------------------------------------------------- # * Update Menu Command #-------------------------------------------------------------------------- def update_command # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to map screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C)# If command other than save or end game, and party members = 0 if $game_party.actors.size == 0 and @command_window.index < 4 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Branch by command window cursor position mitem = 0 msave = 1 mload = 2 msystem = 3 case @command_window.index when 0 # Item @menu_index = mitem # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to item screen $scene = Scene_Item.new when 1 # Save @menu_index = msave # If saving is forbidden if $game_system.save_disabled # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to save screen $scene = Scene_Save.new when 2 # Load @menu_index = mload # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to load screen $scene = Scene_Load.new when 3 # System @menu_index = msystem $game_system.se_play($data_system.decision_se) @sys_command_window.active = true @sys_command_window.visible = true @command_window.active = false end end end #-------------------------------------------------------------------------- # * Update PlayerCommand Window #-------------------------------------------------------------------------- def update_player_command if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @player_command_window.active = false @player_command_window.visible = false @player_command_window.index = 0 @player_command_window.z = 0 return end end #-------------------------------------------------------------------------- # * Update SysCommand Window #-------------------------------------------------------------------------- def update_sys_command if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @sys_command_window.active = false @sys_command_window.visible = false @sys_command_window.index = 0 @sys_command_window.z = 0 return end if Input.trigger?(Input::C) case @sys_command_window.index when 0 #Title # °áÁ¤ SE ¸¦ ¿¬ÁÖ $game_system.se_play($data_system.decision_se) # BGM, BGS, ME ¸¦ ÆäÀ̵å¾Æ¿ô Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # ŸÀÌƲ È­¸éÀ¸·Î ÀüȯÇØ $scene = Scene_Title.new when 1 #Shutdown # °áÁ¤ SE ¸¦ ¿¬ÁÖ $game_system.se_play($data_system.decision_se) # BGM, BGS, ME ¸¦ ÆäÀ̵å¾Æ¿ô Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # ½¸´Ù¿î $scene = nil # return end end end end class Scene_Save < Scene_File alias save_on_decision on_decision alias save_on_cancel on_cancel #-------------------------------------------------------------------------- # * Decision Processing #-------------------------------------------------------------------------- def on_decision(filename) save_on_decision(filename) $scene = Scene_Menu.new(4) end #-------------------------------------------------------------------------- # * Cancel Processing #-------------------------------------------------------------------------- def on_cancel save_on_cancel $scene = Scene_Menu.new(4) end end class Scene_Load < Scene_File #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias load_initialize initialize alias load_on_cancel on_cancel #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize @scene = $scene load_initialize end #-------------------------------------------------------------------------- # * Cancel Processing #-------------------------------------------------------------------------- def on_cancel load_on_cancel $scene = @scene end end