=begin È­Æó´ÜÀ§ ±¸ºÐ ½Ã½ºÅÛ by Çã°Æ ¾Æ·¡ UNITS ºÎºÐ¿¡ ¼³¸í°ú °°ÀÌ ÀûÀ» ¼ö ÀÖ½À´Ï´Ù. ['Ç¥½Ã ´ÜÀ§', »ö»ó(Color.new(Red, Green, Blue), ´ÜÀ§ ÃÖ´ë°ª], =end module ExCurrencyValue UNITS = [ # ['Ç¥½Ã ´ÜÀ§', »ö»ó(Color.new(Red, Green, Blue), ´ÜÀ§ ÃÖ´ë°ª], ['C', Color.new(160,80,30), 100], ['S', Color.new(180,180,180), 100], ['G', Color.new(240,210,60), 100], ['T', Color.new(240,10,160)], # Ç¥½ÃÇÏÁö ¾ÊÀ¸·Á¸é ÁÙ ¾Õ¿¡ # Ç¥½Ã¸¦ ÇØÁÖ¼¼¿ä. ] # ÀÌÈÄ ¼öÁ¤±ÝÁö raise "ÃÖ¼ÒÇÑ ÇϳªÀÇ UNITÀÌ ÀÖ¾î¾ß ÇÕ´Ï´Ù." if UNITS.size == 0 VALUE_COLOR = true # true : ¼ýÀÚ»ö»ó, false : ´ÜÀ§»ö»ó SKIP_OVERZERO = true # true : Àǹ̾ø´Â 0 Ç¥½ÃX, false : 0Ç¥½Ã def self.get_unit UNITS.collect{ |unit| unit[0] } end def self.get_color UNITS.collect{ |unit| unit[1] } end def self.get_value UNITS.collect{ |unit| unit[2] } end def self.size UNITS.size end end class Window_Base < Window #-------------------------------------------------------------------------- # ¡Ü È­Æó´ÜÀ§ ºÙÀº ¼öÄ¡(¼ÒÁö±Ý µî)Ç¥½Ã #-------------------------------------------------------------------------- def draw_currency_value(value, unit, x, y, width) cw = width for i in 0...ExCurrencyValue.size _unit = ExCurrencyValue.get_unit[i] _color = ExCurrencyValue.get_color[i] _value = get_currency_value(_unit, value) change_color(ExCurrencyValue::VALUE_COLOR ? system_color : _color) draw_text(x, y, cw, line_height, _unit, 2) cx = text_size(_unit).width cw = cw - cx - 2 change_color(!ExCurrencyValue::VALUE_COLOR ? normal_color : _color) cx = text_size(_value).width draw_text(x, y, cw, line_height, _value, 2) cw = cw - cx - 3 break if (i+1) == ExCurrencyValue.size total_value = 1 for j in 0..i total_value *= ExCurrencyValue.get_value[j] end break if value < total_value if ExCurrencyValue::SKIP_OVERZERO end end #-------------------------------------------------------------------------- # ¡Ü ´ÜÀ§º° ¾×¼ö Ãëµæ #-------------------------------------------------------------------------- def get_currency_value(unit, value) index = ExCurrencyValue.get_unit.index(unit) if index == nil raise " : #{unit}\nÇØ´ç ¹®ÀÚ¿­Àº ExCurrencyValue ÀÇ UNIT ¿¡ Á¤ÀǵÇÁö ¾Ê¾Ò½À´Ï´Ù." end result = value for i in 0...index result /= ExCurrencyValue.get_value[i] end if (index + 1) < ExCurrencyValue.size result %= ExCurrencyValue.get_value[index] end return result end end class Window_ShopBuy < Window_Selectable #-------------------------------------------------------------------------- # ¡Ü Ç׸ñ Ç¥½Ã #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] rect = item_rect(index) draw_item_name(item, rect.x, rect.y, enable?(item)) rect.width -= 4 draw_currency_value(price(item), nil, rect.x, rect.y, rect.width) end end # presented by Çã°Æ