Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- # #
- # V's Variable Gauge Window #
- # Version 3.3 #
- # #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
- # Written By: V #
- # Last Edited: January 29, 2014 #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
- # #
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- #==============================================================================#
- #------------------------------------------------------------------------------#
- # ** Disclaimer #
- #------------------------------------------------------------------------------#
- # #
- # This script was intended for Non-Commercial use only, if you wish to use #
- # this script in a commercial game please PM me at which ever site you found #
- # this script. Either way please give me credit in your game script as the #
- # writer of this script, and send me a PM abuot the release of the game/demo. #
- # #
- #------------------------------------------------------------------------------#
- # ** How To Use #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
- # #
- # * Use anyone of these commands in a script call. #
- # * Remember to use "" before and after your name's, and bg's. #
- # * The colors are the same as the text color number. 0..31 #
- # #
- #------------------------------------------------------------------------------#
- # #
- # To access this window use SceneManager.call(Scene_VGW) #
- # #
- # To add a new variable use #
- # add_var( page_index, name, icon, var_id, max_value, color1, color2 ) #
- # #
- # To remove a variable use #
- # remove_var(variable_id) #
- # #
- # To change the color of a gauge use #
- # change_var_color( variable_id, color1, color2 ) #
- # #
- #------------------------------------------------------------------------------#
- # ** Description #
- #------------------------------------------------------------------------------#
- # #
- # v0.1 #
- # ~=~=~=~ #
- # #
- # In v0.1, this script basically just creates a status window that displays #
- # variables set to a gauge, there are options to set a name, icon, and #
- # abbereviations for each variable. There is also an option to set a #
- # game_variable, max lv and an option to change the background. #
- # #
- # #
- # v0.2 #
- # ~=~=~=~ #
- # #
- # In v0.2, I've changed the set-up to a variableid array to handle the #
- # variables to make it more user friendly and visually appealing. #
- # #
- # #
- # v0.3 #
- # ~=~=~=~ #
- # #
- # In v0.3, I've added a option to add the menu command. #
- # #
- # #
- # v0.4 #
- # ~=~=~=~ #
- # #
- # In v0.4, I've added a option to use the icons and abbrvs. If you choose not #
- # to use them the screen will almost center its self accrodingly. I have also #
- # add an option to use the numbers along with the gauges. I have also added a #
- # spot in variable_id array to control an independent max_lv for each variable.#
- # #
- # #
- # v1.0 #
- # ~=~=~=~ #
- # #
- # In v1.0, I've basically re-written the script to handle up to 11 variables, #
- # you can use more then 11 but they are not able to be displayed for now. I've #
- # also added options to display a percentage instead of "amount/max_amount" #
- # above the gauges and an option to change the gauge color. The colors are #
- # listed in the variableid description in the editable area of the script. #
- # #
- # #
- # v1.1 #
- # ~=~=~=~ #
- # #
- # In v1.1, I have fixed the scrolling issues the window will now scroll #
- # through as many variables as you want. #
- # #
- # #
- # v1.2 #
- # ~=~=~=~ #
- # #
- # In v1.2, I have added a script call to add variables to the window. #
- # #
- # #
- # v1.3 #
- # ~=~=~=~ #
- # #
- # In v1.3, I have added a script call to remove variables from the window. #
- # #
- # v1.4 #
- # ~=~=~=~ #
- # #
- # In v1.4, I fixed the saving issue now everything should save fine. #
- # #
- # v2.0 #
- # ~=~=~=~ #
- # #
- # In v2.0, I Re-wrote the entire script and added a page feature, and made it #
- # a little more user friendly. #
- # # # #
- # v2.1 #
- # ~=~=~=~ #
- # #
- # In v2.1, I fixed the issues with the page scrolling. #
- # # # #
- # v2.2 #
- # ~=~=~=~ #
- # #
- # In v2.2, I adjusted the page scrolling to fit and not exceed the page #
- # contents. #
- # # # #
- # v2.3 #
- # ~=~=~=~ #
- # #
- # In v2.3, I fixed a few bugs I found. #
- # # # #
- # v3.0 #
- # ~=~=~=~ #
- # #
- # I re-wrote the entire script. It handles pertty much the same way as it did #
- # before the upgrades were mainly for preformance and compadability. #
- # # # #
- # v3.1 #
- # ~=~=~=~ #
- # #
- # I have added a lot more options in the editable region below. This script #
- # can now be used with V's Live H.U.D. Menu System v0.2+ also. #
- # # # #
- # v3.2 #
- # ~=~=~=~ #
- # #
- # Bug Fixed. #
- # # # #
- # v3.3 #
- # ~=~=~=~ #
- # #
- # I added a lot more customization to the script. #
- # # # #
- #------------------------------------------------------------------------------#
- #==============================================================================#
- $imported = {} if $imported.nil?
- $imported["Vs_VGW"] = true
- #==============================================================================
- # ** V's Variable Gauge Window Module
- #------------------------------------------------------------------------------
- # This module manages customizable features and methods.
- #==============================================================================
- module VGW
- module Specs
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- # #
- # Start Customizable Area. #
- # #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
- # #
- # ONLY EDIT AFTER THE EQUALS SYMBOL. #
- # #
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- #============================================================================
- # Use Menu Command for Access
- # ~=~=~=~=~=~=~=~=~=~=~=~=~=~
- # If you choose not to use a window command you can still access the window
- # by using SceneManager.call(Scene_VGW)
- #============================================================================
- Use_Menu_Command = true
- Command_Name = "Game Stats"
- #============================================================================
- # Name of all Pages and the File Used for Background
- # ~=~=~=~=~=~=~=~=~=~=~=~=~=~
- # The pages will not be available to view until you place contents in them.
- # This is just for the backgounds.
- # As a side note if you are using V's Live H.U.D. Menu System you can just
- # leave the backgorund names as empty quotes. ("")
- #============================================================================
- # Page Name, Background Image
- Page_Info = [ ["Game Stats", "StarlitSky" ],
- ["Inventory", "Relic Title BG"],
- ]
- #============================================================================
- # Cosmetic Options
- #============================================================================
- #--------------------------------------------------------------------------
- # Window Options
- #--------------------------------------------------------------------------
- Affect_Boarders = true
- Opacity = 0
- #--------------------------------------------------------------------------
- # Title Window Options
- #--------------------------------------------------------------------------
- Title_Font_Size = 32
- Title_Window_X = 0
- Title_Window_Y = 0
- Title_Window_Width = Graphics.width
- Title_Window_Height = 50
- #--------------------------------------------------------------------------
- # Content Window Options
- #--------------------------------------------------------------------------
- Content_Window_X = 0
- Content_Window_Y = Title_Window_Height
- Content_Window_Width = Graphics.width
- Content_Window_Height = Graphics.height - Title_Window_Height
- #--------------------------------------------------------------------------
- # Item Display Options
- #--------------------------------------------------------------------------
- Display_Icons = true
- Display_Numbers = true
- Show_Percentage = true
- #--------------------------------------------------------------------------
- # Extended Item Options
- #--------------------------------------------------------------------------
- Icon_X = 25
- Icon_Y = 0
- Gauge_Width = Content_Window_Width / 7 * 5
- Gauge_X = Content_Window_Width / 7
- Gauge_Y = 0
- Name_Size = 16
- Name_Alignment = 2
- Name_X = -75
- Name_Y = 0
- Number_Size = 16
- Number_Alignment = 0
- Number_X = 115
- Number_Y = 0
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- # #
- # End Customizable Area. #
- # #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
- # #
- # DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOUR DOING. #
- # #
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- end
- end #<--- End Module===========================================================
- #==============================================================================
- # ** Game_System
- #------------------------------------------------------------------------------
- # This class handles system data. It saves the disable state of saving and
- # menus. Instances of this class are referenced by $game_system.
- #==============================================================================
- class Game_System
- #--------------------------------------------------------------------------
- # * Include Module
- #--------------------------------------------------------------------------
- include VGW::Specs
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :use_menu_command # Use Menu Command
- attr_accessor :vgw_info # VGW Variable Info
- #--------------------------------------------------------------------------
- # * Aliasing Method: Object Initialization
- #--------------------------------------------------------------------------
- alias :gsi450412042040005 :initialize
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- @use_menu_command = Use_Menu_Command
- @vgw_info = {}
- gsi450412042040005()
- end
- end #<--- End Class============================================================
- #==============================================================================
- # ** Game_Interpreter
- #------------------------------------------------------------------------------
- # An interpreter for executing event commands. This class is used within the
- # Game_Map, Game_Troop, and Game_Event classes.
- #==============================================================================
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # * Add Variable
- #--------------------------------------------------------------------------
- def add_var( page_index, name, icon, var_id, max_value, color1, color2)
- $game_system.vgw_info[page_index] = {} if $game_system.vgw_info.has_key?(page_index) != true
- $game_system.vgw_info[page_index][name] = { :var_id => var_id,
- :icon => icon,
- :max_value => max_value,
- :color1 => color1,
- :color2 => color2,
- } unless $game_system.vgw_info[page_index].has_key?(var_id)
- end
- #--------------------------------------------------------------------------
- # * Remove Variable
- #--------------------------------------------------------------------------
- def remove_var( var_id )
- $game_system.vgw_info.each_key { |p|
- $game_system.vgw_info[p].each_key { |v|
- if $game_system.vgw_info[p][v][:var_id] == var_id
- $game_system.vgw_info[p].delete(v)
- end
- }
- }
- end
- #--------------------------------------------------------------------------
- # * Change Menu Availability
- #--------------------------------------------------------------------------
- def use_menu( useable )
- $game_system.use_menu_command = useable
- end
- end #<--- End Class============================================================
- #==============================================================================
- # ** Window VGW Page Title
- #------------------------------------------------------------------------------
- # This Class Handles the Page Titles Window.
- #==============================================================================
- class Window_VGW_Title < Window_Base
- #--------------------------------------------------------------------------
- # * Include Module
- #--------------------------------------------------------------------------
- include VGW::Specs
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :current_vgw # Current VGW
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(Title_Window_X, Title_Window_Y, Title_Window_Width, Title_Window_Height)
- @current_vgw = 0
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh Processing
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_vgw_page_name
- end
- #--------------------------------------------------------------------------
- # * Draw VGW Page Name
- #--------------------------------------------------------------------------
- def draw_vgw_page_name
- page_name = Page_Info[@current_vgw][0]
- draw_title_text(-10, - 10, Title_Window_Width, Title_Window_Height, page_name, 1)
- end
- #--------------------------------------------------------------------------
- # * Draw Title Text
- #--------------------------------------------------------------------------
- def draw_title_text(x, y, w, h, text, alignment)
- reset_font_settings
- contents.font.size = Title_Font_Size
- contents.draw_text(x, y, w, h, text, alignment)
- reset_font_settings
- end
- end #<--- End Class============================================================
- #==============================================================================
- # ** Window VGW Page Contents
- #------------------------------------------------------------------------------
- # This Class Handles the Page Contents Window.
- #==============================================================================
- class Window_VGW_Contents < Window_Command
- #--------------------------------------------------------------------------
- # * Include Module
- #--------------------------------------------------------------------------
- include VGW::Specs
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :current_vgw # Current VGW
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- @current_vgw = 0
- super(Content_Window_X, Content_Window_Y)
- end
- #--------------------------------------------------------------------------
- # * Get Window Height
- #--------------------------------------------------------------------------
- def window_height
- Content_Window_Height
- end
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- Content_Window_Width
- end
- #--------------------------------------------------------------------------
- # * Make Command List
- #--------------------------------------------------------------------------
- def make_command_list
- if $game_system.vgw_info.size > 0
- $game_system.vgw_info[@current_vgw].each_key { |i|
- add_command(i, :vgw_info)
- }
- end
- end
- #--------------------------------------------------------------------------
- # * Item Height
- #--------------------------------------------------------------------------
- def item_height
- return (Graphics.height / 5) / 2
- end
- #--------------------------------------------------------------------------
- # * Draw Var Name Text
- #--------------------------------------------------------------------------
- def draw_var_name_text(x, y, w, h, text)
- reset_font_settings
- contents.font.size = Name_Size
- contents.draw_text(x + Name_X, y + Name_Y, w, h, text, Name_Alignment)
- reset_font_settings
- end
- #--------------------------------------------------------------------------
- # * Draw Var Number Text
- #--------------------------------------------------------------------------
- def draw_var_number_text(x, y, w, h, text)
- reset_font_settings
- contents.font.size = Number_Size
- contents.draw_text(x + Number_X, y + Number_Y, w, h, text, Number_Alignment)
- reset_font_settings
- end
- #--------------------------------------------------------------------------
- # * Draw Item
- #--------------------------------------------------------------------------
- def draw_item(index)
- c = 0
- $game_system.vgw_info[@current_vgw].each_key { |i|
- y = (item_height * c)
- current_info = $game_system.vgw_info[@current_vgw][i]
- var = $game_variables[current_info[:var_id]]
- max = current_info[:max_value]
- rate = var.to_f / max
- color1 = current_info[:color1]
- color2 = current_info[:color2]
- draw_var_name_text(-10, y, Content_Window_Width, 24, i)
- if Display_Numbers
- if Show_Percentage
- draw_var_number_text(-35, y, Content_Window_Width, 24, (rate * 100).to_i.to_s + "%")
- else
- draw_var_number_text(-35, y, Content_Window_Width, 24, var.to_s + " / " + max.to_s)
- end
- end
- draw_icon(current_info[:icon], 10 + Icon_X, y + 10 + Icon_Y, Display_Icons)
- draw_gauge(Gauge_X, y + 5 + Gauge_Y, Gauge_Width, rate, text_color(color1), text_color(color2))
- c += 1
- }
- end
- end #<--- End Class============================================================
- unless $imported["Vs_Live_HUD_Menu"] == true
- #==============================================================================
- # ** Scene Variable Gauge Window
- #------------------------------------------------------------------------------
- # This Class Handles the Variable Gauge Window Scene.
- #==============================================================================
- class Scene_VGW < Scene_Base
- #--------------------------------------------------------------------------
- # * Include Module
- #--------------------------------------------------------------------------
- include VGW::Specs
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super
- @current_vgw = 0
- create_all_windows
- end
- #--------------------------------------------------------------------------
- # * Create All Windows
- #--------------------------------------------------------------------------
- def create_all_windows
- create_background
- create_vgw_windows
- end
- #--------------------------------------------------------------------------
- # * Create VGW Title Window
- #--------------------------------------------------------------------------
- def create_vgw_windows
- @page_title_window = Window_VGW_Title.new
- @page_title_window.opacity = Opacity if Affect_Boarders
- @page_title_window.back_opacity = Opacity unless Affect_Boarders
- @page_contents_window = Window_VGW_Contents.new
- @page_contents_window.opacity = Opacity if Affect_Boarders
- @page_contents_window.back_opacity = Opacity unless Affect_Boarders
- end
- #--------------------------------------------------------------------------
- # * Create Background
- #--------------------------------------------------------------------------
- def create_background
- @background = Sprite.new
- @background.bitmap = Cache.picture(Page_Info[@current_vgw][1])
- @background.x = 0
- @background.y = 0
- @background.zoom_x = (@background.width / Graphics.width)
- @background.zoom_y = (@background.height / Graphics.height)
- end
- #--------------------------------------------------------------------------
- # * Dispose Background
- #--------------------------------------------------------------------------
- def dispose_background
- @background.bitmap.dispose
- @background.dispose
- end
- #--------------------------------------------------------------------------
- # * Refresh Background
- #--------------------------------------------------------------------------
- def refresh_background
- dispose_background
- create_background
- end
- #--------------------------------------------------------------------------
- # * Refresh VGW
- #--------------------------------------------------------------------------
- def refresh_vgw
- refresh_background
- @page_contents_window.select(0)
- @page_contents_window.current_vgw = @current_vgw
- @page_title_window.current_vgw = @current_vgw
- @page_contents_window.refresh
- @page_title_window.refresh
- end
- #--------------------------------------------------------------------------
- # * Next VGW
- #--------------------------------------------------------------------------
- def next_vgw
- Sound.play_cursor
- (@current_vgw + 1) > last_vgw ? @current_vgw = 0 : @current_vgw += 1
- refresh_vgw
- end
- #--------------------------------------------------------------------------
- # * Previous VGW
- #--------------------------------------------------------------------------
- def previous_vgw
- Sound.play_cursor
- (@current_vgw - 1) < 0 ? @current_vgw = last_vgw : @current_vgw -= 1
- refresh_vgw
- end
- #--------------------------------------------------------------------------
- # * Returns Last VGW With Content
- #--------------------------------------------------------------------------
- def last_vgw
- page = 0
- last_page_with_content = 0
- if $game_system.vgw_info.size > 1
- $game_system.vgw_info.each_key { |i|
- if $game_system.vgw_info[i].size > 0
- last_page_with_content = page
- end
- page += 1
- }
- end
- return last_page_with_content
- end
- #--------------------------------------------------------------------------
- # * Update Processing
- #--------------------------------------------------------------------------
- def update
- super
- return_scene if Input.trigger?(:B)
- next_vgw if Input.trigger?(:R)
- previous_vgw if Input.trigger?(:L)
- end
- end #<--- End Class============================================================
- #==============================================================================
- # ** Window_MenuCommand
- #------------------------------------------------------------------------------
- # This command window appears on the menu screen.
- #==============================================================================
- class Window_MenuCommand < Window_Command
- #--------------------------------------------------------------------------
- # * Include Module
- #--------------------------------------------------------------------------
- include VGW::Specs
- #--------------------------------------------------------------------------
- # * Aliasing Method: Create Command Window
- #--------------------------------------------------------------------------
- alias :wmcaoc75750005 :add_original_commands
- #--------------------------------------------------------------------------
- # * For Adding Original Commands
- #--------------------------------------------------------------------------
- def add_original_commands
- wmcaoc75750005()
- add_command(Command_Name, :vgw, $game_system.use_menu_command)
- end
- end #<--- End Class============================================================
- #==============================================================================
- # ** Scene_Menu
- #------------------------------------------------------------------------------
- # This class performs the menu screen processing.
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Include Module
- #--------------------------------------------------------------------------
- include VGW::Specs
- #--------------------------------------------------------------------------
- # * Aliasing Method: Create Command Window
- #--------------------------------------------------------------------------
- alias :smccw45240420475750005 :create_command_window
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- def create_command_window
- smccw45240420475750005()
- @command_window.set_handler(:vgw, method(:command_vgw))
- end
- #--------------------------------------------------------------------------
- # * Create Command(command_vgw)
- #--------------------------------------------------------------------------
- def command_vgw
- SceneManager.call(Scene_VGW)
- end
- end #<--- End Class============================================================
- else
- #==============================================================================
- # ** Window_Hud
- #------------------------------------------------------------------------------
- # This is a super class of all windows within the game.
- #==============================================================================
- class Window_Hud < Window_Command
- #--------------------------------------------------------------------------
- # * Include Module
- #--------------------------------------------------------------------------
- include VGW::Specs
- #--------------------------------------------------------------------------
- # * Aliasing Method: Add Original Commands
- #--------------------------------------------------------------------------
- alias :whaocl44878673424879 :add_original_command
- #--------------------------------------------------------------------------
- # * Add Original Commands
- #--------------------------------------------------------------------------
- def add_original_command
- whaocl44878673424879()
- add_command(Command_Name, :vgw)
- end
- #--------------------------------------------------------------------------
- # * Draw Item
- #--------------------------------------------------------------------------
- def draw_item(index)
- y = 60
- height = 35
- @command_icons.size.times { |i|
- draw_icon(@command_icons[i], 5, y + (height * i))
- }
- draw_original_icons(y + (height * @command_icons.size))
- draw_icon(@option_icon, 5, y + (height * 5))
- end
- #--------------------------------------------------------------------------
- # * Aliasing Method: Draw Original Icons
- #--------------------------------------------------------------------------
- alias :whdoi452242557 :draw_original_icons
- #--------------------------------------------------------------------------
- # * Draw Original Icons
- #--------------------------------------------------------------------------
- def draw_original_icons(y)
- whdoi452242557(y)
- draw_icon(229, 5, y)
- end
- end #<--- End Class============================================================
- #==============================================================================
- # ** Scene_Map
- #------------------------------------------------------------------------------
- # This class performs the map screen processing.
- #==============================================================================
- class Scene_Map < Scene_Base
- #--------------------------------------------------------------------------
- # * Include Module
- #--------------------------------------------------------------------------
- include VGW::Specs
- #--------------------------------------------------------------------------
- # * Aliasing Method: Create All Windows
- #--------------------------------------------------------------------------
- alias :smcaw787866331000 :create_all_windows
- #--------------------------------------------------------------------------
- # * Create All Windows
- #--------------------------------------------------------------------------
- def create_all_windows
- smcaw787866331000()
- create_vgw_windows
- end
- #--------------------------------------------------------------------------
- # * Create VGW Title Window
- #--------------------------------------------------------------------------
- def create_vgw_windows
- @current_vgw = 0
- @vgw_page_title_window = Window_VGW_Title.new
- @vgw_page_title_window.close
- @vgw_page_title_window.opacity = Opacity if Affect_Boarders
- @vgw_page_title_window.back_opacity = Opacity unless Affect_Boarders
- @vgw_page_contents_window = Window_VGW_Contents.new
- @vgw_page_contents_window.close
- @vgw_page_contents_window.opacity = Opacity if Affect_Boarders
- @vgw_page_contents_window.back_opacity = Opacity unless Affect_Boarders
- @vgw_page_contents_window.deactivate
- end
- #--------------------------------------------------------------------------
- # * Aliasing Method: Create All Windows
- #--------------------------------------------------------------------------
- alias :smch45404000455339 :create_hud_window
- #--------------------------------------------------------------------------
- # * Create Hud Window
- #--------------------------------------------------------------------------
- def create_hud_window
- smch45404000455339()
- @hud_window.set_handler(:vgw, method(:command_vgw_select))
- end
- #--------------------------------------------------------------------------
- # * [To Title] Command
- #--------------------------------------------------------------------------
- def command_options_cancel
- @menu_index -= 7
- @options_window.close
- Sound.play_cancel
- @hud_window.select(5)
- @hud_window.activate
- @hud_window.change_text_cursor(5)
- end
- #--------------------------------------------------------------------------
- # * Empty Method: Command Menu Select
- #--------------------------------------------------------------------------
- def command_vgw_select
- @menu_index = 7
- @vgw_page_title_window.refresh
- @vgw_page_title_window.open
- @vgw_page_contents_window.refresh
- @vgw_page_contents_window.select(0)
- @vgw_page_contents_window.activate
- @vgw_page_contents_window.open
- @hud_window.deactivate
- end
- #--------------------------------------------------------------------------
- # * Refresh VGW
- #--------------------------------------------------------------------------
- def refresh_vgw
- @vgw_page_contents_window.select(0)
- @vgw_page_contents_window.current_vgw = @current_vgw
- @vgw_page_title_window.current_vgw = @current_vgw
- @vgw_page_contents_window.refresh
- @vgw_page_title_window.refresh
- end
- #--------------------------------------------------------------------------
- # * Next VGW
- #--------------------------------------------------------------------------
- def next_vgw
- Sound.play_cursor
- (@current_vgw + 1) > last_vgw ? @current_vgw = 0 : @current_vgw += 1
- refresh_vgw
- end
- #--------------------------------------------------------------------------
- # * Previous VGW
- #--------------------------------------------------------------------------
- def previous_vgw
- Sound.play_cursor
- (@current_vgw - 1) < 0 ? @current_vgw = last_vgw : @current_vgw -= 1
- refresh_vgw
- end
- #--------------------------------------------------------------------------
- # * Returns Last VGW With Content
- #--------------------------------------------------------------------------
- def last_vgw
- page = 0
- last_page_with_content = 0
- if $game_system.vgw_info.size > 1
- $game_system.vgw_info.each_key { |i|
- if $game_system.vgw_info[i].size > 0
- last_page_with_content = page
- end
- page += 1
- }
- end
- return last_page_with_content
- end
- #--------------------------------------------------------------------------
- # * Aliasing Method: Frame Update
- #--------------------------------------------------------------------------
- alias :smu777788899333000 :update
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- smu777788899333000()
- case @menu_index
- when 7
- case
- when Input.trigger?(:UP)
- @vgw_page_contents_window.refresh
- when Input.trigger?(:DOWN)
- @vgw_page_contents_window.refresh
- when Input.trigger?(:LEFT)
- previous_vgw
- when Input.trigger?(:RIGHT)
- next_vgw
- when Input.trigger?(:L)
- previous_vgw
- when Input.trigger?(:R)
- next_vgw
- end
- end
- if Input.trigger?(:B)
- case @menu_index
- when 7
- @menu_index -= 6
- @vgw_page_contents_window.deactivate
- @vgw_page_contents_window.unselect
- @vgw_page_title_window.close
- @vgw_page_contents_window.close
- Sound.play_cancel
- @hud_window.select(4)
- @hud_window.activate
- @hud_window.change_text_cursor(4)
- end
- end
- end
- end #<--- End Class============================================================
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement