设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2437|回复: 6
打印 上一主题 下一主题

[已经解决] [ACE]在物品菜单栏中显示物品特性

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
175 小时
注册时间
2011-12-28
帖子
93
跳转到指定楼层
1
发表于 2012-3-28 17:35:55 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 z12508186 于 2012-3-28 17:37 编辑

还是习惯先上图吧。。请教如果在物品菜单中显示物品特性
1,因为在商店购买物品显,可以显示物品的特性,如图1中的右边部份。
2,自己想实现的效果:如图2
3,问题来了,借调用了Window_shopstatus这个窗口时,发现如图3的效果。。什么都不能显示。。哭~
但不希望改变Window_Help的内容..也就是不想实现这个贴子的效果
装备帮助增强

如此之般。希望大大们指教~~

Lv5.捕梦者

梦石
0
星屑
21932
在线时间
8564 小时
注册时间
2011-12-31
帖子
3362
2
发表于 2012-3-28 17:51:07 | 只看该作者
本帖最后由 tseyik 于 2012-3-28 18:20 编辑

我誤會了
在Scene_Shop中把有help_window的語句在最前面都全加上#就會如圖2了���
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
175 小时
注册时间
2011-12-28
帖子
93
3
 楼主| 发表于 2012-3-28 20:53:19 | 只看该作者
tseyik 发表于 2012-3-28 17:51
我誤會了
在Scene_Shop中把有help_window的語句在最前面都全加上#就會如圖2了���
...

呃....说不清楚的应该是我才对了...我指的意思是无论在个人菜单中...或者在商店购买物品时..都可以显示图2的效果..
但注意....windows_help是依然存在在画面上方的....只是想在右下方的窗口中再追加显示其它特性.
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
149
在线时间
664 小时
注册时间
2011-9-25
帖子
241
4
发表于 2012-3-28 22:07:07 | 只看该作者
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Shop Options v1.01
  4. # -- Last Updated: 2012.01.05
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-ShopOptions"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.05 - Compatibility Update: Equip Dynamic Stats
  15. # 2012.01.03 - Started Script and Finished.
  16. #
  17. #==============================================================================
  18. # ▼ Introduction
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # The RPG Maker VX Ace shop scene is relatively basic. It provides adequate
  21. # information, but not really enough to let the player know what they're
  22. # actually buying or even selling. This script enables shops to show more than
  23. # just the basic information displayed in RPG Maker VX Ace and even allow for
  24. # custom commands to be inserted.
  25. #
  26. #==============================================================================
  27. # ▼ Instructions
  28. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. # To install this script, open up your script editor and copy/paste this script
  30. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  31. #
  32. # -----------------------------------------------------------------------------
  33. # Item Notetags - These notetags go in the item notebox in the database.
  34. # -----------------------------------------------------------------------------
  35. # <image: string>
  36. # Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's
  37. # directory with the filename of "string" (without the extension) as the image
  38. # picture shown in the Ace Shop Options.
  39. #
  40. # -----------------------------------------------------------------------------
  41. # Weapon Notetags - These notetags go in the weapon notebox in the database.
  42. # -----------------------------------------------------------------------------
  43. # <image: string>
  44. # Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's
  45. # directory with the filename of "string" (without the extension) as the image
  46. # picture shown in the Ace Shop Options.
  47. #
  48. # -----------------------------------------------------------------------------
  49. # Armour Notetags - These notetags go in the armour notebox in the database.
  50. # -----------------------------------------------------------------------------
  51. # <image: string>
  52. # Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's
  53. # directory with the filename of "string" (without the extension) as the image
  54. # picture shown in the Ace Shop Options.
  55. #
  56. #==============================================================================
  57. # ▼ Compatibility
  58. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  59. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  60. # it will run with RPG Maker VX without adjusting.
  61. #
  62. #==============================================================================

  63. module YEA
  64.   module SHOP
  65.    
  66.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  67.     # - Shop Command Window Settings -
  68.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  69.     # Here, you can adjust the order at which the commands appear (or even
  70.     # remove commands as you see fit). Here's a list of which does what:
  71.     #
  72.     # -------------------------------------------------------------------------
  73.     # :command         Description
  74.     # -------------------------------------------------------------------------
  75.     # :buy             Buys items from the shop. Default.
  76.     # :sell            Sells items top the shop. Default.
  77.     # :cancel          Leaves the shop. Default.
  78.     #
  79.     # :equip           Allows the player to change equipment inside the shop.
  80.     #
  81.     # :totorishop      Requires Kread-EX's Synthesis Shop.
  82.     #
  83.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  84.     COMMANDS =[
  85.       :buy,          # Buys items from the shop. Default.
  86.       :sell,         # Sells items top the shop. Default.
  87.       :equip,        # Allows the player to change equipment inside the shop.
  88.       :totorishop,   # Requires Kread-EX's Synthesis Shop.
  89.       :cancel,       # Leaves the shop. Default.
  90.     # :custom1,      # Custom Command 1.
  91.     # :custom2,      # Custom Command 2.
  92.     ] # Do not remove this.
  93.    
  94.     #--------------------------------------------------------------------------
  95.     # - Shop Custom Commands -
  96.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  97.     # For those who use scripts to that may produce unique effects for their
  98.     # shops, use this hash to manage the custom commands for the Shop Command
  99.     # Window. You can disable certain commands or prevent them from appearing
  100.     # by using switches. If you don't wish to bind them to a switch, set the
  101.     # proper switch to 0 for it to have no impact.
  102.     #--------------------------------------------------------------------------
  103.     CUSTOM_SHOP_COMMANDS ={
  104.     # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
  105.       :equip   => [       "Equip",            0,          0, :command_equip],
  106.       :totorishop => [ "Synthesis",           0,      0, :command_synthshop],
  107.       :custom1 => [ "Custom Name",            0,          0, :command_name1],
  108.       :custom2 => [ "Custom Text",           13,          0, :command_name2],
  109.     } # Do not remove this.
  110.    
  111.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  112.     # - Shop Data Settings -
  113.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  114.     # The shop data window displays information about the item in detail.
  115.     # Adjust the settings below to change the way the data window appears.
  116.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  117.     STATUS_FONT_SIZE = 20       # Font size used for data window.
  118.     MAX_ICONS_DRAWN  = 10       # Maximum number of icons drawn for states.
  119.    
  120.     # The following adjusts the vocabulary used for the data window. Each
  121.     # of the vocabulary settings are self explanatory.
  122.     VOCAB_STATUS ={
  123.       :empty      => "---",          # Text used when nothing is shown.
  124.       :hp_recover => "HP Heal",      # Text used for HP Recovery.
  125.       :mp_recover => "MP Heal",      # Text used for MP Recovery.
  126.       :tp_recover => "TP Heal",      # Text used for TP Recovery.
  127.       :tp_gain    => "TP Gain",      # Text used for TP Gain.
  128.       :applies    => "Applies",      # Text used for applied states and buffs.
  129.       :removes    => "Removes",      # Text used for removed states and buffs.
  130.     } # Do not remove this.
  131.    
  132.   end # SHOP
  133. end # YEA

  134. #==============================================================================
  135. # ▼ Editting anything past this point may potentially result in causing
  136. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  137. # halitosis so edit at your own risk.
  138. #==============================================================================

  139. module YEA
  140.   module REGEXP
  141.   module BASEITEM
  142.    
  143.     IMAGE    = /<(?:IMAGE|image):[ ](.*)>/i
  144.    
  145.   end # BASEITEM
  146.   end # REGEXP
  147. end # YEA

  148. #==============================================================================
  149. # ■ Numeric
  150. #==============================================================================

  151. class Numeric
  152.   
  153.   #--------------------------------------------------------------------------
  154.   # new method: group_digits
  155.   #--------------------------------------------------------------------------
  156.   unless $imported["YEA-CoreEngine"]
  157.   def group; return self.to_s; end
  158.   end # $imported["YEA-CoreEngine"]
  159.    
  160. end # Numeric

  161. #==============================================================================
  162. # ■ Vocab
  163. #==============================================================================

  164. module Vocab
  165.   
  166.   #--------------------------------------------------------------------------
  167.   # new method: self.item_status
  168.   #--------------------------------------------------------------------------
  169.   def self.item_status(type)
  170.     return YEA::SHOP::VOCAB_STATUS[type]
  171.   end
  172.   
  173. end # Vocab

  174. #==============================================================================
  175. # ■ DataManager
  176. #==============================================================================

  177. module DataManager
  178.   
  179.   #--------------------------------------------------------------------------
  180.   # alias method: load_database
  181.   #--------------------------------------------------------------------------
  182.   class <<self; alias load_database_aso load_database; end
  183.   def self.load_database
  184.     load_database_aso
  185.     load_notetags_aso
  186.   end
  187.   
  188.   #--------------------------------------------------------------------------
  189.   # new method: load_notetags_aso
  190.   #--------------------------------------------------------------------------
  191.   def self.load_notetags_aso
  192.     groups = [$data_items, $data_weapons, $data_armors]
  193.     for group in groups
  194.       for obj in group
  195.         next if obj.nil?
  196.         obj.load_notetags_aso
  197.       end
  198.     end
  199.   end
  200.   
  201. end # DataManager

  202. #==============================================================================
  203. # ■ RPG::BaseItem
  204. #==============================================================================

  205. class RPG::BaseItem
  206.   
  207.   #--------------------------------------------------------------------------
  208.   # public instance variables
  209.   #--------------------------------------------------------------------------
  210.   attr_accessor :image
  211.   
  212.   #--------------------------------------------------------------------------
  213.   # common cache: load_notetags_aso
  214.   #--------------------------------------------------------------------------
  215.   def load_notetags_aso
  216.     #---
  217.     self.note.split(/[\r\n]+/).each { |line|
  218.       case line
  219.       #---
  220.       when YEA::REGEXP::BASEITEM::IMAGE
  221.         @image = $1.to_s
  222.       end
  223.     } # self.note.split
  224.     #---
  225.   end
  226.   
  227. end # RPG::BaseItem

  228. #==============================================================================
  229. # ■ Game_Temp
  230. #==============================================================================

  231. class Game_Temp
  232.   
  233.   #--------------------------------------------------------------------------
  234.   # public instance variables
  235.   #--------------------------------------------------------------------------
  236.   attr_accessor :scene_shop_index
  237.   attr_accessor :scene_shop_oy
  238.   
  239. end # Game_Temp

  240. #==============================================================================
  241. # ■ Window_ShopCommand
  242. #==============================================================================

  243. class Window_ShopCommand < Window_HorzCommand
  244.   
  245.   #--------------------------------------------------------------------------
  246.   # alias method: make_command_list
  247.   #--------------------------------------------------------------------------
  248.   alias window_shopcommand_make_command_list_aso make_command_list
  249.   def make_command_list
  250.     unless SceneManager.scene_is?(Scene_Shop)
  251.       window_shopcommand_make_command_list_aso
  252.       return
  253.     end
  254.     for command in YEA::SHOP::COMMANDS
  255.       case command
  256.       #--- Default Commands ---
  257.       when :buy
  258.         add_command(Vocab::ShopBuy, :buy)
  259.       when :sell
  260.         add_command(Vocab::ShopSell, :sell, !@purchase_only)
  261.       when :cancel
  262.         add_command(Vocab::ShopCancel, :cancel)
  263.       #--- Imported Commands ---
  264.       when :totorishop
  265.         next unless $imported["KRX-SynthesisShop"]
  266.         process_custom_command(command)
  267.       #--- Custom Commands ---
  268.       else
  269.         process_custom_command(command)
  270.       end
  271.     end
  272.   end
  273.   
  274.   #--------------------------------------------------------------------------
  275.   # new method: process_custom_command
  276.   #--------------------------------------------------------------------------
  277.   def process_custom_command(command)
  278.     return unless YEA::SHOP::CUSTOM_SHOP_COMMANDS.include?(command)
  279.     show = YEA::SHOP::CUSTOM_SHOP_COMMANDS[command][2]
  280.     continue = show <= 0 ? true : $game_switches[show]
  281.     return unless continue
  282.     text = YEA::SHOP::CUSTOM_SHOP_COMMANDS[command][0]
  283.     switch = YEA::SHOP::CUSTOM_SHOP_COMMANDS[command][1]
  284.     enabled = switch <= 0 ? true : $game_switches[switch]
  285.     add_command(text, command, enabled)
  286.   end
  287.   
  288.   #--------------------------------------------------------------------------
  289.   # overwrite method: process_ok
  290.   #--------------------------------------------------------------------------
  291.   def process_ok
  292.     $game_temp.scene_shop_index = index
  293.     $game_temp.scene_shop_oy = self.oy
  294.     super
  295.   end
  296.   
  297.   #--------------------------------------------------------------------------
  298.   # overwrite method: window_width
  299.   #--------------------------------------------------------------------------
  300.   def window_width; return 160; end
  301.   
  302.   #--------------------------------------------------------------------------
  303.   # overwrite method: contents_width
  304.   #--------------------------------------------------------------------------
  305.   def contents_width; return width - standard_padding * 2; end
  306.   
  307.   #--------------------------------------------------------------------------
  308.   # overwrite method: contents_height
  309.   #--------------------------------------------------------------------------
  310.   def contents_height
  311.     ch = height - standard_padding * 2
  312.     return [ch - ch % item_height, row_max * item_height].max
  313.   end
  314.   
  315.   #--------------------------------------------------------------------------
  316.   # overwrite method: visible_line_number
  317.   #--------------------------------------------------------------------------
  318.   def visible_line_number; return 4; end
  319.   
  320.   #--------------------------------------------------------------------------
  321.   # overwrite method: col_max
  322.   #--------------------------------------------------------------------------
  323.   def col_max; return 1; end
  324.    
  325.   #--------------------------------------------------------------------------
  326.   # overwrite method: item_rect
  327.   #--------------------------------------------------------------------------
  328.   def item_rect(index)
  329.     rect = Rect.new
  330.     rect.width = item_width
  331.     rect.height = item_height
  332.     rect.x = index % col_max * (item_width + spacing)
  333.     rect.y = index / col_max * item_height
  334.     rect
  335.   end
  336.   
  337.   #--------------------------------------------------------------------------
  338.   # overwrite method: ensure_cursor_visible
  339.   #--------------------------------------------------------------------------
  340.   def ensure_cursor_visible
  341.     self.top_row = row if row < top_row
  342.     self.bottom_row = row if row > bottom_row
  343.   end
  344.    
  345.   #--------------------------------------------------------------------------
  346.   # overwrite method: cursor_down
  347.   #--------------------------------------------------------------------------
  348.   def cursor_down(wrap = false)
  349.     if index < item_max - col_max || (wrap && col_max == 1)
  350.       select((index + col_max) % item_max)
  351.     end
  352.   end
  353.   
  354.   #--------------------------------------------------------------------------
  355.   # overwrite method: cursor_up
  356.   #--------------------------------------------------------------------------
  357.   def cursor_up(wrap = false)
  358.     if index >= col_max || (wrap && col_max == 1)
  359.       select((index - col_max + item_max) % item_max)
  360.     end
  361.   end
  362.   
  363.   #--------------------------------------------------------------------------
  364.   # overwrite method: process_pageup
  365.   #--------------------------------------------------------------------------
  366.   def process_pageup
  367.     Sound.play_cursor
  368.     Input.update
  369.     deactivate
  370.     call_handler(:pageup)
  371.   end
  372.   
  373.   #--------------------------------------------------------------------------
  374.   # overwrite method: process_pagedown
  375.   #--------------------------------------------------------------------------
  376.   def process_pagedown
  377.     Sound.play_cursor
  378.     Input.update
  379.     deactivate
  380.     call_handler(:pagedown)
  381.   end
  382.   
  383. end # Window_ShopCommand

  384. #==============================================================================
  385. # ■ Window_ShopCategory
  386. #==============================================================================

  387. class Window_ShopCategory < Window_Command
  388.   
  389.   #--------------------------------------------------------------------------
  390.   # public instance variables
  391.   #--------------------------------------------------------------------------
  392.   attr_reader   :item_window
  393.   
  394.   #--------------------------------------------------------------------------
  395.   # initialize
  396.   #--------------------------------------------------------------------------
  397.   def initialize
  398.     super(0, 0)
  399.   end
  400.   
  401.   #--------------------------------------------------------------------------
  402.   # window_width
  403.   #--------------------------------------------------------------------------
  404.   def window_width; return 160; end
  405.   
  406.   #--------------------------------------------------------------------------
  407.   # visible_line_number
  408.   #--------------------------------------------------------------------------
  409.   def visible_line_number; return 4; end
  410.   
  411.   #--------------------------------------------------------------------------
  412.   # update
  413.   #--------------------------------------------------------------------------
  414.   def update
  415.     super
  416.     @item_window.category = current_symbol if @item_window
  417.   end
  418.   
  419.   #--------------------------------------------------------------------------
  420.   # make_command_list
  421.   #--------------------------------------------------------------------------
  422.   def make_command_list
  423.     add_command(Vocab::item,     :item)
  424.     add_command(Vocab::weapon,   :weapon)
  425.     add_command(Vocab::armor,    :armor)
  426.     add_command(Vocab::key_item, :key_item)
  427.   end
  428.   
  429.   #--------------------------------------------------------------------------
  430.   # item_window=
  431.   #--------------------------------------------------------------------------
  432.   def item_window=(item_window)
  433.     @item_window = item_window
  434.     update
  435.   end
  436.   
  437. end# Window_ShopCategory

  438. #==============================================================================
  439. # ■ Window_ShopBuy
  440. #==============================================================================

  441. class Window_ShopBuy < Window_Selectable
  442.   
  443.   #--------------------------------------------------------------------------
  444.   # overwrite method: item
  445.   #--------------------------------------------------------------------------
  446.   def item
  447.     return index < 0 ? nil : @data[index]
  448.   end
  449.   
  450.   #--------------------------------------------------------------------------
  451.   # overwrite method: window_width
  452.   #--------------------------------------------------------------------------
  453.   def window_width
  454.     return Graphics.width - (Graphics.width * 2 / 5)
  455.   end
  456.   
  457.   #--------------------------------------------------------------------------
  458.   # overwrite method: draw_item
  459.   #--------------------------------------------------------------------------
  460.   def draw_item(index)
  461.     item = @data[index]
  462.     return if item.nil?
  463.     rect = item_rect(index)
  464.     draw_item_name(item, rect.x, rect.y, enable?(item), rect.width-24)
  465.     rect.width -= 4
  466.     contents.font.size = YEA::LIMIT::SHOP_FONT if $imported["YEA-AdjustLimits"]
  467.     draw_text(rect, price(item).group, 2)
  468.     reset_font_settings
  469.   end
  470.   
  471. end # Window_ShopBuy

  472. #==============================================================================
  473. # ■ Window_ShopSell
  474. #==============================================================================

  475. class Window_ShopSell < Window_ItemList
  476.   
  477.   #--------------------------------------------------------------------------
  478.   # overwrite method: initialize
  479.   #--------------------------------------------------------------------------
  480.   def initialize(dx, dy, dw, dh)
  481.     dw = Graphics.width - (Graphics.width * 2 / 5)
  482.     super(dx, dy, dw, dh)
  483.   end
  484.   
  485.   #--------------------------------------------------------------------------
  486.   # overwrite method: col_max
  487.   #--------------------------------------------------------------------------
  488.   def col_max; return 1; end
  489.   
  490.   #--------------------------------------------------------------------------
  491.   # new method: status_window=
  492.   #--------------------------------------------------------------------------
  493.   def status_window= (window)
  494.     @status_window = window
  495.     call_update_help
  496.   end
  497.   
  498.   #--------------------------------------------------------------------------
  499.   # new method: update_help
  500.   #--------------------------------------------------------------------------
  501.   def update_help
  502.     super
  503.     @status_window.item = item if @status_window
  504.   end
  505.   
  506. end # Window_ShopSell

  507. #==============================================================================
  508. # ■ Window_ShopStatus
  509. #==============================================================================

  510. class Window_ShopStatus < Window_Base
  511.   
  512.   #--------------------------------------------------------------------------
  513.   # alias method: initialize
  514.   #--------------------------------------------------------------------------
  515.   alias window_shopstatus_initialize_aso initialize
  516.   def initialize(dx, dy, dw, dh)
  517.     dh = Graphics.height - SceneManager.scene.command_window.y
  518.     dh -= SceneManager.scene.command_window.height + fitting_height(1)
  519.     dy += fitting_height(1)
  520.     window_shopstatus_initialize_aso(dx, dy, dw, dh)
  521.   end
  522.   
  523.   #--------------------------------------------------------------------------
  524.   # overwrite method: page_size
  525.   #--------------------------------------------------------------------------
  526.   def page_size
  527.     n = contents.height - line_height
  528.     n /= line_height
  529.     return n
  530.   end
  531.   
  532.   #--------------------------------------------------------------------------
  533.   # overwrite method: update_page
  534.   #--------------------------------------------------------------------------
  535.   def update_page
  536.     return unless visible
  537.     return if @item.nil?
  538.     return if @item.is_a?(RPG::Item)
  539.     return unless Input.trigger?(:A)
  540.     return unless page_max > 1
  541.     Sound.play_cursor
  542.     @page_index = (@page_index + 1) % page_max
  543.     refresh
  544.   end
  545.   
  546.   #--------------------------------------------------------------------------
  547.   # overwrite method: draw_equip_info
  548.   #--------------------------------------------------------------------------
  549.   def draw_equip_info(dx, dy)
  550.     dy -= line_height
  551.     status_members.each_with_index do |actor, i|
  552.       draw_actor_equip_info(dx, dy + line_height * i, actor)
  553.     end
  554.   end
  555.   
  556.   #--------------------------------------------------------------------------
  557.   # overwrite method: draw_actor_equip_info
  558.   #--------------------------------------------------------------------------
  559.   def draw_actor_equip_info(dx, dy, actor)
  560.     enabled = actor.equippable?(@item)
  561.     change_color(normal_color, enabled)
  562.     draw_text(dx, dy, contents.width, line_height, actor.name)
  563.     item1 = current_equipped_item(actor, @item.etype_id)
  564.     draw_actor_param_change(dx, dy, actor, item1) if enabled
  565.   end
  566.   
  567. end # Window_ShopStatus

  568. #==============================================================================
  569. # ■ Window_ShopNumber
  570. #==============================================================================

  571. class Window_ShopNumber < Window_Selectable
  572.   
  573.   #--------------------------------------------------------------------------
  574.   # alias method: initialize
  575.   #--------------------------------------------------------------------------
  576.   alias window_shopnumber_initialize_aso initialize
  577.   def initialize(dx, dy, dh)
  578.     dh = Graphics.height - SceneManager.scene.command_window.y
  579.     dh -= SceneManager.scene.command_window.height
  580.     window_shopnumber_initialize_aso(dx, dy, dh)
  581.   end
  582.   
  583.   #--------------------------------------------------------------------------
  584.   # overwrite method: window_width
  585.   #--------------------------------------------------------------------------
  586.   def window_width
  587.     return Graphics.width - (Graphics.width * 2 / 5)
  588.   end
  589.   
  590.   #--------------------------------------------------------------------------
  591.   # overwrite method: figures
  592.   #--------------------------------------------------------------------------
  593.   def figures
  594.     maximum = @max.nil? ? 2 : @max.group.size
  595.     return maximum
  596.   end
  597.   
  598.   #--------------------------------------------------------------------------
  599.   # overwrite method: refresh
  600.   #--------------------------------------------------------------------------
  601.   def refresh
  602.     contents.clear
  603.     reset_font_settings
  604.     draw_item_name(@item, 0, item_y, true, contents.width - 24)
  605.     draw_number
  606.     draw_total_price
  607.   end
  608.   
  609.   #--------------------------------------------------------------------------
  610.   # overwrite method: item_y
  611.   #--------------------------------------------------------------------------
  612.   def item_y
  613.     return contents_height / 2 - line_height * 5 / 2
  614.   end
  615.   
  616.   #--------------------------------------------------------------------------
  617.   # overwrite method: price_y
  618.   #--------------------------------------------------------------------------
  619.   def price_y
  620.     return item_y + line_height * 2
  621.   end
  622.   
  623.   #--------------------------------------------------------------------------
  624.   # overwrite method: draw_total_price
  625.   #--------------------------------------------------------------------------
  626.   def draw_total_price
  627.     dw = contents_width - 8
  628.     dy = price_y
  629.     draw_currency_value($game_party.gold, @currency_unit, 4, dy, dw)
  630.     dy += line_height
  631.     draw_horz_line(dy)
  632.     value = @price * @number
  633.     value *= -1 if buy?
  634.     draw_currency_value(value, @currency_unit, 4, dy, dw)
  635.     dy += line_height
  636.     value = $game_party.gold + value
  637.     value = [[value, 0].max, $game_party.max_gold].min
  638.     draw_currency_value(value, @currency_unit, 4, dy, dw)
  639.   end
  640.   
  641.   #--------------------------------------------------------------------------
  642.   # new method: buy?
  643.   #--------------------------------------------------------------------------
  644.   def buy?
  645.     return SceneManager.scene.command_window.current_symbol == :buy
  646.   end
  647.   
  648.   #--------------------------------------------------------------------------
  649.   # new method: sell?
  650.   #--------------------------------------------------------------------------
  651.   def sell?
  652.     return SceneManager.scene.command_window.current_symbol == :sell
  653.   end
  654.   
  655.   #--------------------------------------------------------------------------
  656.   # new method: draw_horz_line
  657.   #--------------------------------------------------------------------------
  658.   def draw_horz_line(dy)
  659.     line_y = dy + line_height - 4
  660.     contents.fill_rect(4, line_y, contents_width-8, 3, Font.default_out_color)
  661.     contents.fill_rect(5, line_y+1, contents_width-10, 1, normal_color)
  662.   end
  663.   
  664.   #--------------------------------------------------------------------------
  665.   # alias method: update_number
  666.   #--------------------------------------------------------------------------
  667.   alias window_shopnumber_update_number_aso update_number
  668.   def update_number
  669.     window_shopnumber_update_number_aso
  670.     change_number(-@max) if Input.repeat?(:L)
  671.     change_number(@max)  if Input.repeat?(:R)
  672.   end
  673.   
  674. end # Window_ShopNumber

  675. #==============================================================================
  676. # ■ Window_ShopData
  677. #==============================================================================

  678. class Window_ShopData < Window_Base
  679.   
  680.   #--------------------------------------------------------------------------
  681.   # initialize
  682.   #--------------------------------------------------------------------------
  683.   def initialize(dx, dy, item_window)
  684.     super(dx, dy, Graphics.width - dx, fitting_height(4))
  685.     @item_window = item_window
  686.     @item = nil
  687.     refresh
  688.   end
  689.   
  690.   #--------------------------------------------------------------------------
  691.   # item_window=
  692.   #--------------------------------------------------------------------------
  693.   def item_window= (window)
  694.     @item_window = window
  695.     update_item(@item_window.item)
  696.   end
  697.   
  698.   #--------------------------------------------------------------------------
  699.   # update
  700.   #--------------------------------------------------------------------------
  701.   def update
  702.     super
  703.     update_item(@item_window.item)
  704.   end
  705.   
  706.   #--------------------------------------------------------------------------
  707.   # update_item
  708.   #--------------------------------------------------------------------------
  709.   def update_item(item)
  710.     return if @item == item
  711.     @item = item
  712.     refresh
  713.   end
  714.   
  715.   #--------------------------------------------------------------------------
  716.   # refresh
  717.   #--------------------------------------------------------------------------
  718.   def refresh
  719.     contents.clear
  720.     reset_font_settings
  721.     return draw_empty if @item.nil?
  722.     contents.font.size = YEA::SHOP::STATUS_FONT_SIZE
  723.     draw_item_image
  724.     draw_item_stats
  725.     draw_item_effects
  726.   end
  727.   
  728.   #--------------------------------------------------------------------------
  729.   # draw_empty
  730.   #--------------------------------------------------------------------------
  731.   def draw_empty
  732.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  733.     rect = Rect.new(1, 1, 94, 94)
  734.     contents.fill_rect(rect, colour)
  735.     dx = 96; dy = 0
  736.     dw = (contents.width - 96) / 2
  737.     for i in 0...8
  738.       draw_background_box(dx, dy, dw)
  739.       dx = dx >= 96 + dw ? 96 : 96 + dw
  740.       dy += line_height if dx == 96
  741.     end
  742.   end
  743.   
  744.   #--------------------------------------------------------------------------
  745.   # draw_background_box
  746.   #--------------------------------------------------------------------------
  747.   def draw_background_box(dx, dy, dw)
  748.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  749.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  750.     contents.fill_rect(rect, colour)
  751.   end
  752.   
  753.   #--------------------------------------------------------------------------
  754.   # draw_item_image
  755.   #--------------------------------------------------------------------------
  756.   def draw_item_image
  757.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  758.     rect = Rect.new(1, 1, 94, 94)
  759.     contents.fill_rect(rect, colour)
  760.     if @item.image.nil?
  761.       icon_index = @item.icon_index
  762.       bitmap = Cache.system("Iconset")
  763.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  764.       target = Rect.new(0, 0, 96, 96)
  765.       contents.stretch_blt(target, bitmap, rect)
  766.     else
  767.       bitmap = Cache.picture(@item.image)
  768.       contents.blt(0, 0, bitmap, bitmap.rect, 255)
  769.     end
  770.   end
  771.   
  772.   #--------------------------------------------------------------------------
  773.   # draw_item_stats
  774.   #--------------------------------------------------------------------------
  775.   def draw_item_stats
  776.     return unless @item.is_a?(RPG::Weapon) || @item.is_a?(RPG::Armor)
  777.     dx = 96; dy = 0
  778.     dw = (contents.width - 96) / 2
  779.     for i in 0...8
  780.       draw_equip_param(i, dx, dy, dw)
  781.       dx = dx >= 96 + dw ? 96 : 96 + dw
  782.       dy += line_height if dx == 96
  783.     end
  784.   end
  785.   
  786.   #--------------------------------------------------------------------------
  787.   # draw_equip_param
  788.   #--------------------------------------------------------------------------
  789.   def draw_equip_param(param_id, dx, dy, dw)
  790.     draw_background_box(dx, dy, dw)
  791.     change_color(system_color)
  792.     draw_text(dx+4, dy, dw-8, line_height, Vocab::param(param_id))
  793.     if $imported["YEA-EquipDynamicStats"]
  794.       draw_percentage_param(param_id, dx, dy, dw)
  795.     else
  796.       draw_set_param(param_id, dx, dy, dw)
  797.     end
  798.   end
  799.   
  800.   #--------------------------------------------------------------------------
  801.   # draw_percentage_param
  802.   #--------------------------------------------------------------------------
  803.   def draw_percentage_param(param_id, dx, dy, dw)
  804.     if @item.per_params[param_id] != 0 && @item.params[param_id] != 0
  805.       text = draw_set_param(param_id, dx, dy, dw)
  806.       dw -= text_size(text).width
  807.       draw_percent_param(param_id, dx, dy, dw)
  808.     elsif @item.per_params[param_id] != 0 && @item.params[param_id] == 0
  809.       draw_percent_param(param_id, dx, dy, dw)
  810.     else
  811.       draw_set_param(param_id, dx, dy, dw)
  812.     end
  813.   end
  814.   
  815.   #--------------------------------------------------------------------------
  816.   # draw_set_param
  817.   #--------------------------------------------------------------------------
  818.   def draw_set_param(param_id, dx, dy, dw)
  819.     value = @item.params[param_id]
  820.     if $imported["YEA-EquipDynamicStats"] && @item.var_params[param_id] > 0
  821.       value += $game_variables[@item.var_params[param_id]] rescue 0
  822.     end
  823.     change_color(param_change_color(value), value != 0)
  824.     text = value.group
  825.     text = "+" + text if value > 0
  826.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  827.     return text
  828.   end
  829.   
  830.   #--------------------------------------------------------------------------
  831.   # draw_percent_param
  832.   #--------------------------------------------------------------------------
  833.   def draw_percent_param(param_id, dx, dy, dw)
  834.     value = @item.per_params[param_id]
  835.     change_color(param_change_color(value))
  836.     text = (@item.per_params[param_id] * 100).to_i.group + "%"
  837.     text = "+" + text if @item.per_params[param_id] > 0
  838.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  839.     return text
  840.   end
  841.   
  842.   #--------------------------------------------------------------------------
  843.   # draw_item_effects
  844.   #--------------------------------------------------------------------------
  845.   def draw_item_effects
  846.     return unless @item.is_a?(RPG::Item)
  847.     dx = 96; dy = 0
  848.     dw = (contents.width - 96) / 2
  849.     draw_hp_recover(dx, dy + line_height * 0, dw)
  850.     draw_mp_recover(dx, dy + line_height * 1, dw)
  851.     draw_tp_recover(dx + dw, dy + line_height * 0, dw)
  852.     draw_tp_gain(dx + dw, dy + line_height * 1, dw)
  853.     dw = contents.width - 96
  854.     draw_applies(dx, dy + line_height * 2, dw)
  855.     draw_removes(dx, dy + line_height * 3, dw)
  856.   end
  857.   
  858.   #--------------------------------------------------------------------------
  859.   # draw_hp_recover
  860.   #--------------------------------------------------------------------------
  861.   def draw_hp_recover(dx, dy, dw)
  862.     draw_background_box(dx, dy, dw)
  863.     change_color(system_color)
  864.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:hp_recover))
  865.     per = 0
  866.     set = 0
  867.     for effect in @item.effects
  868.       next unless effect.code == 11
  869.       per += (effect.value1 * 100).to_i
  870.       set += effect.value2.to_i
  871.     end
  872.     if per != 0 && set != 0
  873.       change_color(param_change_color(set))
  874.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  875.       draw_text(dx+4, dy, dw-8, line_height, text, 2)
  876.       dw -= text_size(text).width
  877.       change_color(param_change_color(per))
  878.       text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
  879.       draw_text(dx+4, dy, dw-8, line_height, text, 2)
  880.       return
  881.     elsif per != 0
  882.       change_color(param_change_color(per))
  883.       text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
  884.     elsif set != 0
  885.       change_color(param_change_color(set))
  886.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  887.     else
  888.       change_color(normal_color, false)
  889.       text = Vocab::item_status(:empty)
  890.     end
  891.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  892.   end
  893.   
  894.   #--------------------------------------------------------------------------
  895.   # draw_mp_recover
  896.   #--------------------------------------------------------------------------
  897.   def draw_mp_recover(dx, dy, dw)
  898.     draw_background_box(dx, dy, dw)
  899.     change_color(system_color)
  900.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:mp_recover))
  901.     per = 0
  902.     set = 0
  903.     for effect in @item.effects
  904.       next unless effect.code == 12
  905.       per += (effect.value1 * 100).to_i
  906.       set += effect.value2.to_i
  907.     end
  908.     if per != 0 && set != 0
  909.       change_color(param_change_color(set))
  910.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  911.       draw_text(dx+4, dy, dw-8, line_height, text, 2)
  912.       dw -= text_size(text).width
  913.       change_color(param_change_color(per))
  914.       text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
  915.       draw_text(dx+4, dy, dw-8, line_height, text, 2)
  916.       return
  917.     elsif per != 0
  918.       change_color(param_change_color(per))
  919.       text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
  920.     elsif set != 0
  921.       change_color(param_change_color(set))
  922.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  923.     else
  924.       change_color(normal_color, false)
  925.       text = Vocab::item_status(:empty)
  926.     end
  927.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  928.   end
  929.   
  930.   #--------------------------------------------------------------------------
  931.   # draw_tp_recover
  932.   #--------------------------------------------------------------------------
  933.   def draw_tp_recover(dx, dy, dw)
  934.     draw_background_box(dx, dy, dw)
  935.     change_color(system_color)
  936.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:tp_recover))
  937.     set = 0
  938.     for effect in @item.effects
  939.       next unless effect.code == 13
  940.       set += effect.value1.to_i
  941.     end
  942.     if set != 0
  943.       change_color(param_change_color(set))
  944.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  945.     else
  946.       change_color(normal_color, false)
  947.       text = Vocab::item_status(:empty)
  948.     end
  949.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  950.   end
  951.   
  952.   #--------------------------------------------------------------------------
  953.   # draw_tp_gain
  954.   #--------------------------------------------------------------------------
  955.   def draw_tp_gain(dx, dy, dw)
  956.     draw_background_box(dx, dy, dw)
  957.     change_color(system_color)
  958.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:tp_gain))
  959.     set = @item.tp_gain
  960.     if set != 0
  961.       change_color(param_change_color(set))
  962.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  963.     else
  964.       change_color(normal_color, false)
  965.       text = Vocab::item_status(:empty)
  966.     end
  967.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  968.   end
  969.   
  970.   #--------------------------------------------------------------------------
  971.   # draw_applies
  972.   #--------------------------------------------------------------------------
  973.   def draw_applies(dx, dy, dw)
  974.     draw_background_box(dx, dy, dw)
  975.     change_color(system_color)
  976.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:applies))
  977.     icons = []
  978.     for effect in @item.effects
  979.       case effect.code
  980.       when 21
  981.         next unless effect.value1 > 0
  982.         next if $data_states[effect.value1].nil?
  983.         icons.push($data_states[effect.data_id].icon_index)
  984.       when 31
  985.         icons.push($game_actors[1].buff_icon_index(1, effect.data_id))
  986.       when 32
  987.         icons.push($game_actors[1].buff_icon_index(-1, effect.data_id))
  988.       end
  989.       icons.delete(0)
  990.       break if icons.size >= YEA::SHOP::MAX_ICONS_DRAWN
  991.     end
  992.     draw_icons(dx, dy, dw, icons)
  993.   end
  994.   
  995.   #--------------------------------------------------------------------------
  996.   # draw_removes
  997.   #--------------------------------------------------------------------------
  998.   def draw_removes(dx, dy, dw)
  999.     draw_background_box(dx, dy, dw)
  1000.     change_color(system_color)
  1001.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:removes))
  1002.     icons = []
  1003.     for effect in @item.effects
  1004.       case effect.code
  1005.       when 22
  1006.         next unless effect.value1 > 0
  1007.         next if $data_states[effect.value1].nil?
  1008.         icons.push($data_states[effect.data_id].icon_index)
  1009.       when 33
  1010.         icons.push($game_actors[1].buff_icon_index(1, effect.data_id))
  1011.       when 34
  1012.         icons.push($game_actors[1].buff_icon_index(-1, effect.data_id))
  1013.       end
  1014.       icons.delete(0)
  1015.       break if icons.size >= YEA::SHOP::MAX_ICONS_DRAWN
  1016.     end
  1017.     draw_icons(dx, dy, dw, icons)
  1018.   end
  1019.   
  1020.   #--------------------------------------------------------------------------
  1021.   # draw_icons
  1022.   #--------------------------------------------------------------------------
  1023.   def draw_icons(dx, dy, dw, icons)
  1024.     dx += dw - 4
  1025.     dx -= icons.size * 24
  1026.     for icon_id in icons
  1027.       draw_icon(icon_id, dx, dy)
  1028.       dx += 24
  1029.     end
  1030.     if icons.size == 0
  1031.       change_color(normal_color, false)
  1032.       text = Vocab::item_status(:empty)
  1033.       draw_text(4, dy, contents.width-8, line_height, text, 2)
  1034.     end
  1035.   end
  1036.   
  1037. end # Window_ShopData

  1038. #==============================================================================
  1039. # ■ Scene_Shop
  1040. #==============================================================================

  1041. class Scene_Shop < Scene_MenuBase
  1042.   
  1043.   #--------------------------------------------------------------------------
  1044.   # public instance variables
  1045.   #--------------------------------------------------------------------------
  1046.   attr_accessor :command_window
  1047.   
  1048.   #--------------------------------------------------------------------------
  1049.   # alias method: start
  1050.   #--------------------------------------------------------------------------
  1051.   alias scene_shop_start_aso start
  1052.   def start
  1053.     scene_shop_start_aso
  1054.     create_actor_window
  1055.     create_data_window
  1056.     clean_up_settings
  1057.     relocate_windows
  1058.   end
  1059.   
  1060.   #--------------------------------------------------------------------------
  1061.   # overwrite method: return_scene
  1062.   #--------------------------------------------------------------------------
  1063.   def return_scene
  1064.     $game_temp.scene_shop_index = nil
  1065.     $game_temp.scene_shop_oy = nil
  1066.     super
  1067.   end
  1068.   
  1069.   #--------------------------------------------------------------------------
  1070.   # alias method: create_gold_window
  1071.   #--------------------------------------------------------------------------
  1072.   alias scene_shop_create_gold_window_aso create_gold_window
  1073.   def create_gold_window
  1074.     scene_shop_create_gold_window_aso
  1075.     @gold_window.width = Graphics.width * 2 / 5
  1076.     @gold_window.create_contents
  1077.     @gold_window.refresh
  1078.     @gold_window.x = Graphics.width - @gold_window.width
  1079.   end
  1080.   
  1081.   #--------------------------------------------------------------------------
  1082.   # alias method: create_command_window
  1083.   #--------------------------------------------------------------------------
  1084.   alias scene_shop_create_command_window_aso create_command_window
  1085.   def create_command_window
  1086.     scene_shop_create_command_window_aso
  1087.     return unless SceneManager.scene_is?(Scene_Shop)
  1088.     if !$game_temp.scene_shop_index.nil?
  1089.       @command_window.select($game_temp.scene_shop_index)
  1090.       @command_window.oy = $game_temp.scene_shop_oy
  1091.     end
  1092.     $game_temp.scene_shop_index = nil
  1093.     $game_temp.scene_shop_oy = nil
  1094.     @command_window.set_handler(:equip, method(:command_equip))
  1095.     process_custom_shop_commands
  1096.   end
  1097.   
  1098.   #--------------------------------------------------------------------------
  1099.   # new method: process_custom_shop_commands
  1100.   #--------------------------------------------------------------------------
  1101.   def process_custom_shop_commands
  1102.     for command in YEA::SHOP::COMMANDS
  1103.       next unless YEA::SHOP::CUSTOM_SHOP_COMMANDS.include?(command)
  1104.       called_method = YEA::SHOP::CUSTOM_SHOP_COMMANDS[command][3]
  1105.       @command_window.set_handler(command, method(called_method))
  1106.     end
  1107.   end
  1108.   
  1109.   #--------------------------------------------------------------------------
  1110.   # alias method: create_dummy_window
  1111.   #--------------------------------------------------------------------------
  1112.   alias scene_shop_create_dummy_window_aso create_dummy_window
  1113.   def create_dummy_window
  1114.     scene_shop_create_dummy_window_aso
  1115.     @gold_window.y = @dummy_window.y
  1116.     @dummy_window.opacity = 0
  1117.   end
  1118.   
  1119.   #--------------------------------------------------------------------------
  1120.   # overwrite method: create_category_window
  1121.   #--------------------------------------------------------------------------
  1122.   def create_category_window
  1123.     @category_window = Window_ShopCategory.new
  1124.     @category_window.viewport = @viewport
  1125.     @category_window.help_window = @help_window
  1126.     @category_window.y = @command_window.y
  1127.     @category_window.deactivate
  1128.     @category_window.x = Graphics.width
  1129.     @category_window.set_handler(:ok,     method(:on_category_ok))
  1130.     @category_window.set_handler(:cancel, method(:on_category_cancel))
  1131.   end
  1132.   
  1133.   #--------------------------------------------------------------------------
  1134.   # new method: create_actor_window
  1135.   #--------------------------------------------------------------------------
  1136.   def create_actor_window
  1137.     @actor_window = Window_MenuActor.new
  1138.     @actor_window.set_handler(:ok,     method(:on_actor_ok))
  1139.     @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  1140.   end
  1141.   
  1142.   #--------------------------------------------------------------------------
  1143.   # new method: create_data_window
  1144.   #--------------------------------------------------------------------------
  1145.   def create_data_window
  1146.     wx = @command_window.width
  1147.     wy = @command_window.y
  1148.     @data_window = Window_ShopData.new(wx, wy, @buy_window)
  1149.     @data_window.viewport = @viewport
  1150.   end
  1151.   
  1152.   #--------------------------------------------------------------------------
  1153.   # new method: clean_up_settings
  1154.   #--------------------------------------------------------------------------
  1155.   def clean_up_settings
  1156.     @dummy_window.create_contents
  1157.     @buy_window.show
  1158.     @buy_window.unselect
  1159.     @buy_window.money = money
  1160.     @last_buy_index = 0
  1161.     @status_window.show
  1162.     @sell_window.show
  1163.     @sell_window.x = Graphics.width
  1164.     @sell_window.status_window = @status_window
  1165.   end
  1166.   
  1167.   #--------------------------------------------------------------------------
  1168.   # new method: relocate_windows
  1169.   #--------------------------------------------------------------------------
  1170.   def relocate_windows
  1171.     return unless $imported["YEA-AceMenuEngine"]
  1172.     case Menu.help_window_location
  1173.     when 0 # Top
  1174.       @help_window.y = 0
  1175.       @command_window.y = @help_window.height
  1176.       @buy_window.y = @command_window.y + @command_window.height
  1177.     when 1 # Middle
  1178.       @command_window.y = 0
  1179.       @help_window.y = @command_window.height
  1180.       @buy_window.y = @help_window.y + @help_window.height
  1181.     else # Bottom
  1182.       @command_window.y = 0
  1183.       @buy_window.y = @command_window.height
  1184.       @help_window.y = @buy_window.y + @buy_window.height
  1185.     end
  1186.     @category_window.y = @command_window.y
  1187.     @data_window.y = @command_window.y
  1188.     @gold_window.y = @buy_window.y
  1189.     @sell_window.y = @buy_window.y
  1190.     @number_window.y = @buy_window.y
  1191.     @status_window.y = @gold_window.y + @gold_window.height
  1192.   end
  1193.   
  1194.   #--------------------------------------------------------------------------
  1195.   # new method: show_sub_window
  1196.   #--------------------------------------------------------------------------
  1197.   def show_sub_window(window)
  1198.     width_remain = Graphics.width - window.width
  1199.     window.x = width_remain
  1200.     @viewport.rect.x = @viewport.ox = 0
  1201.     @viewport.rect.width = width_remain
  1202.     window.show.activate
  1203.   end
  1204.   
  1205.   #--------------------------------------------------------------------------
  1206.   # new method: hide_sub_window
  1207.   #--------------------------------------------------------------------------
  1208.   def hide_sub_window(window)
  1209.     @viewport.rect.x = @viewport.ox = 0
  1210.     @viewport.rect.width = Graphics.width
  1211.     window.hide.deactivate
  1212.     @command_window.activate
  1213.   end
  1214.   
  1215.   #--------------------------------------------------------------------------
  1216.   # new method: on_actor_ok
  1217.   #--------------------------------------------------------------------------
  1218.   def on_actor_ok
  1219.     case @command_window.current_symbol
  1220.     when :equip
  1221.       Sound.play_ok
  1222.       $game_party.menu_actor = $game_party.members[@actor_window.index]
  1223.       SceneManager.call(Scene_Equip)
  1224.     end
  1225.   end
  1226.   
  1227.   #--------------------------------------------------------------------------
  1228.   # new method: on_actor_cancel
  1229.   #--------------------------------------------------------------------------
  1230.   def on_actor_cancel
  1231.     hide_sub_window(@actor_window)
  1232.   end
  1233.   
  1234.   #--------------------------------------------------------------------------
  1235.   # alias method: activate_sell_window
  1236.   #--------------------------------------------------------------------------
  1237.   alias scene_shop_activate_sell_window_aso activate_sell_window
  1238.   def activate_sell_window
  1239.     scene_shop_activate_sell_window_aso
  1240.     @status_window.show
  1241.   end
  1242.   
  1243.   #--------------------------------------------------------------------------
  1244.   # alias method: command_buy
  1245.   #--------------------------------------------------------------------------
  1246.   alias scene_shop_command_buy_aso command_buy
  1247.   def command_buy
  1248.     scene_shop_command_buy_aso
  1249.     @buy_window.select(@last_buy_index)
  1250.     @data_window.item_window = @buy_window
  1251.   end
  1252.   
  1253.   #--------------------------------------------------------------------------
  1254.   # overwrite method: command_sell
  1255.   #--------------------------------------------------------------------------
  1256.   def command_sell
  1257.     @dummy_window.hide
  1258.     @category_window.activate
  1259.     @category_window.x = 0
  1260.     @command_window.x = Graphics.width
  1261.     @sell_window.x = 0
  1262.     @buy_window.x = Graphics.width
  1263.     @sell_window.unselect
  1264.     @sell_window.refresh
  1265.     @data_window.item_window = @sell_window
  1266.   end
  1267.   
  1268.   #--------------------------------------------------------------------------
  1269.   # alias method: on_buy_cancel
  1270.   #--------------------------------------------------------------------------
  1271.   alias scene_shop_on_buy_cancel_aso on_buy_cancel
  1272.   def on_buy_cancel
  1273.     @last_buy_index = @buy_window.index
  1274.     @buy_window.unselect
  1275.     scene_shop_on_buy_cancel_aso
  1276.     @buy_window.show
  1277.     @status_window.show
  1278.   end
  1279.   
  1280.   #--------------------------------------------------------------------------
  1281.   # alias method: on_sell_ok
  1282.   #--------------------------------------------------------------------------
  1283.   alias scene_shop_on_sell_ok_aso on_sell_ok
  1284.   def on_sell_ok
  1285.     scene_shop_on_sell_ok_aso
  1286.     @category_window.show
  1287.   end
  1288.   
  1289.   #--------------------------------------------------------------------------
  1290.   # overwrite method: on_category_cancel
  1291.   #--------------------------------------------------------------------------
  1292.   def on_category_cancel
  1293.     @command_window.activate
  1294.     @dummy_window.show
  1295.     @category_window.x = Graphics.width
  1296.     @command_window.x = 0
  1297.     @sell_window.x = Graphics.width
  1298.     @buy_window.money = money
  1299.     @buy_window.x = 0
  1300.   end
  1301.   
  1302.   #--------------------------------------------------------------------------
  1303.   # new method: current_command_window_symbol
  1304.   #--------------------------------------------------------------------------
  1305.   def current_command_window_symbol
  1306.     return @command_window.current_symbol
  1307.   end
  1308.   
  1309.   #--------------------------------------------------------------------------
  1310.   # new method: current_command_window_y
  1311.   #--------------------------------------------------------------------------
  1312.   def current_command_window
  1313.     return @command_window
  1314.   end
  1315.   
  1316.   #--------------------------------------------------------------------------
  1317.   # new method: command_equip
  1318.   #--------------------------------------------------------------------------
  1319.   def command_equip
  1320.     show_sub_window(@actor_window)
  1321.     @actor_window.select_last
  1322.   end
  1323.   
  1324.   #--------------------------------------------------------------------------
  1325.   # new method: command_synthshop
  1326.   #--------------------------------------------------------------------------
  1327.   def command_synthshop
  1328.     SceneManager.call(Scene_SynthesisShop)
  1329.   end
  1330.   
  1331.   #--------------------------------------------------------------------------
  1332.   # new method: command_name1
  1333.   #--------------------------------------------------------------------------
  1334.   def command_name1
  1335.     # Do nothing.
  1336.   end
  1337.   
  1338.   #--------------------------------------------------------------------------
  1339.   # new method: command_name2
  1340.   #--------------------------------------------------------------------------
  1341.   def command_name2
  1342.     # Do nothing.
  1343.   end
  1344.   
  1345. end # Scene_Shop

  1346. #==============================================================================
  1347. #
  1348. # ▼ End of File
  1349. #
  1350. #==============================================================================
复制代码
LZ看看这个怎么样
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
175 小时
注册时间
2011-12-28
帖子
93
5
 楼主| 发表于 2012-3-29 10:40:51 | 只看该作者
xuzhengchi 发表于 2012-3-28 22:07
LZ看看这个怎么样

感谢LS的脚本,但我想实现的不是在商店时使用的效果 ...

或者这样说吧...我按Esc打开人物界面,,然后选择"物品",就可以出现下面的画面.:

回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
149
在线时间
664 小时
注册时间
2011-9-25
帖子
241
6
发表于 2012-3-29 10:52:30 | 只看该作者
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Item Menu v1.02
  4. # -- Last Updated: 2012.01.05
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-ItemMenu"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.05 - Compatibility Update with Equip Dynamic Stats.
  15. # 2012.01.03 - Started Script and Finished.
  16. #            - Compatibility Update with Ace Menu Engine.
  17. #
  18. #==============================================================================
  19. # ▼ Introduction
  20. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  21. # The Ace Item Menu offers more item categorization control and a better layout
  22. # that simulatenously provides information regarding the items to the player,
  23. # while keeping a good amount of the item list visible on screen at once. The
  24. # script can also be customized to rearrange commands and categories.
  25. #
  26. #==============================================================================
  27. # ▼ Instructions
  28. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. # To install this script, open up your script editor and copy/paste this script
  30. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  31. #
  32. # -----------------------------------------------------------------------------
  33. # Item Notetags - These notetags go in the item notebox in the database.
  34. # -----------------------------------------------------------------------------
  35. # <category: string>
  36. # Places this object into the item category for "string". Whenever the selected
  37. # category is highlighted in the Ace Item Menu command window, this object will
  38. # be included and shown in the item window.
  39. #
  40. # <image: string>
  41. # Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's
  42. # directory with the filename of "string" (without the extension) as the image
  43. # picture shown in the Ace Item Menu.
  44. #
  45. # -----------------------------------------------------------------------------
  46. # Weapon Notetags - These notetags go in the weapon notebox in the database.
  47. # -----------------------------------------------------------------------------
  48. # <category: string>
  49. # Places this object into the item category for "string". Whenever the selected
  50. # category is highlighted in the Ace Item Menu command window, this object will
  51. # be included and shown in the item window.
  52. #
  53. # <image: string>
  54. # Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's
  55. # directory with the filename of "string" (without the extension) as the image
  56. # picture shown in the Ace Item Menu.
  57. #
  58. # -----------------------------------------------------------------------------
  59. # Armour Notetags - These notetags go in the armour notebox in the database.
  60. # -----------------------------------------------------------------------------
  61. # <category: string>
  62. # Places this object into the item category for "string". Whenever the selected
  63. # category is highlighted in the Ace Item Menu command window, this object will
  64. # be included and shown in the item window.
  65. #
  66. # <image: string>
  67. # Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's
  68. # directory with the filename of "string" (without the extension) as the image
  69. # picture shown in the Ace Item Menu.
  70. #
  71. #==============================================================================
  72. # ▼ Compatibility
  73. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  74. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  75. # it will run with RPG Maker VX without adjusting.
  76. #
  77. #==============================================================================

  78. module YEA
  79.   module ITEM
  80.    
  81.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  82.     # - Item Command Settings -
  83.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  84.     # This array adjusts what options appear in the initial item command window
  85.     # before the items are split into separate categories. Add commands, remove
  86.     # commands, or rearrange them. Here's a list of which does what:
  87.     #
  88.     # -------------------------------------------------------------------------
  89.     # :command         Description
  90.     # -------------------------------------------------------------------------
  91.     # :item            Opens up the various item categories. Default.
  92.     # :weapon          Opens up the various weapon categories. Default.
  93.     # :armor           Opens up the various armour categories. Default.
  94.     # :key_item        Shows a list of the various key items. Default.
  95.     #
  96.     # :gogototori      Requires Kread-EX's Go Go Totori Synthesis.
  97.     #
  98.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  99.     COMMANDS =[
  100.       :item,         # Opens up the various item categories. Default.
  101.       :weapon,       # Opens up the various weapon categories. Default.
  102.       :armor,        # Opens up the various armour categories. Default.
  103.       :key_item,     # Shows a list of the various key items. Default.
  104.       :gogototori,   # Requires Kread-EX's Go Go Totori Synthesis.
  105.     # :custom1,      # Custom command 1.
  106.     # :custom2,      # Custom command 2.
  107.     ] # Do not remove this.
  108.    
  109.     #--------------------------------------------------------------------------
  110.     # - Item Custom Commands -
  111.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  112.     # For those who use scripts to that may produce unique effects for the item
  113.     # scene, use this hash to manage the custom commands for the Item Command
  114.     # Window. You can disable certain commands or prevent them from appearing
  115.     # by using switches. If you don't wish to bind them to a switch, set the
  116.     # proper switch to 0 for it to have no impact.
  117.     #--------------------------------------------------------------------------
  118.     CUSTOM_ITEM_COMMANDS ={
  119.     # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
  120.       :gogototori => ["Synthesis",            0,         0, :command_totori],
  121.       :custom1 => [ "Custom Name",            0,          0, :command_name1],
  122.       :custom2 => [ "Custom Text",           13,          0, :command_name2],
  123.     } # Do not remove this.
  124.    
  125.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  126.     # - Item Type Settings -
  127.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  128.     # These arrays adjusts and shows the various item types shown for Items,
  129.     # Weapons, and Armours. Note that when using :category symbols, the
  130.     # specific category shown will be equal to the text used for the Display
  131.     # and the included item must contain a category equal to the Display name.
  132.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  133.     # This array contains the order for the Item categories.
  134.     ITEM_TYPES =[
  135.     # [  :symbol,   "Display"],
  136.       [   :field,     "Field"], # Shows Menu-usable items.
  137.       [  :battle,    "Battle"], # Shows Battle-usable items.
  138.       [:category,   "Special"], # Categorized by <category: string>
  139.       [:category,"Ingredient"], # Categorized by <category: string>
  140.       [:key_item,  "Key Item"], # Shows all key items.
  141.       [     :all,       "All"], # Shows all usable items.
  142.     ] # Do not remove this.
  143.    
  144.     # This array contains the order for the Weapon categories.
  145.     WEAPON_TYPES =[
  146.     # [  :symbol,   "Display"],
  147.       [   :types,  "WPNTYPES"], # Lists all of the individual weapon types.
  148.       [:category,  "Training"], # Categorized by <category: string>
  149.       [:category, "Legendary"], # Categorized by <category: string>
  150.       [     :all,       "All"], # Shows all weapons.
  151.     ] # Do not remove this.
  152.    
  153.     # This array contains the order for the Armour categories.
  154.     ARMOUR_TYPES =[
  155.     # [  :symbol,   "Display"],
  156.       [   :slots,  "ARMSLOTS"], # Lists all of the individual armour slots.
  157.       [   :types,  "ARMTYPES"], # Lists all of the individual armours types.
  158.       [:category,  "Training"], # Categorized by <category: string>
  159.       [:category, "Legendary"], # Categorized by <category: string>
  160.       [     :all,       "All"], # Shows all armours.
  161.     ] # Do not remove this.
  162.    
  163.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  164.     # - Item Status Settings -
  165.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  166.     # The item status window displays information about the item in detail.
  167.     # Adjust the settings below to change the way the status window appears.
  168.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  169.     STATUS_FONT_SIZE = 20       # Font size used for status window.
  170.     MAX_ICONS_DRAWN  = 10       # Maximum number of icons drawn for states.
  171.    
  172.     # The following adjusts the vocabulary used for the status window. Each
  173.     # of the vocabulary settings are self explanatory.
  174.     VOCAB_STATUS ={
  175.       :empty      => "---",          # Text used when nothing is shown.
  176.       :hp_recover => "HP Heal",      # Text used for HP Recovery.
  177.       :mp_recover => "MP Heal",      # Text used for MP Recovery.
  178.       :tp_recover => "TP Heal",      # Text used for TP Recovery.
  179.       :tp_gain    => "TP Gain",      # Text used for TP Gain.
  180.       :applies    => "Applies",      # Text used for applied states and buffs.
  181.       :removes    => "Removes",      # Text used for removed states and buffs.
  182.     } # Do not remove this.
  183.    
  184.   end # ITEM
  185. end # YEA

  186. #==============================================================================
  187. # ▼ Editting anything past this point may potentially result in causing
  188. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  189. # halitosis so edit at your own risk.
  190. #==============================================================================

  191. module YEA
  192.   module REGEXP
  193.   module BASEITEM
  194.    
  195.     CATEGORY = /<(?:CATEGORIES|category):[ ](.*)>/i
  196.     IMAGE    = /<(?:IMAGE|image):[ ](.*)>/i
  197.    
  198.   end # BASEITEM
  199.   end # REGEXP
  200. end # YEA

  201. #==============================================================================
  202. # ■ Numeric
  203. #==============================================================================

  204. class Numeric
  205.   
  206.   #--------------------------------------------------------------------------
  207.   # new method: group_digits
  208.   #--------------------------------------------------------------------------
  209.   unless $imported["YEA-CoreEngine"]
  210.   def group; return self.to_s; end
  211.   end # $imported["YEA-CoreEngine"]
  212.    
  213. end # Numeric

  214. #==============================================================================
  215. # ■ Vocab
  216. #==============================================================================

  217. module Vocab
  218.   
  219.   #--------------------------------------------------------------------------
  220.   # new method: self.item_status
  221.   #--------------------------------------------------------------------------
  222.   def self.item_status(type)
  223.     return YEA::ITEM::VOCAB_STATUS[type]
  224.   end
  225.   
  226. end # Vocab

  227. #==============================================================================
  228. # ■ DataManager
  229. #==============================================================================

  230. module DataManager
  231.   
  232.   #--------------------------------------------------------------------------
  233.   # alias method: load_database
  234.   #--------------------------------------------------------------------------
  235.   class <<self; alias load_database_aim load_database; end
  236.   def self.load_database
  237.     load_database_aim
  238.     load_notetags_aim
  239.   end
  240.   
  241.   #--------------------------------------------------------------------------
  242.   # new method: load_notetags_aim
  243.   #--------------------------------------------------------------------------
  244.   def self.load_notetags_aim
  245.     groups = [$data_items, $data_weapons, $data_armors]
  246.     for group in groups
  247.       for obj in group
  248.         next if obj.nil?
  249.         obj.load_notetags_aim
  250.       end
  251.     end
  252.   end
  253.   
  254. end # DataManager

  255. #==============================================================================
  256. # ■ RPG::BaseItem
  257. #==============================================================================

  258. class RPG::BaseItem
  259.   
  260.   #--------------------------------------------------------------------------
  261.   # public instance variables
  262.   #--------------------------------------------------------------------------
  263.   attr_accessor :category
  264.   attr_accessor :image
  265.   
  266.   #--------------------------------------------------------------------------
  267.   # common cache: load_notetags_aim
  268.   #--------------------------------------------------------------------------
  269.   def load_notetags_aim
  270.     @category = []
  271.     #---
  272.     self.note.split(/[\r\n]+/).each { |line|
  273.       case line
  274.       #---
  275.       when YEA::REGEXP::BASEITEM::CATEGORY
  276.         @category.push($1.upcase.to_s)
  277.       when YEA::REGEXP::BASEITEM::IMAGE
  278.         @image = $1.to_s
  279.       end
  280.     } # self.note.split
  281.     #---
  282.   end
  283.   
  284. end # RPG::BaseItem

  285. #==============================================================================
  286. # ■ Game_Temp
  287. #==============================================================================

  288. class Game_Temp
  289.   
  290.   #--------------------------------------------------------------------------
  291.   # public instance variables
  292.   #--------------------------------------------------------------------------
  293.   attr_accessor :scene_item_index
  294.   attr_accessor :scene_item_oy
  295.   
  296. end # Game_Temp

  297. #==============================================================================
  298. # ■ Window_ItemList
  299. #==============================================================================

  300. class Window_ItemList < Window_Selectable
  301.   
  302.   #--------------------------------------------------------------------------
  303.   # overwrite method: draw_item
  304.   #--------------------------------------------------------------------------
  305.   def draw_item(index)
  306.     item = @data[index]
  307.     return if item.nil?
  308.     rect = item_rect(index)
  309.     rect.width -= 4
  310.     draw_item_name(item, rect.x, rect.y, enable?(item), rect.width - 24)
  311.     draw_item_number(rect, item)
  312.   end
  313.   
  314. end # Window_ItemList

  315. #==============================================================================
  316. # ■ Window_ItemCommand
  317. #==============================================================================

  318. class Window_ItemCommand < Window_Command
  319.   
  320.   #--------------------------------------------------------------------------
  321.   # public instance variables
  322.   #--------------------------------------------------------------------------
  323.   attr_reader   :item_window
  324.   
  325.   #--------------------------------------------------------------------------
  326.   # initialize
  327.   #--------------------------------------------------------------------------
  328.   def initialize(x, y)
  329.     super(x, y)
  330.   end
  331.   
  332.   #--------------------------------------------------------------------------
  333.   # window_width
  334.   #--------------------------------------------------------------------------
  335.   def window_width; return 160; end
  336.   
  337.   #--------------------------------------------------------------------------
  338.   # visible_line_number
  339.   #--------------------------------------------------------------------------
  340.   def visible_line_number; return 4; end
  341.   
  342.   #--------------------------------------------------------------------------
  343.   # process_ok
  344.   #--------------------------------------------------------------------------
  345.   def process_ok
  346.     $game_temp.scene_item_index = index
  347.     $game_temp.scene_item_oy = self.oy
  348.     super
  349.   end
  350.   
  351.   #--------------------------------------------------------------------------
  352.   # make_command_list
  353.   #--------------------------------------------------------------------------
  354.   def make_command_list
  355.     for command in YEA::ITEM::COMMANDS
  356.       case command
  357.       #--- Default Commands ---
  358.       when :item
  359.         add_command(Vocab::item, :item)
  360.       when :weapon
  361.         add_command(Vocab::weapon, :weapon)
  362.       when :armor
  363.         add_command(Vocab::armor, :armor)
  364.       when :key_item
  365.         add_command(Vocab::key_item, :key_item)
  366.       #--- Imported ---
  367.       when :gogototori
  368.         next unless $imported["KRX-AlchemicSynthesis"]
  369.         process_custom_command(command)
  370.       #--- Custom Commands ---
  371.       else
  372.         process_custom_command(command)
  373.       end
  374.     end
  375.   end
  376.   
  377.   #--------------------------------------------------------------------------
  378.   # process_custom_command
  379.   #--------------------------------------------------------------------------
  380.   def process_custom_command(command)
  381.     return unless YEA::ITEM::CUSTOM_ITEM_COMMANDS.include?(command)
  382.     show = YEA::ITEM::CUSTOM_ITEM_COMMANDS[command][2]
  383.     continue = show <= 0 ? true : $game_switches[show]
  384.     return unless continue
  385.     text = YEA::ITEM::CUSTOM_ITEM_COMMANDS[command][0]
  386.     switch = YEA::ITEM::CUSTOM_ITEM_COMMANDS[command][1]
  387.     enabled = switch <= 0 ? true : $game_switches[switch]
  388.     add_command(text, command, enabled)
  389.   end
  390.   
  391.   #--------------------------------------------------------------------------
  392.   # update
  393.   #--------------------------------------------------------------------------
  394.   def update
  395.     super
  396.     return unless self.active
  397.     @item_window.category = current_symbol if @item_window
  398.   end
  399.   
  400.   #--------------------------------------------------------------------------
  401.   # item_window=
  402.   #--------------------------------------------------------------------------
  403.   def item_window=(item_window)
  404.     @item_window = item_window
  405.     update
  406.   end
  407.   
  408. end # Window_ItemCommand

  409. #==============================================================================
  410. # ■ Window_ItemType
  411. #==============================================================================

  412. class Window_ItemType < Window_Command
  413.   
  414.   #--------------------------------------------------------------------------
  415.   # public instance variables
  416.   #--------------------------------------------------------------------------
  417.   attr_reader   :item_window
  418.   
  419.   #--------------------------------------------------------------------------
  420.   # initialize
  421.   #--------------------------------------------------------------------------
  422.   def initialize(x, y)
  423.     super(x, y)
  424.     deactivate
  425.     @type = nil
  426.   end
  427.   
  428.   #--------------------------------------------------------------------------
  429.   # window_width
  430.   #--------------------------------------------------------------------------
  431.   def window_width; return 160; end
  432.   
  433.   #--------------------------------------------------------------------------
  434.   # visible_line_number
  435.   #--------------------------------------------------------------------------
  436.   def visible_line_number; return 4; end
  437.   
  438.   #--------------------------------------------------------------------------
  439.   # reveal
  440.   #--------------------------------------------------------------------------
  441.   def reveal(type)
  442.     @type = type
  443.     refresh
  444.     activate
  445.     select(0)
  446.   end
  447.   
  448.   #--------------------------------------------------------------------------
  449.   # make_command_list
  450.   #--------------------------------------------------------------------------
  451.   def make_command_list
  452.     return if @type.nil?
  453.     #---
  454.     case @type
  455.     when :item
  456.       commands = YEA::ITEM::ITEM_TYPES
  457.     when :weapon
  458.       commands = YEA::ITEM::WEAPON_TYPES
  459.     else
  460.       commands = YEA::ITEM::ARMOUR_TYPES
  461.     end
  462.     #---
  463.     for command in commands
  464.       case command[0]
  465.       #---
  466.       when :types
  467.         case @type
  468.         when :weapon
  469.           for i in 1...$data_system.weapon_types.size
  470.             name = $data_system.weapon_types[i]
  471.             add_command(name, :w_type, true, i)
  472.           end
  473.         else
  474.           for i in 1...$data_system.armor_types.size
  475.             name = $data_system.armor_types[i]
  476.             add_command(name, :a_type, true, i)
  477.           end
  478.         end
  479.       #---
  480.       when :slots
  481.         if $imported["YEA-AceEquipEngine"]
  482.           maximum = 1
  483.           for key in YEA::EQUIP::TYPES
  484.             maximum = [maximum, key[0]].max
  485.           end
  486.         else
  487.           maximum = 4
  488.         end
  489.         for i in 1..maximum
  490.           name = Vocab::etype(i)
  491.           add_command(name, :e_type, true, i) if name != ""
  492.         end
  493.       #---
  494.       else
  495.         add_command(command[1], command[0], true, @type)
  496.       end
  497.     end
  498.   end
  499.   
  500.   #--------------------------------------------------------------------------
  501.   # update
  502.   #--------------------------------------------------------------------------
  503.   def update
  504.     super
  505.     return unless self.active
  506.     @item_window.category = current_symbol if @item_window
  507.   end
  508.   
  509.   #--------------------------------------------------------------------------
  510.   # item_window=
  511.   #--------------------------------------------------------------------------
  512.   def item_window=(item_window)
  513.     @item_window = item_window
  514.     update
  515.   end
  516.   
  517. end # Window_ItemType

  518. #==============================================================================
  519. # ■ Window_ItemList
  520. #==============================================================================

  521. class Window_ItemList < Window_Selectable
  522.   
  523.   #--------------------------------------------------------------------------
  524.   # alias method: initialize
  525.   #--------------------------------------------------------------------------
  526.   alias window_itemlist_initialize_aim initialize
  527.   def initialize(dx, dy, dw, dh)
  528.     window_itemlist_initialize_aim(dx, dy, dw, dh)
  529.     @ext = :none
  530.     @name = ""
  531.   end
  532.   
  533.   #--------------------------------------------------------------------------
  534.   # alias method: category=
  535.   #--------------------------------------------------------------------------
  536.   alias window_itemlist_category_aim category=
  537.   def category=(category)
  538.     if @types_window.nil?
  539.       window_itemlist_category_aim(category)
  540.     else
  541.       return unless update_types?(category)
  542.       @category = category
  543.       if @types_window.active
  544.         @name = @types_window.current_data[:name]
  545.         @ext = @types_window.current_ext
  546.       end
  547.       refresh
  548.       self.oy = 0
  549.     end
  550.   end
  551.   
  552.   #--------------------------------------------------------------------------
  553.   # new method: update_types?
  554.   #--------------------------------------------------------------------------
  555.   def update_types?(category)
  556.     return true if @category != category
  557.     return false unless @types_window.active
  558.     if category == :category
  559.       return @name != @types_window.current_data[:name]
  560.     end
  561.     return @ext != @types_window.current_ext
  562.   end
  563.   
  564.   #--------------------------------------------------------------------------
  565.   # new method: types_window=
  566.   #--------------------------------------------------------------------------
  567.   def types_window=(window)
  568.     @types_window = window
  569.   end
  570.   
  571.   #--------------------------------------------------------------------------
  572.   # alias method: include?
  573.   #--------------------------------------------------------------------------
  574.   alias window_itemlist_include_aim include?
  575.   def include?(item)
  576.     if @types_window.nil?
  577.       return window_itemlist_include_aim(item)
  578.     else
  579.       return ace_item_menu_include?(item)
  580.     end
  581.   end
  582.   
  583.   #--------------------------------------------------------------------------
  584.   # new method: ace_item_menu_include?
  585.   #--------------------------------------------------------------------------
  586.   def ace_item_menu_include?(item)
  587.     case @category
  588.     #---
  589.     when :field
  590.       return false unless item.is_a?(RPG::Item)
  591.       return item.menu_ok?
  592.     when :battle
  593.       return false unless item.is_a?(RPG::Item)
  594.       return item.battle_ok?
  595.     #---
  596.     when :w_type
  597.       return false unless item.is_a?(RPG::Weapon)
  598.       return item.wtype_id == @types_window.current_ext
  599.     when :a_type
  600.       return false unless item.is_a?(RPG::Armor)
  601.       return item.atype_id == @types_window.current_ext
  602.     when :e_type
  603.       return false unless item.is_a?(RPG::Armor)
  604.       return item.etype_id == @types_window.current_ext
  605.     #---
  606.     when :all
  607.       case @types_window.current_ext
  608.       when :item
  609.         return item.is_a?(RPG::Item)
  610.       when :weapon
  611.         return item.is_a?(RPG::Weapon)
  612.       else
  613.         return item.is_a?(RPG::Armor)
  614.       end
  615.     #---
  616.     when :category
  617.       case @types_window.current_ext
  618.       when :item
  619.         return false unless item.is_a?(RPG::Item)
  620.       when :weapon
  621.         return false unless item.is_a?(RPG::Weapon)
  622.       else
  623.         return false unless item.is_a?(RPG::Armor)
  624.       end
  625.       return item.category.include?(@types_window.current_data[:name].upcase)
  626.     #---
  627.     else
  628.       return window_itemlist_include_aim(item)
  629.     end
  630.   end
  631.   
  632. end # Window_ItemList

  633. #==============================================================================
  634. # ■ Window_ItemStatus
  635. #==============================================================================

  636. class Window_ItemStatus < Window_Base
  637.   
  638.   #--------------------------------------------------------------------------
  639.   # initialize
  640.   #--------------------------------------------------------------------------
  641.   def initialize(dx, dy, item_window)
  642.     super(dx, dy, Graphics.width - dx, fitting_height(4))
  643.     @item_window = item_window
  644.     @item = nil
  645.     refresh
  646.   end
  647.   
  648.   #--------------------------------------------------------------------------
  649.   # update
  650.   #--------------------------------------------------------------------------
  651.   def update
  652.     super
  653.     update_item(@item_window.item)
  654.   end
  655.   
  656.   #--------------------------------------------------------------------------
  657.   # update_item
  658.   #--------------------------------------------------------------------------
  659.   def update_item(item)
  660.     return if @item == item
  661.     @item = item
  662.     refresh
  663.   end
  664.   
  665.   #--------------------------------------------------------------------------
  666.   # refresh
  667.   #--------------------------------------------------------------------------
  668.   def refresh
  669.     contents.clear
  670.     reset_font_settings
  671.     return draw_empty if @item.nil?
  672.     contents.font.size = YEA::ITEM::STATUS_FONT_SIZE
  673.     draw_item_image
  674.     draw_item_stats
  675.     draw_item_effects
  676.   end
  677.   
  678.   #--------------------------------------------------------------------------
  679.   # draw_empty
  680.   #--------------------------------------------------------------------------
  681.   def draw_empty
  682.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  683.     rect = Rect.new(1, 1, 94, 94)
  684.     contents.fill_rect(rect, colour)
  685.     dx = 96; dy = 0
  686.     dw = (contents.width - 96) / 2
  687.     for i in 0...8
  688.       draw_background_box(dx, dy, dw)
  689.       dx = dx >= 96 + dw ? 96 : 96 + dw
  690.       dy += line_height if dx == 96
  691.     end
  692.   end
  693.   
  694.   #--------------------------------------------------------------------------
  695.   # draw_background_box
  696.   #--------------------------------------------------------------------------
  697.   def draw_background_box(dx, dy, dw)
  698.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  699.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  700.     contents.fill_rect(rect, colour)
  701.   end
  702.   
  703.   #--------------------------------------------------------------------------
  704.   # draw_item_image
  705.   #--------------------------------------------------------------------------
  706.   def draw_item_image
  707.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  708.     rect = Rect.new(1, 1, 94, 94)
  709.     contents.fill_rect(rect, colour)
  710.     if @item.image.nil?
  711.       icon_index = @item.icon_index
  712.       bitmap = Cache.system("Iconset")
  713.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  714.       target = Rect.new(0, 0, 96, 96)
  715.       contents.stretch_blt(target, bitmap, rect)
  716.     else
  717.       bitmap = Cache.picture(@item.image)
  718.       contents.blt(0, 0, bitmap, bitmap.rect, 255)
  719.     end
  720.   end
  721.   
  722.   #--------------------------------------------------------------------------
  723.   # draw_item_stats
  724.   #--------------------------------------------------------------------------
  725.   def draw_item_stats
  726.     return unless @item.is_a?(RPG::Weapon) || @item.is_a?(RPG::Armor)
  727.     dx = 96; dy = 0
  728.     dw = (contents.width - 96) / 2
  729.     for i in 0...8
  730.       draw_equip_param(i, dx, dy, dw)
  731.       dx = dx >= 96 + dw ? 96 : 96 + dw
  732.       dy += line_height if dx == 96
  733.     end
  734.   end
  735.   
  736.   #--------------------------------------------------------------------------
  737.   # draw_equip_param
  738.   #--------------------------------------------------------------------------
  739.   def draw_equip_param(param_id, dx, dy, dw)
  740.     draw_background_box(dx, dy, dw)
  741.     change_color(system_color)
  742.     draw_text(dx+4, dy, dw-8, line_height, Vocab::param(param_id))
  743.     if $imported["YEA-EquipDynamicStats"]
  744.       draw_percentage_param(param_id, dx, dy, dw)
  745.     else
  746.       draw_set_param(param_id, dx, dy, dw)
  747.     end
  748.   end
  749.   
  750.   #--------------------------------------------------------------------------
  751.   # draw_percentage_param
  752.   #--------------------------------------------------------------------------
  753.   def draw_percentage_param(param_id, dx, dy, dw)
  754.     if @item.per_params[param_id] != 0 && @item.params[param_id] != 0
  755.       text = draw_set_param(param_id, dx, dy, dw)
  756.       dw -= text_size(text).width
  757.       draw_percent_param(param_id, dx, dy, dw)
  758.     elsif @item.per_params[param_id] != 0 && @item.params[param_id] == 0
  759.       draw_percent_param(param_id, dx, dy, dw)
  760.     else
  761.       draw_set_param(param_id, dx, dy, dw)
  762.     end
  763.   end
  764.   
  765.   #--------------------------------------------------------------------------
  766.   # draw_set_param
  767.   #--------------------------------------------------------------------------
  768.   def draw_set_param(param_id, dx, dy, dw)
  769.     value = @item.params[param_id]
  770.     if $imported["YEA-EquipDynamicStats"] && @item.var_params[param_id] > 0
  771.       value += $game_variables[@item.var_params[param_id]] rescue 0
  772.     end
  773.     change_color(param_change_color(value), value != 0)
  774.     text = value.group
  775.     text = "+" + text if value > 0
  776.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  777.     return text
  778.   end
  779.   
  780.   #--------------------------------------------------------------------------
  781.   # draw_percent_param
  782.   #--------------------------------------------------------------------------
  783.   def draw_percent_param(param_id, dx, dy, dw)
  784.     value = @item.per_params[param_id]
  785.     change_color(param_change_color(value))
  786.     text = (@item.per_params[param_id] * 100).to_i.group + "%"
  787.     text = "+" + text if @item.per_params[param_id] > 0
  788.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  789.     return text
  790.   end
  791.   
  792.   #--------------------------------------------------------------------------
  793.   # draw_item_effects
  794.   #--------------------------------------------------------------------------
  795.   def draw_item_effects
  796.     return unless @item.is_a?(RPG::Item)
  797.     dx = 96; dy = 0
  798.     dw = (contents.width - 96) / 2
  799.     draw_hp_recover(dx, dy + line_height * 0, dw)
  800.     draw_mp_recover(dx, dy + line_height * 1, dw)
  801.     draw_tp_recover(dx + dw, dy + line_height * 0, dw)
  802.     draw_tp_gain(dx + dw, dy + line_height * 1, dw)
  803.     dw = contents.width - 96
  804.     draw_applies(dx, dy + line_height * 2, dw)
  805.     draw_removes(dx, dy + line_height * 3, dw)
  806.   end
  807.   
  808.   #--------------------------------------------------------------------------
  809.   # draw_hp_recover
  810.   #--------------------------------------------------------------------------
  811.   def draw_hp_recover(dx, dy, dw)
  812.     draw_background_box(dx, dy, dw)
  813.     change_color(system_color)
  814.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:hp_recover))
  815.     per = 0
  816.     set = 0
  817.     for effect in @item.effects
  818.       next unless effect.code == 11
  819.       per += (effect.value1 * 100).to_i
  820.       set += effect.value2.to_i
  821.     end
  822.     if per != 0 && set != 0
  823.       change_color(param_change_color(set))
  824.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  825.       draw_text(dx+4, dy, dw-8, line_height, text, 2)
  826.       dw -= text_size(text).width
  827.       change_color(param_change_color(per))
  828.       text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
  829.       draw_text(dx+4, dy, dw-8, line_height, text, 2)
  830.       return
  831.     elsif per != 0
  832.       change_color(param_change_color(per))
  833.       text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
  834.     elsif set != 0
  835.       change_color(param_change_color(set))
  836.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  837.     else
  838.       change_color(normal_color, false)
  839.       text = Vocab::item_status(:empty)
  840.     end
  841.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  842.   end
  843.   
  844.   #--------------------------------------------------------------------------
  845.   # draw_mp_recover
  846.   #--------------------------------------------------------------------------
  847.   def draw_mp_recover(dx, dy, dw)
  848.     draw_background_box(dx, dy, dw)
  849.     change_color(system_color)
  850.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:mp_recover))
  851.     per = 0
  852.     set = 0
  853.     for effect in @item.effects
  854.       next unless effect.code == 12
  855.       per += (effect.value1 * 100).to_i
  856.       set += effect.value2.to_i
  857.     end
  858.     if per != 0 && set != 0
  859.       change_color(param_change_color(set))
  860.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  861.       draw_text(dx+4, dy, dw-8, line_height, text, 2)
  862.       dw -= text_size(text).width
  863.       change_color(param_change_color(per))
  864.       text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
  865.       draw_text(dx+4, dy, dw-8, line_height, text, 2)
  866.       return
  867.     elsif per != 0
  868.       change_color(param_change_color(per))
  869.       text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
  870.     elsif set != 0
  871.       change_color(param_change_color(set))
  872.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  873.     else
  874.       change_color(normal_color, false)
  875.       text = Vocab::item_status(:empty)
  876.     end
  877.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  878.   end
  879.   
  880.   #--------------------------------------------------------------------------
  881.   # draw_tp_recover
  882.   #--------------------------------------------------------------------------
  883.   def draw_tp_recover(dx, dy, dw)
  884.     draw_background_box(dx, dy, dw)
  885.     change_color(system_color)
  886.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:tp_recover))
  887.     set = 0
  888.     for effect in @item.effects
  889.       next unless effect.code == 13
  890.       set += effect.value1.to_i
  891.     end
  892.     if set != 0
  893.       change_color(param_change_color(set))
  894.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  895.     else
  896.       change_color(normal_color, false)
  897.       text = Vocab::item_status(:empty)
  898.     end
  899.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  900.   end
  901.   
  902.   #--------------------------------------------------------------------------
  903.   # draw_tp_gain
  904.   #--------------------------------------------------------------------------
  905.   def draw_tp_gain(dx, dy, dw)
  906.     draw_background_box(dx, dy, dw)
  907.     change_color(system_color)
  908.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:tp_gain))
  909.     set = @item.tp_gain
  910.     if set != 0
  911.       change_color(param_change_color(set))
  912.       text = set > 0 ? sprintf("+%s", set.group) : set.group
  913.     else
  914.       change_color(normal_color, false)
  915.       text = Vocab::item_status(:empty)
  916.     end
  917.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  918.   end
  919.   
  920.   #--------------------------------------------------------------------------
  921.   # draw_applies
  922.   #--------------------------------------------------------------------------
  923.   def draw_applies(dx, dy, dw)
  924.     draw_background_box(dx, dy, dw)
  925.     change_color(system_color)
  926.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:applies))
  927.     icons = []
  928.     for effect in @item.effects
  929.       case effect.code
  930.       when 21
  931.         next unless effect.value1 > 0
  932.         next if $data_states[effect.value1].nil?
  933.         icons.push($data_states[effect.data_id].icon_index)
  934.       when 31
  935.         icons.push($game_actors[1].buff_icon_index(1, effect.data_id))
  936.       when 32
  937.         icons.push($game_actors[1].buff_icon_index(-1, effect.data_id))
  938.       end
  939.       icons.delete(0)
  940.       break if icons.size >= YEA::ITEM::MAX_ICONS_DRAWN
  941.     end
  942.     draw_icons(dx, dy, dw, icons)
  943.   end
  944.   
  945.   #--------------------------------------------------------------------------
  946.   # draw_removes
  947.   #--------------------------------------------------------------------------
  948.   def draw_removes(dx, dy, dw)
  949.     draw_background_box(dx, dy, dw)
  950.     change_color(system_color)
  951.     draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:removes))
  952.     icons = []
  953.     for effect in @item.effects
  954.       case effect.code
  955.       when 22
  956.         next unless effect.value1 > 0
  957.         next if $data_states[effect.value1].nil?
  958.         icons.push($data_states[effect.data_id].icon_index)
  959.       when 33
  960.         icons.push($game_actors[1].buff_icon_index(1, effect.data_id))
  961.       when 34
  962.         icons.push($game_actors[1].buff_icon_index(-1, effect.data_id))
  963.       end
  964.       icons.delete(0)
  965.       break if icons.size >= YEA::ITEM::MAX_ICONS_DRAWN
  966.     end
  967.     draw_icons(dx, dy, dw, icons)
  968.   end
  969.   
  970.   #--------------------------------------------------------------------------
  971.   # draw_icons
  972.   #--------------------------------------------------------------------------
  973.   def draw_icons(dx, dy, dw, icons)
  974.     dx += dw - 4
  975.     dx -= icons.size * 24
  976.     for icon_id in icons
  977.       draw_icon(icon_id, dx, dy)
  978.       dx += 24
  979.     end
  980.     if icons.size == 0
  981.       change_color(normal_color, false)
  982.       text = Vocab::item_status(:empty)
  983.       draw_text(4, dy, contents.width-8, line_height, text, 2)
  984.     end
  985.   end
  986.   
  987. end # Window_ItemStatus

  988. #==============================================================================
  989. # ■ Scene_Item
  990. #==============================================================================

  991. class Scene_Item < Scene_ItemBase
  992.   
  993.   #--------------------------------------------------------------------------
  994.   # alias method: start
  995.   #--------------------------------------------------------------------------
  996.   alias scene_item_start_aim start
  997.   def start
  998.     scene_item_start_aim
  999.     create_types_window
  1000.     create_status_window
  1001.     relocate_windows
  1002.   end
  1003.   
  1004.   #--------------------------------------------------------------------------
  1005.   # overwrite method: return_scene
  1006.   #--------------------------------------------------------------------------
  1007.   def return_scene
  1008.     $game_temp.scene_item_index = nil
  1009.     $game_temp.scene_item_oy = nil
  1010.     super
  1011.   end
  1012.   
  1013.   #--------------------------------------------------------------------------
  1014.   # overwrite method: create_category_window
  1015.   #--------------------------------------------------------------------------
  1016.   def create_category_window
  1017.     wy = @help_window.height
  1018.     @category_window = Window_ItemCommand.new(0, wy)
  1019.     @category_window.viewport = @viewport
  1020.     @category_window.help_window = @help_window
  1021.     @category_window.y = @help_window.height
  1022.     if !$game_temp.scene_item_index.nil?
  1023.       @category_window.select($game_temp.scene_item_index)
  1024.       @category_window.oy = $game_temp.scene_item_oy
  1025.     end
  1026.     $game_temp.scene_item_index = nil
  1027.     $game_temp.scene_item_oy = nil
  1028.     @category_window.set_handler(:ok, method(:on_category_ok))
  1029.     @category_window.set_handler(:cancel, method(:return_scene))
  1030.     @category_window.set_handler(:item, method(:open_types))
  1031.     @category_window.set_handler(:weapon, method(:open_types))
  1032.     @category_window.set_handler(:armor, method(:open_types))
  1033.     process_custom_item_commands
  1034.   end
  1035.   
  1036.   #--------------------------------------------------------------------------
  1037.   # new method: process_custom_item_commands
  1038.   #--------------------------------------------------------------------------
  1039.   def process_custom_item_commands
  1040.     for command in YEA::ITEM::COMMANDS
  1041.       next unless YEA::ITEM::CUSTOM_ITEM_COMMANDS.include?(command)
  1042.       called_method = YEA::ITEM::CUSTOM_ITEM_COMMANDS[command][3]
  1043.       @category_window.set_handler(command, method(called_method))
  1044.     end
  1045.   end
  1046.   
  1047.   #--------------------------------------------------------------------------
  1048.   # new method: create_types_window
  1049.   #--------------------------------------------------------------------------
  1050.   def create_types_window
  1051.     wy = @category_window.y
  1052.     @types_window = Window_ItemType.new(Graphics.width, wy)
  1053.     @types_window.viewport = @viewport
  1054.     @types_window.help_window = @help_window
  1055.     @types_window.y = @help_window.height
  1056.     @types_window.item_window = @item_window
  1057.     @item_window.types_window = @types_window
  1058.     @types_window.set_handler(:ok, method(:on_types_ok))
  1059.     @types_window.set_handler(:cancel, method(:on_types_cancel))
  1060.   end
  1061.   
  1062.   #--------------------------------------------------------------------------
  1063.   # new method: create_status_window
  1064.   #--------------------------------------------------------------------------
  1065.   def create_status_window
  1066.     wx = @category_window.width
  1067.     wy = @category_window.y
  1068.     @status_window = Window_ItemStatus.new(wx, wy, @item_window)
  1069.     @status_window.viewport = @viewport
  1070.   end
  1071.   
  1072.   #--------------------------------------------------------------------------
  1073.   # new method: relocate_windows
  1074.   #--------------------------------------------------------------------------
  1075.   def relocate_windows
  1076.     return unless $imported["YEA-AceMenuEngine"]
  1077.     case Menu.help_window_location
  1078.     when 0 # Top
  1079.       @help_window.y = 0
  1080.       @category_window.y = @help_window.height
  1081.       @item_window.y = @category_window.y + @category_window.height
  1082.     when 1 # Middle
  1083.       @category_window.y = 0
  1084.       @help_window.y = @category_window.height
  1085.       @item_window.y = @help_window.y + @help_window.height
  1086.     else # Bottom
  1087.       @category_window.y = 0
  1088.       @item_window.y = @category_window.height
  1089.       @help_window.y = @item_window.y + @item_window.height
  1090.     end
  1091.     @types_window.y = @category_window.y
  1092.     @status_window.y = @category_window.y
  1093.   end
  1094.   
  1095.   #--------------------------------------------------------------------------
  1096.   # new method: open_categories
  1097.   #--------------------------------------------------------------------------
  1098.   def open_types
  1099.     @category_window.x = Graphics.width
  1100.     @types_window.x = 0
  1101.     @types_window.reveal(@category_window.current_symbol)
  1102.   end
  1103.   
  1104.   #--------------------------------------------------------------------------
  1105.   # new method: on_types_ok
  1106.   #--------------------------------------------------------------------------
  1107.   def on_types_ok
  1108.     @item_window.activate
  1109.     @item_window.select_last
  1110.   end
  1111.   
  1112.   #--------------------------------------------------------------------------
  1113.   # new method: on_types_cancel
  1114.   #--------------------------------------------------------------------------
  1115.   def on_types_cancel
  1116.     @category_window.x = 0
  1117.     @category_window.activate
  1118.     @types_window.unselect
  1119.     @types_window.x = Graphics.width
  1120.   end
  1121.   
  1122.   #--------------------------------------------------------------------------
  1123.   # alias method: on_item_cancel
  1124.   #--------------------------------------------------------------------------
  1125.   alias scene_item_on_item_cancel_aim on_item_cancel
  1126.   def on_item_cancel
  1127.     if @types_window.x <= 0
  1128.       @item_window.unselect
  1129.       @types_window.activate
  1130.     else
  1131.       scene_item_on_item_cancel_aim
  1132.     end
  1133.   end
  1134.   
  1135.   #--------------------------------------------------------------------------
  1136.   # new method: command_totori
  1137.   #--------------------------------------------------------------------------
  1138.   def command_totori
  1139.     SceneManager.call(Scene_Alchemy)
  1140.   end
  1141.   
  1142.   #--------------------------------------------------------------------------
  1143.   # new method: command_name1
  1144.   #--------------------------------------------------------------------------
  1145.   def command_name1
  1146.     # Do nothing.
  1147.   end
  1148.   
  1149.   #--------------------------------------------------------------------------
  1150.   # new method: command_name2
  1151.   #--------------------------------------------------------------------------
  1152.   def command_name2
  1153.     # Do nothing.
  1154.   end
  1155.   
  1156. end # Scene_Item

  1157. #==============================================================================
  1158. #
  1159. # ▼ End of File
  1160. #
  1161. #==============================================================================
复制代码
这个呢?也有较详细的物品说明的,还可以自定义物品的大图标
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
175 小时
注册时间
2011-12-28
帖子
93
7
 楼主| 发表于 2012-3-30 14:54:32 | 只看该作者
xuzhengchi 发表于 2012-3-29 10:52
这个呢?也有较详细的物品说明的,还可以自定义物品的大图标

抱歉..我知道我不知足了..但是游戏就是想要自己的那个效果..
脚本很好用..但是效果却有点不一样...能有教学或修改版的么??
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-28 20:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表