Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Shanghai Simple Script - Final Fantasy 13 Skill Menu
- # Last Date Updated: 2010.06.20
- # Level: Normal
- #
- # NOTE! This requires Yanfly Engine Ace's JP Manager script to be installed
- # and located above this script to work. This makes your skill menu ordered
- # like Final Fantasy 13's.
- #
- # 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["FinalFantasy13SkillMenu"] = 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 skill menu text items.
- MENU_TEXT_SKILL_TITLE = "Abilities"
- MENU_TEXT_SKILL_DATA = "Data"
- MENU_TEXT_SKILL_LIST = "Skills List"
- FONTSIZE = 16
- HIDE_JP = false
- end
- #==============================================================================
- # ** Window_Base
- #==============================================================================
- class Window_Base < Window
- WLH = 24
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- alias initialize_sss_ff13_skill_menu_window_base initialize unless $@
- def initialize(x, y, width, height)
- initialize_sss_ff13_skill_menu_window_base(x, y, width, height)
- self.opacity = 0 if SceneManager.scene_is?(Scene_Skill)
- end
- end
- #==============================================================================
- # ** Window_Selectable
- #==============================================================================
- class Window_Selectable < Window_Base
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :column_max
- 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
- #==============================================================================
- # ** 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_LearnData
- #===============================================================================
- class Window_LearnData < Window_Base
- #--------------------------------------------------------------------------
- # * Get System Text Color
- #--------------------------------------------------------------------------
- def system_color
- return text_color(0)
- end
- end
- #===============================================================================
- # Window_Actor_Skill_Status
- #===============================================================================
- class Window_Actor_Skill_Status < Window_Base
- #--------------------------------------------------------------------------
- # initialize
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(-8, Graphics.height - 100, Graphics.width+16, 56)
- @actor = actor
- @class_id = actor.class_id
- refresh
- end
- #--------------------------------------------------------------------------
- # actor=
- #--------------------------------------------------------------------------
- def actor=(new_actor)
- @actor = new_actor
- @class_id = new_actor.class_id
- refresh
- end
- #--------------------------------------------------------------------------
- # class_id=
- #--------------------------------------------------------------------------
- def class_id=(new_class)
- @class_id = new_class
- refresh
- end
- #--------------------------------------------------------------------------
- # refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- dx = 0; dy = 0
- draw_actor_graphic(@actor, 16, 32); dx += 32
- draw_actor_name(@actor, dx, dy); dx += 120
- draw_actor_hp(@actor, dx, dy); dx += 126
- draw_actor_mp(@actor, dx, dy); dx += 126
- draw_actor_jp(@actor, @class_id, dx, dy); dx += 124
- end
- #--------------------------------------------------------------------------
- # draw_actor_jp
- #--------------------------------------------------------------------------
- def draw_actor_jp(actor, class_id, dx, dy)
- return if SSS::HIDE_JP
- self.contents.font.color = system_color
- self.contents.draw_text(dx, dy, 120, WLH, Vocab.jp, 0)
- draw_icon(Icon.jp, dx+96, dy)
- jp = actor.jp(class_id)
- self.contents.font.color = normal_color
- self.contents.draw_text(dx, dy, 96, WLH, jp, 2)
- end
- end # Window_Actor_Skill_Status
- #===============================================================================
- # ** Window_LearnData
- #===============================================================================
- class Window_SkillList
- def col_max
- return 1
- end
- end
- #==============================================================================
- # ** Scene_Skill
- #==============================================================================
- class Scene_Skill
- #--------------------------------------------------------------------------
- # public instance variables
- #--------------------------------------------------------------------------
- attr_accessor :actor
- #--------------------------------------------------------------------------
- # * Start
- #--------------------------------------------------------------------------
- alias start_sss_ff13_skill_menu start unless $@
- def start
- start_sss_ff13_skill_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
- #@menuback_sprite.z = @viewport.z - 1 unless @viewport.nil?
- @status_window.dispose
- @status_window = Window_Actor_Skill_Status.new(@actor)
- @gold_window = Window_MenuGold.new
- @gold_window.viewport = @viewport
- @menu_timer_window = Window_MenuTimer.new
- @menu_timer_window.viewport = @viewport
- @location_window = Window_MenuLocation.new
- @location_window.viewport = @viewport
- @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
- @help_window.viewport = @viewport
- @item_window.help_window = @help_window
- @command_window.y = @help_window.height+2
- @command_window.x = 0
- # Resize Skill Window
- @item_window.width = Graphics.width - 240 - 16
- @item_window.height = Graphics.height - 56 - 65
- @item_window.height = (@item_window.height-32)/24
- @item_window.height = (@item_window.height) * 24 + 32
- @item_window.refresh
- @item_window.index = 0
- @item_window.y = @command_window.y
- @item_window.x = Graphics.width - @item_window.width + 8
- # Create Skill Data Window, once it'll exist
- #~ @skill_data = Window_LearnData.new(@actor, @item_window)
- #~ @skill_data.height = 7 * 24 + 32
- #~ @skill_data.create_contents
- #~ @skill_data.refresh
- #~ @skill_data.active = false
- #~ @skill_data.viewport = @viewport
- # Resize Other Windows
- unless @learn_window.nil?
- @learn_window.width = @item_window.width
- @learn_window.height = @item_window.height
- @learn_data.height = @skill_data.height
- @learn_data.create_contents
- @learn_window.refresh
- @learn_data.refresh
- end
- unless @passive_window.nil?
- @passive_window.width = @item_window.width
- @passive_window.height = @item_window.height
- @passive_data.height = @skill_data.height
- @passive_data.create_contents
- @passive_window.refresh
- @passive_data.refresh
- end
- unless @equip_skill_window.nil?
- @equip_skill_window.width = @item_window.width
- @equip_skill_window.height = @item_window.height
- @equip_skill_data.height = @item_window.height
- @equip_skill_data.create_contents
- @equip_skill_window.refresh
- @equip_skill_data.refresh
- end
- # Create Other Stuff
- create_underscore_windows
- create_dummy_text_windows
- create_item_image
- @item_back_sprite.x = Graphics.width - 286
- @item_back_sprite.y = @item_window.y + 12
- end
- #--------------------------------------------------------------------------
- # * Create Underscore Windows
- #--------------------------------------------------------------------------
- def create_underscore_windows
- @underscore_window1 = Window_Underscore.new(2)
- @underscore_window1.y = @command_window.y - 14
- @underscore_window1.x = -Graphics.width+168
- @underscore_window1.viewport = @viewport
- #~ @underscore_window2 = Window_Underscore.new(2)
- #~ @underscore_window2.y = @command_window.y + @command_window.height - 40
- #~ @underscore_window2.x = -Graphics.width+240
- #~ @underscore_window2.viewport = @viewport
- @underscore_window3 = Window_Underscore.new(0)
- @underscore_window3.y = @command_window.y - 14
- @underscore_window3.x = Graphics.width-286-16
- @underscore_window3.viewport = @viewport
- end
- #--------------------------------------------------------------------------
- # * Create Dummy Text Windows
- #--------------------------------------------------------------------------
- def create_dummy_text_windows
- # Upper Left
- @dummy_stats1_window = Window_Base.new(0, 0, Graphics.width, 56)
- @dummy_stats1_window.contents.font.size = SSS::FONTSIZE
- rect = Rect.new(0, 0, @dummy_stats1_window.contents.width, 24)
- text = SSS::MENU_TEXT_SKILL_TITLE
- @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
- @dummy_stats1_window.viewport = @viewport
- # Lower Left
- #~ @dummy_stats2_window = Window_Base.new(0, 0, Graphics.width, 56)
- #~ @dummy_stats2_window.contents.font.size = YEM::SKILL::LEARN_DATA[:fontsize]
- #~ rect = Rect.new(0, 0, @dummy_stats1_window.contents.width, 24)
- #~ text = SSS::MENU_TEXT_SKILL_DATA
- #~ @dummy_stats2_window.contents.draw_text(rect, text, 2)
- #~ @dummy_stats2_window.x = @underscore_window2.x-4
- #~ @dummy_stats2_window.y = @underscore_window2.y-8
- #~ @dummy_stats2_window.viewport = @viewport
- # Upper Left
- @dummy_stats3_window = Window_Base.new(0, 0, Graphics.width, 56)
- @dummy_stats3_window.contents.font.size = SSS::FONTSIZE
- rect = Rect.new(0, 0, @dummy_stats1_window.contents.width, 24)
- text = SSS::MENU_TEXT_SKILL_LIST
- @dummy_stats3_window.contents.draw_text(rect, text, 0)
- @dummy_stats3_window.x = @underscore_window3.x+4
- @dummy_stats3_window.y = @underscore_window3.y-8
- @dummy_stats3_window.viewport = @viewport
- end
- #--------------------------------------------------------------------------
- # * Create Item Image
- #--------------------------------------------------------------------------
- def create_item_image
- @item_back_sprite = Sprite.new
- bitmap_w = 286
- bitmap_h = (@item_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
- @item_back_sprite.viewport = @viewport
- 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
- #--------------------------------------------------------------------------
- # * Change actor
- #--------------------------------------------------------------------------
- alias_method :ff13_skill_on_act_chg, :on_actor_change unless method_defined?(:ff13_skill_on_act_chg)
- def on_actor_change
- ff13_skill_on_act_chg
- @status_window.actor = @actor
- load_actor
- @status_window.activate
- end
- #--------------------------------------------------------------------------
- # * Load actor
- #--------------------------------------------------------------------------
- def load_actor
- 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
- #--------------------------------------------------------------------------
- # new method: show_view_skills
- #--------------------------------------------------------------------------
- def show_view_skills
- @help_window.y = 12
- @item_window.y = @command_window.y
- @item_window.x = Graphics.width - @item_window.width + 8
- unless @skill_data.nil?
- @skill_data.y = @command_window.y + @command_window.height - 24
- @skill_data.x = 0
- end
- @item_window.update_help
- unless @item_back_sprite.nil?
- @item_back_sprite.x = Graphics.width - 286
- @item_back_sprite.y = @item_window.y + 16
- end
- end
- #--------------------------------------------------------------------------
- # new method: show_learn_skill
- #--------------------------------------------------------------------------
- def show_learn_skill
- @help_window.y = 12
- @learn_window.y = @command_window.y
- @learn_window.x = Graphics.width - @learn_window.width + 8
- @learn_data.y = @command_window.y + @command_window.height - 24
- @learn_data.x = 0
- @learn_window.update_help
- unless @item_back_sprite.nil?
- @item_back_sprite.x = Graphics.width - 286
- @item_back_sprite.y = @learn_window.y + 16
- end
- end
- #--------------------------------------------------------------------------
- # new method: show_learn_passive
- #--------------------------------------------------------------------------
- def show_learn_passive
- @help_window.y = 12
- @passive_window.y = @command_window.y
- @passive_window.x = Graphics.width - @passive_window.width + 8
- @passive_data.y = @command_window.y + @command_window.height - 24
- @passive_data.x = 0
- @passive_window.update_help
- unless @item_back_sprite.nil?
- @item_back_sprite.x = Graphics.width - 286
- @item_back_sprite.y = @passive_window.y + 16
- end
- end
- #--------------------------------------------------------------------------
- # new method: show_equip_skill_windows
- #--------------------------------------------------------------------------
- if $imported["SkillEquipSystem"]
- def show_equip_skill_windows
- @help_window.y = 12
- @equip_skill_window.y = @command_window.y
- @equip_skill_window.x = Graphics.width - @equip_skill_window.width + 8
- @equip_skill_data.y = @command_window.y + @command_window.height - 24
- @passive_data.x = 0
- @equip_skill_window.update_help
- unless @item_back_sprite.nil?
- @item_back_sprite.x = Graphics.width - 286
- @item_back_sprite.y = @equip_skill_window.y + 16
- end
- end
- end
- #~ #--------------------------------------------------------------------------
- #~ # * Update Skill Selection
- #~ #--------------------------------------------------------------------------
- #~ alias update_skill_selection_sss_ff13_skill_menu update_skill_selection
- #~ def update_skill_selection
- #~ @skill_data.update
- #~ update_skill_selection_sss_ff13_skill_menu
- #~ end
- #~ #--------------------------------------------------------------------------
- #~ # * Show Target Window
- #~ #--------------------------------------------------------------------------
- #~ alias show_target_window_sss_ff13_skill_menu show_target_window unless $@
- #~ def show_target_window(right)
- #~ show_target_window_sss_ff13_skill_menu(true)
- #~ end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement