Advertisement
vindaca510

V's Progression Window v1.5

Apr 19th, 2013
1,744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 29.67 KB | None | 0 0
  1.  
  2. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  3. #                                                                              #
  4. #                            V's Progression Window                            #
  5. #                                 Version v1.5                                 #
  6. #                                                                              #
  7. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  8. #                                Written By:  V                                #
  9. #                         Last Edited:  June 29, 2013                          #
  10. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  11. #                                                                              #
  12. #                                                                              #
  13. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  14.  
  15.  
  16. #==============================================================================#
  17. #------------------------------------------------------------------------------#
  18. # ** Disclaimer                                                                #
  19. #------------------------------------------------------------------------------#
  20. #                                                                              #
  21. # I do not mind sharing credit for this script if alterations to the script    #
  22. # are made. I am not making this script for commercial uses. If anyone wants   #
  23. # to use this script in one there games just give credit to any and everyone   #
  24. # who took part in creating it.                                                #
  25. #                                                                              #
  26. #------------------------------------------------------------------------------#
  27. # ** How To Use                                                                #
  28. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  29. #  * Use anyone of these commands in a script call to change the data          #
  30. #  * Remember to use "" before and after your text, bg, or chapt_name.         #
  31. #------------------------------------------------------------------------------#
  32. #                                                                              #
  33. # To access this window use SceneManager.call(Prog_Scene)                      #
  34. # To add a new entry use add_chapt_info(page, bg, chapt_name, text)            #
  35. # To change the font use change_prog_text_font(text)                           #
  36. # To change the text size use change_prog_text_size(text)                      #
  37. # To change the text x position use change_prog_text_x(integer)                #
  38. # To change the text y position use change_prog_text_y(integer)                #
  39. # To toggle the menu command use menu_command(true or false)                   #
  40. # To add to the game progress gauge use add_progress(integer)                  #
  41. # To remove from the game progress gauge use remove_progress(integer)          #
  42. #                                                                              #
  43. #------------------------------------------------------------------------------#
  44. # ** Description                                                               #
  45. #------------------------------------------------------------------------------#
  46. #                                                                              #
  47. #  v1.0                                                                        #
  48. # ~=~=~=~                                                                      #
  49. #                                                                              #
  50. # In v1.0, this script creates a game progress window that dispalys a gauge,   #
  51. # the current chapter(or whatever you want to call it.) and a discription of   #
  52. # the chapter so far. If you choose not to use the menu command then the script#
  53. # call for the window is SceneManager.call(Prog_Scene) you must set the value  #
  54. # of the max game variable at the start of the game.                           #  
  55. #                                                                              #
  56. #  v1.1                                                                        #
  57. # ~=~=~=~                                                                      #
  58. #                                                                              #
  59. # In v1.1, I've taken out the variable controll and set it all on script calls.#
  60. # I've also added two more commands.One allows you to toggle the menu command, #
  61. # the othe is to add progress to the gauge.                                    #
  62. #                                                                              #
  63. #  v1.2                                                                        #
  64. # ~=~=~=~                                                                      #
  65. #                                                                              #
  66. # In v1.2, I added the game_variable option to fill the gauge again. I also    #
  67. # added some options for the x and y values as well as font and font size.     #
  68. # Also new to the script is a scroll feature to view the progress text.        #
  69. #                                                                              #
  70. #  v1.3                                                                        #
  71. # ~=~=~=~                                                                      #
  72. #                                                                              #
  73. # In v1.3, I added a command to change the color of the gauge in game via      #
  74. # script call change_gauge_color(V's_Color_ID). I have also fixed a bug with   #
  75. # with the add_progress script call and I added a script call to               #
  76. # remove_progress.                                                             #
  77. #                                                                              #
  78. #  v1.4                                                                        #
  79. # ~=~=~=~                                                                      #
  80. #                                                                              #
  81. # In v1.4, I've combined the change_prog_bg, change_prog_chapt, and            #
  82. # change_prog_text script calls and made it so you can add new entries with    #
  83. # one command instead of three. With that said, I have also added a left/right #
  84. # page control to veiw the other chapters.                                     #
  85. #                                                                              #
  86. #  v1.5                                                                        #
  87. # ~=~=~=~                                                                      #
  88. #                                                                              #
  89. #  In v1.5, I fixed the issue with the chapter info not saving and loading     #
  90. #  properly, and resulting in a crash.                                         #
  91. #                                                                              #
  92. #------------------------------------------------------------------------------#
  93. #==============================================================================#
  94.  
  95.  
  96.  
  97. #==============================================================================
  98. # ** V's Progression Window Module
  99. #------------------------------------------------------------------------------
  100. #  This module manages customizable features and methods.
  101. #==============================================================================
  102.    
  103. module V_Progress
  104.   module Specs
  105.    
  106. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  107. #                                                                              #
  108. #                           Start Customizable Area.                           #
  109. #                                                                              #
  110. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  111. #                                                                              #
  112. #                      ONLY EDIT AFTER THE EQUALS SYMBOL.                      #
  113. #                                                                              #
  114. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  115.      
  116.   #--------------------------------------------------------------------------
  117.   # * What To Call The Game Chapters
  118.   #--------------------------------------------------------------------------
  119.    
  120.     Page_Title               = ""
  121.    
  122.   #--------------------------------------------------------------------------
  123.   # * Default Window Contents At Start Of Game.
  124.   #--------------------------------------------------------------------------
  125.  
  126.   #--------------------------------------------------------------------------
  127.   # * Customization For Gauge Used To Track Game Progress.
  128.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  129.   #
  130.   #  ** If you do not want to use the script calls you can fill the gauge
  131.   #     by adding to the "Game_Variable_For_Filling" below.
  132.   #
  133.   #  ** If you dont want to use the game variables method just set it to an
  134.   #     unused variable.
  135.   #
  136.   #  ** There are 9 gauge colors so far they are as follows:
  137.   #     1 = hp_gauge_colors 1 & 2
  138.   #     2 = mp_gauge_colors 1 & 2
  139.   #     3 = tp_gauge_colors 1 & 2
  140.   #     4 = hp_gauge_color1 & mp_gauge_color1
  141.   #     5 = hp_gauge_color1 & tp_gauge_color1
  142.   #     6 = mp_gauge_color1 & tp_gauge_color1
  143.   #     7 = Love Theme
  144.   #     8 = Ice Theme
  145.   #     9 = Circuit Board Theme#
  146.   #
  147.   #--------------------------------------------------------------------------
  148.  
  149.     Game_Progress_Gauge_Max   = 28 # Total number of quests, tasks, or whatever
  150.     Game_Prog_Gauge_Color     = 1
  151.     Game_Variable_For_Filling = 6
  152.    
  153.   #--------------------------------------------------------------------------
  154.   # * Customization For The Menu Command.
  155.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  156.   #
  157.   #  ** If you want to enable the menu command via script call set
  158.   #     Use_Menu_Command = false
  159.   #
  160.   #  ** If You Choose Not To Use The Menu Command, You Can Still
  161.   #     Access The Window By Using SceneManager.call(Prog_Scene)
  162.   #     In A Script Call.
  163.   #--------------------------------------------------------------------------
  164.    
  165.     Use_Menu_Command         = true
  166.     Command_Name             = "Game Progress"
  167.    
  168.   #--------------------------------------------------------------------------
  169.   # * Current Text Options
  170.   #--------------------------------------------------------------------------
  171.    
  172.     Text_Font               = "Times New Roman"
  173.     Text_Size               = 24
  174.     Text_X                  = 38
  175.     Text_Y                  = 15
  176.    
  177. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  178. #                                                                              #
  179. #                            End Customizable Area.                            #
  180. #                                                                              #
  181. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  182. #                                                                              #
  183. #         DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOUR DOING.         #
  184. #                                                                              #
  185. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  186.    
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.   end
  207. end  
  208.  
  209.  
  210. #==============================================================================
  211. # ** Window_Base
  212. #------------------------------------------------------------------------------
  213. #  This is a super class of all windows within the game.
  214. #==============================================================================
  215.  
  216. class Prog_Window < Window_Base
  217.  
  218.   #--------------------------------------------------------------------------
  219.   # * Object Initialization
  220.   #--------------------------------------------------------------------------
  221.  
  222.   def initialize
  223.     super(0, 0, 544, 120)
  224.     gaugevar  = $game_variables[V_Progress::Specs::Game_Variable_For_Filling]
  225.     maxvarnum = $game_system.progress_gauge_max
  226.     rate = gaugevar.to_f / maxvarnum * 100
  227.     draw_face($game_party.members[0].face_name, $game_party.members[0].face_index, 0, 0, enabled = true)
  228.     contents.font.size = 25
  229.     draw_actor_name($game_party.members[0], 115, line_height * 2)
  230.     contents.font.size = 16
  231.     draw_text((Graphics.width / 9) + 80, 0, 544, line_height * 7 - 5, "Game Progress", 1)
  232.     draw_text((Graphics.width / 9) - 115, 0, 544, line_height * 7 - 5, rate.to_i, 2)
  233.     draw_text((Graphics.width / 9) + 160, 0, 544, line_height * 7 - 5, "%", 1)
  234.     make_font_bigger
  235.     contents.font.size = 18
  236.     draw_actor_level($game_party.members[0], 115, line_height * 3)
  237.     draw_prog_gauge()
  238.   end
  239.  
  240.  
  241.   #--------------------------------------------------------------------------
  242.   # * Draw Window Contents
  243.   #     args : Same as Bitmap#draw_text.
  244.   #--------------------------------------------------------------------------
  245.  
  246.   def draw_prog_gauge()
  247.  
  248.     x = 255
  249.     y = line_height * 3
  250.     gaugevar  = $game_variables[V_Progress::Specs::Game_Variable_For_Filling]
  251.     maxvarnum = $game_system.progress_gauge_max
  252.     rate = gaugevar.to_f / maxvarnum
  253.     if    $game_system.progress_gauge_color == 1
  254.       draw_gauge(x, y, (Graphics.width / 9 * 4), rate, mp_gauge_color1, mp_gauge_color2)
  255.     elsif $game_system.progress_gauge_color == 2
  256.       draw_gauge(x, y, (Graphics.width / 9 * 4), rate, hp_gauge_color1, hp_gauge_color2)
  257.     elsif $game_system.progress_gauge_color == 3
  258.       draw_gauge(x, y, (Graphics.width / 9 * 4), rate, tp_gauge_color1, tp_gauge_color2)
  259.     elsif $game_system.progress_gauge_color == 4
  260.       draw_gauge(x, y, (Graphics.width / 9 * 4), rate, hp_gauge_color1, mp_gauge_color1)
  261.     elsif $game_system.progress_gauge_color == 5
  262.       draw_gauge(x, y, (Graphics.width / 9 * 4), rate, hp_gauge_color1, tp_gauge_color1)
  263.     elsif $game_system.progress_gauge_color == 6
  264.       draw_gauge(x, y, (Graphics.width / 9 * 4), rate, mp_gauge_color1, tp_gauge_color1)
  265.     elsif $game_system.progress_gauge_color == 7
  266.       draw_gauge(x, y, (Graphics.width / 9 * 4), rate, normal_color, knockout_color)
  267.     elsif $game_system.progress_gauge_color == 8
  268.       draw_gauge(x, y, (Graphics.width / 9 * 4), rate, normal_color, mp_cost_color)
  269.     elsif $game_system.progress_gauge_color == 9
  270.       draw_gauge(x, y, (Graphics.width / 9 * 4), rate, tp_cost_color, normal_color)
  271.     end
  272.    
  273.   end  
  274.  
  275. end
  276.  
  277.  
  278.  
  279. #==============================================================================
  280. # ** Window_Base
  281. #------------------------------------------------------------------------------
  282. #  This is a super class of all windows within the game.
  283. #==============================================================================
  284.  
  285. class Chapt_Window < Window_Base
  286.  
  287.   #--------------------------------------------------------------------------
  288.   # * Object Initialization
  289.   #--------------------------------------------------------------------------
  290.  
  291.   def initialize
  292.     super(0, 0, 544, line_height * 17)
  293.   end
  294.  
  295.   #--------------------------------------------------------------------------
  296.   # * Draw Horz. Lines
  297.   #--------------------------------------------------------------------------
  298.  
  299.   def draw_horz_lines
  300.     draw_horz_line(line_height * 4)
  301.     draw_horz_line(line_height * 6)
  302.   end
  303.  
  304.   #--------------------------------------------------------------------------
  305.   # * Draw Chapter Title
  306.   #--------------------------------------------------------------------------
  307.  
  308.   def draw_chapt_title
  309.     contents.font.size = 16
  310.     chaptname = V_Progress::Specs::Page_Title
  311.     draw_text(-270, 0, 544, line_height * 11, *chaptname, 2)
  312.   end
  313.  
  314.   #--------------------------------------------------------------------------
  315.   # * Draw Chapter Name
  316.   #--------------------------------------------------------------------------
  317.  
  318.   def draw_chapt_name
  319.     contents.font.size = 16
  320.     @current_chapt = $game_system.chapter_info[$game_system.current_page][1]
  321.     draw_text(280, 0, 544, line_height * 11, *@current_chapt, 0)
  322.   end
  323.  
  324.   #--------------------------------------------------------------------------
  325.   # * Draw Horizontal Line
  326.   #--------------------------------------------------------------------------
  327.  
  328.   def draw_horz_line(y)
  329.     line_y = y + line_height / 2 - 1
  330.     contents.fill_rect(0, line_y, contents_width, 2, line_color)
  331.   end
  332.  
  333.   #--------------------------------------------------------------------------
  334.   # * Get Color of Horizontal Line
  335.   #--------------------------------------------------------------------------
  336.  
  337.   def line_color
  338.     color = normal_color
  339.     color.alpha = 48
  340.     color
  341.   end
  342.  
  343.   #=============================================================================
  344.   # * Update
  345.   #=============================================================================
  346.  
  347.   def update
  348.     super
  349.     current_chapt = @current_chapt
  350.  
  351.     if $game_system.current_page != current_chapt
  352.       contents.clear
  353.       draw_horz_lines
  354.       draw_chapt_title
  355.       draw_chapt_name
  356.     end
  357.    
  358.   end
  359.  
  360. end
  361.    
  362.  
  363.    
  364.    
  365.  
  366.  
  367. #==============================================================================
  368. # ** Window_Base
  369. #------------------------------------------------------------------------------
  370. #  This is a super class of all windows within the game.
  371. #==============================================================================
  372.  
  373. class Context_Window < Window_ScrollText
  374.   #--------------------------------------------------------------------------
  375.   # * Object Initialization
  376.   #--------------------------------------------------------------------------
  377.  
  378.   def initialize
  379.     super()
  380.     self.y = 175
  381.     self.height = (Graphics.height * 0.7)
  382.     self.opacity = 0
  383.     show
  384.     @last_page = ($game_system.chapter_info.size - 1)
  385.     @first_page = 1
  386.     create_context
  387.   end
  388.  
  389.   #--------------------------------------------------------------------------
  390.   # * Create Text
  391.   #--------------------------------------------------------------------------
  392.  
  393.   def create_context
  394.     curtextpos = 0
  395.     text = $game_system.chapter_info[$game_system.current_page][2]
  396.  
  397.     for i in 0..(text.length - 1)
  398.      
  399.       if text[i] == "\n"
  400.         curtextpos = 0
  401.         next
  402.       end
  403.      
  404.       curtextpos += text_size(text[i]).width
  405.      
  406.       if curtextpos > self.width
  407.         curelem = i
  408.        
  409.         while(text[curelem]) != " "
  410.           break if curelem == 0
  411.           curelem -= 1
  412.         end
  413.        
  414.         temptext = ""
  415.        
  416.         for j in 0..(text.length - 1)
  417.           temptext += text[j]
  418.           temptext += "\n" if j == curelem
  419.         end
  420.        
  421.         text = temptext
  422.         i = curelem
  423.         curtextpos = 0
  424.        
  425.       end
  426.      
  427.     end
  428.     fs = Font.default_size
  429.     Font.default_size = $game_system.progress_current_text_size
  430.     x = $game_system.progress_current_text_x
  431.     y = $game_system.progress_current_text_y
  432.     fn = Font.default_name
  433.     Font.default_name = $game_system.progress_current_text_font
  434.     draw_text_ex(x, y, text)
  435.     Font.default_size = fs
  436.     Font.default_name = fn
  437.   end
  438.  
  439.   #=============================================================================
  440.   # * Update
  441.   #=============================================================================
  442.  
  443.   def update
  444.     super
  445.     page = $game_system.current_page
  446.     $game_system.current_page -= 1 if Input.trigger?(:LEFT) && $game_system.current_page > @first_page
  447.     $game_system.current_page += 1 if Input.trigger?(:RIGHT) && $game_system.current_page < @last_page
  448.     $game_system.scroll_position -= 1 if Input.press?(:UP)
  449.     $game_system.scroll_position += 1 if Input.press?(:DOWN)
  450.     self.oy = $game_system.scroll_position
  451.    
  452.     if $game_system.current_page != page
  453.       contents.clear
  454.       $game_system.scroll_position = 0
  455.       create_context
  456.     end
  457.    
  458.   end
  459.  
  460. end
  461.  
  462.  
  463.  
  464.  
  465.  
  466. #==============================================================================
  467. # ** Window_MenuCommand
  468. #------------------------------------------------------------------------------
  469. #  This command window appears on the menu screen.
  470. #==============================================================================
  471.  
  472. class Window_MenuCommand < Window_Command
  473.  
  474.   #--------------------------------------------------------------------------
  475.   # * For Creating An Alias
  476.   #--------------------------------------------------------------------------
  477.  
  478.   alias v_prog_winmenucmmd_addorigcmmd_885           add_original_commands
  479.  
  480.   #--------------------------------------------------------------------------
  481.   # * For Adding Original Commands
  482.   #--------------------------------------------------------------------------
  483.  
  484.   def add_original_commands
  485.     v_prog_winmenucmmd_addorigcmmd_885()
  486.     progname = V_Progress::Specs::Command_Name
  487.  
  488.     if V_Progress::Specs::Use_Menu_Command || $game_system.progress_menu_command
  489.       then
  490.       add_command(*progname, :prog_scene, true)
  491.     end
  492.  
  493.   end
  494.  
  495. end
  496.  
  497.  
  498.  
  499.  
  500.  
  501. #==============================================================================
  502. # ** Scene_Menu
  503. #------------------------------------------------------------------------------
  504. #  This class performs the menu screen processing.
  505. #==============================================================================
  506.  
  507. class Scene_Menu < Scene_MenuBase
  508.  
  509.   #--------------------------------------------------------------------------
  510.   # * For Creating An Alias
  511.   #--------------------------------------------------------------------------
  512.  
  513.   alias v_prog_scenemenu_createcmmdwin_9874          create_command_window
  514.  
  515.   #--------------------------------------------------------------------------
  516.   # * Create Command Window
  517.   #--------------------------------------------------------------------------
  518.  
  519.   def create_command_window
  520.     v_prog_scenemenu_createcmmdwin_9874()
  521.      
  522.     if V_Progress::Specs::Use_Menu_Command || $game_system.progress_menu_command
  523.       then
  524.       @command_window.set_handler(:prog_scene, method(:command_prog_scene))
  525.     end
  526.      
  527.   end
  528.  
  529.   #--------------------------------------------------------------------------
  530.   # * Create VGW Scene
  531.   #--------------------------------------------------------------------------
  532.  
  533.   def command_prog_scene
  534.     SceneManager.call(Prog_Scene)
  535.   end
  536.  
  537. end
  538.  
  539.  
  540.  
  541.  
  542. #==============================================================================
  543. # ** Variable Gauge Window Scene
  544. #------------------------------------------------------------------------------
  545. #  This Class Performs The Variable Gauge Window Screen Processing.
  546. #==============================================================================
  547.  
  548. class Prog_Scene < Scene_Base
  549.  
  550.   #--------------------------------------------------------------------------
  551.   # * Start Processing
  552.   #--------------------------------------------------------------------------
  553.  
  554.   def start
  555.     super()
  556.  
  557.   #--------------------------------------------------------------------------
  558.   # * Background Processing
  559.   #--------------------------------------------------------------------------
  560.      
  561.     @bg_image = $game_system.chapter_info[$game_system.current_page][0]
  562.     @prog_bg = Sprite.new
  563.     @prog_bg.bitmap = Cache.picture(*@bg_image)
  564.     @prog_bg.x= 0
  565.     @prog_bg.y = 0
  566.     @prog_bg.zoom_x = ( Graphics.width.to_f / 544 )
  567.     @prog_bg.zoom_y = ( Graphics.height.to_f / 416 )
  568.     @prog_bg.opacity = 180
  569.     @prog_bg.visible = true
  570.    
  571.   #--------------------------------------------------------------------------
  572.   # * Window Processing
  573.   #--------------------------------------------------------------------------
  574.    
  575.     @prog_window               = Prog_Window.new
  576.     @prog_window.opacity       = 0
  577.     @chapt_window              = Chapt_Window.new
  578.     @chapt_window.opacity      = 0
  579.     @context_window            = Context_Window.new
  580.     @context_window.opacity    = 0
  581.    
  582.   end
  583.  
  584.   #--------------------------------------------------------------------------
  585.   # * Post-Start Processing
  586.   #--------------------------------------------------------------------------
  587.  
  588.   def post_start
  589.     super()
  590.   end
  591.  
  592.   #--------------------------------------------------------------------------
  593.   # * Frame Update
  594.   #--------------------------------------------------------------------------
  595.  
  596.   def update
  597.     super()
  598.     return_scene() if Input.trigger?(:B)
  599.   end
  600.  
  601.   #--------------------------------------------------------------------------
  602.   # * Pre-Termination Processing
  603.   #--------------------------------------------------------------------------
  604.  
  605.   def pre_terminate
  606.   end
  607.  
  608.   #--------------------------------------------------------------------------
  609.   # * Termination Processing
  610.   #--------------------------------------------------------------------------
  611.  
  612.   def terminate
  613.     super()
  614.    
  615.     if @prog_bg
  616.       @prog_bg.dispose
  617.       @prog_bg.bitmap.dispose
  618.     end
  619.  
  620.   end
  621.  
  622. end
  623.  
  624.  
  625.  
  626.  
  627.  
  628. #==============================================================================
  629. # ** Game_System
  630. #------------------------------------------------------------------------------
  631. #  This class handles system data. It saves the disable state of saving and
  632. # menus. Instances of this class are referenced by $game_system.
  633. #==============================================================================
  634.  
  635. class Game_System
  636.  
  637.   #--------------------------------------------------------------------------
  638.   # * Public Instance Variables
  639.   #--------------------------------------------------------------------------
  640.  
  641.   attr_accessor :chapter_info
  642.   attr_accessor :progress_current_text
  643.   attr_accessor :progress_current_text_x
  644.   attr_accessor :progress_current_text_y
  645.   attr_accessor :progress_current_text_size
  646.   attr_accessor :progress_current_text_font
  647.   attr_accessor :progress_current_chapt
  648.   attr_accessor :progress_current_bg
  649.   attr_accessor :progress_menu_command
  650.   attr_accessor :progress_gauge_max
  651.   attr_accessor :progress_gauge_color
  652.   attr_accessor :current_page
  653.   attr_accessor :scroll_position
  654.  
  655.   #--------------------------------------------------------------------------
  656.   # * For Creating An Alias
  657.   #--------------------------------------------------------------------------
  658.  
  659.   alias v_prog_gamesys_init_654885                                 initialize
  660.  
  661.   #--------------------------------------------------------------------------
  662.   # * Object Initialization
  663.   #--------------------------------------------------------------------------
  664.  
  665.   def initialize
  666.     @chapter_info               = []
  667.     @scroll_position            = 0
  668.     @current_page               = 0
  669.     @progress_gauge_max         = V_Progress::Specs::Game_Progress_Gauge_Max
  670.     @progress_menu_command      = V_Progress::Specs::Use_Menu_Command
  671.     @progress_current_text_x    = V_Progress::Specs::Text_X
  672.     @progress_current_text_y    = V_Progress::Specs::Text_Y
  673.     @progress_current_text_size = V_Progress::Specs::Text_Size
  674.     @progress_current_text_font = V_Progress::Specs::Text_Font
  675.     @progress_gauge_color       = V_Progress::Specs::Game_Prog_Gauge_Color
  676.     v_prog_gamesys_init_654885()
  677.   end
  678.  
  679. end
  680.  
  681.  
  682.  
  683.  
  684. #==============================================================================
  685. # ** Game_Interpreter
  686. #------------------------------------------------------------------------------
  687. #  An interpreter for executing event commands. This class is used within the
  688. # Game_Map, Game_Troop, and Game_Event classes.
  689. #==============================================================================
  690.  
  691. class Game_Interpreter
  692.  
  693.   #--------------------------------------------------------------------------
  694.   # * Public Instance Variables
  695.   #--------------------------------------------------------------------------
  696.    
  697.   def add_chapt_info( page, bg, chapt_name, text )
  698.     return unless page.is_a?(Integer)
  699.     return unless bg.is_a?(String)
  700.     return unless chapt_name.is_a?(String)
  701.     return unless text.is_a?(String)
  702.     $game_system.chapter_info[page] = [*bg, *chapt_name, *text]
  703.     $game_system.current_page = page
  704.     end
  705.  
  706.   def change_prog_text_size( integer )
  707.     return unless integer.is_a?(Integer)
  708.     $game_system.progress_current_text_size = integer
  709.   end
  710.  
  711.   def change_prog_text_x( integer )
  712.     return unless integer.is_a?(Integer)
  713.     $game_system.progress_current_text_x = integer
  714.   end
  715.  
  716.   def change_prog_text_y( integer )
  717.     return unless integer.is_a?(Integer)
  718.     $game_system.progress_current_text_y = integer
  719.   end
  720.  
  721.   def change_prog_text_font( text )
  722.     return unless text.is_a?(String)
  723.     $game_system.progress_current_text_font = text
  724.   end
  725.  
  726.   def menu_command( text )
  727.     $game_system.progress_menu_command = text
  728.   end
  729.  
  730.   def add_progress( integer )
  731.     return unless integer.is_a?(Integer)
  732.     if $game_variables[V_Progress::Specs::Game_Variable_For_Filling] < $game_system.progress_gauge_max
  733.     $game_variables[V_Progress::Specs::Game_Variable_For_Filling] += integer
  734.     end
  735.    
  736.   end
  737.  
  738.   def remove_progress( integer )
  739.     return unless integer.is_a?(Integer)
  740.     if $game_variables[V_Progress::Specs::Game_Variable_For_Filling] < $game_system.progress_gauge_max
  741.     $game_variables[V_Progress::Specs::Game_Variable_For_Filling] -= integer
  742.     end
  743.    
  744.   end
  745.  
  746.   def change_gauge_color( integer )
  747.     return unless integer.is_a?(Integer)
  748.     $game_system.progress_gauge_color = integer
  749.   end
  750.  
  751.  
  752. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement