=begin#=============================================================================== Title: Shop Manager - Hide Items Add-On Shop Manager Author: Tsukihime Add-on Author: CT_Bolt Date: Feb 22, 2013-------------------------------------------------------------------------------- ** Change log 1.0 Feb 25, 2013 - Initial Release-------------------------------------------------------------------------------- ** Terms of Use * Free to use in commercial/non-commercial projects * No real support. The script is provided as-is * Will do bug fixes, but no compatibility patches * Features may be requested but no guarantees, especially if it is non-trivial * Preserve this header-------------------------------------------------------------------------------- ** Installation--------------------------------------------------------------------------------Place this script below Shop Manager & YEA - Ace Shop Options (if used)Place this script above Shop Stock (if used) & main. ** Description Hides items, weapons, & armor from being presented in the shop with a notetag Hides prices from being presented in the shop with a notetag Hides all items, weapons, & armor from being presented in the shop with a switch Hides all prices from being presented in the shop with a switch-------------------------------------------------------------------------------- Compatibility: Compatible with Yanfly Engine Ace - Ace Shop Options v1.01 * Overwrite methods: class Window_ShopBuy < Window_Selectable def draw_item(index) * Alias Methods: class Window_ShopBuy < Window_Selectable def include?(shopGood) module DataManager def load_database class Scene_Title < Scene_Base def command_new_game-------------------------------------------------------------------------------- ** Usage Place <hide item> in an item, weapon, or armor notebox on a newline to have these not show up in a shop. Place <hide item price> in an item, weapon, or armor notebox on a newline to have the price of these not show up in a shop.#================================================================================endmodule REGEXP TOKEN = "<hide item>" #Token to Hide the items/weapons/armor TOKEN_PRICE_ONLY = "<hide item price>" #Token to Hide price of the #items/weapons/armor SWITCH_ID = 128 #Switch that determines weather the items will show up AUTO_ON = true #Set this to true to turn the above switch on when the #user loads a new game ALWAYS_HIDE_PRICE_SWITCH_ID = 130 #Switch that determines weather the items #price will show up ever ALWAYS_HIDE_SWITCH_ID = 131 #Switch that determines weather the items #will show up everendmodule DataManager #-------------------------------------------------------------------------- # ● Loads the database #-------------------------------------------------------------------------- class << self alias_method

my_load_database, :load_database) end def self.load_database my_load_database load_noshow_notetags end #-------------------------------------------------------------------------- # ● Loads the note tags #-------------------------------------------------------------------------- def self.load_noshow_notetags groups = [$data_items, $data_weapons, $data_armors] for group in groups for obj in group next if obj.nil? obj.load_noshow_notetags end end puts "Read: Hide Item Notetags" endend#==========================================================================# ■ RPG::Item#==========================================================================class RPG::Item < RPG::UsableItem #-------------------------------------------------------------------------- # ● Public instance variables #-------------------------------------------------------------------------- attr_reader :noshow_token #-------------------------------------------------------------------------- # ● Loads the note tags #-------------------------------------------------------------------------- def load_noshow_notetags @noshow_token = "" @note.split(/[\r\n]+/).each do |line| case line when REGEXP::TOKEN @noshow_token = line when REGEXP::TOKEN_PRICE_ONLY @noshow_token = line end end endend#==========================================================================# ■ RPG::EquipItem#==========================================================================class RPG::EquipItem < RPG::BaseItem #-------------------------------------------------------------------------- # ● Public instance variables #-------------------------------------------------------------------------- attr_reader :noshow_token #-------------------------------------------------------------------------- # ● Loads the note tags #-------------------------------------------------------------------------- def load_noshow_notetags @noshow_token = "" @note.split(/[\r\n]+/).each do |line| case line when REGEXP::TOKEN @noshow_token = line when REGEXP::TOKEN_PRICE_ONLY @noshow_token = line end end endend#-------------------------------------------------------------------------------# @shop_goods is now an array of Game_ShopGoods#-------------------------------------------------------------------------------class Window_ShopBuy < Window_Selectable alias :my_include? :include? def include?(shopGood) if $game_switches[REGEXP::SWITCH_ID] return false if $game_switches[REGEXP::ALWAYS_HIDE_SWITCH_ID] return false if shopGood.item.noshow_token == REGEXP::TOKEN end my_include?(shopGood) end unless $imported["YEA-ShopOptions"].nil? #-------------------------------------------------------------------------- # overwrite method: draw_item #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] return if item.nil? rect = item_rect(index) draw_item_name(item, rect.x, rect.y, enable?(item), rect.width-24) rect.width -= 4 contents.font.size = YEA::LIMIT::SHOP_FONT if $imported["YEA-AdjustLimits"] if item.noshow_token != REGEXP::TOKEN_PRICE_ONLY || $game_switches[REGEXP::SWITCH_ID] != true if $game_switches[REGEXP::ALWAYS_HIDE_PRICE_SWITCH_ID] != true draw_text(rect, price(item).group, 2) end end reset_font_settings end else #-------------------------------------------------------------------------- # overwrite method: draw_item #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] rect = item_rect(index) draw_item_name(item, rect.x, rect.y, enable?(item)) rect.width -= 4 if item.noshow_token != REGEXP::TOKEN_PRICE_ONLY || $game_switches[REGEXP::SWITCH_ID] != true if $game_switches[REGEXP::ALWAYS_HIDE_PRICE_SWITCH_ID] != true draw_text(rect, price(item), 2) end end end end endclass Scene_Title < Scene_Base alias my_new command_new_game def command_new_game my_new $game_switches[REGEXP::SWITCH_ID] = REGEXP::AUTO_ON if $game_switches[REGEXP::SWITCH_ID] == true puts "Switch " + REGEXP::SWITCH_ID.to_s + " is turned on." else puts "Switch " + REGEXP::SWITCH_ID.to_s + " is turned off." end endend