Advertisement
roninator2

Kid Friendly Basic Quest - System Menu

Dec 14th, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 29.32 KB | None | 0 0
  1. # ╔═════════════════════════════════════╦════════════════════╗
  2. # ║ Title: KFBQ System Menu Functions   ║  Version: 1.00     ║
  3. # ║ Author: Roninator2                  ║                    ║
  4. # ╠═════════════════════════════════════╬════════════════════╣
  5. # ║ Function:                           ║   Date Created     ║
  6. # ║                                     ╠════════════════════╣
  7. # ║   FFMQ Style System Screens         ║    09 Mar 2023     ║
  8. # ╚═════════════════════════════════════╩════════════════════╝
  9. # ╔══════════════════════════════════════════════════════════╗
  10. # ║ Instructions:                                            ║
  11. # ║                                                          ║
  12. # ║  Set the Windows to look like FFMQ.                      ║
  13. # ║                                                          ║
  14. # ║  Code has been used (copied/retyped/modified) from       ║
  15. # ║  other scripts. Credit must be given to those creators.  ║
  16. # ║  Roninator2, Yanfly, Zero_G, Kamesoft                    ║
  17. # ║                                                          ║
  18. # ║  Config options below                                    ║
  19. # ╚══════════════════════════════════════════════════════════╝
  20. # ╔══════════════════════════════════════════════════════════╗
  21. # ║ Terms of use:                                            ║
  22. # ║ Free for all uses in RPG Maker - Except nudity           ║
  23. # ╚══════════════════════════════════════════════════════════╝
  24.  
  25. #==============================================================================
  26. # ** Module System
  27. #==============================================================================
  28. module R2
  29.   module SYSTEM
  30.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  31.     # - System Option Defaults
  32.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  33.     COMMAND_NAME = "CUSTOMIZE"   # Command name used to replace Game End.
  34.     DEFAULT_AUTOBATTLE = false   # Enable automatic battle control by default?
  35.     DEFAULT_MSGSPEED   = 4       # Set the default message speed. 4 = normal
  36.     DEFAULT_LIFE       = false   # Set life bar setting, true equals figure
  37.     MSG_SPEED_IMG = "msg-speed-" # file used to draw image for message speed
  38.       # file name is the base name. the variable value will be added to make
  39.       # the filename complete. e.g. msg-speed-4.png
  40.     WINDOW_COLOUR = "Color-Bar"  # filename for drawing window colour setting
  41.     COLOUR_DOT = "Color-Dot"     # filename of colour indicator
  42.    
  43.     COMMAND_VOCAB ={
  44.     # -------------------------------------------------------------------------
  45.     # :command    => [Command Name, Option1, Option2
  46.     #                 Help Window Description,
  47.     #                ], # Do not remove this.
  48.     # -------------------------------------------------------------------------
  49.       :title      => [COMMAND_NAME, nil, nil,
  50.                      ], # Do not remove this.
  51.     # -------------------------------------------------------------------------
  52.       :lifeindicate => ["LIFE INDICATE", "SCALE", "FIGURE",
  53.                      ], # Do not remove this.
  54.     # -------------------------------------------------------------------------
  55.       :autobattle => ["CONTROL", "MANUAL", "AUTO",
  56.                      ], # Do not remove this.
  57.     # -------------------------------------------------------------------------
  58.       :msgspeed   => ["MESSAGE SPEED", 1, 7, 5,
  59.                      ], # Do not remove this.
  60.     # -------------------------------------------------------------------------
  61.       :window_red => ["R", "None", "None",
  62.                      ], # Do not remove this.
  63.     # -------------------------------------------------------------------------
  64.       :window_grn => ["G", "None", "None",
  65.                      ], # Do not remove this.
  66.     # -------------------------------------------------------------------------
  67.       :window_blu => ["B", "None", "None",
  68.                      ], # Do not remove this.
  69.     }
  70.   end # SYSTEM
  71. end # YEA
  72.  
  73. #==============================================================================
  74. # ■ Set Command Vocab
  75. #==============================================================================
  76.  
  77. module Vocab
  78.   #--------------------------------------------------------------------------
  79.   # overwrite method: self.game_end
  80.   #--------------------------------------------------------------------------
  81.   def self.game_end
  82.     return R2::SYSTEM::COMMAND_NAME
  83.   end
  84. end # Vocab
  85.  
  86. #==============================================================================
  87. # ■ Set Game System Options
  88. #==============================================================================
  89. class Game_System
  90.   #--------------------------------------------------------------------------
  91.   # alias method: initialize
  92.   #--------------------------------------------------------------------------
  93.   alias game_system_initialize_92v81cfe7gh initialize
  94.   def initialize
  95.     game_system_initialize_92v81cfe7gh
  96.     init_autobattle
  97.     init_msgspeed
  98.     init_life
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # new method: init_autobattle
  102.   #--------------------------------------------------------------------------
  103.   def init_autobattle
  104.     @autobattle = R2::SYSTEM::DEFAULT_AUTOBATTLE
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # new method: autobattle?
  108.   #--------------------------------------------------------------------------
  109.   def autobattle?
  110.     init_autobattle if @autobattle.nil?
  111.     return @autobattle
  112.   end
  113.   #--------------------------------------------------------------------------
  114.   # new method: autobattle?
  115.   #--------------------------------------------------------------------------
  116.   def autobattle=(value)
  117.     @autobattle = value
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # new method: set_autobattle
  121.   #--------------------------------------------------------------------------
  122.   def set_autobattle(bool = false)
  123.     @autobattle = bool
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # new method: init_msgspeed
  127.   #--------------------------------------------------------------------------
  128.   def init_msgspeed
  129.     @msgspeed = R2::SYSTEM::DEFAULT_MSGSPEED
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # new method: msgspeed
  133.   #--------------------------------------------------------------------------
  134.   def msgspeed
  135.     init_msgspeed if @msgspeed.nil?
  136.     return @msgspeed
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # new method: set_msgspeed
  140.   #--------------------------------------------------------------------------
  141.   def set_msgspeed(value)
  142.     @msgspeed = value
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # new method: init_life
  146.   #--------------------------------------------------------------------------
  147.   def init_life
  148.     @life_indicator = R2::SYSTEM::DEFAULT_LIFE
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # new method: life_indicator?
  152.   #--------------------------------------------------------------------------
  153.   def life_indicator?
  154.     init_life if @life_indicator.nil?
  155.     return @life_indicator
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # new method: set_life
  159.   #--------------------------------------------------------------------------
  160.   def set_life(bool = false)
  161.     @life_indicator = bool
  162.   end
  163. end
  164.  
  165. #==============================================================================
  166. # ■ ********* Autobattle Controls ***************
  167. #==============================================================================
  168. #==============================================================================
  169. # ■ BattleManager
  170. #==============================================================================
  171. module BattleManager
  172.   #--------------------------------------------------------------------------
  173.   # Next Command
  174.   #--------------------------------------------------------------------------
  175.   def self.next_command
  176.     begin
  177.       if !actor || !actor.next_command
  178.         @actor_index += 1
  179.         return false if (@actor_index >= 1) && $game_system.autobattle?
  180.         return false if @actor_index >= $game_party.members.size
  181.         return false if actor.dead? && (@actor_index >= 1) && !$game_system.autobattle?
  182.       end
  183.     end until actor.inputable?
  184.     return true
  185.   end
  186. end
  187.  
  188. #==============================================================================
  189. # ■ Game BattlerBase
  190. #==============================================================================
  191. class Game_BattlerBase
  192.   #--------------------------------------------------------------------------
  193.   # Check for Autobattle
  194.   #--------------------------------------------------------------------------
  195.   def inputable?
  196.     normal? && !auto_battle? || (!$game_system.autobattle? && (self != $game_party.leader))
  197.   end
  198. end # Game_BattlerBase
  199.  
  200. #==============================================================================
  201. # ■ Game Actor
  202. #==============================================================================
  203. class Game_Actor
  204.   #--------------------------------------------------------------------------
  205.   # Actor performs Autobattle
  206.   #--------------------------------------------------------------------------
  207.   def make_actions
  208.     super
  209.     if auto_battle? || $game_system.autobattle?
  210.       make_auto_battle_actions
  211.     elsif confusion?
  212.       make_confusion_actions
  213.     end
  214.   end
  215. end # Game_Actor
  216.  
  217. #==============================================================================
  218. # ■ ********* Message Speed Controls ***************
  219. #==============================================================================
  220. #==============================================================================
  221. # ■ Message Speed
  222. #==============================================================================
  223. module DataManager
  224.   class << self; alias r2_setup_new_game_kfbq setup_new_game; end
  225.   def self.setup_new_game
  226.     r2_setup_new_game_kfbq
  227.     $game_variables[R2::SYSTEM::COMMAND_VOCAB[:msgspeed][3]] = $game_system.msgspeed
  228.   end
  229. end
  230.  
  231. #==============================================================================
  232. # ■ Window Message
  233. #==============================================================================
  234. class Window_Message < Window_Base
  235.   #--------------------------------------------------------------------------
  236.   # draw_title
  237.   #--------------------------------------------------------------------------
  238.   def find_msg_speed
  239.     case $game_variables[R2::SYSTEM::COMMAND_VOCAB[:msgspeed][3]]
  240.     when 1
  241.       return 3
  242.     when 2
  243.       return 2
  244.     when 3
  245.       return 1
  246.     when 4
  247.       return 0
  248.     when 5
  249.       return -1
  250.     when 6
  251.       return -2
  252.     when 7
  253.       return -3
  254.     end
  255.   end
  256.   #--------------------------------------------------------------------------
  257.   # Update Fiber
  258.   #--------------------------------------------------------------------------
  259.   def update_fiber
  260.     if @fiber
  261.       @fiber.resume
  262.       for i in 2..find_msg_speed
  263.         @fiber.resume unless @fiber.nil?
  264.       end
  265.     elsif $game_message.busy? && !$game_message.scroll_mode
  266.       @fiber = Fiber.new { fiber_main }
  267.       @fiber.resume
  268.     else
  269.       $game_message.visible = false
  270.     end
  271.   end
  272.   #--------------------------------------------------------------------------
  273.   # Fiber Main
  274.   #--------------------------------------------------------------------------
  275.   def fiber_main
  276.     $game_message.visible = true
  277.     update_background
  278.     update_placement
  279.     loop do
  280.       process_all_text if $game_message.has_text?
  281.       process_input
  282.       $game_message.clear
  283.       @gold_window.close
  284.       Fiber.yield
  285.       for i in 2..find_msg_speed
  286.         Fiber.yield
  287.       end
  288.       break unless text_continue?
  289.     end
  290.     close_and_wait
  291.     $game_message.visible = false
  292.     @fiber = nil
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # Wait for one Character Drawing
  296.   #--------------------------------------------------------------------------
  297.   alias zero_wait_for_one_character wait_for_one_character
  298.   def wait_for_one_character
  299.     zero_wait_for_one_character
  300.     for i in find_msg_speed..-2
  301.       Fiber.yield unless @show_fast || @line_show_fast
  302.     end
  303.   end
  304. end # class Window_Message
  305.  
  306. #==============================================================================
  307. # ■ ********* Create Windows ***************
  308. #==============================================================================
  309. #==============================================================================
  310. # ■ Window_KFBQSystemBlank
  311. #==============================================================================
  312. class Window_KFBQSystemBlank < Window_Base
  313.   #--------------------------------------------------------------------------
  314.   # * Object Initialization
  315.   #--------------------------------------------------------------------------
  316.   def initialize(x, y, w, h)
  317.     hgt = line_height * h + 10
  318.     super(x, y, w, hgt)
  319.   end
  320.   #--------------------------------------------------------------------------
  321.   # * Get Line Height
  322.   #--------------------------------------------------------------------------
  323.   def line_height
  324.     return 21
  325.   end  
  326. end
  327.  
  328. #==============================================================================
  329. # ■ Window_KFBQSystemName
  330. #==============================================================================
  331. class Window_KFBQSystemName < Window_Base
  332.   #--------------------------------------------------------------------------
  333.   # * Object Initialization
  334.   #--------------------------------------------------------------------------
  335.   def initialize
  336.     super(Graphics.width/2, 0, window_width, fitting_height(1))
  337.     draw_title
  338.   end
  339.   #--------------------------------------------------------------------------
  340.   # * Get Window Width
  341.   #--------------------------------------------------------------------------
  342.   def window_width
  343.     return Graphics.width / 2
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # draw_title
  347.   #--------------------------------------------------------------------------
  348.   def draw_title
  349.     name = R2::SYSTEM::COMMAND_NAME
  350.     draw_text(0, 0, contents.width, line_height, name, 1)
  351.   end
  352. end
  353.  
  354. #==============================================================================
  355. # ■ Window_KFBQSystemOptions
  356. #==============================================================================
  357. class Window_KFBQSystemOptions < Window_Command
  358.   #--------------------------------------------------------------------------
  359.   # initialize
  360.   #--------------------------------------------------------------------------
  361.   def initialize
  362.     super(0, 45)
  363.     self.opacity = 0
  364.     self.back_opacity = 0
  365.     @color_dot = {}
  366.     refresh
  367.   end
  368.   #--------------------------------------------------------------------------
  369.   # window_width
  370.   #--------------------------------------------------------------------------
  371.   def window_width; return Graphics.width; end
  372.   #--------------------------------------------------------------------------
  373.   # window_height
  374.   #--------------------------------------------------------------------------
  375.   def window_height; return Graphics.height - 100; end
  376.   #--------------------------------------------------------------------------
  377.   # * Get Item Height
  378.   #--------------------------------------------------------------------------
  379.   def item_height
  380.     window_height / @list.size - 5
  381.   end
  382.   #--------------------------------------------------------------------------
  383.   # * Get Line Height
  384.   #--------------------------------------------------------------------------
  385.   def line_height
  386.     return 20
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # * Update Cursor
  390.   #--------------------------------------------------------------------------
  391.   def update_cursor
  392.     ensure_cursor_visible
  393.     cursor_rect.set(item_rect(@index))
  394.     cursor_rect.height -= 15
  395.     cursor_rect.y += 3
  396.     case @list[index][:symbol]
  397.     when :autobattle
  398.       cursor_rect.y += 7
  399.     when :msgspeed
  400.       cursor_rect.y += 9
  401.     when :window_red
  402.       cursor_rect.y += 10
  403.     when :window_grn
  404.       cursor_rect.y -= 7
  405.     when :window_blu
  406.       cursor_rect.y -= 22
  407.     end
  408.   end
  409.   #--------------------------------------------------------------------------
  410.   # make_command_list
  411.   #--------------------------------------------------------------------------
  412.   def make_command_list
  413.     add_command(R2::SYSTEM::COMMAND_VOCAB[:lifeindicate][0], :lifeindicate)
  414.     add_command(R2::SYSTEM::COMMAND_VOCAB[:autobattle][0], :autobattle)
  415.     add_command(R2::SYSTEM::COMMAND_VOCAB[:msgspeed][0], :msgspeed)
  416.     add_command(R2::SYSTEM::COMMAND_VOCAB[:window_red][0], :window_red)
  417.     add_command(R2::SYSTEM::COMMAND_VOCAB[:window_grn][0], :window_grn)
  418.     add_command(R2::SYSTEM::COMMAND_VOCAB[:window_blu][0], :window_blu)
  419.   end
  420.   #--------------------------------------------------------------------------
  421.   # draw_item
  422.   #--------------------------------------------------------------------------
  423.   def draw_item(index)
  424.     reset_font_settings
  425.     rect = item_rect(index)
  426.     rect.height -= 15
  427.     case index
  428.     when 3
  429.       rect.y += 15
  430.     when 5
  431.       rect.y -= 10
  432.     end
  433.     contents.clear_rect(rect)
  434.     case @list[index][:symbol]
  435.     when :lifeindicate, :autobattle
  436.       draw_option_toggle(rect, index, @list[index][:symbol])
  437.     when :msgspeed
  438.       draw_msgspeed_variable(rect, index, @list[index][:symbol])
  439.     when :window_red, :window_grn, :window_blu
  440.       draw_window_tone(rect, index, @list[index][:symbol])
  441.     end
  442.   end
  443.   #--------------------------------------------------------------------------
  444.   # draw_window_background
  445.   #--------------------------------------------------------------------------
  446.   def create_option_window_backs(index)
  447.     @option_title[index] = Window_KFBQSystemName.new(index)
  448.   end
  449.   #--------------------------------------------------------------------------
  450.   # draw_option_toggle
  451.   #--------------------------------------------------------------------------
  452.   def draw_option_toggle(rect, index, symbol)
  453.     name = @list[index][:name]
  454.     px = contents.width / 2
  455.     rect.y += 5
  456.     case symbol
  457.     when :lifeindicate
  458.       enabled = $game_system.life_indicator?
  459.       draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  460.     when :autobattle
  461.       enabled = $game_system.autobattle?
  462.       rect.y += 7
  463.       draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  464.     end
  465.     change_color(crisis_color) if !enabled
  466.     change_color(normal_color) if enabled
  467.     option1 = R2::SYSTEM::COMMAND_VOCAB[symbol][1]
  468.     draw_text(px, rect.y, contents.width/4, line_height, option1, 1)
  469.     px += contents.width/4
  470.     change_color(crisis_color) if enabled
  471.     change_color(normal_color) if !enabled
  472.     option2 = R2::SYSTEM::COMMAND_VOCAB[symbol][2]
  473.     draw_text(px, rect.y, contents.width/4, line_height, option2, 1)
  474.   end
  475.   #--------------------------------------------------------------------------
  476.   # draw_msgspeed_variable
  477.   #--------------------------------------------------------------------------
  478.   def draw_msgspeed_variable(rect, index, var)
  479.     name = @list[index][:name]
  480.     rect.y += 17
  481.     draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  482.     px = contents.width / 2
  483.     value = $game_variables[R2::SYSTEM::COMMAND_VOCAB[var][3]]
  484.     minimum = R2::SYSTEM::COMMAND_VOCAB[var][1]
  485.     maximum = R2::SYSTEM::COMMAND_VOCAB[var][2]
  486.     rate = (value - minimum).to_f / [(maximum - minimum).to_f, 0.01].max
  487.     draw_message_gauge
  488.   end
  489.   #--------------------------------------------------------------------------
  490.   # draw_window_tone
  491.   #--------------------------------------------------------------------------
  492.   def draw_window_tone(rect, index, symbol)
  493.     name = @list[index][:name]
  494.     #---
  495.     px = contents.width / 2
  496.     rect.height -= 5
  497.     tone = $game_system.window_tone
  498.     case symbol
  499.     when :window_red
  500.       name = "WINDOW COLOR"
  501.       draw_text(30, rect.y + 5, contents.width/2, line_height, name, 0)
  502.       name = @list[index][:name]
  503.       draw_text(0, rect.y + 4, contents.width/2, line_height, name, 2)
  504.       value = tone.red.to_i
  505.       minimum = 0
  506.       maximum = 248
  507.       value = [[value, minimum].max, maximum].min
  508.       tone.red = value
  509.       draw_window_colour_base(0)
  510.       draw_window_colour_dot(0, value)
  511.     when :window_grn
  512.       draw_text(0, rect.y + 2, contents.width/2, line_height, name, 2)
  513.       value = tone.green.to_i
  514.       minimum = 0
  515.       maximum = 248
  516.       value = [[value, minimum].max, maximum].min
  517.       tone.green = value
  518.       draw_window_colour_base(1)
  519.       draw_window_colour_dot(1, value)
  520.     when :window_blu
  521.       draw_text(0, rect.y - 4, contents.width/2, line_height, name, 2)
  522.       value = tone.blue.to_i
  523.       minimum = 0
  524.       maximum = 248
  525.       value = [[value, minimum].max, maximum].min
  526.       tone.blue = value
  527.       draw_window_colour_base(2)
  528.       draw_window_colour_dot(2, value)
  529.     end
  530.   end
  531.   #--------------------------------------------------------------------------
  532.   # cursor_right
  533.   #--------------------------------------------------------------------------
  534.   def cursor_right(wrap = false)
  535.     cursor_change(:right)
  536.     super(wrap)
  537.   end
  538.   #--------------------------------------------------------------------------
  539.   # cursor_left
  540.   #--------------------------------------------------------------------------
  541.   def cursor_left(wrap = false)
  542.     cursor_change(:left)
  543.     super(wrap)
  544.   end
  545.   #--------------------------------------------------------------------------
  546.   # party_full
  547.   #--------------------------------------------------------------------------
  548.   def party_full_enabled?
  549.     return true if $game_party.members.size > 1
  550.     return false
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # cursor_change
  554.   #--------------------------------------------------------------------------
  555.   def cursor_change(direction)
  556.     case current_symbol
  557.     when :window_red, :window_blu, :window_grn
  558.       change_window_tone(direction)
  559.     when :lifeindicate
  560.       change_toggle(direction)
  561.     when :autobattle
  562.       if !party_full_enabled?
  563.         Sound.play_buzzer
  564.         return
  565.       end
  566.       change_toggle(direction)
  567.     when :msgspeed
  568.       change_msgspeed_variable(direction)
  569.     end
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # change_window_tone
  573.   #--------------------------------------------------------------------------
  574.   def change_window_tone(direction)
  575.     Sound.play_cursor
  576.     value = direction == :left ? -31 : 31
  577.     tone = $game_system.window_tone.clone
  578.     case current_symbol
  579.     when :window_red; tone.red += value
  580.       value = tone.red
  581.       minimum = 0; maximum = 248
  582.       value = [[value, minimum].max, maximum].min
  583.       tone.red = value
  584.     when :window_grn; tone.green += value
  585.       value = tone.green
  586.       minimum = 0; maximum = 248
  587.       value = [[value, minimum].max, maximum].min
  588.       tone.green = value
  589.     when :window_blu; tone.blue += value
  590.       value = tone.blue
  591.       minimum = 0; maximum = 248
  592.       value = [[value, minimum].max, maximum].min
  593.       tone.blue = value
  594.     end
  595.     $game_system.window_tone = tone
  596.     draw_item(index)
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # change_toggle
  600.   #--------------------------------------------------------------------------
  601.   def change_toggle(direction)
  602.     value = direction == :left ? false : true
  603.     case current_symbol
  604.     when :autobattle
  605.       current_case = $game_system.autobattle?
  606.       $game_system.set_autobattle(value)
  607.       SceneManager.scene.change_data(true)
  608.     when :lifeindicate
  609.       current_case = $game_system.life_indicator?
  610.       $game_system.set_life(value)
  611.     end
  612.     Sound.play_cursor if value != current_case
  613.     draw_item(index)
  614.   end
  615.   #--------------------------------------------------------------------------
  616.   # change_custom_variables
  617.   #--------------------------------------------------------------------------
  618.   def change_msgspeed_variable(direction)
  619.     Sound.play_cursor
  620.     value = direction == :left ? -1 : 1
  621.     var = R2::SYSTEM::COMMAND_VOCAB[:msgspeed][3]
  622.     minimum = R2::SYSTEM::COMMAND_VOCAB[:msgspeed][1]
  623.     maximum = R2::SYSTEM::COMMAND_VOCAB[:msgspeed][2]
  624.     $game_variables[var] += value
  625.     $game_variables[var] = [[$game_variables[var], minimum].max, maximum].min
  626.     draw_item(index)
  627.   end
  628.   #--------------------------------------------------------------------------
  629.   # draw_message_popup
  630.   #--------------------------------------------------------------------------
  631.   def draw_message_gauge
  632.     rect = item_rect(2)
  633.     py = rect.y + 18
  634.     px = contents.width / 2
  635.     rect = Rect.new(0, 0, 200, 25)
  636.     img = Cache.system(R2::SYSTEM::MSG_SPEED_IMG + $game_variables[R2::SYSTEM::COMMAND_VOCAB[:msgspeed][3]].to_s)
  637.     contents.blt(px + 20, py, img, rect)
  638.   end
  639.   #--------------------------------------------------------------------------
  640.   # draw_window_colour_base
  641.   #--------------------------------------------------------------------------
  642.   def draw_window_colour_base(index)
  643.     rect = item_rect(3+index)
  644.     rect.height -= 5
  645.     py = rect.y + 20 - (index * 15)
  646.     px = contents.width / 2
  647.     rect = Rect.new(0, 0, 220, 25)
  648.     img = Cache.system(R2::SYSTEM::WINDOW_COLOUR)
  649.     contents.blt(px + 20, py, img, rect)
  650.   end
  651.   #--------------------------------------------------------------------------
  652.   # draw_window_colour_dot
  653.   #--------------------------------------------------------------------------
  654.   def draw_window_colour_dot(index, value)
  655.     rect = item_rect(3+index)
  656.     rect.height -= 5
  657.     py = rect.y + 25 - (index * 15)
  658.     px = contents.width / 2 + 20
  659.     ax = (value / 31).to_i * 25
  660.     rect = Rect.new(0, 0, 200, 25)
  661.     img = Cache.system(R2::SYSTEM::COLOUR_DOT)
  662.     contents.blt(px + ax, py, img, rect)
  663.   end
  664. end
  665.  
  666. #==============================================================================
  667. # ■ Call Scene
  668. #==============================================================================
  669. class Scene_Menu < Scene_MenuBase
  670.   #--------------------------------------------------------------------------
  671.   # overwrite method: command_game_end
  672.   #--------------------------------------------------------------------------
  673.   def command_game_end
  674.     SceneManager.call(Scene_KFBQSystem)
  675.   end
  676. end # Scene_Menu
  677.  
  678. #==============================================================================
  679. # ■ Scene_System
  680. #==============================================================================
  681. class Scene_KFBQSystem < Scene_MenuBase
  682.   #--------------------------------------------------------------------------
  683.   # Start
  684.   #--------------------------------------------------------------------------
  685.   def start
  686.     super
  687.     create_option_title
  688.     create_option_window
  689.     create_dummy_windows
  690.   end
  691.   #--------------------------------------------------------------------------
  692.   # Create Option Window
  693.   #--------------------------------------------------------------------------
  694.   def create_option_window
  695.     @options_window = Window_KFBQSystemOptions.new
  696.     @options_window.set_handler(:cancel, method(:return_scene))
  697.   end
  698.   #--------------------------------------------------------------------------
  699.   # Create Option Title
  700.   #--------------------------------------------------------------------------
  701.   def create_option_title
  702.     @option_title = Window_KFBQSystemName.new
  703.   end
  704.   #--------------------------------------------------------------------------
  705.   # Create Dummy Windows
  706.   #--------------------------------------------------------------------------
  707.   def create_dummy_windows
  708.     @life_window = Window_KFBQSystemBlank.new(0, 56, Graphics.width, 2)
  709.     @life_window.z = 1
  710.     @auto_window = Window_KFBQSystemBlank.new(0, 120, Graphics.width, 2)
  711.     @auto_window.z = 1
  712.     @msgspd_window = Window_KFBQSystemBlank.new(0, 180, Graphics.width, 2)
  713.     @msgspd_window.z = 1
  714.     @colour_window = Window_KFBQSystemBlank.new(0, 240, Graphics.width, 6)
  715.     @colour_window.z = 1
  716.   end
  717. end # Scene_System
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement