Advertisement
TroyZ

TroyZ - Currency Display Mods

Jun 13th, 2013
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.14 KB | None | 0 0
  1. # ==============================================================================
  2. # ▼▼▼▼▼▼                 TroyZ - Currency Display Mods                    ▼▼▼▼▼▼
  3. # ==============================================================================
  4. # Script by : Agung Prasetyo(TroyZ)
  5. # Contact me by : - Email agung.endisnear.xyz@gmail.com
  6. #                 - Forum RPGMakerID, username TroyZ
  7. #                 - Handphone 085756289121
  8. # Engine : VXAce
  9. # Level : Easy
  10. # Version : 1.0
  11. # ------------------------------------------------------------------------------
  12. # Change Logs :
  13. # 13 June 2013 : Version 1.0 released
  14. # ------------------------------------------------------------------------------
  15. # How this work :
  16. # This little script will give you an ability to alter how to show the gold in
  17. # the menu, in the shop, and also when gold window popup using \$.
  18. # ------------------------------------------------------------------------------
  19. # How to use :
  20. # Place it between material and main. Choose your currency mode :
  21. # 1. Mode 1, the currency will be drawn normally with the unit.
  22. # 2. Mode 2, the currency will be drawn with currency icon and without the unit.
  23. # 3. Mode 3, the currency will be drawn with currency icon and its unit.
  24. # If you use either mode 2 or 3, you'll need to specifiy the currency icon inside
  25. # the module
  26. # ------------------------------------------------------------------------------
  27. # Compatibility issues :
  28. # I haven't get any compatibility issues actually. It works with almost many
  29. # menu engine, as long they didn't also alter the Window_Gold.
  30. # ------------------------------------------------------------------------------
  31. # Who to credit :
  32. # - Allah swt. : For the chance of living that he has given to me.
  33. # - Nabi Muhammad saw. : As a leader and messenger and prophet of Muslim.
  34. #                        I'm proud to be your follower. :)
  35. # - Agung Prasetyo(TroyZ) : Thats me, of course, the ones that made this script. :P
  36. # ------------------------------------------------------------------------------
  37. # License :
  38. # - Free Game : Just credit those names above.
  39. # - Commercial Game : Same as free game's license.
  40. # ------------------------------------------------------------------------------
  41. $imported = {} if $imported.nil?
  42. $imported[:TroyZ_CurrencyDisplayMods] = true
  43.  
  44. # ------------------------------------------------------------------------------
  45. # Configuration of script starts here
  46. # ------------------------------------------------------------------------------
  47. module AGUNG
  48.   CURRENCY_MODE = 1 # change this number into currency mode that suit your needs
  49.   CURRENCY_ICON = 361 # only applies to mode 2 and 3. specify the currency icon index
  50. end
  51. # ------------------------------------------------------------------------------
  52. # End of Configuration
  53. # ------------------------------------------------------------------------------
  54. class Window_Base < Window
  55.   # ----------------------------------------------------------------------------
  56.   # New method, for currency mode 2
  57.   # ----------------------------------------------------------------------------
  58.   def draw_currency_value_without_unit(value, x, y, width)
  59.     cx = text_size(value).width
  60.     change_color(normal_color)
  61.     draw_text(x, y, width - 2, line_height, value, 2)
  62.     change_color(system_color)
  63.   end
  64. end
  65.  
  66. class Window_Gold < Window_Base
  67.   # ----------------------------------------------------------------------------
  68.   # Overwrite refresh
  69.   # ----------------------------------------------------------------------------
  70.   include AGUNG
  71.   def refresh
  72.     contents.clear
  73.     case CURRENCY_MODE
  74.     when 1
  75.       draw_currency_value(value, currency_unit, 4, 0, contents.width - 8)
  76.     when 2
  77.       draw_currency_value_without_unit(value, 4, 0, contents.width - 8)
  78.       draw_icon(CURRENCY_ICON,0,0)
  79.     when 3
  80.       draw_currency_value(value, currency_unit, 4, 0, contents.width - 8)
  81.       draw_icon(CURRENCY_ICON,0,0)
  82.     end
  83.   end
  84. end
  85. # ------------------------------------------------------------------------------
  86. # END OF SCRIPT
  87. # ------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement