Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================#
- # ■■■■■■■■■■■■■■■■■■■■■■■■■■■■ EXTRA MENU WINDOW ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ #
- # ---=== Version: 1.3 ===--- #
- #==============================================================================#
- # Script written by: Rikifive #
- #==============================================================================#
- # ▼ INTRODUCTION ▼ #
- #==============================================================================#
- # This script creates a simple window with custom information in main menu. #
- # Variations, playtime, location etc. can now be displayed in menu. #
- #==============================================================================#
- # ▼ COMPATIBILITY ▼ #
- #==============================================================================#
- # this script is written in the most simplest possible way, but it may #
- # be incompatible with scripts that changes your menu. #
- #==============================================================================#
- # ▼ TERMS OF USE ▼ #
- #==============================================================================#
- # ---=== For both COMMERCIAL and NON-COMMERCIAL projects. ===--- #
- # Crediting me (Rikifive) in your game would be appreciated. #
- #==============================================================================#
- # ▼ VERSION HISTORY ▼ #
- #==============================================================================#
- # Version 1.0: Initial Release #
- # Version 1.1: - Changed refresh rate of playtime. (thanks to DigiDeity) #
- # Version 1.2: - Added option that disables the default Gold Window in Menu. #
- # - Fixed the resolution of the window lines. #
- # Version 1.3: - Added option to center text/value when not using icons. #
- # - Moved "Font settings" to "Main Settings". #
- #==============================================================================#
- # ▼ INSTRUCTIONS ▼ #
- #==============================================================================#
- # I know this script is kinda messy, but it's pretty easy to configure. #
- # #
- # Configuring things (*items*) displayed in window starts in line #100. #
- # Each item starts with "[ ● Item Setup ]" and ends with second wall of "###". #
- # To configure *items* simply follow the examples. #
- # Do not edit anything between walls of "##############", unless you know what #
- # you're doing. #
- # You can add as many lines as you want. (the display resolution is the limit) #
- # To add a new line (item), copy everything from "[ ● Item Setup ]" to #
- # second wall of "###" and paste that below/above the other things (items). #
- # You can put text into value or a value into text or you can even put two #
- # texts in the one thing (item), that doesn't matter. #
- # You can use things like "$game_party.gold" or use a variable. #
- # To add variable into the window put $game_variables[ID] in the text/value. #
- #==============================================================================#
- #-------------------------------------------------------------------------------
- # ► Main Settings (Setup your window and stuff)
- #-------------------------------------------------------------------------------
- # ● Set amount of items displayed in the window.
- WINDOW_LINES = 4
- # ● Set the window position.
- WINDOW_POSITION_X = 0
- WINDOW_POSITION_Y = 360
- # ● Font settings
- BOLD = false # enable / disable font BOLD.
- SIZE = 20 # Set the font SIZE.
- OUTLINE = false # enable / disable font OUTLINE.
- SHADOW = true # enable / disable font SHADOW.
- # ● Enable / Disable default Gold Window.
- DEFAULT_GOLD_WINDOW = false
- # ● In case of incompatibilities (disappearing other custom windows), try
- # moving that script up. If that will not work, you can always disable
- # overwriting of the Scene_Menu < Scene_MenuBase.
- # NOTE: This will disable the "Default Gold Window" option.
- OVERWRITE_SCENE_MENU = true
- #===========================[ END OF MAIN SETTINGS ]===========================#
- #-------------------------------------------------------------------------------
- # ► Initialize (Do not touch anything here)
- #-------------------------------------------------------------------------------
- class Window_ExtraMenuWindow < Window_Base
- def initialize(x, y)
- super(x, y, 160, 24 + 24 * WINDOW_LINES)
- self.contents.font.bold = BOLD
- self.contents.font.size = SIZE
- self.contents.font.outline = OUTLINE
- self.contents.font.shadow = SHADOW
- self.contents.font.color = normal_color
- @playtime = 0
- refresh
- end
- #-----------------------------------------------------------------------------
- # ► Setup (Do not touch anything here)
- #-----------------------------------------------------------------------------
- def refresh
- self.contents.clear
- # ● Width & Height
- wid = contents.width - 24
- hei = 72
- #-----------------------------------------------------------------------------
- # ► Draw Stuff (Here you can setup displayed stuff)
- #-----------------------------------------------------------------------------
- #===========================[ ● Item 1 Setup ]===============================#
- enable = true # Enable this item? (Playtime by default)
- if enable # DO NOT TOUCH
- position = 4 # Sets the position of this item
- text = "Time" # Sets the displayed text, leave "" to disable text
- t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
- t_red = 150 # Set the color of text displayed
- t_grn = 175 # ~
- t_blu = 255 # ~
- value = $game_system.playtime_s # Sets the value displayed
- v_align = 2 # Sets the value alignment (0 - left; 1 - center; 2 - right)
- v_red = 255 # Set the color of value displayed
- v_grn = 255 # ~
- v_blu = 255 # ~
- icon = 280 # ID of the displayed icon. (put 0 to disable [blank icon])
- iconpos = 0 # Sets the position of icon. (0 - left; 1 - right)
- center = false # Center text/value? (use when icon is not used)
- ##############################################################################
- self.contents.font.color = Color.new(t_red,t_grn,t_blu)
- if center
- self.contents.draw_text(0, -48 + 24 * position, wid + 24, hei, text, t_align)
- else # normal
- self.contents.draw_text(24 - 24 * iconpos, -48 + 24 * position, wid, hei, text, t_align)
- end # if CENTER_TEXT
- self.contents.font.color = Color.new(v_red,v_grn,v_blu)
- if center
- self.contents.draw_text(0, -48 + 24 * position, wid + 24, hei, "#{value}", v_align)
- else # normal
- self.contents.draw_text(24 - 24 * iconpos, -48 + 24 * position, wid, hei, "#{value}", v_align)
- end #if CENTER_TEXT
- self.contents.font.color = normal_color
- draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
- else # disabled text
- end # if enable
- ##############################################################################
- #===========================[ ● Item 2 Setup ]===============================#
- enable = true # Enable this item? (Location by default)
- if enable # DO NOT TOUCH
- position = 3 # Sets the position of this item
- text = "" # Sets the displayed text, leave "" to disable text
- t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
- t_red = 35 # Set the color of text displayed
- t_grn = 160 # ~
- t_blu = 220 # ~
- value = $data_mapinfos[$game_map.map_id].name # Sets the value displayed
- v_align = 1 # Sets the value alignment (0 - left; 1 - center; 2 - right)
- v_red = 255 # Set the color of value displayed
- v_grn = 210 # ~
- v_blu = 170 # ~
- icon = 231 # ID of the displayed icon.
- iconpos = 0 # Sets the position of icon (0 - left; 1 - right)
- center = false # Center text/value? (use when icon is not used)
- ##############################################################################
- self.contents.font.color = Color.new(t_red,t_grn,t_blu)
- if center
- self.contents.draw_text(0, -48 + 24 * position, wid + 24, hei, text, t_align)
- else # normal
- self.contents.draw_text(24 - 24 * iconpos, -48 + 24 * position, wid, hei, text, t_align)
- end # if CENTER_TEXT
- self.contents.font.color = Color.new(v_red,v_grn,v_blu)
- if center
- self.contents.draw_text(0, -48 + 24 * position, wid + 24, hei, "#{value}", v_align)
- else # normal
- self.contents.draw_text(24 - 24 * iconpos, -48 + 24 * position, wid, hei, "#{value}", v_align)
- end #if CENTER_TEXT
- self.contents.font.color = normal_color
- draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
- else # disabled text
- end # if enable
- ##############################################################################
- #===========================[ ● Item 3 Setup ]===============================#
- enable = true # Enable this item? (Gold by default)
- if enable # DO NOT TOUCH
- position = 1 # Sets the position of this item
- text = "Gold" # Sets the displayed text, leave "" to disable text
- t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
- t_red = 150 # Set the color of text displayed
- t_grn = 175 # ~
- t_blu = 255 # ~
- value = $game_party.gold # Sets the value displayed
- v_align = 2 # Sets the value alignment (0 - left; 1 - center; 2 - right)
- v_red = 255 # Set the color of value displayed
- v_grn = 255 # ~
- v_blu = 150 # ~
- icon = 361 # ID of the displayed icon.
- iconpos = 1 # Sets the position of icon (0 - left; 1 - right)
- center = false # Center text/value? (use when icon is not used)
- ##############################################################################
- self.contents.font.color = Color.new(t_red,t_grn,t_blu)
- if center
- self.contents.draw_text(0, -48 + 24 * position, wid + 24, hei, text, t_align)
- else # normal
- self.contents.draw_text(24 - 24 * iconpos, -48 + 24 * position, wid, hei, text, t_align)
- end # if CENTER_TEXT
- self.contents.font.color = Color.new(v_red,v_grn,v_blu)
- if center
- self.contents.draw_text(0, -48 + 24 * position, wid + 24, hei, "#{value}", v_align)
- else # normal
- self.contents.draw_text(24 - 24 * iconpos, -48 + 24 * position, wid, hei, "#{value}", v_align)
- end #if CENTER_TEXT
- self.contents.font.color = normal_color
- draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
- else # disabled text
- end # if enable
- ##############################################################################
- #===========================[ ● Item 4 Setup ]===============================#
- enable = true # Enable this item? (Variable 18 by default)
- if enable # DO NOT TOUCH
- position = 2 # Sets the position of this item
- text = "Var 18" # Sets the displayed text, leave "" to disable text
- t_align = 0 # Sets the text alignment (0 - left; 1 - center; 2 - right)
- t_red = 150 # Set the color of text displayed
- t_grn = 175 # ~
- t_blu = 255 # ~
- value = $game_variables[18] # Sets the value displayed
- v_align = 2 # Sets the value alignment (0 - left; 1 - center; 2 - right)
- v_red = 50 # Set the color of value displayed
- v_grn = 255 # ~
- v_blu = 255 # ~
- icon = 347 # ID of the displayed icon.
- iconpos = 1 # Sets the position of icon (0 - left; 1 - right)
- center = false # Center text/value? (use when icon is not used)
- ##############################################################################
- self.contents.font.color = Color.new(t_red,t_grn,t_blu)
- if center
- self.contents.draw_text(0, -48 + 24 * position, wid + 24, hei, text, t_align)
- else # normal
- self.contents.draw_text(24 - 24 * iconpos, -48 + 24 * position, wid, hei, text, t_align)
- end # if CENTER_TEXT
- self.contents.font.color = Color.new(v_red,v_grn,v_blu)
- if center
- self.contents.draw_text(0, -48 + 24 * position, wid + 24, hei, "#{value}", v_align)
- else # normal
- self.contents.draw_text(24 - 24 * iconpos, -48 + 24 * position, wid, hei, "#{value}", v_align)
- end #if CENTER_TEXT
- self.contents.font.color = normal_color
- draw_icon(icon, 0 + 112 * iconpos, -24 + 24 * position)
- else # disabled text
- end # if enable
- ##############################################################################
- #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■#
- #■ END OF CUSTOMIZATION, Do not edit anything below, unless you know ■#
- #■ what you're doing! ■#
- #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■#
- @playtime = $game_system.playtime
- end # Refresh
- #-----------------------------------------------------------------------------
- # ► Update
- #-----------------------------------------------------------------------------
- def update
- super
- refresh if $game_system.playtime - @playtime >= 1
- end
- end
- #-------------------------------------------------------------------------------
- # ► Disable Window
- #-------------------------------------------------------------------------------
- if OVERWRITE_SCENE_MENU
- class Scene_Menu < Scene_MenuBase
- def start
- super
- create_command_window
- if DEFAULT_GOLD_WINDOW
- create_gold_window
- else
- end # if
- create_status_window
- end # def
- end # class
- else
- end # if
- #-------------------------------------------------------------------------------
- # ► Create Window
- #-------------------------------------------------------------------------------
- class Scene_Menu < Scene_MenuBase
- #-----------------------------------------------------------------------------
- # ► Start
- #-----------------------------------------------------------------------------
- alias extramenuwindow_start start
- def start
- extramenuwindow_start
- create_extramenuwindow_window
- end
- #-----------------------------------------------------------------------------
- # ► create Extra Menu Window
- #-----------------------------------------------------------------------------
- def create_extramenuwindow_window
- @extramenuwindow_window = Window_ExtraMenuWindow.new(WINDOW_POSITION_X, WINDOW_POSITION_Y)
- end
- end
RAW Paste Data