Advertisement
Mawichan

Edited Script

Jan 23rd, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.07 KB | None | 0 0
  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: false,
  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: 64,
  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: [:item, :weapon, :armor, :key_item, :ores, :souls],
  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. :weapon => :"Vocab::weapon",
  160. :armor => :"Vocab::armor",
  161. :key_item => :"Vocab::key_item",
  162. :ores => :"Vocab::ores",
  163. :souls=> :"Vocab::souls",
  164. }, # END VOCAB HASH
  165. # category_icons - If using icons to represent categories, then this is where
  166. # you set which icons will show for each category. Just set it to whichever
  167. # icon index you want. Similar to the vocab hash, the format is:
  168. #
  169. # :unique => 0,
  170. #
  171. # EXAMPLE:
  172. # Our potions category could be set as follows:
  173. #
  174. # :potion => 192,
  175. category_icons: {
  176. :all => 270,
  177. :item => 260,
  178. :weapon => 115,
  179. :armor => 506,
  180. :key_item => 240,
  181. :ores => 110,
  182. :souls => 300,
  183. }, # END ICONS HASH
  184. # category_descriptions - If you wish you can make it so that each category
  185. # has a description which will be shown in the help window whenever you are
  186. # selecting a category. Similar to the above hashes, the format is:
  187. #
  188. # :unique => "",
  189. #
  190. # To make a new line, simply put a \\n within the string.
  191. #
  192. # EXAMPLE:
  193. # Our potions category could have a new description as follows:
  194. #
  195. # :potion => "Alchemical concoctions to \\c[3]remedy\\c[0] various\\nillnesses.",
  196. #
  197. # If you are showing an image in the description of items, you can also set
  198. # an image to show for the category description by the following code:
  199. #
  200. # :unique => ["description", "image filename"],
  201. #
  202. # where description is the regular description and image filename is the
  203. # filename of an image in the Pictures folder of Graphics. You could also just
  204. # put an integer, in which case it would draw an enlarged version of the icon
  205. # with that index.
  206. #
  207. # EXAMPLES:
  208. # If you wanted your potions category to show an enlarged version of icon 192
  209. # and be described as "Alchemical concoctions", you would add the following
  210. # line:
  211. #
  212. # :potion => ["Alchemical concoctions", 192],
  213. #
  214. # If you instead wanted to use a graphic from Pictures called "Potion01", then
  215. # the line would be:
  216. #
  217. # :potion => ["Alchemical concoctions", "Potion01"],
  218. category_descriptions: {
  219. :all => "",
  220. :item => "See consumables",
  221. :weapon => "See offensive equipment",
  222. :armor => "See defensive equipment",
  223. :key_item => "See keys found so far",
  224. :ores => "See smithing materials",
  225. :souls => "See souls aquired so far",
  226. }, # END DESCRIPTIONS HASH
  227. #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  228. # END Editable Region
  229. #//////////////////////////////////////////////////////////////////////////////
  230. }
  231. MA_CUSTOM_ITEM_MENU[:category_vocab].default = ""
  232. MA_CUSTOM_ITEM_MENU[:category_descriptions].default = ""
  233. MA_CUSTOM_ITEM_MENU[:category_icons].default = 0
  234.  
  235. #==============================================================================
  236. # *** MACIM_RPG_ItemWeaponArmor
  237. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  238. # This method mixes in with RPG::Item, RPG::Weapon, and RPG::Armor, adding
  239. # the following:
  240. # new method - macim_categories
  241. #==============================================================================
  242.  
  243. module MACIM_RPG_ItemWeaponArmor
  244. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  245. # * Custom Categories
  246. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  247. def macim_categories
  248. if !@macim_categories
  249. @macim_categories = [macim_default_category]
  250. if self.note[/\\CIM[_ ]CATEGOR(Y|IES)(!?)\s*\[\s*(.+?)\s*\]/i]
  251. @macim_categories.delete(macim_default_category) unless $2.empty?
  252. cats = $3.scan(/[^:,;\s]+/)
  253. cats.each { |category| @macim_categories.push(category.to_sym) }
  254. end
  255. end
  256. @macim_categories
  257. end
  258. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  259. # * Image
  260. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  261. def macim_desc_image
  262. if !@macim_desc_image
  263. @macim_desc_image = ""
  264. if self.note[/\\IMAGE\[(.+?)\]/i]
  265. @macim_desc_image = $1
  266. elsif MA_CUSTOM_ITEM_MENU[:use_enlarged_icons_as_default]
  267. @macim_desc_image = $imported[:MAIcon_Hue] ? [icon_index, icon_hue] : icon_index
  268. end
  269. end
  270. @macim_desc_image
  271. end
  272. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  273. # * Description
  274. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  275. def description(*args, &block)
  276. result = super(*args, &block)
  277. if !@macim_description_plus
  278. @macim_description_plus = ""
  279. self.note.scan(/\\(DESC|DESCRIPTION)\+\{(.+?)\}/im) { |line|
  280. desc_plus = line[1].gsub(/\s*[\r\n]+\s*/, " ")
  281. desc_plus.gsub!(/\\[Nn]/, "\n")
  282. @macim_description_plus += "\n" + desc_plus
  283. }
  284. end
  285. result + @macim_description_plus
  286. end
  287. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  288. # * Default Category
  289. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  290. def macim_default_category; :item; end
  291. end
  292.  
  293. #==============================================================================
  294. # *** RPG
  295. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  296. # This adds a few methods to the Item, Weapon, and Armor classes by mixing in
  297. # the MACIM_RPG_ItemWeaponArmor module.
  298. #==============================================================================
  299.  
  300. module RPG
  301. class Item
  302. include MACIM_RPG_ItemWeaponArmor
  303. def macim_default_category; key_item? ? :key_item : :item; end
  304. end
  305. class Weapon
  306. include MACIM_RPG_ItemWeaponArmor
  307. def macim_default_category; :weapon; end
  308. end
  309. class Armor
  310. include MACIM_RPG_ItemWeaponArmor
  311. def macim_default_category; :armor; end
  312. end
  313. end
  314.  
  315. unless $imported[:"MA_ParagraphFormat_1.0"]
  316. #==============================================================================
  317. # ** MA_Window_ParagraphFormat
  318. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  319. # This module inserts into Window_Base and provides a method to format the
  320. # strings so as to go to the next line if it exceeds a set limit. This is
  321. # designed to work with draw_text_ex, and a string formatted by this method
  322. # should go through that, not draw_text.
  323. #==============================================================================
  324.  
  325. module MA_Window_ParagraphFormat
  326. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  327. # * Calc Line Width
  328. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  329. def mapf_calc_line_width(line, tw = 0, contents_dummy = false)
  330. return tw if line.nil?
  331. line = line.clone
  332. unless contents_dummy
  333. real_contents = contents # Preserve Real Contents
  334. # Create a dummy contents
  335. self.contents = Bitmap.new(contents_width, 24)
  336. reset_font_settings
  337. end
  338. pos = {x: 0, y: 0, new_x: 0, height: calc_line_height(line)}
  339. while line[/^(.*?)\e(.*)/]
  340. tw += text_size($1).width
  341. line = $2
  342. # Remove all ancillaries to the code, like parameters
  343. code = obtain_escape_code(line)
  344. # If direct setting of x, reset tw.
  345. tw = 0 if ($imported[:ATS_SpecialMessageCodes] && code.upcase == 'X') ||
  346. ($imported["YEA-MessageSystem"] && code.upcase == 'PX')
  347. # If I need to do something special on the basis that it is testing,
  348. # alias process_escape_character and differentiate using @atsf_testing
  349. process_escape_character(code, line, pos)
  350. end
  351. # Add width of remaining text, as well as the value of pos[:x] under the
  352. # assumption that any additions to it are because the special code is
  353. # replaced by something which requires space (like icons)
  354. tw += text_size(line).width + pos[:x]
  355. unless contents_dummy
  356. contents.dispose # Dispose dummy contents
  357. self.contents = real_contents # Restore real contents
  358. end
  359. return tw
  360. end
  361. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  362. # * Format Paragraph
  363. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  364. def mapf_format_paragraph(text, max_width = contents_width)
  365. text = text.clone
  366. # Create a Dummy Contents - I wanted to boost compatibility by using the
  367. # default process method for escape codes. It may have the opposite effect,
  368. # for some :(
  369. real_contents = contents # Preserve Real Contents
  370. self.contents = Bitmap.new(contents_width, 24)
  371. reset_font_settings
  372. paragraph = ""
  373. while !text.empty?
  374. text.lstrip!
  375. oline, nline, tw = mapf_format_by_line(text.clone, max_width)
  376. # Replace old line with the new one
  377. text.sub!(/#{Regexp.escape(oline)}/m, nline)
  378. paragraph += text.slice!(/.*?(\n|$)/)
  379. end
  380. contents.dispose # Dispose dummy contents
  381. self.contents = real_contents # Restore real contents
  382. return paragraph
  383. end
  384. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  385. # * Format By Line
  386. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  387. def mapf_format_by_line(text, max_width = contents_width)
  388. oline, nline, tw = "", "", 0
  389. loop do
  390. # Format each word until reach the width limit
  391. oline, nline, tw, done = mapf_format_by_word(text, nline, tw, max_width)
  392. return oline, nline, tw if done
  393. end
  394. end
  395. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  396. # * Format By Word
  397. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  398. def mapf_format_by_word(text, line, tw, max_width)
  399. return line, line, tw, true if text.nil? || text.empty?
  400. # Extract next word
  401. if text.sub!(/(\s*)([^\s\n\f]*)([\n\f]?)/, "") != nil
  402. prespace, word, line_end = $1, $2, $3
  403. ntw = mapf_calc_line_width(word, tw, true)
  404. pw = contents.text_size(prespace).width
  405. if (pw + ntw >= max_width)
  406. # Insert
  407. if line.empty?
  408. # If one word takes entire line
  409. return prespace + word, word + "\n", ntw, true
  410. else
  411. return line + prespace + word, line + "\n" + word, tw, true
  412. end
  413. else
  414. line += prespace + word
  415. tw = pw + ntw
  416. # If the line is force ended, then end
  417. return line, line, tw, true if !line_end.empty?
  418. end
  419. else
  420. return line, line, tw, true
  421. end
  422. return line, line, tw, false
  423. end
  424. end
  425.  
  426. class Window_Base
  427. include MA_Window_ParagraphFormat
  428. end
  429.  
  430. $imported[:"MA_ParagraphFormat_1.0"] = true
  431. end
  432.  
  433. unless $imported[:"MA_IconHorzCommand_1.0"]
  434. #==============================================================================
  435. # ** Window_MA_IconHorzCommand
  436. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  437. # This window is a base window to show a horizontal command window populated
  438. # with icons.
  439. #==============================================================================
  440.  
  441. class Window_MA_IconHorzCommand < Window_HorzCommand
  442. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  443. # * Public Instance Variable
  444. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  445. attr_reader :observing_procs
  446. attr_accessor :cursor_hide
  447. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  448. # * Object Initialization
  449. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  450. def initialize(*args, &block)
  451. @observing_procs = {}
  452. super(*args, &block)
  453. end
  454. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  455. # * Column Max
  456. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  457. def col_max; [(width - standard_padding) / (24 + spacing), item_max].min; end
  458. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  459. # * Item
  460. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  461. def item
  462. @list[index] ? @list[index][:symbol] : nil
  463. end
  464. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  465. # * Enabled? / Current Item Enabled?
  466. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  467. def enable?(index); self.index == index; end
  468. def current_item_enabled?; !current_data.nil?; end
  469. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  470. # * Draw Item
  471. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  472. def draw_item(index)
  473. rect = item_rect(index)
  474. contents.clear_rect(rect)
  475. draw_icon(@list[index][:ext], rect.x + ((rect.width - 24) / 2), rect.y, enable?(index))
  476. end
  477. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  478. # * Set Index
  479. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  480. def index=(index)
  481. old_index = self.index
  482. super(index)
  483. draw_item(old_index)
  484. draw_item(self.index)
  485. end
  486. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  487. # * Frame Update
  488. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  489. def update
  490. super
  491. @observing_procs.values.each { |block| block.call(item) }
  492. end
  493. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  494. # * Add/Remove Observing Window
  495. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  496. def add_observing_proc(id, &block)
  497. @observing_procs[id] = block
  498. update
  499. end
  500. def remove_observing_proc(id) ; @observing_procs.delete(id) ; end
  501. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  502. # * Update Cursor
  503. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  504. def update_cursor
  505. super
  506. cursor_rect.empty if @cursor_hide
  507. end
  508. end
  509. $imported[:"MA_IconHorzCommand_1.0"] = true
  510. end
  511.  
  512. #==============================================================================
  513. # ** Window_ItemCategory
  514. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  515. # Summary of Changes:
  516. # overwritten method - make_command_list; update_help
  517. #==============================================================================
  518.  
  519. class Window_ItemCategory
  520. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  521. # * Create Command List
  522. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  523. def make_command_list
  524. categories = MA_CUSTOM_ITEM_MENU[:custom_categories]
  525. vocab = MA_CUSTOM_ITEM_MENU[:category_vocab]
  526. categories.each {|category|
  527. text = vocab[category].is_a?(Symbol) ? eval(vocab[category].to_s) : vocab[category]
  528. add_command(text, category)
  529. }
  530. end
  531. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  532. # * Update Help
  533. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  534. def update_help
  535. @help_window.set_text(MA_CUSTOM_ITEM_MENU[:category_descriptions][current_symbol])
  536. end
  537. end
  538.  
  539. #==============================================================================
  540. # ** Window_ItemCategory
  541. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  542. # Summary of Changes:
  543. # aliased method - include?
  544. #==============================================================================
  545.  
  546. class Window_ItemList
  547. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  548. # * Include in Item List?
  549. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  550. alias ma_cim_includecheck_2hj7 include?
  551. def include?(item, *args, &block)
  552. return true if @category == :all
  553. if item.is_a?(MACIM_RPG_ItemWeaponArmor)
  554. item.macim_categories.include?(@category)
  555. else
  556. ma_cim_includecheck_2hj7(item, *args, &block)
  557. end
  558. end
  559. end
  560.  
  561. #==============================================================================
  562. # ** Window_MACIM_ItemIconCategory
  563. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  564. # This window shows categories represented by icons
  565. #==============================================================================
  566.  
  567. class Window_MACIM_ItemIconCategory < Window_MA_IconHorzCommand
  568. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  569. # * Object Initialization
  570. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  571. def initialize(x = 0, y = 0, categories = MA_CUSTOM_ITEM_MENU[:custom_categories])
  572. @cursor_hide = false
  573. @categories = categories
  574. super(x, y)
  575. end
  576. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  577. # * Window Width
  578. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  579. def window_width
  580. !MA_CUSTOM_ITEM_MENU[:show_category_label] ? Graphics.width :
  581. MA_CUSTOM_ITEM_MENU[:icon_category_width]
  582. end
  583. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  584. # * Category=
  585. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  586. def category=(category)
  587. self.index = @categories.index(category) if @categories.include?(category)
  588. end
  589. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  590. # * Create Command List
  591. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  592. def make_command_list
  593. icons = MA_CUSTOM_ITEM_MENU[:category_icons]
  594. @categories.each {|category|
  595. add_command("", category, false, icons[category])
  596. }
  597. end
  598. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  599. # * Set Item Window
  600. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  601. def item_window=(window, *args)
  602. add_observing_proc(:list) {|category| window.category = category }
  603. end
  604. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  605. # * Update Help
  606. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  607. def update_help
  608. desc = MA_CUSTOM_ITEM_MENU[:category_descriptions][current_symbol]
  609. desc = [desc] if !desc.is_a?(Array)
  610. @help_window.set_text(*desc)
  611. end
  612. end
  613.  
  614. #==============================================================================
  615. # ** Window Category Label
  616. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  617. # This window simply shows a label for category currently selected
  618. #==============================================================================
  619.  
  620. class Window_MACIM_CategoryLabel < Window_Base
  621. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  622. # * Object Initialization
  623. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  624. def initialize(x, y, label = "")
  625. super(x, y, window_width, window_height)
  626. refresh(label)
  627. end
  628. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  629. # * Window Attributes
  630. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  631. def window_width; Graphics.width - MA_CUSTOM_ITEM_MENU[:icon_category_width]; end
  632. def window_height; line_height + (standard_padding*2); end
  633. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  634. # * Refresh
  635. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  636. def refresh(label = @label)
  637. @label = label.is_a?(String) ? convert_escape_characters(label) : ""
  638. contents.clear
  639. reset_font_settings
  640. tw = mapf_calc_line_width(@label)
  641. draw_text_ex((contents_width - tw) / 2, 0, @label)
  642. end
  643. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  644. # * Set Category
  645. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  646. def category=(category)
  647. return if @category == category
  648. @category = category
  649. vocab = MA_CUSTOM_ITEM_MENU[:category_vocab][@category]
  650. label = vocab.is_a?(Symbol) ? eval(vocab.to_s) : vocab
  651. refresh(label)
  652. end
  653. end
  654.  
  655. #==============================================================================
  656. # ** Window_MACIM_Help
  657. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  658. # This window is a help window with adjustable height and can show an image
  659. #==============================================================================
  660.  
  661. class Window_MACIM_Help < Window_Help
  662. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  663. # * Set Text
  664. # Adds argument to change the image associated with the description
  665. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  666. def set_text(text, filename = "")
  667. if filename != @image || text != @text
  668. @text = text
  669. @image = filename
  670. refresh
  671. end
  672. end
  673. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  674. # * Set Item
  675. # item : Skills and items etc.
  676. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  677. def set_item(item)
  678. item ? set_text(item.description, item.is_a?(MACIM_RPG_ItemWeaponArmor) ? item.macim_desc_image : "") : set_text("", "")
  679. end
  680. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  681. # * Refresh
  682. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  683. def refresh
  684. contents.clear
  685. draw_image(0, 0, MA_CUSTOM_ITEM_MENU[:image_width], contents_height, @image) unless @image == ""
  686. # Adjust x position for text to give room for image
  687. x = 4
  688. x += MA_CUSTOM_ITEM_MENU[:image_width]
  689. draw_text_ex(x, 0, @text)
  690. end
  691. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  692. # * Draw Image
  693. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  694. def draw_image(x, y, w, h, filename)
  695. contents.clear_rect(x, y, w, h)
  696. bmp = make_image_bmp(filename, w, h)
  697. # Adjust position and src_rect
  698. src_rect = Rect.new(0, 0, w, h)
  699. if w >= bmp.rect.width # If width allowed greater than width of image
  700. x += ((w - bmp.rect.width) / 2) # Centre
  701. src_rect.width = bmp.rect.width
  702. else # If width allowed is less than width of image
  703. src_rect.x += ((bmp.rect.width - w) / 2) # Cut to centre
  704. end
  705. if h >= bmp.rect.height # If height allowed is greater than height of image
  706. y += ((h - bmp.rect.height) / 2) # Centre
  707. src_rect.height = bmp.rect.height
  708. else # If height allowed is less than height of image
  709. src_rect.y += ((bmp.rect.height - h) / 2) # Cut to centre
  710. end
  711. contents.blt(x, y, bmp, src_rect)
  712. end
  713. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  714. # * Make the image bitmap
  715. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  716. def make_image_bmp(filename, w, h)
  717. case filename
  718. when String then Cache.picture(filename) # Filename
  719. when Integer then get_enlarged_icon([w, h].min, filename) # icon index
  720. when Array # [icon index, hue]
  721. filename = filename.select {|num| num.is_a?(Integer) }
  722. filename.slice!(2, filename.size - 2) if filename.size > 2
  723. return if filename.empty?
  724. get_enlarged_icon([w, h].min, *filename)
  725. else # empty
  726. Cache.picture("")
  727. end
  728. end
  729. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  730. # * Get Enlarged Icon
  731. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  732. def get_enlarged_icon(size, icon_index, icon_hue = 0)
  733. iconset = Cache.system("Iconset")
  734. src_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  735. bmp = Bitmap.new(size, size)
  736. bmp.stretch_blt(bmp.rect, iconset, src_rect)
  737. # Compatibility with Icon Hues
  738. bmp.change_hue(icon_hue) if icon_hue != 0
  739. bmp
  740. end
  741. end
  742.  
  743. #==============================================================================
  744. # ** Scene_Item
  745. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  746. # Summary of Changes:
  747. # aliased method - start; create_category_window; create_help_window;
  748. # create_item_window
  749. # new method - create_category_label_window
  750. #==============================================================================
  751.  
  752. class Scene_Item
  753. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  754. # * Start Processing
  755. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  756. alias macim_start_2hz7 start
  757. def start(*args, &block)
  758. macim_start_2hz7(*args, &block) # Call Original Method
  759. create_category_label_window if MA_CUSTOM_ITEM_MENU[:use_icons_for_categories] &&
  760. MA_CUSTOM_ITEM_MENU[:show_category_label]
  761. end
  762. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  763. # * Create Help Window
  764. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  765. alias macim_createhelp_2sk4 create_help_window
  766. def create_help_window(*args, &block)
  767. if MA_CUSTOM_ITEM_MENU[:description_lines] == 2 &&
  768. !MA_CUSTOM_ITEM_MENU[:image_in_description]
  769. macim_createhelp_2sk4(*args, &block) # Call Original Method
  770. else
  771. # Create special help window if showing image - otherwise normal
  772. @help_window = MA_CUSTOM_ITEM_MENU[:image_in_description] ?
  773. Window_MACIM_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines]) :
  774. Window_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines])
  775. @help_window.viewport = @viewport
  776. end
  777. @help_window.y = Graphics.height - @help_window.height unless MA_CUSTOM_ITEM_MENU[:description_at_top]
  778. end
  779. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  780. # * Create Category Window
  781. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  782. alias macim_createcatwind_7jc4 create_category_window
  783. def create_category_window(*args, &block)
  784. if MA_CUSTOM_ITEM_MENU[:use_icons_for_categories] # If Icon Categories
  785. # Create Icon Categories window instead of regular
  786. x = (!MA_CUSTOM_ITEM_MENU[:show_category_label] ||
  787. MA_CUSTOM_ITEM_MENU[:category_label_position] == :right) ? 0 :
  788. Graphics.width - MA_CUSTOM_ITEM_MENU[:icon_category_width]
  789. y = MA_CUSTOM_ITEM_MENU[:description_at_top] ? @help_window.height : 0
  790. @category_window = Window_MACIM_ItemIconCategory.new(x, y)
  791. @category_window.viewport = @viewport
  792. @category_window.help_window = @help_window
  793. @category_window.set_handler(:ok, method(:on_category_ok))
  794. @category_window.set_handler(:cancel, method(:return_scene))
  795. else # Create regular category window if not using icons
  796. macim_createcatwind_7jc4(*args, &block) # Call Original Method
  797. end
  798. end
  799. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  800. # * Create Item Window
  801. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  802. alias macim_cretitmwdow_4gz9 create_item_window
  803. def create_item_window(*args, &block)
  804. macim_cretitmwdow_4gz9(*args, &block) # Call Original Method
  805. unless MA_CUSTOM_ITEM_MENU[:description_at_top]
  806. @item_window.height -= @help_window.height
  807. @item_window.refresh
  808. end
  809. end
  810. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  811. # * Create Category Label Window
  812. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  813. def create_category_label_window
  814. # Determine position
  815. x = MA_CUSTOM_ITEM_MENU[:category_label_position] == :right ?
  816. MA_CUSTOM_ITEM_MENU[:icon_category_width] : 0
  817. y = MA_CUSTOM_ITEM_MENU[:description_at_top] ? @help_window.height : 0
  818. # Create label window
  819. @macim_categorylabel_window = Window_MACIM_CategoryLabel.new(x, y)
  820. @macim_categorylabel_window.viewport = @viewport
  821. @category_window.add_observing_proc(:label) { |category|
  822. @macim_categorylabel_window.category = category }
  823. end
  824. end
  825.  
  826. #==============================================================================
  827. # ** Scene_Battle
  828. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  829. # Summary of Changes:
  830. # aliased method - create_help_window
  831. #==============================================================================
  832.  
  833. class Scene_Battle
  834. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  835. # * Create Help Window
  836. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  837. alias macim_crthelpwind_2kf6 create_help_window
  838. def create_help_window(*args, &block)
  839. if MA_CUSTOM_ITEM_MENU[:description_lines] == 2 &&
  840. !MA_CUSTOM_ITEM_MENU[:image_in_description]
  841. macim_crthelpwind_2kf6(*args, &block) # Call Original Method
  842. else
  843. # Create special help window if showing image - otherwise normal
  844. @help_window = MA_CUSTOM_ITEM_MENU[:image_in_description] ?
  845. Window_MACIM_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines]) :
  846. Window_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines])
  847. @help_window.visible = false
  848. end
  849. end
  850. end
  851.  
  852. #==============================================================================
  853. # ** Scene_Equip
  854. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  855. # Summary of Changes:
  856. # aliased method - create_help_window
  857. #==============================================================================
  858.  
  859. class Scene_Equip
  860. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  861. # * Create Help Window
  862. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  863. alias macim_catehelp_3nb7 create_help_window
  864. def create_help_window(*args, &block)
  865. if MA_CUSTOM_ITEM_MENU[:description_lines] == 2 &&
  866. !MA_CUSTOM_ITEM_MENU[:image_in_description]
  867. macim_catehelp_3nb7(*args, &block) # Call Original Method
  868. else
  869. # Create special help window if showing image - otherwise normal
  870. @help_window = MA_CUSTOM_ITEM_MENU[:image_in_description] ?
  871. Window_MACIM_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines]) :
  872. Window_Help.new(MA_CUSTOM_ITEM_MENU[:description_lines])
  873. @help_window.viewport = @viewport
  874. end
  875. end
  876. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement