Advertisement
deadelf79

[RGSS3]Window Gold + Gold Icon

Mar 18th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.90 KB | None | 0 0
  1. # Данный скрипт добавляет отображение иконки в окно показа количества монеток
  2. #----------------------------------------------------------------------------
  3. class Window_Base
  4.   def draw_currency_value_ex(value, unit, x, y, width,icon_index)
  5.     cx = text_size(unit).width
  6.     change_color(normal_color)
  7.     draw_text(x, y, width - cx - 2, line_height, value, 2)
  8.     change_color(system_color)
  9.     draw_text(x, y, width, line_height, unit, 2)
  10.     draw_icon(icon_index,x,y)
  11.   end
  12. end
  13.  
  14. class Window_Gold < Window_Base
  15.   attr_accessor :icon
  16.   alias too_old_initialize initialize
  17.   def initialize
  18.     # Поменяй здесь на нужный номер иконки
  19.     @icon=245
  20.     too_old_initialize
  21.   end
  22.  
  23.   def refresh
  24.     contents.clear
  25.     draw_currency_value_ex(value, currency_unit, 4, 0, contents.width - 8,@icon)
  26.   end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement