Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # ■ Scene_Help [RMXP]
- # ■ Author: Bigace360
- # ■ Version: 1.0
- # ■ Date: 5.19.2012
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # INTRODUCTION #
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # Creates a window that shows help information during game play anywhere.
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # SECTIONS #
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # ■ Game_Objects
- # ** Module ACE::Help
- # ** Module Input
- #
- # ■ Windows
- # ** Window_GameHelp
- #
- # ■ Scenes
- # ** Scene_Help
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # ■ Module ACE::Help
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- module ACE
- module Help
- #Window Opacity (1-255)
- OPACITY = 255
- #Titles of the help scene window
- MAP_TITLE = ' ■ Map Help'
- MENU_TITLE = ' ■ Menu Help'
- # Map Window Text
- MAP_WINDOW_TEXT = [
- '● Open Menu:',
- '● Interaction:',
- '● Jump:',
- '● Sprint:',
- '● Minimap:'
- ]
- MAP_WINDOW_COMMANDS = [
- 'Press Esc or X',
- 'Press Enter or Space',
- 'Press A',
- 'Press S',
- 'Press D'
- ]
- # Menu Window Text
- MENU_WINDOW_TEXT = [
- '● Selection:',
- '● Go Back:'
- ]
- MENU_WINDOW_COMMANDS = [
- 'Press Enter or Space',
- 'Press Esc or X'
- ]
- #---------------------------------------------------------------------------
- # Add scenes here that you want quick access blocked on. Example,
- # Scene_Title, wouldn't want users to view achievements there. Kinda odd.
- #---------------------------------------------------------------------------
- Block_Scenes = [Scene_Title]
- #---------------------------------------------------------------------------
- # If set to an Input key, it will open up a quick view window to view all
- # achievements, can be opened up from anywhere, and doesn't interupt the
- # current scene. Set to nil to turn it off.
- #---------------------------------------------------------------------------
- Quick_Access = Input::A
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
- # DO NOT TOUCH THESE LINES BELOW
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
- Keys_To_Scene = {
- Input::A => Scene_Map,
- Input::B => Scene_Map
- }
- end
- end
- #==============================================================================
- # ▼ WARNING!!!
- # 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.
- #==============================================================================
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:#
- $ace_script = {} if $ace_script.nil?
- $ace_script['ACE Help Menu'] = true
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:#
- module Input
- include ACE::Help
- class << self; alias ace_init_update update unless $@; end
- def self.update_old; ace_init_update; end
- def self.check_blocked
- Block_Scenes.each {|s| return true if $scene.is_a?(s)}
- return false
- end
- def self.update
- if Quick_Access != nil && Input.trigger?(Quick_Access) &&
- @scene == nil && !self.check_blocked
- $game_system.se_play($data_system.decision_se)
- @scene = Scene_Help.new
- @scene = nil
- end
- ace_init_update
- end
- end
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- # ■ Window_GameHelp
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- class Window_GameHelp < Window_Base
- include ACE::Help
- def initialize
- super(50, 50, contents_width, 380)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity, self.z = OPACITY, 10000
- refresh
- end
- def refresh
- self.contents.clear
- self.contents.font.size = 28
- $scene.is_a?(Scene_Map) ? scene_map : scene_menu
- draw_horz_line(18)
- draw_vert_line(125, 30)
- end
- def scene_map
- title_text = MAP_TITLE
- self.contents.draw_text(4, 0, contents_width, 32, title_text)
- self.contents.font.size = 16
- text = MAP_WINDOW_TEXT
- command = MAP_WINDOW_COMMANDS
- self.contents.font.name, self.contents.font.bold = 'Verdana', true
- subtitle
- y = 10
- text.each_index {|i| self.contents.draw_text(0, (40+y)+i*(y*2), contents_width, 20, text[i],0)}
- self.contents.font.bold = false
- command.each_index {|i| self.contents.draw_text(150, (40+y)+i*(y*2), contents_width, 20, command[i],0)}
- end
- def scene_menu
- title_text = MENU_TITLE
- self.contents.draw_text(4, 0, contents_width, 32, title_text)
- self.contents.font.size = 16
- text = MENU_WINDOW_TEXT
- command = MENU_WINDOW_COMMANDS
- self.contents.font.name, self.contents.font.bold = 'Verdana', true
- subtitle
- y = 10
- text.each_index {|i| self.contents.draw_text(0, (40+y)+i*(y*2), contents_width, 20, text[i],0)}
- self.contents.font.bold = false
- command.each_index {|i| self.contents.draw_text(150, (40+y)+i*(y*2), contents_width, 20, command[i],0)}
- end
- def subtitle
- self.contents.draw_text(0, 32, contents_width, 24, ' Functions',0)
- x2 = 120+contents.text_size('Function').width
- self.contents.draw_text(x2, 32, contents_width, 24, 'Commands',0)
- end
- def contents_width; return 540; end
- def draw_horz_line(y)
- line_y = y + 24 / 2 - 1
- self.contents.fill_rect(0, line_y, contents_width, 2, line_color)
- end
- def draw_vert_line(x,y)
- line_y = y + 24 / 2 - 1
- line_x = x + 24 / 2 - 1
- self.contents.fill_rect(line_x, line_y, 2, 380, line_color)
- end
- def line_color
- color = normal_color
- color.alpha = 192
- return color
- end
- end
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- # ■ Scene_Help
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- class Scene_Help
- def initialize
- @gamehelp_window = Window_GameHelp.new
- loop do
- Graphics.update
- Input.update_old
- update
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- break
- end
- end
- @gamehelp_window.dispose
- end
- def update; @gamehelp_window.update; end
- end
Advertisement
Add Comment
Please, Sign In to add comment