Advertisement
Guest User

Untitled

a guest
Feb 10th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 6.43 KB | None | 0 0
  1. module Quasi
  2.   # Change to w.e you want the command name to be
  3.   CMD_NAME = "Score"
  4.  
  5.   MENU_TITLE = "Partial Score"
  6.   MENU_RUBRICS = "RUBRICS"
  7.   MENU_GAMEDS = "Poor"
  8.   MENU_GAMEDS1 = "Fair"
  9.   MENU_GAMEDS2 = "Good"
  10.   MENU_GAMEDS3 = "Very Good"
  11.   MENU_GAMEDS4 = "Excellent"
  12.   MENU_WRONG = ""
  13.  
  14.  
  15.   # Variable to display
  16.  
  17.   VARIABLE = 18
  18.   TOTAL = 50
  19.  
  20. end
  21.  
  22. #==============================================================================
  23. # ** Scene_Menu
  24. #------------------------------------------------------------------------------
  25. #  This class performs the menu screen processing.
  26. #==============================================================================
  27.  
  28. class Scene_Menu < Scene_MenuBase
  29.   alias quasi_menu_start start
  30.   alias quasi_menu_update update
  31.   #--------------------------------------------------------------------------
  32.   # * Start Processing
  33.   #--------------------------------------------------------------------------
  34.   def start
  35.     quasi_menu_start
  36.     create_variable_window
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # * New Update
  40.   #--------------------------------------------------------------------------
  41.   def update
  42.     if @variable_window.visible == true
  43.       if Input.trigger?(:C) or Input.trigger?(:B)
  44.         @command_window.activate
  45.         @status_window.visible = true
  46.         @variable_window.visible = false
  47.       end
  48.     end
  49.     quasi_menu_update
  50.   end
  51.   #--------------------------------------------------------------------------
  52.   # * Create Command Window
  53.   #--------------------------------------------------------------------------
  54.   def create_command_window
  55.     @command_window = Window_MenuCommand.new
  56.     @command_window.set_handler(:item,      method(:command_item))
  57.     @command_window.set_handler(:skill,     method(:command_personal))
  58.     @command_window.set_handler(:equip,     method(:command_personal))
  59.     @command_window.set_handler(:status,    method(:command_personal))
  60.     @command_window.set_handler(:formation, method(:command_formation))
  61.     @command_window.set_handler(:Score,      method(:command_custom))
  62.     @command_window.set_handler(:save,      method(:command_save))
  63.     @command_window.set_handler(:game_end,  method(:command_game_end))
  64.     @command_window.set_handler(:cancel,    method(:return_scene))
  65.   end
  66.   #--------------------------------------------------------------------------
  67.   # * Create Variable Window
  68.   #--------------------------------------------------------------------------
  69.   def create_variable_window
  70.     #New Window
  71.     @variable_window = Window_Variable.new
  72.     @variable_window.visible = false
  73.   end
  74.   #--------------------------------------------------------------------------
  75.   # * [New Custom] Command
  76.   #--------------------------------------------------------------------------
  77.   def command_custom
  78.     @status_window.visible = false
  79.     @command_window.active = false
  80.     @variable_window.visible = true
  81.   end
  82. end
  83.  
  84. #==============================================================================
  85. # ** Window_Status
  86. #------------------------------------------------------------------------------
  87. #  This window displays full status specs on the status screen.
  88. #==============================================================================
  89.  
  90. class Window_Variable < Window_Base
  91.   #--------------------------------------------------------------------------
  92.   # * Object Initialization
  93.   #--------------------------------------------------------------------------
  94.   def initialize
  95.     super(160, 0, Graphics.width - 160, Graphics.height)
  96.     refresh
  97.   end
  98.    #--------------------------------------------------------------------------
  99.   # * Refresh
  100.   #--------------------------------------------------------------------------
  101.   def refresh
  102.     contents.clear
  103.     var = Quasi::VARIABLE
  104.     var = $game_variables[var].to_s
  105.    
  106.     tot = Quasi::TOTAL.to_s
  107.     self.draw_text(0,0,200,24, Quasi::MENU_TITLE)
  108.     self.draw_text(0,24,224,24, var + " Out of " + tot + " Points")
  109.     self.draw_text(0,180,200,24, Quasi::MENU_GAMEDS)
  110.     self.draw_text(0,160,200,24, Quasi::MENU_GAMEDS1)
  111.     self.draw_text(0,140,200,24, Quasi::MENU_GAMEDS2)
  112.     self.draw_text(0,120,200,24, Quasi::MENU_GAMEDS3)
  113.     self.draw_text(0,100,200,24, Quasi::MENU_GAMEDS4)
  114.     color =  Color.new(12,223,0)
  115.       change_color(color)
  116.     self.draw_text(0,80,200,24, Quasi::MENU_RUBRICS)
  117.    
  118.    
  119.     rubric = $game_variables[18]
  120.     if rubric >= 40
  121.       color =  Color.new(255,0,0)
  122.       change_color(color)
  123.       self.draw_text(0,100,200,24, "Excellent")
  124.     elsif rubric >= 30
  125.       color =  Color.new(255,0,0)
  126.       change_color(color)
  127.       self.draw_text(0,120,200,24, "Very Good")
  128.     elsif rubric >= 20
  129.       color =  Color.new(255,0,0)
  130.       change_color(color)
  131.       self.draw_text(0,140,200,24, "Good")
  132.     elsif rubric >= 10
  133.       color =  Color.new(255,0,0)
  134.       change_color(color)
  135.       self.draw_text(0,160,200,24, "Fair")
  136.     else rubric >= 0
  137.       color = Color.new(255,0,0)
  138.       change_color(color)
  139.       self.draw_text(0,180,200,24, "Poor")
  140.     end
  141.     change_color(normal_color)
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # * Draw Horizontal Line
  145.   #--------------------------------------------------------------------------
  146.   def draw_horz_line(y)
  147.     line_y = y + line_height / 2 - 1
  148.     contents.fill_rect(0, line_y, contents_width, 2, line_color)
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # * Get Color of Horizontal Line
  152.   #--------------------------------------------------------------------------
  153.   def line_color
  154.     color = normal_color
  155.     color.alpha = 48
  156.     color
  157.   end
  158. end
  159.  
  160. #==============================================================================
  161. # ** Window_MenuCommand
  162. #------------------------------------------------------------------------------
  163. #  Added Custom command for variable window
  164. #==============================================================================
  165.  
  166. class Window_MenuCommand < Window_Command
  167.   alias quasi_ccomands add_original_commands
  168.   #--------------------------------------------------------------------------
  169.   # * For Adding Original Commands
  170.   #--------------------------------------------------------------------------
  171.   def add_original_commands
  172.     quasi_ccomands
  173.     add_command(Quasi::CMD_NAME, :Score)
  174.   end
  175. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement