To start off, Rokan's script essentially highlights any new items that are added to the party's inventory up to a certain maximum. For example, if the max is 3, up to 3 items will be highlighted at any time (updating as it goes along).
What the script doesn't do, is un-highlight them when they're used. This is what I want it to do.
For example, say the player picks up a new potion (assuming it's non-consumable). That potion's text will highlight green in their item menu. Once they "use" it, it should no longer be highlighted as a new item.
Rokan's script below:
And a link to the script page: http://forums.rpgmakerweb.com/index.php?/topic/973-rokans-highlight-new-items-100/
What the script doesn't do, is un-highlight them when they're used. This is what I want it to do.
For example, say the player picks up a new potion (assuming it's non-consumable). That potion's text will highlight green in their item menu. Once they "use" it, it should no longer be highlighted as a new item.
Rokan's script below:
=begin RGSS3 * Highlight New Items in Inventory * Highlights the names of new items in the inventory in a different color to improve player usability. ● Important ●======================================================= After a certain number of items has been registered as 'new', older items will be un-emphasized and newer items will be emphasized. -------------------------------------------------------------------- 'Oldest' in this case refers to the last item that is new, not the first item that was registered. -------------------------------------------------------------------- For example: A => B => C => A => D => E => F In the above example, the first item obtained is A, but another A is obtained after C. Since A is now 'newer', B is now the oldest item in the history, and will be the next to be de-emphasized. ==================================================================== ● Event Command ●=================================================== Place the following in a script call to clear the 'history' of new items: clear_new_item -------------------------------------------------------------------- New Games in particular highlight every item you get initially as new, so this script needs to be called. ==================================================================== ● Notice ●========================================================== Please start a new game to avoid errors. ==================================================================== ver1.00 Last Update : 2011/12/18 12/18 : Created script. Written by Rokan http://kaisou-ryouiki.sakura.ne.jp/ Translated by kirinelf=end#===================================# ● Configuration Block#===================================module Rokanmodule Put_New_Item # Number of items to register as new. # (This setting determines the highest number of highlighted items) MNIS = 3 # Font color of highlighted items. # (Determined from the WindowSkin) PIFC = 3 # ID of the switch to disable memory. # (If this switch is on, new items will not be registered and highlighted) DEIS = 62endend#============================================================================# Do not edit anything past this point unless you know what you're doing!#============================================================================$rsi ||= {}$rsi["新規入手アイテム強調表現"] = trueclass Game_Party < Game_Unit #-------------------------------------------------------------------------- # ● インクルード Rokan:😛ut_New_Item #-------------------------------------------------------------------------- include Rokan:😛ut_New_Item #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias _new_item_initialize initialize def initialize _new_item_initialize clear_new_item end #-------------------------------------------------------------------------- # ● 新規入手アイテムの初期化 #-------------------------------------------------------------------------- def clear_new_item @get_newer_items = [] end #-------------------------------------------------------------------------- # ● 新規入手アイテムであるか #-------------------------------------------------------------------------- def new_item?(item) @get_newer_items.include?(new_item_obj(item)) end #-------------------------------------------------------------------------- # ● 新規入手アイテムを登録される形にして返す #-------------------------------------------------------------------------- def new_item_obj(item) case item when RPG::Item [0, item.id] when RPG::Weapon [1, item.id] when RPG::Armor [2, item.id] else nil end end #-------------------------------------------------------------------------- # ● 新規入手配列を更新するかどうか #-------------------------------------------------------------------------- def update_new_item? !$game_switches[DEIS] && !SceneManager.scene_is?(Scene_Equip) end #-------------------------------------------------------------------------- # ● 新規入手配列の更新 #-------------------------------------------------------------------------- def update_new_item(item, amount) if update_new_item? if amount > 0 set_new_item(new_item_obj(item)) elsif item_number(item).zero? remove_new_item(new_item_obj(item)) end end end #-------------------------------------------------------------------------- # ● 新規入手アイテム情報の追加 #-------------------------------------------------------------------------- def set_new_item(new_item) @get_newer_items.delete(new_item) @get_newer_items << new_item @get_newer_items.shift if @get_newer_items.size > MNIS end #-------------------------------------------------------------------------- # ● 新規入手アイテム情報の削除 #-------------------------------------------------------------------------- def remove_new_item(new_item) @get_newer_items.delete(new_item) end #-------------------------------------------------------------------------- # ● アイテムの増加(減少) #-------------------------------------------------------------------------- alias _put_newitem_gain_item gain_item def gain_item(item, amount, include_equip = false) _put_newitem_gain_item(item, amount, include_equip) update_new_item(item, amount) endendclass Game_Interpreter #-------------------------------------------------------------------------- # ● 新規入手アイテム情報のクリア #-------------------------------------------------------------------------- def clear_new_item $game_party.clear_new_item endendclass Window_Base < Window #-------------------------------------------------------------------------- # ● インクルード Rokan:😛ut_New_Item #-------------------------------------------------------------------------- include Rokan:😛ut_New_Item #-------------------------------------------------------------------------- # ● 各種文字色の取得 #-------------------------------------------------------------------------- def putitem_color; text_color(PIFC); end; # アイテム強調色 #-------------------------------------------------------------------------- # ● アイテム描画色の取得 #-------------------------------------------------------------------------- def item_color(item) if item.is_a?(RPG::Skill) normal_color else if SceneManager.scene_is?(Scene_Shop) normal_color elsif !$game_party.new_item?(item) normal_color else putitem_color end end end #-------------------------------------------------------------------------- # ● アイテム名の描画 ※再定義 #-------------------------------------------------------------------------- def draw_item_name(item, x, y, enabled = true, width = 172) return unless item draw_icon(item.icon_index, x, y, enabled) change_color(item_color(item), enabled) draw_text(x + 24, y, width, line_height, item.name) endend