Advertisement
Dekita

scenehelp1.0

Mar 29th, 2014
739
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.04 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Scene Help
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  7. # -- Level : Easy / Normal
  8. # -- Requires : $D13x Core v2.4+
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Scene_Help]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 24/o3/2o14 - Started, Finished,
  21. #
  22. #===============================================================================
  23. # ☆ Introduction
  24. #-------------------------------------------------------------------------------
  25. # This script allows you to insert a customizable help window into any scene.
  26. # No Coding Knowledge Required!
  27. #
  28. #===============================================================================
  29. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  30. #===============================================================================
  31. # 1. You MUST give credit to "Dekita" !!
  32. # 2. You are NOT allowed to repost this script.(or modified versions)
  33. # 3. You are NOT allowed to convert this script.
  34. # 4. You are NOT allowed to use this script for Commercial games.
  35. # 5. ENJOY!
  36. #
  37. # "FINE PRINT"
  38. # By using this script you hereby agree to the above terms and conditions,
  39. # if any violation of the above terms occurs "legal action" may be taken.
  40. # Not understanding the above terms and conditions does NOT mean that
  41. # they do not apply to you.
  42. # If you wish to discuss the terms and conditions in further detail you can
  43. # contact me at http://dekitarpg.wordpress.com/
  44. #
  45. #===============================================================================
  46. # ☆ Instructions
  47. #-------------------------------------------------------------------------------
  48. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  49. # Place Below $D13x Core Script.
  50. #
  51. #===============================================================================
  52. module DSceneHelp
  53. #===============================================================================
  54. #-----------------------------------------------------------------------------
  55. # The key that toggles the help window on/off.
  56. #-----------------------------------------------------------------------------
  57. Key = :H
  58. #-----------------------------------------------------------------------------
  59. # The width of the window (gets eval'ed)
  60. #-----------------------------------------------------------------------------
  61. Width = "Graphics.width / 5 * 3"
  62. #-----------------------------------------------------------------------------
  63. # The color of the background box within the window
  64. #-----------------------------------------------------------------------------
  65. Box_Color = Color.new(0,0,0,128)
  66. #-----------------------------------------------------------------------------
  67. Main={# Main settings ::
  68. # It is here you define the help windows hieight, text and the scene that it
  69. # will be shown in.
  70. #-----------------------------------------------------------------------------
  71. # "Scene_Name" => {
  72. # :lc => number of visible lines in window.
  73. # :txt => [
  74. # ["Your Text Goes Here" , y, align, color],
  75. # ],
  76. # } # << End Scene_Name
  77. #-----------------------------------------------------------------------------
  78. "Scene_Status" => {
  79. :lc => 3,
  80. :txt => [
  81. ["--HELP--" , 0, 1, Text_Color::Gold ],
  82. ["Key To Close Help:" , 24, 0, Text_Color::White],
  83. ["'H'" , 24, 2, Text_Color::Red],
  84. ["Key To Exit:" , 48, 0, Text_Color::White],
  85. ["'ESC'" , 48, 2, Text_Color::Red],
  86. ], # << :txt
  87. }, # << "Scene_Status"
  88. "Scene_Equip" => {
  89. :lc => 5,
  90. :txt => [
  91. ["--HELP--" , 0, 1, Text_Color::Gold ],
  92. ["Left Shift:" , 24, 0, Text_Color::White],
  93. ["Change Stat Page Down", 24, 2, Text_Color::Red],
  94. ["Right Shift:" , 48, 0, Text_Color::White],
  95. ["Change Stat Page Up" , 48, 2, Text_Color::Red],
  96. ["Tab:" , 72, 0, Text_Color::White],
  97. ["Toggle Actor/Weapon Stats", 72, 2, Text_Color::Red],
  98. ["'H' Key:" , 96, 0, Text_Color::White],
  99. ["Close Help Info", 96, 2, Text_Color::Red],
  100. ], # << :txt
  101. }, # << "Scene_Equip"
  102. "Scene_Map" => {
  103. :lc => 4,
  104. :txt => [
  105. ["--HELP--" , 0, 1, Text_Color::Gold ],
  106. ["-Removed For Now-" , 24, 1, Text_Color::Red],
  107. ], # << :txt
  108. }, # << "Custom_Scene_Name"
  109. #-----------------------------------------------------------------------------
  110. # << Add More "Scene_Name" here
  111. #-----------------------------------------------------------------------------
  112.  
  113.  
  114. }# << Main -------------------------------------------------------------------
  115. # Do Not Modify This Method!
  116. #-----------------------------------------------------------------------------
  117. def self.help scene_class
  118. return Main[scene_class.to_s] rescue nil
  119. end # KEEP THIS METHOD #####################
  120. # CUSTOMISATION END #
  121. end #####################
  122. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  123. # #
  124. # http://dekitarpg.wordpress.com/ #
  125. # #
  126. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  127. #===============================================================================#
  128. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  129. # YES?\.\. #
  130. # OMG, REALLY? \| #
  131. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  132. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  133. #===============================================================================#
  134. class Scene_Base
  135. #===============================================================================
  136. #-----------------------------------------------------------------------------
  137. #
  138. #-----------------------------------------------------------------------------
  139. alias :scenebasestart_dehelpyo :start
  140. alias :updatesceneheppstuffz :update
  141. alias :terminateScenehelpstuffz :terminate
  142. #-----------------------------------------------------------------------------
  143. #
  144. #-----------------------------------------------------------------------------
  145. def start
  146. scenebasestart_dehelpyo
  147. create_scene_help__stuffz
  148. end
  149. #-----------------------------------------------------------------------------
  150. #
  151. #-----------------------------------------------------------------------------
  152. def create_scene_help__stuffz
  153. return unless DSceneHelp.help(self.class.name)
  154. @scene_help_window = Scene_Help_Window.new
  155. end
  156. #-----------------------------------------------------------------------------
  157. #
  158. #-----------------------------------------------------------------------------
  159. def update
  160. updatesceneheppstuffz
  161. update_scene_help_stuffz
  162. end
  163. #-----------------------------------------------------------------------------
  164. #
  165. #-----------------------------------------------------------------------------
  166. def update_scene_help_stuffz
  167. return unless @scene_help_window
  168. if Keys.trigger?(DSceneHelp::Key)
  169. if @scene_help_window.visible
  170. @scene_help_window.visible = false
  171. @scene_help_window.hide
  172. else
  173. @scene_help_window.visible = true
  174. @scene_help_window.show
  175. end
  176. end
  177. @scene_help_window.update
  178. end
  179. #-----------------------------------------------------------------------------
  180. #
  181. #-----------------------------------------------------------------------------
  182. def terminate
  183. dispose_scene_help__styffz
  184. terminateScenehelpstuffz
  185. end
  186. #-----------------------------------------------------------------------------
  187. #
  188. #-----------------------------------------------------------------------------
  189. def dispose_scene_help__styffz
  190. return unless @scene_help_window
  191. @scene_help_window.dispose
  192. end
  193. end
  194. #===============================================================================
  195. class Scene_Help_Window < Window_Base
  196. #===============================================================================
  197. #-----------------------------------------------------------------------------
  198. #
  199. #-----------------------------------------------------------------------------
  200. def initialize
  201. s = SceneManager.scene.class.name
  202. l = DSceneHelp.help(s.to_s)[:lc]
  203. w = eval(DSceneHelp::Width)
  204. h = fitting_height(l)
  205. x = Graphics.width/2 - (w/2)
  206. y = Graphics.height/2 - (h/2)
  207. @text = DSceneHelp.help(s.to_s)[:txt]
  208. @line_counts = l
  209. super(x, y, w, h)
  210. self.visible = false
  211. self.z = 201
  212. refresh
  213. hide
  214. end
  215. #-----------------------------------------------------------------------------
  216. #
  217. #-----------------------------------------------------------------------------
  218. def clear
  219. @text = ''
  220. refresh
  221. end
  222. #-----------------------------------------------------------------------------
  223. #
  224. #-----------------------------------------------------------------------------
  225. def refresh
  226. contents.clear
  227. @line_counts.times do |i|
  228. contents.fill_rect(0,24*i,width-24,line_height-2,DSceneHelp::Box_Color)
  229. end
  230. @text.each do |line|
  231. change_color line[3]
  232. x = line[2] == 0 ? 4 : 0
  233. draw_text(x,line[1],width-24-x,line_height,line[0],line[2])
  234. end
  235. end
  236. end
  237. #==============================================================================#
  238. # http://dekitarpg.wordpress.com/ #
  239. #==============================================================================#
  240. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement