Guest User

Extra Menu Window by Rikifive

a guest
Jul 9th, 2015
206
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #==============================================================================#
  2. # ■■■■■■■■■■■■■■■■■■■■■■■■■■■■ EXTRA MENU WINDOW ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ #
  3. #                          ---=== Version: 1.1 ===---                          #
  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. #==============================================================================#
  27. #                              ▼ INSTRUCTIONS ▼                                #
  28. #==============================================================================#
  29. # I know this script is kinda messy, but it's pretty easy to configure.        #
  30. # The options ale all over the place, but they are labeled with info.          #
  31. # Simply follow these options and set them to your needs.                      #
  32. #                                                                              #
  33. # Configuring things displayed in window starts in line #84.                   #
  34. # Each thing starts with "[ ● Item Setup ]" and ends with second wall of "###" #
  35. # To configure things simply follow the examples.                              #
  36. # Do not edit anything between walls of "##############", unless you know what #
  37. # you're doing.                                                                #
  38. # You can add as many lines as you want. (the screen resolution is the border) #
  39. # To add a new line (thing), copy everything from "[ ● Item Setup ]" to        #
  40. # second wall of "###" and paste that below the other things.                  #
  41. # You can put text into value or a value into text or you can even put two     #
  42. # texts in the one thing, that doesn't matter.                                 #
  43. # You can use things like "$game_party.gold" or use a variable.                #
  44. # To add variable into the window put $game_variables[ID] in the text/value.   #
  45. #==============================================================================#
  46.  
  47. #-------------------------------------------------------------------------------
  48. # ► Main Settings
  49. #-------------------------------------------------------------------------------
  50. # ● Set amount of items displayed in the window.
  51. WINDOW_LINES = 4
  52.  
  53. # ● Set the window position.
  54. WINDOW_POSITION_X = 0
  55. WINDOW_POSITION_Y = 304
  56.  
  57. #-------------------------------------------------------------------------------
  58. # ► Initialize
  59. #-------------------------------------------------------------------------------
  60. class Window_ExtraInfo < Window_Base
  61.   def initialize(x, y)
  62.   super(x, y, 160, 32 * WINDOW_LINES)
  63.   # ● You can set the font settings here:
  64.   self.contents.font.bold = true # enable BOLD?
  65.   self.contents.font.size = 20 # set the font SIZE
  66.   self.contents.font.outline = true # enable OUTLINE?
  67.   self.contents.font.shadow = true # enable SHADOW?
  68.   # ● End of font settings
  69.   self.contents.font.color = normal_color
  70.   @playtime = 0
  71.   refresh
  72. end
  73.  
  74.   #-----------------------------------------------------------------------------
  75.   # ► Setup (Do not touch anything here)
  76.   #-----------------------------------------------------------------------------
  77.   def refresh
  78.   self.contents.clear
  79.   # ● Width & Height
  80.   wid = contents.width - 24
  81.   hei = contents.height
  82.  
  83.   #-----------------------------------------------------------------------------
  84.   # ► Draw Stuff (Here you can setup displayed stuff)
  85.   #-----------------------------------------------------------------------------
  86.  
  87.   #===========================[ ● Item 1 Setup ]===============================#
  88.   enable = true # Enable this item? (Playtime by default)
  89.   if enable # DO NOT TOUCH
  90.   position = 4 # Sets the position of this item
  91.   text = "Time" # Sets the displayed text, leave "" to disable text
  92.   t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
  93.   t_red = 150 # Set the color of text displayed
  94.   t_grn = 175 # ~
  95.   t_blu = 255 # ~
  96.   value = $game_system.playtime_s # Sets the value displayed
  97.   v_align = 2 # Sets the value alignment (0 - left; 1 - center; 2 - right)
  98.   v_red = 255 # Set the color of value displayed
  99.   v_grn = 255 # ~
  100.   v_blu = 255 # ~
  101.   icon = 1260 # ID of the displayed icon.
  102.   iconpos = 0 # Sets the position of icon (0 - left; 1 - right)
  103.  
  104.   ##############################################################################
  105.   self.contents.font.color = Color.new(t_red,t_grn,t_blu)
  106.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, text, t_align)
  107.   self.contents.font.color = Color.new(v_red,v_grn,v_blu)
  108.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, "#{value}", v_align)
  109.   self.contents.font.color = normal_color
  110.   draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
  111.   else
  112.   end
  113.   ##############################################################################
  114.  
  115.   #===========================[ ● Item 2 Setup ]===============================#
  116.   enable = true # Enable this item? (Location by default)
  117.   if enable # DO NOT TOUCH
  118.   position = 3 # Sets the position of this item
  119.   text = "" # Sets the displayed text, leave "" to disable text
  120.   t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
  121.   t_red = 35 # Set the color of text displayed
  122.   t_grn = 160 # ~
  123.   t_blu = 220 # ~
  124.   value = $data_mapinfos[$game_map.map_id].name # Sets the value displayed
  125.   v_align = 1 # Sets the value alignment (0 - left; 1 - center; 2 - right)
  126.   v_red = 255 # Set the color of value displayed
  127.   v_grn = 210 # ~
  128.   v_blu = 170 # ~
  129.   icon = 1270 # ID of the displayed icon.
  130.   iconpos = 0 # Sets the position of icon (0 - left; 1 - right)
  131.  
  132.   ##############################################################################
  133.   self.contents.font.color = Color.new(t_red,t_grn,t_blu)
  134.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, text, t_align)
  135.   self.contents.font.color = Color.new(v_red,v_grn,v_blu)
  136.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, "#{value}", v_align)
  137.   self.contents.font.color = normal_color
  138.   draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
  139.   else
  140.   end
  141.   ##############################################################################
  142.  
  143.   #===========================[ ● Item 3 Setup ]===============================#
  144.   enable = true # Enable this item? (Gold by default)
  145.   if enable # DO NOT TOUCH
  146.   position = 1 # Sets the position of this item
  147.   text = "Gold" # Sets the displayed text, leave "" to disable text
  148.   t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
  149.   t_red = 150 # Set the color of text displayed
  150.   t_grn = 175 # ~
  151.   t_blu = 255 # ~
  152.   value = $game_party.gold # Sets the value displayed
  153.   v_align = 2 # Sets the value alignment (0 - left; 1 - center; 2 - right)
  154.   v_red = 255 # Set the color of value displayed
  155.   v_grn = 255 # ~
  156.   v_blu = 150 # ~
  157.   icon = 361 # ID of the displayed icon.
  158.   iconpos = 1 # Sets the position of icon (0 - left; 1 - right)
  159.  
  160.   ##############################################################################
  161.   self.contents.font.color = Color.new(t_red,t_grn,t_blu)
  162.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, text, t_align)
  163.   self.contents.font.color = Color.new(v_red,v_grn,v_blu)
  164.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, " #{value}", v_align)
  165.   self.contents.font.color = normal_color
  166.   draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
  167.   else
  168.   end
  169.   ##############################################################################
  170.    
  171.   #===========================[ ● Item 4 Setup ]===============================#
  172.   enable = true # Enable this item? (Variable 18 by default)
  173.   if enable # DO NOT TOUCH
  174.   position = 2 # Sets the position of this item
  175.   text = "Var 18" # Sets the displayed text, leave "" to disable text
  176.   t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
  177.   t_red = 150 # Set the color of text displayed
  178.   t_grn = 175 # ~
  179.   t_blu = 255 # ~
  180.   value = $game_variables[18] # Sets the value displayed
  181.   v_align = 2 # Sets the value alignment (0 - left; 1 - center; 2 - right)
  182.   v_red = 50 # Set the color of value displayed
  183.   v_grn = 255 # ~
  184.   v_blu = 255 # ~
  185.   icon = 347 # ID of the displayed icon.
  186.   iconpos = 1 # Sets the position of icon (0 - left; 1 - right)
  187.  
  188.   ##############################################################################
  189.   self.contents.font.color = Color.new(t_red,t_grn,t_blu)
  190.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, text, t_align)
  191.   self.contents.font.color = Color.new(v_red,v_grn,v_blu)
  192.   self.contents.draw_text(24 - 23 * iconpos, -48 + 24 * position, wid, 72, " #{value}", v_align)
  193.   self.contents.font.color = normal_color
  194.   draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
  195.   else
  196.   end
  197.   ##############################################################################
  198.  
  199. ################################################################################
  200. # END OF CUSTOMIZATION, Do not edit anything below, unless you know,
  201. # what you're doing!
  202. ################################################################################
  203.     @playtime = $game_system.playtime
  204.   end # Refresh
  205.  
  206.   #-----------------------------------------------------------------------------
  207.   # ► Update
  208.   #-----------------------------------------------------------------------------
  209.   def update
  210.     super
  211.     refresh if $game_system.playtime - @playtime >= 1
  212.   end
  213. end
  214.  
  215. #-------------------------------------------------------------------------------
  216. # ► Create Window
  217. #-------------------------------------------------------------------------------
  218. class Scene_Menu < Scene_MenuBase
  219.  
  220.   #-----------------------------------------------------------------------------
  221.   # ► Start
  222.   #-----------------------------------------------------------------------------
  223.   alias extra_info_start start
  224.   def start
  225.   extra_info_start
  226.   create_extrainfo_window
  227.   end
  228.  
  229.   #-----------------------------------------------------------------------------
  230.   # ► create Extra Info Window
  231.   #-----------------------------------------------------------------------------
  232.   def create_extrainfo_window
  233.     @extrainfo_window = Window_ExtraInfo.new(WINDOW_POSITION_X, WINDOW_POSITION_Y)
  234.   end
  235. end
RAW Paste Data