Guest User

Untitled

a guest
Apr 22nd, 2011
2,584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 27.72 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # Shanghai Simple Script - Final Fantasy 13 Equip Menu
  4. # Last Date Updated: 2010.06.05
  5. # Level: Normal
  6. #
  7. # NOTE! This requires Yanfly Engine Melody's Equipment Overhaul script to be
  8. # installed and located above this script to work. This makes your equip menu
  9. # ordered like Final Fantasy 13's.
  10. #===============================================================================
  11. # Instructions
  12. # -----------------------------------------------------------------------------
  13. # To install this script, open up your script editor and copy/paste this script
  14. # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
  15. #
  16. #===============================================================================
  17.  
  18. $imported = {} if $imported == nil
  19. $imported["FinalFantasy13EquipMenu"] = true
  20.  
  21. module SSS
  22.   # This is the image used for the header and footer of the profile scenes.
  23.   # Must be 544x416 pixels or whatever resolution size you're using.
  24.   MENU_BACK_PROFILE_IMAGE = "ProfileBack"
  25.  
  26.   # This is the image used for the item back image. Must be 286x24 pixels.
  27.   MENU_BACK_PROFILE_ITEM = "ProfileItem"
  28.  
  29.   # This sets the menu help window's text color.
  30.   MENU_HELP_TEXT_COLOR = Color.new(0, 0, 0)
  31.  
  32.   # This is the text format used to write out the current map.
  33.   MENU_LOCATION = "Location: %s"
  34.  
  35.   # This hash sets the image files for your actors. These images must be placed
  36.   # inside of the Graphics\System folder and they have to be 544x416 pixels or
  37.   # whatever resolution size you're using.
  38.   MENU_PROFILE_IMAGES ={
  39.     1 => "ProfileRalph",
  40.     2 => "ProfileUlrika",
  41.     3 => "ProfileBennett",
  42.     4 => "ProfileYlva",
  43.   } # Remove this and perish.
  44.  
  45.   # This is the text used to write out various equip menu text items.
  46.   MENU_TEXT_EQUIP_STATS1  = "Status"
  47.   MENU_TEXT_EQUIP_STATS2  = "Aptitude Rates"
  48.   MENU_TEXT_EQUIP_EQUIP1  = "Option"
  49.   MENU_TEXT_EQUIP_EQUIP2  = "Equipment"
  50.   MENU_TEXT_EQUIP_APT     = "Aptitude"
  51.   MENU_TEXT_EQUIP_PASSIVE = "Passives Abilities"
  52.  
  53.   # This is the text used to write out the passive names.
  54.   MENU_TEXT_SUPER_GUARD   = "Super Guard"
  55.   MENU_TEXT_FAST_ATTACK   = "Fast Attack"
  56.   MENU_TEXT_DUAL_ATTACK   = "Dual Attack"
  57.   MENU_TEXT_PREVENT_CRI   = "Prevent Critical"
  58.   MENU_TEXT_HALF_MP_COST  = "Half MP Cost"
  59.   MENU_TEXT_PHARMACOLOGY  = "Pharmacology"
  60.   MENU_TEXT_DOUBLE_EXP    = "Double EXP Gain"
  61.   MENU_TEXT_AUTO_HP_REC   = "Auto HP Recover"
  62. end
  63.  
  64. #==============================================================================
  65. # ** Window_Base
  66. #==============================================================================
  67.  
  68. class Window_Base < Window
  69.   #--------------------------------------------------------------------------
  70.   # * Object Initialization
  71.   #--------------------------------------------------------------------------
  72.   alias initialize_sss_ff13_equip_menu_window_base initialize unless $@
  73.   def initialize(x, y, width, height)
  74.     initialize_sss_ff13_equip_menu_window_base(x, y, width, height)
  75.     self.opacity = 0 if $scene.is_a?(Scene_Equip)
  76.   end
  77. end
  78.  
  79. #===============================================================================
  80. # ** Window_Equip
  81. #===============================================================================
  82.  
  83. class Window_Equip < Window_Selectable
  84.   #--------------------------------------------------------------------------
  85.   # * Draw Equipment Category
  86.   #--------------------------------------------------------------------------
  87.   def draw_equipment_category
  88.     self.contents.font.size = YEM::EQUIP::CATEGORY_FONT_SIZE
  89.     self.contents.font.shadow = true
  90.     dy = 0
  91.     for i in 0..(@actor.equip_type.size)
  92.       self.contents.font.color = normal_color
  93.       if i == 0 and @actor.weapons[0] != nil and @actor.weapons[0].two_handed
  94.         text = @actor.weapons[0].two_hand_text
  95.       elsif i == 0
  96.         text = YEM::EQUIP::TYPE_RULES[:weapon][0]
  97.       elsif i == 1 and @actor.two_swords_style
  98.         text = YEM::EQUIP::TYPE_RULES[:weapon][0]
  99.       else
  100.         type = @actor.equip_type[i-1]
  101.         text = YEM::EQUIP::TYPE_RULES[type][0]
  102.       end
  103.       self.contents.draw_text(4, dy, 76, WLH, text, 1)
  104.       dy += WLH
  105.     end
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # * Draw Equipment Items
  109.   #--------------------------------------------------------------------------
  110.   def draw_equipment_items
  111.     self.contents.font.size = YEM::EQUIP::CATEGORY_FONT_SIZE
  112.     self.contents.font.shadow = false
  113.     dy = 0; dx = 76
  114.     for i in 0..(@actor.equip_type.size)
  115.       self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  116.       item = @data[i]
  117.       if item == nil
  118.         text = YEM::EQUIP::VOCAB[:noequip]
  119.         self.contents.font.color.alpha = 128
  120.         self.contents.draw_text(dx, dy, 196, WLH, text)
  121.       else
  122.         draw_item_name(item, dx, dy)
  123.       end
  124.       dy += WLH
  125.     end
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # * Draw Item Name
  129.   #--------------------------------------------------------------------------
  130.   def draw_item_name(item, x, y, enabled = true)
  131.     if item != nil
  132.       draw_icon(item.icon_index, x, y, enabled)
  133.       self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  134.       self.contents.font.color.alpha = enabled ? 255 : 128
  135.       self.contents.draw_text(x + 24, y, 172, WLH, item.name)
  136.     end
  137.   end
  138. end
  139.  
  140. #===============================================================================
  141. # ** Window_Equip_Item
  142. #===============================================================================
  143.  
  144. class Window_Equip_Item < Window_Selectable
  145.   #--------------------------------------------------------------------------
  146.   # * Draw Item
  147.   #--------------------------------------------------------------------------
  148.   def draw_item(index)
  149.     rect = item_rect(index)
  150.     self.contents.clear_rect(rect)
  151.     self.contents.font.shadow = false
  152.     self.contents.font.size = YEM::EQUIP::CATEGORY_FONT_SIZE
  153.     self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  154.     item = @data[index]
  155.     if item == nil
  156.       draw_icon(YEM::EQUIP::UNEQUIP_ICON, rect.x+12, rect.y)
  157.       text = YEM::EQUIP::VOCAB[:unequip]
  158.       self.contents.draw_text(rect.x+36, rect.y, 172, WLH, text)
  159.       return
  160.     end
  161.     number = $game_party.item_number(item)
  162.     enabled = enable?(item)
  163.     rect.width -= 4
  164.     draw_item_name(item, rect.x+12, rect.y, enabled)
  165.     if $imported["BattleEngineMelody"]
  166.       self.contents.font.size = YEM::BATTLE_ENGINE::ITEM_SETTINGS[:size]
  167.       self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  168.       sprint = YEM::BATTLE_ENGINE::ITEM_SETTINGS[:text]
  169.     else
  170.       sprint = YEM::EQUIP::VOCAB[:amount]
  171.     end
  172.     self.contents.draw_text(rect, sprintf(sprint, number),2)
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # * Draw Item Name
  176.   #--------------------------------------------------------------------------
  177.   def draw_item_name(item, x, y, enabled = true)
  178.     if item != nil
  179.       draw_icon(item.icon_index, x, y, enabled)
  180.       self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  181.       self.contents.font.color.alpha = enabled ? 255 : 128
  182.       self.contents.draw_text(x + 24, y, 172, WLH, item.name)
  183.     end
  184.   end
  185. end
  186.  
  187. #===============================================================================
  188. # ** Window_Aptitude
  189. #===============================================================================
  190.  
  191. class Window_Aptitude < Window_Selectable
  192.   #--------------------------------------------------------------------------
  193.   # new method: draw_obj_name
  194.   #--------------------------------------------------------------------------
  195.   def draw_obj_name(obj, rect, enabled)
  196.     draw_icon(obj.icon_index, rect.x+12, rect.y, enabled)
  197.     self.contents.font.shadow = false
  198.     self.contents.font.size = YEM::EQUIP::CATEGORY_FONT_SIZE
  199.     self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  200.     self.contents.font.color.alpha = enabled ? 255 : 128
  201.     rect.width -= 48
  202.     self.contents.draw_text(rect.x+48, rect.y, rect.width-24, WLH, obj.name)
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # new method: draw_obj_total
  206.   #--------------------------------------------------------------------------
  207.   def draw_obj_total(obj, rect, enabled)
  208.     if $imported["BattleEngineMelody"]
  209.       hash = YEM::BATTLE_ENGINE::ITEM_SETTINGS
  210.     else
  211.       hash ={ :text => ":%d", :size => Font.default_size, :colour => 0 }
  212.     end
  213.     number = $game_party.item_number(obj)
  214.     dx = rect.x + rect.width - 36; dy = rect.y; dw = 32
  215.     text = sprintf(hash[:text], number)
  216.     self.contents.font.size = YEM::EQUIP::CATEGORY_FONT_SIZE
  217.     self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  218.     self.contents.font.color.alpha = enabled ? 255 : 128
  219.     self.contents.draw_text(dx, dy, dw, WLH, text, 2)
  220.   end
  221. end
  222.  
  223. #==============================================================================
  224. # ** Window_MenuHelp
  225. #==============================================================================
  226.  
  227. class Window_MenuHelp < Window_Help
  228.   #--------------------------------------------------------------------------
  229.   # * Set Text
  230.   #--------------------------------------------------------------------------
  231.   def set_text(text, align = 0)
  232.     if text != @text or align != @align
  233.       self.contents.clear
  234.       self.contents.font.shadow = false
  235.       self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  236.       self.contents.draw_text(4, 0, self.width - 40, WLH, text, align)
  237.       @text = text
  238.       @align = align
  239.     end
  240.   end
  241. end
  242.  
  243. #==============================================================================
  244. # ** Window_MenuTimer
  245. #==============================================================================
  246.  
  247. class Window_MenuTimer < Window_Base
  248.   #--------------------------------------------------------------------------
  249.   # * Object Initialization
  250.   #--------------------------------------------------------------------------
  251.   def initialize
  252.     super(0, Graphics.height - 60, 120, 56)
  253.     self.contents.font.size = Font.default_size - 4
  254.     self.contents.font.shadow = false
  255.     self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  256.     refresh
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # * Refresh
  260.   #--------------------------------------------------------------------------
  261.   def refresh
  262.     self.contents.clear
  263.     format = "%03d:%02d:%02d"
  264.     @game_time = Graphics.frame_count / Graphics.frame_rate
  265.     hours = @game_time / 3600
  266.     minutes = @game_time / 60 % 60
  267.     seconds = @game_time % 60
  268.     text = sprintf(format, hours, minutes, seconds)
  269.     self.contents.draw_text(0, 0, contents.width-4, WLH, text, 2)
  270.   end
  271.   #--------------------------------------------------------------------------
  272.   # * Update
  273.   #--------------------------------------------------------------------------
  274.   def update
  275.     super
  276.     refresh if @game_time != (Graphics.frame_count / Graphics.frame_rate)
  277.   end
  278. end
  279.  
  280. #==============================================================================
  281. # ** Window_MenuGold
  282. #==============================================================================
  283.  
  284. class Window_MenuGold < Window_Base
  285.   #--------------------------------------------------------------------------
  286.   # * Object Initialization
  287.   #--------------------------------------------------------------------------
  288.   def initialize
  289.     super(100, Graphics.height - 60, 120, 56)
  290.     self.contents.font.size = Font.default_size - 4
  291.     self.contents.font.shadow = false
  292.     self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  293.     refresh
  294.   end
  295.   #--------------------------------------------------------------------------
  296.   # * Refresh
  297.   #--------------------------------------------------------------------------
  298.   def refresh
  299.     self.contents.clear
  300.     text = sprintf("%d%s", $game_party.gold, Vocab.gold)
  301.     self.contents.draw_text(0, 0, contents.width-4, WLH, text, 0)
  302.   end
  303. end
  304.  
  305. #==============================================================================
  306. # ** Window_MenuLocation
  307. #==============================================================================
  308.  
  309. class Window_MenuLocation < Window_Base
  310.   #--------------------------------------------------------------------------
  311.   # * Object Initialization
  312.   #--------------------------------------------------------------------------
  313.   def initialize
  314.     super(Graphics.width/2-16, Graphics.height - 60, Graphics.width/2+16, 56)
  315.     self.contents.font.size = Font.default_size - 4
  316.     self.contents.font.shadow = false
  317.     self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  318.     refresh
  319.   end
  320.   #--------------------------------------------------------------------------
  321.   # * Refresh
  322.   #--------------------------------------------------------------------------
  323.   def refresh
  324.     self.contents.clear
  325.     text = sprintf(SSS::MENU_LOCATION, $game_map.map_name)
  326.     self.contents.draw_text(4, 0, contents.width, WLH, text, 0)
  327.   end
  328. end
  329.  
  330. #==============================================================================
  331. # ** Window_Equip
  332. #==============================================================================
  333.  
  334. class Window_Equip < Window_Selectable
  335.   #--------------------------------------------------------------------------
  336.   # * Refresh
  337.   #--------------------------------------------------------------------------
  338.   alias refresh_sss_ff13_equip_menu refresh unless $@
  339.   def refresh
  340.     if $scene.is_a?(Scene_Equip) and not $scene.passives_window.nil?
  341.       $scene.passives_window.refresh
  342.     end
  343.     refresh_sss_ff13_equip_menu
  344.   end
  345. end
  346.  
  347. #==============================================================================
  348. # ** Window_Underscore
  349. #==============================================================================
  350.  
  351. class Window_Underscore < Window_Base
  352.   #--------------------------------------------------------------------------
  353.   # * Object Initialization
  354.   #--------------------------------------------------------------------------
  355.   def initialize(align = 0)
  356.     super(0, 0, Graphics.width, 56)
  357.     @align = align
  358.     refresh
  359.   end
  360.   #--------------------------------------------------------------------------
  361.   # * Refresh
  362.   #--------------------------------------------------------------------------
  363.   def refresh
  364.     self.contents.clear
  365.     self.contents.font.name = ["UmePlus Gothic", "Courier New"]
  366.     self.contents.font.size += 4
  367.     text = "―――――――――――――――――――――――――――――――――――――――――――――――――――――――"
  368.     self.contents.draw_text(0, 0, contents.width, WLH, text, @align)
  369.   end
  370. end
  371.  
  372. #==============================================================================
  373. # ** Window_MenuEquipPassives
  374. #==============================================================================
  375.  
  376. class Window_MenuEquipPassives < Window_Base
  377.   #--------------------------------------------------------------------------
  378.   # * Object Initialization
  379.   #--------------------------------------------------------------------------
  380.   def initialize(yy)
  381.     super(Graphics.width-240, yy, 240, 6*24+32)
  382.     refresh
  383.   end
  384.   #--------------------------------------------------------------------------
  385.   # * Refresh
  386.   #--------------------------------------------------------------------------
  387.   def refresh
  388.     self.contents.clear
  389.     @actor = $scene.actor
  390.     self.contents.font.color = normal_color
  391.     self.contents.font.size = YEM::EQUIP::STAT_FONT_SIZE
  392.     yy = WLH
  393.     xx = 12
  394.     if @actor.super_guard
  395.       text = SSS::MENU_TEXT_SUPER_GUARD
  396.       self.contents.draw_text(xx, yy, contents.width, WLH, text)
  397.       yy += WLH
  398.     end
  399.     if @actor.fast_attack
  400.       text = SSS::MENU_TEXT_FAST_ATTACK
  401.       self.contents.draw_text(xx, yy, contents.width, WLH, text)
  402.       yy += WLH
  403.     end
  404.     if @actor.dual_attack
  405.       text = SSS::MENU_TEXT_DUAL_ATTACK
  406.       self.contents.draw_text(xx, yy, contents.width, WLH, text)
  407.       yy += WLH
  408.     end
  409.     if @actor.prevent_critical
  410.       text = SSS::MENU_TEXT_PREVENT_CRI
  411.       self.contents.draw_text(xx, yy, contents.width, WLH, text)
  412.       yy += WLH
  413.     end
  414.     if @actor.half_mp_cost
  415.       text = SSS::MENU_TEXT_HALF_MP_COST
  416.       self.contents.draw_text(xx, yy, contents.width, WLH, text)
  417.       yy += WLH
  418.     end
  419.     if @actor.pharmacology
  420.       text = SSS::MENU_TEXT_PHARMACOLOGY
  421.       self.contents.draw_text(xx, yy, contents.width, WLH, text)
  422.       yy += WLH
  423.     end
  424.     if @actor.double_exp_gain
  425.       text = SSS::MENU_TEXT_DOUBLE_EXP
  426.       self.contents.draw_text(xx, yy, contents.width, WLH, text)
  427.       yy += WLH
  428.     end
  429.     if @actor.auto_hp_recover
  430.       text = SSS::MENU_TEXT_AUTO_HP_REC
  431.       self.contents.draw_text(xx, yy, contents.width, WLH, text)
  432.       yy += WLH
  433.     end
  434.     for state in @actor.equip_autostates
  435.       text = state.name
  436.       self.contents.draw_text(xx, yy, contents.width, WLH, text)
  437.       yy += WLH
  438.     end
  439.   end
  440. end
  441.  
  442. #===============================================================================
  443. # Override Equipment Overhaul Settings
  444. #===============================================================================
  445.  
  446. YEM::EQUIP::STAT_FONT_SIZE = 16
  447. YEM::EQUIP::CATEGORY_FONT_SIZE = 16
  448.  
  449. #==============================================================================
  450. # ** Scene_Equip
  451. #==============================================================================
  452.  
  453. class Scene_Equip < Scene_Base
  454.   #--------------------------------------------------------------------------
  455.   # public instance variables
  456.   #--------------------------------------------------------------------------
  457.   attr_accessor :actor
  458.   attr_accessor :passives_window
  459.   #--------------------------------------------------------------------------
  460.   # * Start
  461.   #--------------------------------------------------------------------------
  462.   alias start_sss_ff13_equip_menu start unless $@
  463.   def start
  464.     start_sss_ff13_equip_menu
  465.     start_ff13_menu_style
  466.   end
  467.   #--------------------------------------------------------------------------
  468.   # * Start Final Fantasy 13 Menu Style
  469.   #--------------------------------------------------------------------------
  470.   def start_ff13_menu_style
  471.     @gold_window = Window_MenuGold.new
  472.     @menu_timer_window = Window_MenuTimer.new
  473.     @location_window = Window_MenuLocation.new
  474.     @help_window.dispose
  475.     @help_window = Window_MenuHelp.new
  476.     @help_window.x += 48
  477.     @help_window.width -= 48
  478.     @help_window.create_contents
  479.     @help_window.contents.font.size = Font.default_size - 4
  480.     for window in @windows
  481.       next unless window.is_a?(Window_Selectable)
  482.       window.help_window = @help_window
  483.     end
  484.     @command_window.y = @help_window.height+2
  485.     @command_window.height = 24*3+32
  486.     @command_window.x += (Graphics.width-240-@command_window.width-32)/2
  487.     @help_window.y += 12
  488.     @status_window.y = -@status_window.height * @status_window.height
  489.     @aptitude_window.x -= 8 unless @aptitude_window.nil?
  490.     @equip_window.x -= 8 unless @equip_window.nil?
  491.     @item_window.height = (@item_window.height-32)/24
  492.     @item_window.height = @item_window.height*24+32
  493.     @aptitude_window.height = @item_window.height unless @aptitude_window.nil?
  494.     @aptitude_window.refresh
  495.     @item_window.x -= 8 unless @item_window.nil?
  496.     create_underscore_windows
  497.     create_dummy_text_windows
  498.     create_item_image
  499.     passives_y = @underscore_window2.y+10
  500.     @passives_window = Window_MenuEquipPassives.new(passives_y-24)
  501.     update_windows
  502.   end
  503.   #--------------------------------------------------------------------------
  504.   # * Create Underscore Windows
  505.   #--------------------------------------------------------------------------
  506.   def create_underscore_windows
  507.     @underscore_window1 = Window_Underscore.new(2)
  508.     @underscore_window2 = Window_Underscore.new(0)
  509.     @underscore_window3 = Window_Underscore.new(0)
  510.     @underscore_window4 = Window_Underscore.new(2)
  511.     @underscore_window1.y = @command_window.y + @command_window.height - 40
  512.     @underscore_window1.x = -Graphics.width/3-60
  513.     @underscore_window2.y = @command_window.y + @command_window.height + 6
  514.     extra_y = YEM::EQUIP::SHOWN_STATS.size - 4
  515.     if YEM::EQUIP::SHOWN_STATS.include?(:dex) and not $imported["DEX Stat"]
  516.       extra_y -= 1
  517.     end
  518.     if YEM::EQUIP::SHOWN_STATS.include?(:res) and not $imported["RES Stat"]
  519.       extra_y -= 1
  520.     end
  521.     @underscore_window2.y += extra_y * 24
  522.     @underscore_window2.y -= 16
  523.     @underscore_window2.x = @underscore_window1.x + @underscore_window1.width-2
  524.     @underscore_window3.x = @underscore_window1.x
  525.     @underscore_window3.y = @help_window.y + @help_window.height-24
  526.     @underscore_window4.x = @underscore_window2.x
  527.     @underscore_window4.y = @underscore_window3.y
  528.   end
  529.   #--------------------------------------------------------------------------
  530.   # * Create Dummy Text Windows
  531.   #--------------------------------------------------------------------------
  532.   def create_dummy_text_windows
  533.     # Lower Left
  534.     @dummy_stats1_window = Window_Base.new(0, 0, Graphics.width, 56)
  535.     @dummy_stats1_window.contents.font.size = YEM::EQUIP::STAT_FONT_SIZE
  536.     rect = Rect.new(0, 0, @dummy_stats1_window.contents.width, 24)
  537.     text = SSS::MENU_TEXT_EQUIP_EQUIP2
  538.     @dummy_stats1_window.contents.draw_text(rect, text, 2)
  539.     @dummy_stats1_window.x = @underscore_window1.x-4
  540.     @dummy_stats1_window.y = @underscore_window1.y-8
  541.     # Lower Right
  542.     @dummy_stats2_window = Window_Base.new(0, 0, Graphics.width, 56)
  543.     @dummy_stats2_window.contents.font.size = YEM::EQUIP::STAT_FONT_SIZE
  544.     rect = Rect.new(0, 0, @dummy_stats2_window.contents.width, 24)
  545.     text = SSS::MENU_TEXT_EQUIP_PASSIVE
  546.     @dummy_stats2_window.contents.draw_text(rect, text, 0)
  547.     @dummy_stats2_window.x = @underscore_window2.x+4
  548.     @dummy_stats2_window.y = @underscore_window2.y-8
  549.     # Upper Left
  550.     @dummy_stats3_window = Window_Base.new(0, 0, Graphics.width, 56)
  551.     @dummy_stats3_window.contents.font.size = YEM::EQUIP::STAT_FONT_SIZE
  552.     rect = Rect.new(0, 0, @dummy_stats3_window.contents.width, 24)
  553.     text = SSS::MENU_TEXT_EQUIP_EQUIP1
  554.     @dummy_stats3_window.contents.draw_text(rect, text, 2)
  555.     @dummy_stats3_window.x = @underscore_window3.x-4
  556.     @dummy_stats3_window.y = @underscore_window3.y-8
  557.     # Upper Right
  558.     @dummy_stats4_window = Window_Base.new(0, 0, Graphics.width, 56)
  559.     @dummy_stats4_window.contents.font.size = YEM::EQUIP::STAT_FONT_SIZE
  560.     rect = Rect.new(0, 0, @dummy_stats4_window.contents.width, 24)
  561.     text = SSS::MENU_TEXT_EQUIP_STATS1
  562.     @dummy_stats4_window.contents.draw_text(rect, text, 0)
  563.     @dummy_stats4_window.x = @underscore_window4.x+4
  564.     @dummy_stats4_window.y = @underscore_window4.y-8
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # * Create Item Image
  568.   #--------------------------------------------------------------------------
  569.   def create_item_image
  570.     @item_back_sprite = Sprite.new
  571.     bitmap_w = 286
  572.     bitmap_h = (@equip_window.height-32)/24
  573.     @item_back_sprite.bitmap = Bitmap.new(bitmap_w, bitmap_h*24)
  574.     rect = Rect.new(0, 0, 286, 24)
  575.     source = Cache.system(SSS::MENU_BACK_PROFILE_ITEM)
  576.     yy = 0
  577.     bitmap_h.times do
  578.       @item_back_sprite.bitmap.blt(0, yy, source, rect)
  579.       yy += 24
  580.     end
  581.   end
  582.   #--------------------------------------------------------------------------
  583.   # * Create Background for Menu Screen
  584.   #--------------------------------------------------------------------------
  585.   def create_menu_background
  586.     @menuback_sprite.dispose unless @menuback_sprite.nil?
  587.     @menuback_sprite = Sprite.new
  588.     @actor = $game_party.members[@actor_index]
  589.     filename = SSS::MENU_PROFILE_IMAGES[@actor.id]
  590.     filename = SSS::MENU_PROFILE_IMAGES[1] if filename.nil?
  591.     @menuback_sprite.bitmap = Cache.system(filename)
  592.     blur_times = 2
  593.     blur_times.times do @menuback_sprite.bitmap.blur end
  594.     @menuback_sprite.color.set(16, 16, 16, 64)
  595.     @profile_back_sprite.dispose unless @profile_back_sprite.nil?
  596.     @profile_back_sprite = Sprite.new
  597.     @profile_back_sprite.bitmap = Cache.system(SSS::MENU_BACK_PROFILE_IMAGE)
  598.     update_menu_background
  599.   end
  600.   #--------------------------------------------------------------------------
  601.   # * Termination Processing
  602.   #--------------------------------------------------------------------------
  603.   alias terminate_sss_ff13_equip_menu terminate unless $@
  604.   def terminate
  605.     @gold_window.dispose
  606.     @menu_timer_window.dispose
  607.     @location_window.dispose
  608.     @profile_back_sprite.bitmap.dispose
  609.     @profile_back_sprite.dispose
  610.     @underscore_window1.dispose
  611.     @underscore_window2.dispose
  612.     @underscore_window3.dispose
  613.     @underscore_window4.dispose
  614.     @dummy_stats1_window.dispose
  615.     @dummy_stats2_window.dispose
  616.     @dummy_stats3_window.dispose
  617.     @dummy_stats4_window.dispose
  618.     @passives_window.dispose
  619.     @item_back_sprite.bitmap.dispose
  620.     @item_back_sprite.dispose
  621.     terminate_sss_ff13_equip_menu
  622.   end
  623.   #--------------------------------------------------------------------------
  624.   # * Update Background for Menu Screen
  625.   #--------------------------------------------------------------------------
  626.   def update_menu_background
  627.     super
  628.     @gold_window.update unless @gold_window.nil?
  629.     @menu_timer_window.update unless @menu_timer_window.nil?
  630.     @profile_back_sprite.update unless @profile_back_sprite.nil?
  631.   end
  632.   #--------------------------------------------------------------------------
  633.   # * Update Windows
  634.   #--------------------------------------------------------------------------
  635.   def update_windows
  636.     @aptitude_window.y = Graphics.height*8 if @aptitude_window != nil
  637.     @apt_stat.y = Graphics.height*8 if @apt_stat != nil
  638.     @help_window.y = Graphics.height*8
  639.     @equip_window.y = Graphics.height*8
  640.     @stat_window.y = @equip_window.y
  641.     item_window_height = @command_window.y + @command_window.height - 25
  642.     @item_back_sprite.y = Graphics.height*8 unless @item_back_sprite.nil?
  643.     case @data[@command_window.index]
  644.     when :aptitude
  645.       @help_window.y = 12
  646.       @aptitude_window.y = item_window_height
  647.       @apt_stat.y = @command_window.y - 4
  648.       @aptitude_window.update_help
  649.       unless @dummy_stats4_window.nil?
  650.         @dummy_stats4_window.contents.clear
  651.         rect = Rect.new(0, 0, @dummy_stats4_window.contents.width, 24)
  652.         text = SSS::MENU_TEXT_EQUIP_STATS2
  653.         @dummy_stats4_window.contents.draw_text(rect, text, 0)
  654.       end
  655.       unless @item_back_sprite.nil?
  656.         @item_back_sprite.y = item_window_height+16
  657.       end
  658.     else
  659.       @help_window.y = 12
  660.       @equip_window.y = item_window_height
  661.       @stat_window.y = @command_window.y - 4
  662.       @equip_window.update_help
  663.       unless @dummy_stats4_window.nil?
  664.         @dummy_stats4_window.contents.clear
  665.         rect = Rect.new(0, 0, @dummy_stats4_window.contents.width, 24)
  666.         text = SSS::MENU_TEXT_EQUIP_STATS1
  667.         @dummy_stats4_window.contents.draw_text(rect, text, 0)
  668.       end
  669.       unless @item_back_sprite.nil?
  670.         @item_back_sprite.y = item_window_height+16
  671.       end
  672.     end
  673.   end
  674.   #--------------------------------------------------------------------------
  675.   # * Set New Actor
  676.   #--------------------------------------------------------------------------
  677.   alias set_new_actor_sss_ff13_equip_menu set_new_actor unless $@
  678.   def set_new_actor
  679.     set_new_actor_sss_ff13_equip_menu
  680.     Graphics.freeze
  681.     create_menu_background
  682.     Graphics.transition(10)
  683.   end
  684. end
  685.  
  686. #===============================================================================
  687. #
  688. # END OF FILE
  689. #
  690. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment