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
- #
- # Converted by mikb89 to work for VX Ace.
- # UNOFFICIAL porting, all credits go to Shangai.
- #===============================================================================
- # 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 => "Charas",
- 2 => "Charas",
- 3 => "Charas",
- 4 => "Charas",
- } # 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
- #==============================================================================
- # ** Window_Base
- #==============================================================================
- class Window_Base < Window
- WLH = 24
- #--------------------------------------------------------------------------
- # * 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 SceneManager.scene_is?(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_Status
- #==============================================================================
- class Window_Status < Window_Selectable
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_block1 (line_height * 0)
- draw_horz_line(line_height * 1)
- draw_block2 (line_height * 2)
- draw_horz_line(line_height * 6)
- draw_block3 (line_height * 7)
- 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::currency_unit)
- 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.display_name)
- self.contents.draw_text(4, 0, contents.width, WLH, text, 0)
- end
- end
- #==============================================================================
- # ** Scene_Status
- #==============================================================================
- class Scene_Status
- #--------------------------------------------------------------------------
- # public instance variables
- #--------------------------------------------------------------------------
- attr_accessor :actor
- #--------------------------------------------------------------------------
- # * Start processing
- #--------------------------------------------------------------------------
- alias start_sss_ff13_status_menu start unless $@
- def start
- start_sss_ff13_status_menu
- @menuback_sprite.dispose unless @menuback_sprite.nil?
- @menuback_sprite = Sprite.new(@viewport)
- start_ff13_menu_style
- load_actor
- create_background
- 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 if @help_window != nil
- @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
- @help_window.y += 12
- @status_window.y = @help_window.height+2 - 16 - 14
- @status_window.x += 16
- @status_window.z += 100000
- @help_window.z += 100000
- end
- #--------------------------------------------------------------------------
- # * Change actor
- #--------------------------------------------------------------------------
- def on_actor_change
- @status_window.actor = @actor
- load_actor
- @status_window.activate
- end
- #--------------------------------------------------------------------------
- # * Load actor
- #--------------------------------------------------------------------------
- def load_actor
- @help_window.set_text(@actor.description)
- filename = SSS::MENU_PROFILE_IMAGES[@actor.id]
- filename = SSS::MENU_PROFILE_IMAGES[1] if filename.nil?
- @menuback_sprite.bitmap.dispose if @menuback_sprite.bitmap != nil
- @menuback_sprite.bitmap = Cache.system(filename).clone
- blur_times = 2
- blur_times.times do @menuback_sprite.bitmap.blur end
- @menuback_sprite.color.set(16, 16, 16, 64)
- end
- #--------------------------------------------------------------------------
- # * Create Background for Menu Screen
- #--------------------------------------------------------------------------
- def create_background
- super
- @background_sprite.color.set(0, 0, 0, 0)
- b = Cache.system(SSS::MENU_BACK_PROFILE_IMAGE)
- @background_sprite.bitmap.blt(0,0,b,b.rect,128)
- end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement