Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Quasi
- # Change to w.e you want the command name to be
- CMD_NAME = "Score"
- MENU_TITLE = "Partial Score"
- MENU_RUBRICS = "RUBRICS"
- MENU_GAMEDS = "Poor"
- MENU_GAMEDS1 = "Fair"
- MENU_GAMEDS2 = "Good"
- MENU_GAMEDS3 = "Very Good"
- MENU_GAMEDS4 = "Excellent"
- MENU_WRONG = ""
- # Variable to display
- VARIABLE = 18
- TOTAL = 50
- end
- #==============================================================================
- # ** Scene_Menu
- #------------------------------------------------------------------------------
- # This class performs the menu screen processing.
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
- alias quasi_menu_start start
- alias quasi_menu_update update
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start
- quasi_menu_start
- create_variable_window
- end
- #--------------------------------------------------------------------------
- # * New Update
- #--------------------------------------------------------------------------
- def update
- if @variable_window.visible == true
- if Input.trigger?(:C) or Input.trigger?(:B)
- @command_window.activate
- @status_window.visible = true
- @variable_window.visible = false
- end
- end
- quasi_menu_update
- end
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- def create_command_window
- @command_window = Window_MenuCommand.new
- @command_window.set_handler(:item, method(:command_item))
- @command_window.set_handler(:skill, method(:command_personal))
- @command_window.set_handler(:equip, method(:command_personal))
- @command_window.set_handler(:status, method(:command_personal))
- @command_window.set_handler(:formation, method(:command_formation))
- @command_window.set_handler(:Score, method(:command_custom))
- @command_window.set_handler(:save, method(:command_save))
- @command_window.set_handler(:game_end, method(:command_game_end))
- @command_window.set_handler(:cancel, method(:return_scene))
- end
- #--------------------------------------------------------------------------
- # * Create Variable Window
- #--------------------------------------------------------------------------
- def create_variable_window
- #New Window
- @variable_window = Window_Variable.new
- @variable_window.visible = false
- end
- #--------------------------------------------------------------------------
- # * [New Custom] Command
- #--------------------------------------------------------------------------
- def command_custom
- @status_window.visible = false
- @command_window.active = false
- @variable_window.visible = true
- end
- end
- #==============================================================================
- # ** Window_Status
- #------------------------------------------------------------------------------
- # This window displays full status specs on the status screen.
- #==============================================================================
- class Window_Variable < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(160, 0, Graphics.width - 160, Graphics.height)
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- var = Quasi::VARIABLE
- var = $game_variables[var].to_s
- tot = Quasi::TOTAL.to_s
- self.draw_text(0,0,200,24, Quasi::MENU_TITLE)
- self.draw_text(0,24,224,24, var + " Out of " + tot + " Points")
- self.draw_text(0,180,200,24, Quasi::MENU_GAMEDS)
- self.draw_text(0,160,200,24, Quasi::MENU_GAMEDS1)
- self.draw_text(0,140,200,24, Quasi::MENU_GAMEDS2)
- self.draw_text(0,120,200,24, Quasi::MENU_GAMEDS3)
- self.draw_text(0,100,200,24, Quasi::MENU_GAMEDS4)
- color = Color.new(12,223,0)
- change_color(color)
- self.draw_text(0,80,200,24, Quasi::MENU_RUBRICS)
- rubric = $game_variables[18]
- if rubric >= 40
- color = Color.new(255,0,0)
- change_color(color)
- self.draw_text(0,100,200,24, "Excellent")
- elsif rubric >= 30
- color = Color.new(255,0,0)
- change_color(color)
- self.draw_text(0,120,200,24, "Very Good")
- elsif rubric >= 20
- color = Color.new(255,0,0)
- change_color(color)
- self.draw_text(0,140,200,24, "Good")
- elsif rubric >= 10
- color = Color.new(255,0,0)
- change_color(color)
- self.draw_text(0,160,200,24, "Fair")
- else rubric >= 0
- color = Color.new(255,0,0)
- change_color(color)
- self.draw_text(0,180,200,24, "Poor")
- end
- change_color(normal_color)
- end
- #--------------------------------------------------------------------------
- # * Draw Horizontal Line
- #--------------------------------------------------------------------------
- def draw_horz_line(y)
- line_y = y + line_height / 2 - 1
- contents.fill_rect(0, line_y, contents_width, 2, line_color)
- end
- #--------------------------------------------------------------------------
- # * Get Color of Horizontal Line
- #--------------------------------------------------------------------------
- def line_color
- color = normal_color
- color.alpha = 48
- color
- end
- end
- #==============================================================================
- # ** Window_MenuCommand
- #------------------------------------------------------------------------------
- # Added Custom command for variable window
- #==============================================================================
- class Window_MenuCommand < Window_Command
- alias quasi_ccomands add_original_commands
- #--------------------------------------------------------------------------
- # * For Adding Original Commands
- #--------------------------------------------------------------------------
- def add_original_commands
- quasi_ccomands
- add_command(Quasi::CMD_NAME, :Score)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement