Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # ■ Multi Variable Window
- # ■ Author: Bigace360
- # ■ Version: 1.2
- # ■ Date: Feb. 5, 2013
- # ■ Blog: http://bigaceworld.wordpress.com/
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # VERSION HISTORY #
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # o v1.0 <> 02.05.2013 - Started and Finished Script
- # o v1.2 <> 02.08.2013 - You can now change the y-axis of the window form the
- # module.
- # - Compatible wity Yanfly digit grouping method
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # INTRODUCTION #
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # This alters the side windows at the bottom to display variables, time, steps,
- # gold, or your own custom variable. The script uses Yanfly's digit grouping
- # method, if you have Yanfly's ACE Core Engine installed.
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # SECTIONS #
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # ■ Game_Objects
- # ** ACE Module
- # ** Numeric
- #
- # ■ Windows
- # ** Window_MultiVariable
- #
- # ■ Scenes
- # ** Scene_Menu
- #
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- #
- # Credits/Thanks:
- # - Bigace360, for the script.
- #
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # Script Conflicts and Compatability #
- #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
- # ● Overwriten methods
- # class Scene_Menu
- # def create_gold_window
- #
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- #
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- # ■ Module ACE::Variable
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- module ACE
- module Variable
- #--------------------------------------------------------------------------
- # ◆ Section I. Multi Variable Window ◆
- # -------------------------------------------------------------------------
- # This alters the side windows at the bottom to display variables, time,
- # steps, gold, etc. This window appears at the bottom of the screen.
- # Variable ID => Windows
- # -2 => Play Time
- # -1 => Steps
- # 0 => Gold
- #--------------------------------------------------------------------------
- VARIABLE ={
- # Variables will be shown in this order. Use 0 to show gold. Adjust the
- # following information as seen necessary.
- :shown => [-2, 0, -1, 1],
- :icons => true,
- # use this to change the y-axis of the variable window. It must be in a
- # string to work.
- :y_axis => "@command_window.height",
- :hash =>{# Do not remove this.
- # VarID => [Icon, Text]
- -2 => [15, "Time"], #Default
- -1 => [48, "Steps"], #Default
- 0 => [360, "Gold"], #Default
- 1 => [339, "Monsters"], #Example
- },# Do not remove this.
- }
- end
- end
- #==============================================================================
- # ▼ Editting anything past this point may potentially result in causing
- # computer damage, incontinence, explosion of user's head, coma, death, and/or
- # halitosis so edit at your own risk.
- #==============================================================================
- #
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- # ▼ Import to Global Hash ▼ #
- ($ace_script ||= {})[:multi_variables] = 1.2
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- # ■ Numeric
- ($imported ||= {})["YEA-CoreEngine"] = true
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- class Numeric
- #--------------------------------------------------------------------------
- # new method: group_digits
- #--------------------------------------------------------------------------
- def group; return self.to_s; end unless $imported["YEA-CoreEngine"]
- end # Numeric
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- # ■ Window_MultiVariable
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- class Window_MultiVariable < Window_Selectable
- include ACE::Variable
- def initialize(dy)
- super(0, dy, window_width, fitting_height(VARIABLE[:shown].size))
- @data = []
- refresh
- end
- def window_width
- return 160
- end
- def draw_var
- return VARIABLE[:hash]
- end
- def gold
- $game_party.gold
- end
- def steps
- $game_party.steps
- end
- def variables(item)
- $game_variables[item]
- end
- def item_max
- @data ? @data.size : 0
- end
- def refresh
- make_item_list
- create_contents
- draw_all_items
- end
- def make_item_list
- VARIABLE[:shown].each do |i|
- next unless draw_var.include?(i)
- @time_index = @data.size if i == -2
- @data << i
- end
- end
- def draw_item(index)
- rect = item_rect(index)
- clear_item(index)
- item = @data[index]
- case item
- when -2 then draw_variables(rect, game_time, draw_var[-2])
- when -1 then draw_variables(rect, steps.group, draw_var[-1])
- when 0 then draw_variables(rect, gold.group, draw_var[0])
- else draw_variables(rect, variables(item).group, draw_var[item])
- end
- end
- def draw_variables(rect, text, variable)
- if VARIABLE[:icons]
- rect.width -= 24
- draw_text(rect, text, 2)
- draw_icon(variable[0], rect.width, rect.y)
- elsif VARIABLE[:shown].include?(-2)
- draw_time_value(variable[1], text, 0, rect.y, rect.width)
- else draw_currency_value(variable[1], text, 0, rect.y, rect.width)
- end
- end
- def draw_time_value(value, unit, x, y, width)
- cx = text_size(unit).width
- change_color(normal_color)
- draw_text(x, y, width - cx - 2, line_height, value, 2)
- change_color(system_color)
- draw_text(x, y, width, line_height, unit, 2)
- end
- def game_time
- gametime = Graphics.frame_count / Graphics.frame_rate
- hours = gametime / 3600
- minutes = gametime / 60 % 60
- seconds = gametime % 60
- result = sprintf("%d:%02d:%02d", hours, minutes, seconds)
- return result
- end
- if VARIABLE[:shown].include?(-2)
- def update
- if game_time != (Graphics.frame_count / Graphics.frame_rate)
- draw_item(@time_index)
- end
- super
- end
- end
- def open
- refresh
- super
- end
- end
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # ■ Scene_Menu
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- class Scene_Menu < Scene_MenuBase
- def create_gold_window
- dy = eval(ACE::Variable::VARIABLE[:y_axis])
- @gold_window = Window_MultiVariable.new(dy)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement