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 Melody's Skill Overhaul script to be
- # installed and located above this script to work. This makes your equip 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["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 => "ProfileRalph",
- 2 => "ProfileUlrika",
- 3 => "ProfileBennett",
- 4 => "ProfileYlva",
- } # 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"
- end
- #==============================================================================
- # ** Window_Base
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # * 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 $scene.is_a?(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.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
- #==============================================================================
- # ** 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 - 105, 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 += 124
- draw_actor_hp(@actor, dx, dy); dx += 124
- draw_actor_mp(@actor, dx, dy); dx += 124
- draw_actor_jp(@actor, @class_id, dx, dy); dx += 124
- end
- end
- #==============================================================================
- # ** Scene_Skill
- #==============================================================================
- class Scene_Skill < Scene_Base
- #--------------------------------------------------------------------------
- # public instance variables
- #--------------------------------------------------------------------------
- attr_accessor :actor
- #--------------------------------------------------------------------------
- # * Start
- #--------------------------------------------------------------------------
- alias start_sss_ff13_skill_menu start unless $@
- def start
- start_sss_ff13_skill_menu
- start_ff13_menu_style
- end
- #--------------------------------------------------------------------------
- # * Start Final Fantasy 13 Menu Style
- #--------------------------------------------------------------------------
- def start_ff13_menu_style
- @menuback_sprite.z = @viewport.z - 1 unless @viewport.nil?
- @profile_back_sprite.z = @viewport.z - 1 unless @viewport.nil?
- @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
- 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 = 0
- # Resize Skill Window
- @skill_window.width = Graphics.width - 240 - 16
- @skill_window.height = Graphics.height - 56 - 65
- @skill_window.height = (@skill_window.height-32)/24
- @skill_window.height = (@skill_window.height) * 24 + 32
- @skill_window.column_max = 1
- @skill_window.refresh
- @skill_window.index = 0
- # Create Skill Data Window
- @skill_data = Window_LearnData.new(@actor, @skill_window)
- @skill_data.height = 7 * 24 + 32
- @skill_data.create_contents
- @skill_data.refresh
- @skill_data.active = false
- @skill_data.viewport = @viewport
- @windows.push(@skill_data)
- # Resize Other Windows
- unless @learn_window.nil?
- @learn_window.width = @skill_window.width
- @learn_window.height = @skill_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 = @skill_window.width
- @passive_window.height = @skill_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 = @skill_window.width
- @equip_skill_window.height = @skill_window.height
- @equip_skill_data.height = @skill_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
- update_windows
- 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 = YEM::SKILL::LEARN_DATA[: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 = YEM::SKILL::LEARN_DATA[: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 = (@skill_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
- #--------------------------------------------------------------------------
- # * Termination Processing
- #--------------------------------------------------------------------------
- alias terminate_sss_ff13_skill_menu terminate unless $@
- def terminate
- @gold_window.dispose
- @menu_timer_window.dispose
- @location_window.dispose
- @profile_back_sprite.bitmap.dispose
- @profile_back_sprite.dispose
- @underscore_window1.dispose
- @underscore_window2.dispose
- @underscore_window3.dispose
- @dummy_stats1_window.dispose
- @dummy_stats2_window.dispose
- @dummy_stats3_window.dispose
- @skill_data.dispose
- terminate_sss_ff13_skill_menu
- 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
- #--------------------------------------------------------------------------
- # * Create Background for Menu Screen
- #--------------------------------------------------------------------------
- def create_menu_background
- @menuback_sprite.dispose unless @menuback_sprite.nil?
- @menuback_sprite = Sprite.new
- @menuback_sprite.z = @viewport.z - 1 unless @viewport.nil?
- @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)
- @profile_back_sprite.z = @viewport.z - 1 unless @viewport.nil?
- update_menu_background
- end
- #--------------------------------------------------------------------------
- # new method: show_view_skills
- #--------------------------------------------------------------------------
- def show_view_skills
- @help_window.y = 12
- @skill_window.y = @command_window.y
- @skill_window.x = Graphics.width - @skill_window.width + 8
- unless @skill_data.nil?
- @skill_data.y = @command_window.y + @command_window.height - 24
- @skill_data.x = 0
- end
- @skill_window.update_help
- unless @item_back_sprite.nil?
- @item_back_sprite.x = Graphics.width - 286
- @item_back_sprite.y = @skill_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
- #--------------------------------------------------------------------------
- # * Set New Actor
- #--------------------------------------------------------------------------
- alias set_new_actor_sss_ff13_skill_menu set_new_actor unless $@
- def set_new_actor
- set_new_actor_sss_ff13_skill_menu
- Graphics.freeze
- create_menu_background
- Graphics.transition(10)
- 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