#============================================================================== # ■ Item Borders Rank # By :VIPArcher [email: VIPArcher@sina.com] # -- The script comes from http://rm.66rpg.com Please keep the information above. # Feel free to use/ reprint #============================================================================== $VIPArcherScript ||= {};$VIPArcherScript[:itemcolor] = __FILE__ #20141007 #------------------------------------------------------------------------------- module VIPArcher end #============================================================================== # ★ Setting ★ #============================================================================== module VIPArcher::ItemColor RIM = true # whether to draw a border FILL = true # whether to fill the border # To set a color quality, Color_Lv = { # Rank => Control character color number, 0 => 0, 1 => 24, 2 => 1, 3 => 30, 4 => 27, 5 => 18, 6 => 14 # Addition };Color_Lv.default = 0 # Don't delete this line end #============================================================================== # ☆ End of setting ☆ #============================================================================== class RPG::BaseItem include VIPArcher::ItemColor #-------------------------------------------------------------------------- # ● Define color #-------------------------------------------------------------------------- def color @note =~ // [[$1.to_i,Color_Lv.size - 1].min,0].max end end #------------------------------------------------------------------------------- class Window_Base < Window include VIPArcher::ItemColor #-------------------------------------------------------------------------- # ● Draw item name #-------------------------------------------------------------------------- def draw_item_name(item, x, y, enabled = true, width = 172) return unless item item_color = text_color(Color_Lv[item.color]) change_color(item_color, enabled) self.color_fill_rect(x,y,item_color) if RIM draw_icon(item.icon_index, x, y, enabled) draw_text(x + 30, y, width, line_height, item.name) end #-------------------------------------------------------------------------- # ● Draw icon border #-------------------------------------------------------------------------- def color_fill_rect(x,y,item_color) item_alpha = item_color.clone item_alpha.alpha = 160 contents.fill_rect(x+1 ,y+1 ,22, 22 ,item_alpha) if FILL contents.fill_rect(x+1 ,y+1 ,22, 1 ,item_color) contents.fill_rect(x ,y+2 ,1 , 20 ,item_color) contents.fill_rect(x+1 ,y+22,22, 1 ,item_color) contents.fill_rect(x+23,y+2 ,1 , 20 ,item_color) end end