Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - Scene Help
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy / Normal
- # -- Requires : $D13x Core v2.4+
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Scene_Help]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 24/o3/2o14 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script allows you to insert a customizable help window into any scene.
- # No Coding Knowledge Required!
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- # Place Below $D13x Core Script.
- #
- #===============================================================================
- module DSceneHelp
- #===============================================================================
- #-----------------------------------------------------------------------------
- # The key that toggles the help window on/off.
- #-----------------------------------------------------------------------------
- Key = :H
- #-----------------------------------------------------------------------------
- # The width of the window (gets eval'ed)
- #-----------------------------------------------------------------------------
- Width = "Graphics.width / 5 * 3"
- #-----------------------------------------------------------------------------
- # The color of the background box within the window
- #-----------------------------------------------------------------------------
- Box_Color = Color.new(0,0,0,128)
- #-----------------------------------------------------------------------------
- Main={# Main settings ::
- # It is here you define the help windows hieight, text and the scene that it
- # will be shown in.
- #-----------------------------------------------------------------------------
- # "Scene_Name" => {
- # :lc => number of visible lines in window.
- # :txt => [
- # ["Your Text Goes Here" , y, align, color],
- # ],
- # } # << End Scene_Name
- #-----------------------------------------------------------------------------
- "Scene_Status" => {
- :lc => 3,
- :txt => [
- ["--HELP--" , 0, 1, Text_Color::Gold ],
- ["Key To Close Help:" , 24, 0, Text_Color::White],
- ["'H'" , 24, 2, Text_Color::Red],
- ["Key To Exit:" , 48, 0, Text_Color::White],
- ["'ESC'" , 48, 2, Text_Color::Red],
- ], # << :txt
- }, # << "Scene_Status"
- "Scene_Equip" => {
- :lc => 5,
- :txt => [
- ["--HELP--" , 0, 1, Text_Color::Gold ],
- ["Left Shift:" , 24, 0, Text_Color::White],
- ["Change Stat Page Down", 24, 2, Text_Color::Red],
- ["Right Shift:" , 48, 0, Text_Color::White],
- ["Change Stat Page Up" , 48, 2, Text_Color::Red],
- ["Tab:" , 72, 0, Text_Color::White],
- ["Toggle Actor/Weapon Stats", 72, 2, Text_Color::Red],
- ["'H' Key:" , 96, 0, Text_Color::White],
- ["Close Help Info", 96, 2, Text_Color::Red],
- ], # << :txt
- }, # << "Scene_Equip"
- "Scene_Map" => {
- :lc => 4,
- :txt => [
- ["--HELP--" , 0, 1, Text_Color::Gold ],
- ["-Removed For Now-" , 24, 1, Text_Color::Red],
- ], # << :txt
- }, # << "Custom_Scene_Name"
- #-----------------------------------------------------------------------------
- # << Add More "Scene_Name" here
- #-----------------------------------------------------------------------------
- }# << Main -------------------------------------------------------------------
- # Do Not Modify This Method!
- #-----------------------------------------------------------------------------
- def self.help scene_class
- return Main[scene_class.to_s] rescue nil
- end # KEEP THIS METHOD #####################
- # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- class Scene_Base
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :scenebasestart_dehelpyo :start
- alias :updatesceneheppstuffz :update
- alias :terminateScenehelpstuffz :terminate
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def start
- scenebasestart_dehelpyo
- create_scene_help__stuffz
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def create_scene_help__stuffz
- return unless DSceneHelp.help(self.class.name)
- @scene_help_window = Scene_Help_Window.new
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update
- updatesceneheppstuffz
- update_scene_help_stuffz
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_scene_help_stuffz
- return unless @scene_help_window
- if Keys.trigger?(DSceneHelp::Key)
- if @scene_help_window.visible
- @scene_help_window.visible = false
- @scene_help_window.hide
- else
- @scene_help_window.visible = true
- @scene_help_window.show
- end
- end
- @scene_help_window.update
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def terminate
- dispose_scene_help__styffz
- terminateScenehelpstuffz
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def dispose_scene_help__styffz
- return unless @scene_help_window
- @scene_help_window.dispose
- end
- end
- #===============================================================================
- class Scene_Help_Window < Window_Base
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize
- s = SceneManager.scene.class.name
- l = DSceneHelp.help(s.to_s)[:lc]
- w = eval(DSceneHelp::Width)
- h = fitting_height(l)
- x = Graphics.width/2 - (w/2)
- y = Graphics.height/2 - (h/2)
- @text = DSceneHelp.help(s.to_s)[:txt]
- @line_counts = l
- super(x, y, w, h)
- self.visible = false
- self.z = 201
- refresh
- hide
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def clear
- @text = ''
- refresh
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def refresh
- contents.clear
- @line_counts.times do |i|
- contents.fill_rect(0,24*i,width-24,line_height-2,DSceneHelp::Box_Color)
- end
- @text.each do |line|
- change_color line[3]
- x = line[2] == 0 ? 4 : 0
- draw_text(x,line[1],width-24-x,line_height,line[0],line[2])
- end
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement