Guest User

Untitled

a guest
Oct 20th, 2013
38
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #==============================================================================
  2. # Customizable Item Menu
  3. # Version: 1.0.1
  4. # Author: modern algebra (rmrk.net)
  5. # Date: August 10, 2012
  6. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  7. # Description:
  8. #
  9. # This script allows you to customize various features of the default item
  10. # menu. It lets you:
  11. #
  12. # - Increase the number of lines you can use in the description window.
  13. # - Change the position of the description window.
  14. # - Show an enlarged picture of the item in the description window.
  15. # - Make new categories to make the item menu cleaner to navigate.
  16. # - Represent categories by icons instead of plain text.
  17. # - Give descriptions to the categories.
  18. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  19. # Instructions:
  20. #
  21. # Paste this script into its own slot in the Script Editor, above Main but
  22. # below Materials and other custom scripts.
  23. #
  24. # All of the configuration for this script is done within the Editable
  25. # Region starting at line 71. It is heavily commented and explains what each
  26. # option does, so I encourage you to read it. Here, however, I will explain
  27. # the configuration you can do within the note field of each item.
  28. #``````````````````````````````````````````````````````````````````````````````
  29. # If you set the image_in_description value at line 83 to true, then you can
  30. # assign an image to any given item with the following code in a note field:
  31. #
  32. # \image[filename]
  33. # where filename is the name of an image file in the Pictures folder of
  34. # Graphics.
  35. #``````````````````````````````````````````````````````````````````````````````
  36. # If you set the description_lines value at line 79 to more than 2, then
  37. # you can add new lines to the description of an item with the followinf
  38. # code in a note field:
  39. #
  40. # \desc+{new line of description}
  41. # You can add as many lines as you like, and message codes like \c[n] are
  42. # recognized.
  43. #``````````````````````````````````````````````````````````````````````````````
  44. # If you are using custom categories, then you can assign an item to appear
  45. # in the new category with the following code:
  46. #
  47. # \cim_category[unique_1, unique_2, etc...]
  48. # where unique_1, unique_2, etc... are the names of the custom categories to
  49. # which you want to assign the item. Also, if you do not want the item to
  50. # appear in its default category (a weapon in Weapons, an armour in Armours,
  51. # etc...), then all you need to do is place an ! after category and the
  52. # item will then only appear in the categories you specify, like so:
  53. #
  54. # \cim_category![unique_1, unique_2, etc...]
  55. #
  56. # EXAMPLE:
  57. # Say the following is in the note field of item 1:
  58. # \cim_category[potion]
  59. # This item will now appear in the :all, :item, and :potion categories.
  60. #
  61. # However, if the following is used:
  62. # \cim_category![potion]
  63. # then the item will only appear in the :all and :potion categories.
  64. #==============================================================================
  65.  
  66. $imported ||= {}
  67. $imported[:"MA Customizable Item Menu 1.0.x"] = true
  68.  
  69. MA_CUSTOM_ITEM_MENU = {
  70. #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  71. # BEGIN Editable Region
  72. #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  73. # DESCRIPTION OPTIONS
  74. #``````````````````````````````````````````````````````````````````````````````
  75. # description_at_top - If true, the description window will be at the top of
  76. # the screen. If false, it will be at the bottom.
  77. description_at_top: true,
  78. # description_lines - The number of lines to show in the description.
  79. description_lines: 3,
  80. # image_in_description - If false, there will be no image shown in the
  81. # description. If true, there will be. See line 29 for instructions on how to
  82. # assign an image to an item through its notefield.
  83. image_in_description: true,
  84. # image_width - If showing an image in the description window, this value is
  85. # the number of pixels the description image requires horizontally.
  86. image_width: 95,
  87. # use_enlarged_icons_as_default - If you are showing images in the description
  88. # window and this value is true, then for any item which has no assigned image,
  89. # an enlarged version of its icon will be shown instead. If false, then no
  90. # image will be shown unless one is specifically assigned.
  91. use_enlarged_icons_as_default: true,
  92. #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  93. # CATEGORY OPTIONS
  94. #``````````````````````````````````````````````````````````````````````````````
  95. # use_icons_for_categories - If true, the categories will be represented by
  96. # icons. If false, the categories will just be shown as text, as is normal
  97. use_icons_for_categories: true,
  98. # show_category_label - if using icons for categories, this determines whether
  99. # the name of the category is shown in a parallel window. If this value is true,
  100. # then the category name is shown. If false, then it will just be the icons.
  101. show_category_label: true,
  102. # icon_category_width - if using icons for categories and are showing labels,
  103. # this determines the width of the icon category window.
  104. icon_category_width: 288,
  105. # category_label_position - If using icons for categories and showing the
  106. # category label, this determines the position of the label window relative to
  107. # the icon window. If :left, will be to the left. If :right, will be to the
  108. # right.
  109. category_label_position: :left,
  110. #``````````````````````````````````````````````````````````````````````````````
  111. # custom_categories - This option allows you to choose which categories are
  112. # shown in the Item Menu. There are five default categories: :item, :weapon,
  113. # :armor, :key_item, and :all. As you would expect, the :item shows non-key
  114. # items, :weapon shows all weapons, :armor shows all armors, :key_item shows
  115. # all key items, and :all shows all items held by the party. They will appear
  116. # in the order that you set below. You can also create your own categories -
  117. # all you need to do is first create a symbol for the category and add it to
  118. # the array below. This can be anything as long as it is unique and in the
  119. # format:
  120. # :unique
  121. # Next, you will need to go to the category_vocab and category_icons hashes and
  122. # assign to it a Label (if showing labels) and an icon (if using category
  123. # icons). See the instructions above those hashes for details.
  124. #
  125. # EXAMPLE:
  126. # If we wanted to add a Potions category, we could call it :potion and the
  127. # array would look as follows:
  128. #
  129. # custom_categories: [:item, :potion, :weapon, :armor, :key_item],
  130. #
  131. # To find out how to assign an item to one of the custom categories you create,
  132. # see line 44.
  133. custom_categories: [:potion, :weapon, :key_item],
  134. # category_vocab - In this hash, you can set the name of each category. You
  135. # need to set a name for every category included in the custom_categories
  136. # array unless you are using icons and not showing any label at all. You set
  137. # each label as a "string" and that will be what shows up in-game. You can also
  138. # set it so that the name is retrieved by evaluating an expression. To do that,
  139. # just put a : in front of the quotation marks, like so:
  140. #
  141. # :"expression"
  142. #
  143. # Below, you will see examples of both - the :all category is set, by default,
  144. # to an ordinary string, while the others are all set to retrieve the name for
  145. # the category that is assigned in the Database.
  146. #
  147. # Now, to set the name of a custom category that you create, all you need to
  148. # do is make a new line before the } line in the following format:
  149. #
  150. # :unique => "",
  151. #
  152. # EXAMPLE:
  153. # To set the name of our new potions category, we could do the following:
  154. #
  155. # :potion => "Potions",
  156. category_vocab: {
  157. :all => "All Items",
  158. # :item => :"Vocab::item",
  159. :potion => "Healing",
  160. :weapon => "Battle",
  161. # :armor => "Defense",
  162. :key_item => :"Vocab::key_item",
  163. }, # END VOCAB HASH
  164. # category_icons - If using icons to represent categories, then this is where
  165. # you set which icons will show for each category. Just set it to whichever
  166. # icon index you want. Similar to the vocab hash, the format is:
  167. #
  168. # :unique => 0,
  169. #
  170. # EXAMPLE:
  171. # Our potions category could be set as follows:
  172. #
  173. # :potion => 192,
  174. category_icons: {
  175. :all => 270,
  176. :item => 260,
  177. :potion => 192,
  178. :weapon => 115,
  179. # :armor => 506,
  180. :key_item => 240,
  181. }, # END ICONS HASH
  182. # category_descriptions - If you wish you can make it so that each category
  183. # has a description which will be shown in the help window whenever you are
  184. # selecting a category. Similar to the above hashes, the format is:
  185. #
  186. # :unique => "",
  187. #
  188. # To make a new line, simply put a \\n within the string.
  189. #
  190. # EXAMPLE:
  191. # Our potions category could have a new description as follows:
  192. #
  193. # :potion => "Alchemical concoctions to \\c[3]remedy\\c[0] various\\nillnesses.",
  194. #
  195. # If you are showing an image in the description of items, you can also set
  196. # an image to show for the category description by the following code:
  197. #
  198. # :unique => ["description", "image filename"],
  199. #
  200. # where description is the regular description and image filename is the
  201. # filename of an image in the Pictures folder of Graphics. You could also just
  202. # put an integer, in which case it would draw an enlarged version of the icon
  203. # with that index.
  204. #
  205. # EXAMPLES:
  206. # If you wanted your potions category to show an enlarged version of icon 192
  207. # and be described as "Alchemical concoctions", you would add the following
  208. # line:
  209. #
  210. # :potion => ["Alchemical concoctions", 192],
  211. #
  212. # If you instead wanted to use a graphic from Pictures called "Potion01", then
  213. # the line would be:
  214. #
  215. # :potion => ["Alchemical concoctions", "Potion01"],
  216. category_descriptions: {
  217. # :all => "",
  218. # :item => "",
  219. :potion => "",
  220. :weapon => "",
  221. # :armor => "",
  222. :key_item => "",
  223. }, # END DESCRIPTIONS HASH
  224. #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  225. # END Editable Region
  226. #//////////////////////////////////////////////////////////////////////////////
  227. }
  228. MA_CUSTOM_ITEM_MENU[:category_vocab].default = ""
  229. MA_CUSTOM_ITEM_MENU[:category_descriptions].default = ""
  230. MA_CUSTOM_ITEM_MENU[:category_icons].default = 0
  231.  
  232. #==============================================================================
  233. # *** MACIM_RPG_ItemWeaponArmor
  234. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  235. # This method mixes in with RPG::Item, RPG::Weapon, and RPG::Armor, adding
  236. # the following:
  237. # new method - macim_categories
  238. #==============================================================================
  239.  
  240. module MACIM_RPG_ItemWeaponArmor
  241. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  242. # * Custom Categories
  243. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  244. def macim_categories
  245. if !@macim_categories
  246. @macim_categories = [macim_default_category]
  247. if self.note[/\\CIM[_ ]CATEGOR(Y|IES)(!?)\s*\[\s*(.+?)\s*\]/i]
  248. @macim_categories.delete(macim_default_category) unless $2.empty?
  249. cats = $3.scan(/[^:,;\s]+/)
  250. cats.each { |category| @macim_categories.push(category.to_sym) }
  251. end
  252. end
  253. @macim_categories
  254. end
  255. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  256. # * Image
  257. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  258. def macim_desc_image
  259. if !@macim_desc_image
  260. @macim_desc_image = ""
  261. if self.note[/\\IMAGE\[(.+?)\]/i]
  262. @macim_desc_image = $1
  263. elsif MA_CUSTOM_ITEM_MENU[:use_enlarged_icons_as_default]
  264. @macim_desc_image = $imported[:MAIcon_Hue] ? [icon_index, icon_hue] : icon_index
  265. end
  266. end
  267. @macim_desc_image
  268. end
  269. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  270. # * Description
  271. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  272. def description(*args, &block)
  273. result = super(*args, &block)
  274. if !@macim_description_plus
  275. @macim_description_plus = ""
  276. self.note.scan(/\\(DESC|DESCRIPTION)\+\{(.+?)\}/im) { |line|
  277. desc_plus = line[1].gsub(/\s*[\r\n]+\s*/, " ")
  278. desc_plus.gsub!(/\\[Nn]/, "\n")
  279. @macim_description_plus += "\n" + desc_plus
  280. }
  281. end
  282. result + @macim_description_plus
  283. end
  284. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  285. # * Default Category
  286. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  287. def macim_default_category; :item; end
  288. end
  289.  
  290. #==============================================================================
  291. # *** RPG
  292. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  293. # This adds a few methods to the Item, Weapon, and Armor classes by mixing in
  294. # the MACIM_RPG_ItemWeaponArmor module.
  295. #==============================================================================
  296.  
  297. module RPG
  298. class Item
  299. include MACIM_RPG_ItemWeaponArmor
  300. def macim_default_category; key_item? ? :key_item : :item; end
  301. end
  302. class Weapon
  303. include MACIM_RPG_ItemWeaponArmor
  304. def macim_default_category; :weapon; end
  305. end
  306. class Armor
  307. include MACIM_RPG_ItemWeaponArmor
  308. def macim_default_category; :armor; end
  309. end
  310. end
  311.  
  312. unless $imported[:"MA_ParagraphFormat_1.0"]
  313. #==============================================================================
  314. # ** MA_Window_ParagraphFormat
  315. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  316. # This module inserts into Window_Base and provides a method to format the
  317. # strings so as to go to the next line if it exceeds a set limit. This is
  318. # designed to work with draw_text_ex, and a string formatted by this method
  319. # should go through that, not draw_text.
  320. #==============================================================================
  321.  
  322. module MA_Window_ParagraphFormat
  323. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  324. # * Calc Line Width
  325. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  326. def mapf_calc_line_width(line, tw = 0, contents_dummy = false)
  327. return tw if line.nil?
  328. line = line.clone
  329. unless contents_dummy
  330. real_contents = contents # Preserve Real Contents
  331. # Create a dummy contents
  332. self.contents = Bitmap.new(contents_width, 24)
  333. reset_font_settings
  334. end
  335. pos = {x: 0, y: 0, new_x: 0, height: calc_line_height(line)}
  336. while line[/^(.*?)\e(.*)/]
  337. tw += text_size($1).width
  338. line = $2
  339. # Remove all ancillaries to the code, like parameters
  340. code = obtain_escape_code(line)
  341. # If direct setting of x, reset tw.
  342. tw = 0 if ($imported[:ATS_SpecialMessageCodes] && code.upcase == 'X') ||
  343. ($imported["YEA-MessageSystem"] && code.upcase == 'PX')
  344. # If I need to do something special on the basis that it is testing,
  345. # alias process_escape_character and differentiate using @atsf_testing
  346. process_escape_character(code, line, pos)
  347. end
  348. # Add width of remaining text, as well as the value of pos[:x] under the
  349. # assumption that any additions to it are because the special code is
  350. # replaced by something which requires space (like icons)
  351. tw += text_size(line).width + pos[:x]
  352. unless contents_dummy
  353. contents.dispose # Dispose dummy contents
  354. self.contents = real_contents # Restore real contents
  355. end
  356. return tw
  357. end
  358. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  359. # * Format Paragraph
  360. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  361. def mapf_format_paragraph(text, max_width = contents_width)
  362. text = text.clone
  363. # Create a Dummy Contents - I wanted to boost compatibility by using the
  364. # default process method for escape codes. It may have the opposite effect,
  365. # for some :(
  366. real_contents = contents # Preserve Real Contents
  367. self.contents = Bitmap.new(contents_width, 24)
  368. reset_font_settings
  369. paragraph = ""
  370. while !text.empty?
  371. text.lstrip!
  372. oline, nline, tw = mapf_format_by_line(text.clone, max_width)
  373. # Replace old line with the new one
  374. text.sub!(/#{Regexp.escape(oline)}/m, nline)
  375. paragraph += text.slice!(/.*?(\n|$)/)
  376. end
  377. contents.dispose # Dispose dummy contents
  378. self.contents = real_contents # Restore real contents
  379. return paragraph
  380. end
  381. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  382. # * Format By Line
  383. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  384. def mapf_format_by_line(text, max_width = contents_width)
  385. oline, nline, tw = "", "", 0
  386. loop do
  387. # Format each word until reach the width limit
  388. oline, nline, tw, done = mapf_format_by_word(text, nline, tw, max_width)
  389. return oline, nline, tw if done
  390. end
  391. end
  392. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  393. # * Format By Word
  394. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  395. def mapf_format_by_word(text, line, tw, max_width)
  396. return line, line, tw, true if text.nil? || text.empty?
  397. # Extract next word
  398. if text.sub!(/(\s*)([^\s\n\f]*)([\n\f]?)/, "") != nil
  399. prespace, word, line_end = $1, $2, $3
  400. ntw = mapf_calc_line_width(word, tw, true)
  401. pw = contents.text_size(prespace).width
  402. if (pw + ntw >= max_width)
  403. # Insert
  404. if line.empty?
  405. # If one word takes entire line
  406. return prespace + word, word + "\n", ntw, true
  407. else
  408. return line + prespace + word, line + "\n" + word, tw, true
  409. end
  410. else
  411. line += prespace + word
  412. tw = pw + ntw
  413. # If the line is force ended, then end
  414. return line, line, tw, true if !line_end.empty?
  415. end
  416. else
  417. return line, line, tw, true
  418. end
  419. return line, line, tw, false
  420. end
  421. end
  422.  
  423. class Window_Base
  424. include MA_Window_ParagraphFormat
  425. end
  426.  
  427. $imported[:"MA_ParagraphFormat_1.0"] = true
  428. end
  429.  
  430. unless $imported[:"MA_IconHorzCommand_1.0"]
  431. #==============================================================================
  432. # ** Window_MA_IconHorzCommand
  433. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  434. # This window is a base window to show a horizontal command window populated
  435. # with icons.
  436. #==============================================================================
  437.  
  438. class Window_MA_IconHorzCommand < Window_HorzCommand
  439. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  440. # * Public Instance Variable
  441. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  442. attr_reader :observing_procs
  443. attr_accessor :cursor_hide
  444. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  445. # * Object Initialization
  446. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  447. def initialize(*args, &block)
  448. @observing_procs = {}
  449. super(*args, &block)
  450. end
  451. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  452. # * Column Max
  453. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  454. def col_max; [(width - standard_padding) / (24 + spacing), item_max].min; end
  455. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  456. # * Item
  457. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  458. def item
  459. @list[index] ? @list[index][:symbol] : nil
  460. end
  461. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  462. # * Enabled? / Current Item Enabled?
  463. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  464. def enable?(index); self.index == index; end
  465. def current_item_enabled?; !current_data.nil?; end
  466. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  467. # * Draw Item
  468. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  469. def draw_item(index)
  470. rect = item_rect(index)
  471. contents.clear_rect(rect)
  472. draw_icon(@list[index][:ext], rect.x + ((rect.width - 24) / 2), rect.y, enable?(index))
  473. end
  474. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  475. # * Set Index
  476. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  477. def index=(index)
  478. old_index = self.index
  479. super(index)
  480. draw_item(old_index)
  481. draw_item(self.index)
  482. end
  483. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  484. # * Frame Update
  485. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  486. def update
  487. super
  488. @observing_procs.values.each { |block| block.call(item) }
  489. end
  490. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  491. # * Add/Remove Observing Window
  492. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  493. def add_observing_proc(id, &block)
  494. @observing_procs[id] = block
  495. update
  496. end
  497. def remove_observing_proc(id) ; @observing_procs.delete(id) ; end
  498. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  499. # * Update Cursor
  500. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  501. def update_cursor
  502. super
  503. cursor_rect.empty if @cursor_hide
  504. end
  505. end
  506. $imported[:"MA_IconHorzCommand_1.0"] = true
  507. end
  508.  
  509. #==============================================================================
  510. # ** Window_ItemCategory
  511. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  512. # Summary of Changes:
  513. # overwritten method - make_command_list; update_help
  514. #==============================================================================
  515.  
  516. class Window_ItemCategory
  517. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  518. # * Create Command List
  519. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  520. def make_command_list
  521. categories = MA_CUSTOM_ITEM_MENU[:custom_categories]
  522. vocab = MA_CUSTOM_ITEM_MENU[:category_vocab]
  523. categories.each {|category|
  524. text = vocab[category].is_a?(Symbol) ? eval(vocab[category].to_s) : vocab[category]
  525. add_command(text, category)
  526. }
  527. end
  528. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  529. # * Update Help
  530. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  531. def update_help
  532. @help_window.set_text(MA_CUSTOM_ITEM_MENU[:category_descriptions][current_symbol])
  533. end
  534. end
  535.  
  536. #==============================================================================
  537. # ** Window_ItemCategory
  538. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  539. # Summary of Changes:
  540. # aliased method - include?
  541. #==============================================================================
  542.  
  543. class Window_ItemList
  544. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  545. # * Include in Item List?
  546. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  547. alias ma_cim_includecheck_2hj7 include?
  548. def include?(item, *args, &block)
  549. return true if @category == :all
  550. if item.is_a?(MACIM_RPG_ItemWeaponArmor)
  551. item.macim_categories.include?(@category)
  552. else
  553. ma_cim_includecheck_2hj7(item, *args, &block)
  554. end
  555. end
  556. end
  557.  
  558. #==============================================================================
  559. # ** Window_MACIM_ItemIconCategory
  560. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  561. # This window shows categories represented by icons
  562. #==============================================================================
  563.  
  564. class Window_MACIM_ItemIconCategory < Window_MA_IconHorzCommand
  565. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  566. # * Object Initialization
  567. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  568. def initialize(x = 0, y = 0, categories = MA_CUSTOM_ITEM_MENU[:custom_categories])
  569. @cursor_hide = false
  570. @categories = categories
  571. super(x, y)
  572. end
  573. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  574. # * Window Width
  575. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  576. def window_width
  577. !MA_CUSTOM_ITEM_MENU[:show_category_label] ? Graphics.width :
  578. MA_CUSTOM_ITEM_MENU[:icon_category_width]
  579. end
  580. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  581. # * Category=
  582. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  583. def category=(category)
  584. self.index = @categories.index(category) if @categories.include?(category)
  585. end
  586. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  587. # * Create Command List
  588. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  589. def make_command_list
  590. icons = MA_CUSTOM_ITEM_MENU[:category_icons]
  591. @categories.each {|category|
  592. add_command("", category, false, icons[category])
  593. }
  594. end
  595. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  596. # * Set Item Window
  597. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  598. def item_window=(window, *args)
  599. add_observing_proc(:list) {|category| window.category = category }
  600. end
  601. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  602. # * Update Help
  603. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  604. def update_help
  605. desc = MA_CUSTOM_ITEM_MENU[:category_descriptions][current_symbol]
  606. desc = [desc] if !desc.is_a?(Array)
  607. @help_window.set_text(*desc)
  608. end
  609. end
  610.  
  611. #==============================================================================
  612. # ** Window Category Label
  613. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  614. # This window simply shows a label for category currently selected
  615. #==============================================================================
  616.  
  617. class Window_MACIM_CategoryLabel < Window_Base
  618. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  619. # * Object Initialization
  620. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  621. def initialize(x, y, label = "")
  622. super(x, y, window_width, window_height)
  623. refresh(label)
  624. end
  625. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  626. # * Window Attributes
  627. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  628. def window_width; Graphics.width - MA_CUSTOM_ITEM_MENU[:icon_category_width]; end
  629. def window_height; line_height + (standard_padding*2); end
  630. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  631. # * Refresh
  632. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  633. def refresh(label = @label)
  634. @label = label.is_a?(String) ? convert_escape_characters(label) : ""
  635. contents.clear
  636. reset_font_settings
  637. tw = mapf_calc_line_width(@label)
  638. draw_text_ex((contents_width - tw) / 2, 0, @label)
  639. end
  640. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  641. # * Set Category
  642. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  643. def category=(category)
  644. return if @category == category
  645. @category = category
  646. vocab = MA_CUSTOM_ITEM_MENU[:category_vocab][@category]
  647. label = vocab.is_a?(Symbol) ? eval(vocab.to_s) : vocab
  648. refresh(label)
  649. end
  650. end
  651.  
  652. #==============================================================================
  653. # ** Window_MACIM_Help
  654. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  655. # This window is a help window with adjustable height and can show an image
  656. #==============================================================================
  657.  
  658. class Window_MACIM_Help < Window_Help
  659. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  660. # * Set Text
  661. # Adds argument to change the image associated with the description
  662. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  663. def set_text(text, filename = "")
  664. if filename != @image || text != @text
  665. @text = text
  666. @image = filename
  667. refresh
  668. end
  669. end
  670. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  671. # * Set Item
  672. # item : Skills and items etc.
  673. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  674. def set_item(item)
  675. item ? set_text(item.description, item.is_a?(MACIM_RPG_ItemWeaponArmor) ? item.macim_desc_image : "") : set_text("", "")
  676. end
  677. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  678. # * Refresh
  679. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  680. def refresh
  681. contents.clear
  682. draw_image(0, 0, MA_CUSTOM_ITEM_MENU[:image_width], contents_height, @image) unless @image == ""
  683. # Adjust x position for text to give room for image
  684. x = 4
  685. x += MA_CUSTOM_ITEM_MENU[:image_width]
  686. draw_text_ex(x, 0, @text)
  687. end
  688. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  689. # * Draw Image
  690. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  691. def draw_image(x, y, w, h, filename)
  692. contents.clear_rect(x, y, w, h)
  693. bmp = make_image_bmp(filename, w, h)
  694. # Adjust position and src_rect
  695. src_rect = Rect.new(0, 0, w, h)
  696. if w >= bmp.rect.width # If width allowed greater than width of image
  697. x += ((w - bmp.rect.width) / 2) # Centre
  698. src_rect.width = bmp.rect.width
  699. else # If width allowed is less than width of image
  700. src_rect.x += ((bmp.rect.width - w) / 2) # Cut to centre
  701. end
  702. if h >= bmp.rect.height # If height allowed is greater than height of image
  703. y += ((h - bmp.rect.height) / 2) # Centre
  704. src_rect.height = bmp.rect.height
  705. else # If height allowed is less than height of image
  706. src_rect.y += ((bmp.rect.height - h) / 2) # Cut to centre
  707. end
  708. contents.blt(x, y, bmp, src_rect)
  709. end
  710. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  711. # * Make the image bitmap
  712. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  713. def make_image_bmp(filename, w, h)
  714. case filename
  715. when String then Cache.picture(filename) # Filename
  716. when Integer then get_enlarged_icon([w, h].min, filename) # icon index
  717. when Array # [icon index, hue]
  718. filename = filename.select {|num| num.is_a?(Integer) }
  719. filename.slice!(2, filename.size - 2) if filename.size > 2
  720. return if filename.empty?
  721. get_enlarged_icon([w, h].min, *filename)
  722. else # empty
  723. Cache.picture("")
  724. end
  725. end
  726. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  727. # * Get Enlarged Icon
  728. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  729. def get_enlarged_icon(size, icon_index, icon_hue = 0)
  730. iconset = Cache.system("Iconset")
  731. src_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  732. bmp = Bitmap.new(size, size)
  733. bmp.stretch_blt(bmp.rect, iconset, src_rect)
  734. # Compatibility with Icon Hues
  735. bmp.change_hue(icon_hue) if icon_hue != 0
  736. bmp
  737. end
  738. end
  739.  
  740. #==============================================================================
  741. # ** Scene_Item
  742. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  743. # Summary of Changes:
  744. # aliased method - start; create_category_window; create_help_window;
  745. # create_item_window
  746. # new method - create_category_label_window
  747. #==============================================================================
  748.  
  749. class Scene_Item
  750. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  751. # * Start Processing
  752. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  753. alias macim_start_2hz7 start
  754. def start(*args, &block)
  755. macim_start_2hz7(*args, &block) # Call Original Method
  756. create_category_label_window if MA_CUSTOM_ITEM_MENU[:use_icons_for_categories] &&
  757. MA_CUSTOM_ITEM_MENU[:show_category_label]
  758. end
  759. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  760. # * Create Help Window
  761. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  762. alias macim_createhelp_2sk4 create_help_window
  763. def create_help_window(*args, &block)
  764. if MA_CUSTOM_ITEM_MENU[:description_lines] == 2 &&
  765. !MA_CUSTOM_ITEM_MENU[:image_in_description]
  766. macim_createhelp_2sk4(*args, &block) # Call Original Method
  767. else
  768. # Create special help window if showing image - otherwise normal
  769. @help_window = MA_CUSTOM_ITEM_MENU[:image_in_description] ?
  770. Window_MACIM_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines]) :
  771. Window_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines])
  772. @help_window.viewport = @viewport
  773. end
  774. @help_window.y = Graphics.height - @help_window.height unless MA_CUSTOM_ITEM_MENU[:description_at_top]
  775. end
  776. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  777. # * Create Category Window
  778. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  779. alias macim_createcatwind_7jc4 create_category_window
  780. def create_category_window(*args, &block)
  781. if MA_CUSTOM_ITEM_MENU[:use_icons_for_categories] # If Icon Categories
  782. # Create Icon Categories window instead of regular
  783. x = (!MA_CUSTOM_ITEM_MENU[:show_category_label] ||
  784. MA_CUSTOM_ITEM_MENU[:category_label_position] == :right) ? 0 :
  785. Graphics.width - MA_CUSTOM_ITEM_MENU[:icon_category_width]
  786. y = MA_CUSTOM_ITEM_MENU[:description_at_top] ? @help_window.height : 0
  787. @category_window = Window_MACIM_ItemIconCategory.new(x, y)
  788. @category_window.viewport = @viewport
  789. @category_window.help_window = @help_window
  790. @category_window.set_handler(:ok, method(:on_category_ok))
  791. @category_window.set_handler(:cancel, method(:return_scene))
  792. else # Create regular category window if not using icons
  793. macim_createcatwind_7jc4(*args, &block) # Call Original Method
  794. end
  795. end
  796. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  797. # * Create Item Window
  798. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  799. alias macim_cretitmwdow_4gz9 create_item_window
  800. def create_item_window(*args, &block)
  801. macim_cretitmwdow_4gz9(*args, &block) # Call Original Method
  802. unless MA_CUSTOM_ITEM_MENU[:description_at_top]
  803. @item_window.height -= @help_window.height
  804. @item_window.refresh
  805. end
  806. end
  807. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  808. # * Create Category Label Window
  809. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  810. def create_category_label_window
  811. # Determine position
  812. x = MA_CUSTOM_ITEM_MENU[:category_label_position] == :right ?
  813. MA_CUSTOM_ITEM_MENU[:icon_category_width] : 0
  814. y = MA_CUSTOM_ITEM_MENU[:description_at_top] ? @help_window.height : 0
  815. # Create label window
  816. @macim_categorylabel_window = Window_MACIM_CategoryLabel.new(x, y)
  817. @macim_categorylabel_window.viewport = @viewport
  818. @category_window.add_observing_proc(:label) { |category|
  819. @macim_categorylabel_window.category = category }
  820. end
  821. end
  822.  
  823. #==============================================================================
  824. # ** Scene_Battle
  825. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  826. # Summary of Changes:
  827. # aliased method - create_help_window
  828. #==============================================================================
  829.  
  830. class Scene_Battle
  831. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  832. # * Create Help Window
  833. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  834. alias macim_crthelpwind_2kf6 create_help_window
  835. def create_help_window(*args, &block)
  836. if MA_CUSTOM_ITEM_MENU[:description_lines] == 2 &&
  837. !MA_CUSTOM_ITEM_MENU[:image_in_description]
  838. macim_crthelpwind_2kf6(*args, &block) # Call Original Method
  839. else
  840. # Create special help window if showing image - otherwise normal
  841. @help_window = MA_CUSTOM_ITEM_MENU[:image_in_description] ?
  842. Window_MACIM_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines]) :
  843. Window_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines])
  844. @help_window.visible = false
  845. end
  846. end
  847. end
  848.  
  849. #==============================================================================
  850. # ** Scene_Equip
  851. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  852. # Summary of Changes:
  853. # aliased method - create_help_window
  854. #==============================================================================
  855.  
  856. class Scene_Equip
  857. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  858. # * Create Help Window
  859. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  860. alias macim_catehelp_3nb7 create_help_window
  861. def create_help_window(*args, &block)
  862. if MA_CUSTOM_ITEM_MENU[:description_lines] == 2 &&
  863. !MA_CUSTOM_ITEM_MENU[:image_in_description]
  864. macim_catehelp_3nb7(*args, &block) # Call Original Method
  865. else
  866. # Create special help window if showing image - otherwise normal
  867. @help_window = MA_CUSTOM_ITEM_MENU[:image_in_description] ?
  868. Window_MACIM_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines]) :
  869. Window_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines])
  870. @help_window.viewport = @viewport
  871. end
  872. end
  873. end
RAW Paste Data