Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Shanghai Simple Script - Final Fantasy 13 Status Menu
- # Last Date Updated: 2010.06.26
- # Level: Normal
- #
- # NOTE! This requires Yanfly Engine Melody's Status Menu Melody script to be
- # installed and located above this script to work. This makes your status menu
- # ordered like Final Fantasy 13's.
- #===============================================================================
- # Instructions
- # -----------------------------------------------------------------------------
- # To install this script, open up your script editor and copy/paste this script
- # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
- #
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["FinalFantasy13StatusMenu"] = true
- module SSS
- # This is the image used for the header and footer of the profile scenes.
- # Must be 544x416 pixels or whatever resolution size you're using.
- MENU_BACK_PROFILE_IMAGE = "ProfileBack"
- # This is the image used for the item back image. Must be 286x24 pixels.
- MENU_BACK_PROFILE_ITEM = "ProfileItem"
- # This sets the menu help window's text color.
- MENU_HELP_TEXT_COLOR = Color.new(0, 0, 0)
- # This is the text format used to write out the current map.
- MENU_LOCATION = "Location: %s"
- # This hash sets the image files for your actors. These images must be placed
- # inside of the Graphics\System folder and they have to be 544x416 pixels or
- # whatever resolution size you're using.
- MENU_PROFILE_IMAGES ={
- 1 => "ProfileRalph",
- 2 => "ProfileUlrika",
- 3 => "ProfileBennett",
- 4 => "ProfileYlva",
- } # Remove this and perish.
- # This is the text used to write out various status menu text items.
- MENU_STATUS_OPTIONS = "Options"
- MENU_STATUS_PARAM = "Parameters"
- MENU_STATUS_BOOSTER = "Boost Items"
- MENU_STATUS_ELEMENT = "Element Items"
- MENU_STATUS_STATES = "Status Items"
- end
- #==============================================================================
- # ** Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :boost_dex
- attr_accessor :boost_res
- end
- #==============================================================================
- # ** Window_Base
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- alias initialize_sss_ff13_status_menu_window_base initialize unless $@
- def initialize(x, y, width, height)
- initialize_sss_ff13_status_menu_window_base(x, y, width, height)
- self.opacity = 0 if $scene.is_a?(Scene_Status)
- end
- end
- #==============================================================================
- # ** Window_Actor_Status
- #==============================================================================
- class Window_Actor_Status < Window_Base
- #--------------------------------------------------------------------------
- # refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- dx = 120; dy = 0
- difference = contents.width-124-dx-4
- draw_actor_name(@actor, dx, dy)
- draw_actor_class(@actor, contents.width-124, dy)
- draw_actor_level(@actor, dx, dy + WLH * 1)
- draw_actor_hp(@actor, contents.width-124, dy + WLH * 1)
- draw_actor_mp(@actor, contents.width-124, dy + WLH * 2)
- draw_actor_exp(@actor, dx, dy + WLH * 2, difference)
- end
- end
- #==============================================================================
- # ** Window_Underscore
- #==============================================================================
- class Window_Underscore < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(align = 0)
- super(0, 0, Graphics.width, 56)
- @align = align
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.name = ["UmePlus Gothic", "Courier New"]
- self.contents.font.size += 4
- text = "―――――――――――――――――――――――――――――――――――――――――――――――――――――――"
- self.contents.draw_text(0, 0, contents.width, WLH, text, @align)
- end
- end
- #==============================================================================
- # ** Window_MenuHelp
- #==============================================================================
- class Window_MenuHelp < Window_Help
- #--------------------------------------------------------------------------
- # * Set Text
- #--------------------------------------------------------------------------
- def set_text(text, align = 0)
- if text != @text or align != @align
- self.contents.clear
- self.contents.font.shadow = false
- self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
- self.contents.draw_text(4, 0, self.width - 40, WLH, text, align)
- @text = text
- @align = align
- end
- end
- end
- #==============================================================================
- # ** Window_MenuTimer
- #==============================================================================
- class Window_MenuTimer < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(0, Graphics.height - 60, 120, 56)
- self.contents.font.size = Font.default_size - 4
- self.contents.font.shadow = false
- self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- format = "%03d:%02d:%02d"
- @game_time = Graphics.frame_count / Graphics.frame_rate
- hours = @game_time / 3600
- minutes = @game_time / 60 % 60
- seconds = @game_time % 60
- text = sprintf(format, hours, minutes, seconds)
- self.contents.draw_text(0, 0, contents.width-4, WLH, text, 2)
- end
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- def update
- super
- refresh if @game_time != (Graphics.frame_count / Graphics.frame_rate)
- end
- end
- #==============================================================================
- # ** Window_MenuGold
- #==============================================================================
- class Window_MenuGold < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(100, Graphics.height - 60, 120, 56)
- self.contents.font.size = Font.default_size - 4
- self.contents.font.shadow = false
- self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- text = sprintf("%d%s", $game_party.gold, Vocab.gold)
- self.contents.draw_text(0, 0, contents.width-4, WLH, text, 0)
- end
- end
- #==============================================================================
- # ** Window_MenuLocation
- #==============================================================================
- class Window_MenuLocation < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(Graphics.width/2-16, Graphics.height - 60, Graphics.width/2+16, 56)
- self.contents.font.size = Font.default_size - 4
- self.contents.font.shadow = false
- self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- text = sprintf(SSS::MENU_LOCATION, $game_map.map_name)
- self.contents.draw_text(4, 0, contents.width, WLH, text, 0)
- end
- end
- #===============================================================================
- # Override Status Menu Melody Settings
- #===============================================================================
- YEM::STATUS::BOOSTER_FONT_SIZE = 16
- YEM::STATUS::COMMANDS = [:boosters, :elements, :states]
- #==============================================================================
- # ** Scene_Status
- #==============================================================================
- class Scene_Status < Scene_Base
- #--------------------------------------------------------------------------
- # public instance variables
- #--------------------------------------------------------------------------
- attr_accessor :actor
- #--------------------------------------------------------------------------
- # * Start processing
- #--------------------------------------------------------------------------
- alias start_sss_ff13_status_menu start unless $@
- def start
- for member in $game_party.members
- member.boost_dex = 0 if member.boost_dex == nil
- member.boost_res = 0 if member.boost_res == nil
- end
- start_sss_ff13_status_menu
- start_ff13_menu_style
- end
- #--------------------------------------------------------------------------
- # * Start Final Fantasy 13 Menu Style
- #--------------------------------------------------------------------------
- def start_ff13_menu_style
- @gold_window = Window_MenuGold.new
- @menu_timer_window = Window_MenuTimer.new
- @location_window = Window_MenuLocation.new
- @help_window.dispose
- @help_window = Window_MenuHelp.new
- @help_window.x += 48
- @help_window.width -= 48
- @help_window.create_contents
- @help_window.contents.font.size = Font.default_size - 4
- for window in @windows
- next unless window.is_a?(Window_Selectable)
- window.help_window = @help_window
- end
- @command_window.y = @help_window.height+2
- @command_window.height = 24*3+32
- @command_window.x += (Graphics.width-240-@command_window.width-32)/2
- @help_window.y += 12
- @status_window.y = @command_window.y - 16
- @status_window.x += 16
- unless @boosters_window.nil?
- @boosters_window.x += 8
- @boosters_window.width -= 16
- @boosters_window.create_contents
- @boosters_window.refresh
- end
- unless @elements_window.nil?
- @elements_window.x += 8
- @elements_window.width -= 16
- @elements_window.create_contents
- @elements_window.refresh
- end
- unless @states_window.nil?
- @states_window.x += 8
- @states_window.width -= 16
- @states_window.create_contents
- @states_window.refresh
- end
- create_underscore_windows
- create_dummy_text_windows
- create_item_image
- update_visible_windows
- end
- #--------------------------------------------------------------------------
- # * Create Underscore Windows
- #--------------------------------------------------------------------------
- def create_underscore_windows
- @underscore_window1 = Window_Underscore.new(2)
- @underscore_window2 = Window_Underscore.new(0)
- @underscore_window3 = Window_Underscore.new(0)
- @underscore_window1.y = @command_window.y + @command_window.height - 40
- @underscore_window1.x = -Graphics.width/3-60
- @underscore_window2.y = @command_window.y + @command_window.height - 40
- @underscore_window2.x = @underscore_window1.x + @underscore_window1.width-2
- @underscore_window3.x = @underscore_window1.x
- @underscore_window3.y = @help_window.y + @help_window.height-24
- end
- #--------------------------------------------------------------------------
- # * Create Dummy Text Windows
- #--------------------------------------------------------------------------
- def create_dummy_text_windows
- # Lower Left
- @dummy_stats1_window = Window_Base.new(0, 0, Graphics.width, 56)
- @dummy_stats1_window.contents.font.size = YEM::EQUIP::STAT_FONT_SIZE
- rect = Rect.new(0, 0, @dummy_stats1_window.contents.width, 24)
- text = SSS::MENU_STATUS_BOOSTER
- @dummy_stats1_window.contents.draw_text(rect, text, 2)
- @dummy_stats1_window.x = @underscore_window1.x-4
- @dummy_stats1_window.y = @underscore_window1.y-8
- # Lower Right
- @dummy_stats2_window = Window_Base.new(0, 0, Graphics.width, 56)
- @dummy_stats2_window.contents.font.size = YEM::EQUIP::STAT_FONT_SIZE
- rect = Rect.new(0, 0, @dummy_stats2_window.contents.width, 24)
- text = SSS::MENU_STATUS_PARAM
- @dummy_stats2_window.contents.draw_text(rect, text, 0)
- @dummy_stats2_window.x = @underscore_window2.x+4
- @dummy_stats2_window.y = @underscore_window2.y-8
- # Upper Left
- @dummy_stats3_window = Window_Base.new(0, 0, Graphics.width, 56)
- @dummy_stats3_window.contents.font.size = YEM::EQUIP::STAT_FONT_SIZE
- rect = Rect.new(0, 0, @dummy_stats3_window.contents.width, 24)
- text = SSS::MENU_STATUS_OPTIONS
- @dummy_stats3_window.contents.draw_text(rect, text, 2)
- @dummy_stats3_window.x = @underscore_window3.x-4
- @dummy_stats3_window.y = @underscore_window3.y-8
- end
- #--------------------------------------------------------------------------
- # * Create Item Image
- #--------------------------------------------------------------------------
- def create_item_image
- @item_back_sprite = Sprite.new
- bitmap_w = 286
- item_window_height = @command_window.y + @command_window.height - 25
- bitmap_h = @boosters_window.nil? ? 8 : (@boosters_window.height-32)/24
- @item_back_sprite.bitmap = Bitmap.new(bitmap_w, bitmap_h*24)
- rect = Rect.new(0, 0, 286, 24)
- source = Cache.system(SSS::MENU_BACK_PROFILE_ITEM)
- yy = 0
- bitmap_h.times do
- @item_back_sprite.bitmap.blt(0, yy, source, rect)
- yy += 24
- end
- end
- #--------------------------------------------------------------------------
- # * Termination Processing
- #--------------------------------------------------------------------------
- alias terminate_sss_ff13_status_menu terminate unless $@
- def terminate
- @gold_window.dispose
- @menu_timer_window.dispose
- @profile_back_sprite.bitmap.dispose
- @profile_back_sprite.dispose
- @location_window.dispose
- @underscore_window1.dispose
- @underscore_window2.dispose
- @underscore_window3.dispose
- @dummy_stats1_window.dispose
- @dummy_stats2_window.dispose
- @dummy_stats3_window.dispose
- @item_back_sprite.bitmap.dispose
- @item_back_sprite.dispose
- terminate_sss_ff13_status_menu
- end
- #--------------------------------------------------------------------------
- # * Create Background for Menu Screen
- #--------------------------------------------------------------------------
- def create_menu_background
- @menuback_sprite.dispose unless @menuback_sprite.nil?
- @menuback_sprite = Sprite.new
- @actor = $game_party.members[@actor_index]
- filename = SSS::MENU_PROFILE_IMAGES[@actor.id]
- filename = SSS::MENU_PROFILE_IMAGES[1] if filename.nil?
- @menuback_sprite.bitmap = Cache.system(filename)
- blur_times = 2
- blur_times.times do @menuback_sprite.bitmap.blur end
- @menuback_sprite.color.set(16, 16, 16, 64)
- @profile_back_sprite.dispose unless @profile_back_sprite.nil?
- @profile_back_sprite = Sprite.new
- @profile_back_sprite.bitmap = Cache.system(SSS::MENU_BACK_PROFILE_IMAGE)
- update_menu_background
- end
- #--------------------------------------------------------------------------
- # * Update Background for Menu Screen
- #--------------------------------------------------------------------------
- def update_menu_background
- super
- @gold_window.update unless @gold_window.nil?
- @menu_timer_window.update unless @menu_timer_window.nil?
- @profile_back_sprite.update unless @profile_back_sprite.nil?
- end
- #--------------------------------------------------------------------------
- # * Update Visible Windows
- #--------------------------------------------------------------------------
- def update_visible_windows
- @help_window.y = Graphics.height * 8
- for window in @windows; window.y = Graphics.height * 8; end
- @item_back_sprite.y = Graphics.height*8 unless @item_back_sprite.nil?
- item_window_height = @command_window.y + @command_window.height - 25
- case @data[@command_window.index]
- when :general
- @general_window.y = @command_window.height
- when :boosters
- @help_window.y = 12
- @boosters_window.y = item_window_height
- @boosters_stats.y = item_window_height
- @boosters_window.update_help
- unless @dummy_stats1_window.nil?
- @dummy_stats1_window.contents.clear
- rect = Rect.new(0, 0, @dummy_stats1_window.contents.width, 24)
- text = SSS::MENU_STATUS_BOOSTER
- @dummy_stats1_window.contents.draw_text(rect, text, 2)
- end
- unless @item_back_sprite.nil?
- @item_back_sprite.y = item_window_height+16
- end
- when :elements
- @help_window.y = 12
- @elements_window.y = item_window_height
- @elements_stats.y = item_window_height
- @elements_window.update_help
- unless @dummy_stats1_window.nil?
- @dummy_stats1_window.contents.clear
- rect = Rect.new(0, 0, @dummy_stats1_window.contents.width, 24)
- text = SSS::MENU_STATUS_ELEMENT
- @dummy_stats1_window.contents.draw_text(rect, text, 2)
- end
- unless @item_back_sprite.nil?
- @item_back_sprite.y = item_window_height+16
- end
- when :states
- @help_window.y = 12
- @states_window.y = item_window_height
- @states_stats.y = item_window_height
- @states_window.update_help
- unless @dummy_stats1_window.nil?
- @dummy_stats1_window.contents.clear
- rect = Rect.new(0, 0, @dummy_stats1_window.contents.width, 24)
- text = SSS::MENU_STATUS_STATES
- @dummy_stats1_window.contents.draw_text(rect, text, 2)
- end
- unless @item_back_sprite.nil?
- @item_back_sprite.y = item_window_height+16
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Set New Actor
- #--------------------------------------------------------------------------
- alias set_new_actor_sss_ff13_status_menu set_new_actor unless $@
- def set_new_actor
- set_new_actor_sss_ff13_status_menu
- Graphics.freeze
- create_menu_background
- Graphics.transition(10)
- end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement