Guest User

Extra Menu Window 1.2 by Rikifive

a guest
Jul 9th, 2015
264
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #==============================================================================#
  2. # ■■■■■■■■■■■■■■■■■■■■■■■■■■■■ EXTRA MENU WINDOW ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ #
  3. #                          ---=== Version: 1.2 ===---                          #
  4. #==============================================================================#
  5. #                         Script written by: Rikifive                          #
  6. #==============================================================================#
  7. #                              ▼ INTRODUCTION ▼                                #
  8. #==============================================================================#
  9. # This script creates a simple window with custom information in main menu.    #
  10. # Variations, playtime, location etc. can now be displayed in menu.            #
  11. #==============================================================================#
  12. #                              ▼ COMPATIBILITY ▼                               #
  13. #==============================================================================#
  14. # this script is written in the most simplest possible way, but it may         #
  15. # be incompatible with scripts that changes your menu.                         #
  16. #==============================================================================#
  17. #                              ▼ TERMS OF USE ▼                                #
  18. #==============================================================================#
  19. #       ---=== For both COMMERCIAL and NON-COMMERCIAL projects. ===---         #
  20. #         Crediting me (Rikifive) in your game would be appreciated.           #
  21. #==============================================================================#
  22. #                             ▼ VERSION HISTORY ▼                              #
  23. #==============================================================================#
  24. # Version 1.0: Initial Release                                                 #
  25. # Version 1.1: - Changed refresh rate of playtime. (thanks to DigiDeity)       #
  26. # Version 1.2: - Added option that disables the default Gold Window in Menu.   #
  27. #              - Fixed the resolution of the window lines.                     #
  28. #==============================================================================#
  29. #                              ▼ INSTRUCTIONS ▼                                #
  30. #==============================================================================#
  31. # I know this script is kinda messy, but it's pretty easy to configure.        #
  32. # The options ale all over the place, but they are labeled with info.          #
  33. # Simply follow these options and set them to your needs.                      #
  34. #                                                                              #
  35. # Configuring things displayed in window starts in line #95.                   #
  36. # Each thing starts with "[ ● Item Setup ]" and ends with second wall of "###" #
  37. # To configure things simply follow the examples.                              #
  38. # Do not edit anything between walls of "##############", unless you know what #
  39. # you're doing.                                                                #
  40. # You can add as many lines as you want. (the screen resolution is the border) #
  41. # To add a new line (thing), copy everything from "[ ● Item Setup ]" to        #
  42. # second wall of "###" and paste that below the other things.                  #
  43. # You can put text into value or a value into text or you can even put two     #
  44. # texts in the one thing, that doesn't matter.                                 #
  45. # You can use things like "$game_party.gold" or use a variable.                #
  46. # To add variable into the window put $game_variables[ID] in the text/value.   #
  47. #==============================================================================#
  48.  
  49. #-------------------------------------------------------------------------------
  50. # ► Main Settings
  51. #-------------------------------------------------------------------------------
  52. # ● Set amount of items displayed in the window.
  53. WINDOW_LINES = 4
  54.  
  55. # ● Set the window position.
  56. WINDOW_POSITION_X = 0
  57. WINDOW_POSITION_Y = 360
  58.  
  59. # ● Enable / Disable default Gold Window?
  60. DEFAULT_GOLD_WINDOW = false
  61.  
  62. # ● In case of incompatibilities (disappearing other custom windows), try
  63. #   moving that script up. If that will not work, you can always disable
  64. #   overwriting of the Scene_Menu < Scene_MenuBase.
  65. #   NOTE: This will disable the "Default Gold Window" option.
  66. OVERWRITE_SCENE_MENU = true
  67.  
  68. #-------------------------------------------------------------------------------
  69. # ► Initialize
  70. #-------------------------------------------------------------------------------
  71. class Window_ExtraInfo < Window_Base
  72.   def initialize(x, y)
  73.   super(x, y, 160, 24 + 24 * WINDOW_LINES)
  74.   # ● You can set the font settings here:
  75.   self.contents.font.bold = true # enable BOLD?
  76.   self.contents.font.size = 20 # set the font SIZE
  77.   self.contents.font.outline = true # enable OUTLINE?
  78.   self.contents.font.shadow = true # enable SHADOW?
  79.   # ● End of font settings
  80.   self.contents.font.color = normal_color
  81.   @playtime = 0
  82.   refresh
  83. end
  84.  
  85.   #-----------------------------------------------------------------------------
  86.   # ► Setup (Do not touch anything here)
  87.   #-----------------------------------------------------------------------------
  88.   def refresh
  89.   self.contents.clear
  90.   # ● Width & Height
  91.   wid = contents.width - 24
  92.   hei = contents.height
  93.  
  94.   #-----------------------------------------------------------------------------
  95.   # ► Draw Stuff (Here you can setup displayed stuff)
  96.   #-----------------------------------------------------------------------------
  97.  
  98.   #===========================[ ● Item 1 Setup ]===============================#
  99.   enable = true # Enable this item? (Playtime by default)
  100.   if enable # DO NOT TOUCH
  101.   position = 4 # Sets the position of this item
  102.   text = "Time" # Sets the displayed text, leave "" to disable text
  103.   t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
  104.   t_red = 150 # Set the color of text displayed
  105.   t_grn = 175 # ~
  106.   t_blu = 255 # ~
  107.   value = $game_system.playtime_s # Sets the value displayed
  108.   v_align = 2 # Sets the value alignment (0 - left; 1 - center; 2 - right)
  109.   v_red = 255 # Set the color of value displayed
  110.   v_grn = 255 # ~
  111.   v_blu = 255 # ~
  112.   icon = 1260 # ID of the displayed icon.
  113.   iconpos = 0 # Sets the position of icon (0 - left; 1 - right)
  114.  
  115.   ##############################################################################
  116.   self.contents.font.color = Color.new(t_red,t_grn,t_blu)
  117.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, text, t_align)
  118.   self.contents.font.color = Color.new(v_red,v_grn,v_blu)
  119.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, "#{value}", v_align)
  120.   self.contents.font.color = normal_color
  121.   draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
  122.   else
  123.   end
  124.   ##############################################################################
  125.  
  126.   #===========================[ ● Item 2 Setup ]===============================#
  127.   enable = true # Enable this item? (Location by default)
  128.   if enable # DO NOT TOUCH
  129.   position = 3 # Sets the position of this item
  130.   text = "" # Sets the displayed text, leave "" to disable text
  131.   t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
  132.   t_red = 35 # Set the color of text displayed
  133.   t_grn = 160 # ~
  134.   t_blu = 220 # ~
  135.   value = $data_mapinfos[$game_map.map_id].name # Sets the value displayed
  136.   v_align = 1 # Sets the value alignment (0 - left; 1 - center; 2 - right)
  137.   v_red = 255 # Set the color of value displayed
  138.   v_grn = 210 # ~
  139.   v_blu = 170 # ~
  140.   icon = 1270 # ID of the displayed icon.
  141.   iconpos = 0 # Sets the position of icon (0 - left; 1 - right)
  142.  
  143.   ##############################################################################
  144.   self.contents.font.color = Color.new(t_red,t_grn,t_blu)
  145.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, text, t_align)
  146.   self.contents.font.color = Color.new(v_red,v_grn,v_blu)
  147.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, "#{value}", v_align)
  148.   self.contents.font.color = normal_color
  149.   draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
  150.   else
  151.   end
  152.   ##############################################################################
  153.  
  154.   #===========================[ ● Item 3 Setup ]===============================#
  155.   enable = true # Enable this item? (Gold by default)
  156.   if enable # DO NOT TOUCH
  157.   position = 1 # Sets the position of this item
  158.   text = "Gold" # Sets the displayed text, leave "" to disable text
  159.   t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
  160.   t_red = 150 # Set the color of text displayed
  161.   t_grn = 175 # ~
  162.   t_blu = 255 # ~
  163.   value = $game_party.gold # Sets the value displayed
  164.   v_align = 2 # Sets the value alignment (0 - left; 1 - center; 2 - right)
  165.   v_red = 255 # Set the color of value displayed
  166.   v_grn = 255 # ~
  167.   v_blu = 150 # ~
  168.   icon = 361 # ID of the displayed icon.
  169.   iconpos = 1 # Sets the position of icon (0 - left; 1 - right)
  170.  
  171.   ##############################################################################
  172.   self.contents.font.color = Color.new(t_red,t_grn,t_blu)
  173.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, text, t_align)
  174.   self.contents.font.color = Color.new(v_red,v_grn,v_blu)
  175.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, " #{value}", v_align)
  176.   self.contents.font.color = normal_color
  177.   draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
  178.   else
  179.   end
  180.   ##############################################################################
  181.    
  182.   #===========================[ ● Item 4 Setup ]===============================#
  183.   enable = true # Enable this item? (Variable 18 by default)
  184.   if enable # DO NOT TOUCH
  185.   position = 2 # Sets the position of this item
  186.   text = "Var 18" # Sets the displayed text, leave "" to disable text
  187.   t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
  188.   t_red = 150 # Set the color of text displayed
  189.   t_grn = 175 # ~
  190.   t_blu = 255 # ~
  191.   value = $game_variables[18] # Sets the value displayed
  192.   v_align = 2 # Sets the value alignment (0 - left; 1 - center; 2 - right)
  193.   v_red = 50 # Set the color of value displayed
  194.   v_grn = 255 # ~
  195.   v_blu = 255 # ~
  196.   icon = 347 # ID of the displayed icon.
  197.   iconpos = 1 # Sets the position of icon (0 - left; 1 - right)
  198.  
  199.   ##############################################################################
  200.   self.contents.font.color = Color.new(t_red,t_grn,t_blu)
  201.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, text, t_align)
  202.   self.contents.font.color = Color.new(v_red,v_grn,v_blu)
  203.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, " #{value}", v_align)
  204.   self.contents.font.color = normal_color
  205.   draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
  206.   else
  207.   end
  208.   ##############################################################################
  209.  
  210. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■#
  211. #■ END OF CUSTOMIZATION, Do not edit anything below, unless you know,         ■#
  212. #■ what you're doing!                                                         ■#
  213. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■#
  214.  
  215.     @playtime = $game_system.playtime
  216.   end # Refresh
  217.  
  218.   #-----------------------------------------------------------------------------
  219.   # ► Update
  220.   #-----------------------------------------------------------------------------
  221.   def update
  222.     super
  223.     refresh if $game_system.playtime - @playtime >= 1
  224.   end
  225. end
  226.  
  227. #-------------------------------------------------------------------------------
  228. # ► Disable Window
  229. #-------------------------------------------------------------------------------
  230. if OVERWRITE_SCENE_MENU
  231. class Scene_Menu < Scene_MenuBase
  232.   def start
  233.     super
  234.     create_command_window
  235.     if DEFAULT_GOLD_WINDOW
  236.     create_gold_window
  237.     else
  238.     end # if
  239.     create_status_window
  240.   end # def
  241. end # class
  242. else
  243. end # if
  244.  
  245. #-------------------------------------------------------------------------------
  246. # ► Create Window
  247. #-------------------------------------------------------------------------------
  248. class Scene_Menu < Scene_MenuBase
  249.  
  250.   #-----------------------------------------------------------------------------
  251.   # ► Start
  252.   #-----------------------------------------------------------------------------
  253.   alias extra_info_start start
  254.   def start
  255.   extra_info_start
  256.   create_extrainfo_window
  257.   end
  258.  
  259.   #-----------------------------------------------------------------------------
  260.   # ► create Extra Info Window
  261.   #-----------------------------------------------------------------------------
  262.   def create_extrainfo_window
  263.     @extrainfo_window = Window_ExtraInfo.new(WINDOW_POSITION_X, WINDOW_POSITION_Y)
  264.   end
  265. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×