cooldoode325

CSCA Menu Organizer

Jan 25th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.89 KB | None | 0 0
  1. =begin
  2. CSCA Menu Organizer
  3. version: 1.0.6 (Released: July 20, 2013)
  4. Created by: Casper Gaming (http://www.caspergaming.com/)
  5.  
  6. This version supports:
  7. CSCA Encyclopedia w/ Bestiary (all versions)
  8. CSCA Dungeon Tools (v1.3b +)
  9. CSCA Treasure Maps (all versions)
  10. CSCA Achievements (all versions)
  11. CSCA SideQuests (all versions)
  12. CSCA Professions (all versions)
  13. CSCA Quest System (all versions)
  14.  
  15. COMPATIBILITY
  16. Note: If you are using a version of any CSCA script that adds itself to the menu,
  17. you'll need to turn that option off to be compatible with this script.
  18.  
  19. Should be compatible with almost any script. Compatible only for VXAce.
  20. IMPORTANT: ALL CSCA Scripts should be compatible with each other unless
  21. otherwise noted.
  22.  
  23. FFEATURES
  24. This script will allow you to easily add any CSCA Scripts to your main menu. It
  25. also allows you to change the default commands easily, as well as add an option
  26. to open the debug menu from the main menu during playtest mode.
  27.  
  28. SETUP
  29. Setup options below.
  30.  
  31. CREDIT:
  32. Free to use in noncommercial games if credit is given to:
  33. Casper Gaming (http://www.caspergaming.com/)
  34.  
  35. To use in a commercial game, please purchase a license here:
  36. http://www.caspergaming.com/licenses.html
  37.  
  38. TERMS:
  39. http://www.caspergaming.com/terms_of_use.html
  40. =end
  41. module CSCA
  42. module MENU
  43.  
  44. #Main Menu Options - changing these to true may increase compatibility with
  45. #custom menu scripts
  46. MAIN_COMMANDS = true # Add item, skill, equip, status to the menu?
  47. FORMATION_COMMAND = true # Add the formation command to the menu?
  48. ORIGINAL_COMMANDS = true # Add custom script commands to the menu?
  49. SAVE_COMMAND = true # Add the save command to the menu?
  50. END_COMMAND = true # Add the game end command to the menu?
  51.  
  52. # Leaving these as true may increase compatibility with custom menu scripts.
  53. # These only have an effect if MAIN_COMMANDS above is set to true.
  54. ITEM_ENABLED = true # Add Item to the menu?
  55. SKILL_ENABLED = true # Add Skill to the menu?
  56. EQUIP_ENABLED = true # Add Equip to the menu?
  57. STATUS_ENABLED = true # Add Status to the menu?
  58.  
  59. DEBUG = true # Add debug option to menu in playtest mode?
  60.  
  61. #Setting this to 0 may increase compatibility with custom menu scripts.
  62. LINES = 0 #Amount of commands to show before scrolling to show.
  63. #If set to 0, the window will show all commands without scrolling.
  64.  
  65.  
  66. #CSCA Script Setup
  67.  
  68. #The following commands require CSCA Encyclopedia
  69. #http://www.rpgmakervxace.net/topic/2775-csca-encyclopedia-w-bestiary-v20/
  70. ENCYCLOPEDIA = "Encyclopedia"
  71. INCLUDE_ENC = false # Include the CSCA Encyclopedia in the menu?
  72. ENC_SWITCH = 0 # Switch that shows/hides Encyclopedia in menu. 0 = always show
  73.  
  74. #The following commands require CSCA Dungeon Tools
  75. #http://www.rpgmakervxace.net/topic/2275-csca-dungeon-tools/
  76. DUNGEON_TOOLS = "Dungeon Tools"
  77. INCLUDE_DUN = false # Include the CSCA Dungeon Tools in the menu?
  78. DT_SWITCH = 0 # Switch that shows/hides Dungeon Tools in menu. 0 = always show
  79.  
  80. #The following commands require CSCA Treasure Maps
  81. #http://www.rpgmakervxace.net/topic/5388-csca-treasure-maps/
  82. TREASURE_MAPS = "Treasure Maps"
  83. INCLUDE_MAP = true # Include the CSCA Treasure Maps in the menu?
  84. MAP_SWITCH = 0 # Switch that shows/hides Treasure Maps in menu. 0 = always show
  85.  
  86. #The following commands require CSCA Achievements
  87. #http://www.rpgmakervxace.net/topic/5554-csca-achievements/
  88. ACHIEVEMENTS = "Achievements"
  89. INCLUDE_ACH = true # Include the CSCA Achievements in the menu?
  90. ACH_SWITCH = 0 # Switch that shows/hides Achievements in menu. 0 = always show
  91.  
  92. # The following commands require CSCA Quest System
  93. #coming soon
  94. QUESTS = "Quests"
  95. INCLUDE_QSY = false # Include CSCA Quest System in the menu?
  96. QSY_SWITCH = 0 # Switch that shows/hides Quest System in menu. 0 = always show
  97.  
  98. # The following commands require CSCA SideQuests
  99. #http://www.rpgmakervxace.net/topic/7837-csca-sidequestbulletin-board-system/
  100. SIDEQUESTS = "Sidequests"
  101. INCLUDE_SQ = false # Include CSCA SideQuests in the menu?
  102. SQ_SWITCH = 0 # Switch that shows/hides Sidequess in menu. 0 = always show
  103.  
  104. # The following commands require CSCA Professions
  105. #http://www.rpgmakervxace.net/topic/14734-csca-professions/
  106. PROFESSIONS = "Professions"
  107. INCLUDE_PRF = true # Include CSCA Professions in the menu?
  108. PRF_SWITCH = 0 # Switch that shows/hides Professions in menu. 0 = always show
  109.  
  110.  
  111.  
  112. # NOTE:
  113. #
  114. # This script will be updated consistently to include future CSCA scripts
  115. # that can go in the menu, however support for all custom scripts is not
  116. # planned. Yanfly already has a script for that, if that's what you want:
  117. # http://yanflychannel.wordpress.com/rmvxa/menu-scripts/ace-menu-engine/
  118. #
  119. # This script is just meant for those who just want to easily add CSCA
  120. # Scripts to the menu without all of the other features.
  121.  
  122. end
  123. end
  124. $imported = {} if $imported.nil?
  125. $imported["CSCA-MenuOrganizer"] = true
  126. #==============================================================================
  127. # ** Scene_Menu
  128. #------------------------------------------------------------------------------
  129. # Adds commands for CSCA Scripts.
  130. #==============================================================================
  131. class Scene_Menu < Scene_MenuBase
  132. #--------------------------------------------------------------------------
  133. # Alias Method; create command window
  134. #--------------------------------------------------------------------------
  135. alias :csca_create_command_window :create_command_window
  136. def create_command_window
  137. csca_create_command_window
  138. @command_window.set_handler(:cscadebug, method(:csca_debug_select)) if $TEST && CSCA::MENU::DEBUG
  139. @command_window.set_handler(:encyclopedia, method(:csca_encyclopedia_select)) if $imported["CSCA-Encyclopedia"] &&
  140. CSCA::MENU::INCLUDE_ENC
  141. @command_window.set_handler(:dungeontools, method(:csca_dt_select)) if $imported["CSCA-DungeonTools"] &&
  142. CSCA::MENU::INCLUDE_DUN
  143. @command_window.set_handler(:treasuremaps, method(:csca_tmap_select)) if $imported["CSCA-TreasureMaps"] &&
  144. CSCA::MENU::INCLUDE_MAP
  145. @command_window.set_handler(:achievements, method(:csca_ach_select)) if $imported["CSCA-Achievements"] &&
  146. CSCA::MENU::INCLUDE_ACH
  147. @command_window.set_handler(:quests, method(:csca_qsys_select)) if $imported["CSCA-QuestSystem"] &&
  148. CSCA::MENU::INCLUDE_QSY
  149. @command_window.set_handler(:sidequests, method(:csca_sq_select)) if $imported["CSCA-SideQuests"] &&
  150. CSCA::MENU::INCLUDE_SQ
  151. @command_window.set_handler(:professions, method(:csca_prf_select)) if $imported["CSCA-Professions"] &&
  152. CSCA::MENU::INCLUDE_PRF
  153.  
  154. end
  155. #--------------------------------------------------------------------------
  156. # Processing when Encyclopedia is selected
  157. #--------------------------------------------------------------------------
  158. def csca_encyclopedia_select
  159. SceneManager.call(Scene_CSCA_Encyclopedia)
  160. end
  161. #--------------------------------------------------------------------------
  162. # Processing when Dungeon Tools is selected
  163. #--------------------------------------------------------------------------
  164. def csca_dt_select
  165. SceneManager.call(CSCA_Scene_DungeonToolSelect)
  166. end
  167. #--------------------------------------------------------------------------
  168. # Processing when Treasure Maps is selected
  169. #--------------------------------------------------------------------------
  170. def csca_tmap_select
  171. SceneManager.call(Scene_CSCA_TreasureMaps)
  172. end
  173. #--------------------------------------------------------------------------
  174. # Processing when Debug is selected
  175. #--------------------------------------------------------------------------
  176. def csca_debug_select
  177. SceneManager.call(Scene_Debug)
  178. end
  179. #--------------------------------------------------------------------------
  180. # Processing when Achievements is selected
  181. #--------------------------------------------------------------------------
  182. def csca_ach_select
  183. SceneManager.call(CSCA_Scene_Achievements)
  184. end
  185. #--------------------------------------------------------------------------
  186. # Processing when Side Quests is selected
  187. #--------------------------------------------------------------------------
  188. def csca_sq_select
  189. SceneManager.call(CSCA_Scene_SidequestMenu)
  190. end
  191. #--------------------------------------------------------------------------
  192. # Processing when Professions is selected
  193. #--------------------------------------------------------------------------
  194. def csca_prf_select
  195. SceneManager.call(CSCA_Scene_Professions)
  196. end
  197. #--------------------------------------------------------------------------
  198. # Processing when Quest System is selected
  199. #--------------------------------------------------------------------------
  200. def csca_qsys_select
  201. SceneManager.call(CSCA_Scene_Quest)
  202. end
  203. end
  204. #==============================================================================
  205. # ** Window_MenuCommand
  206. #------------------------------------------------------------------------------
  207. # Displays commands for CSCA Scripts.
  208. #==============================================================================
  209. class Window_MenuCommand < Window_Command
  210. #--------------------------------------------------------------------------
  211. # Alias Method; make command list
  212. #--------------------------------------------------------------------------
  213. alias :csca_make_command_list :make_command_list
  214. def make_command_list
  215. if CSCA::MENU::MAIN_COMMANDS && CSCA::MENU::FORMATION_COMMAND &&
  216. CSCA::MENU::ORIGINAL_COMMANDS && CSCA::MENU::SAVE_COMMAND &&
  217. CSCA::MENU::END_COMMAND
  218. csca_make_command_list
  219. else
  220. add_main_commands if CSCA::MENU::MAIN_COMMANDS
  221. add_formation_command if CSCA::MENU::FORMATION_COMMAND
  222. add_original_commands if CSCA::MENU::ORIGINAL_COMMANDS
  223. add_save_command if CSCA::MENU::SAVE_COMMAND
  224. add_game_end_command if CSCA::MENU::END_COMMAND
  225. end
  226. end
  227. #--------------------------------------------------------------------------
  228. # Alias Method; add main commands
  229. #--------------------------------------------------------------------------
  230. alias :csca_main_commands :add_main_commands
  231. def add_main_commands
  232. if CSCA::MENU::ITEM_ENABLED && CSCA::MENU::SKILL_ENABLED && CSCA::MENU::EQUIP_ENABLED &&
  233. CSCA::MENU::STATUS_ENABLED
  234. csca_main_commands
  235. else
  236. add_command(Vocab::item, :item, main_commands_enabled) if CSCA::MENU::ITEM_ENABLED
  237. add_command(Vocab::skill, :skill, main_commands_enabled) if CSCA::MENU::SKILL_ENABLED
  238. add_command(Vocab::equip, :equip, main_commands_enabled) if CSCA::MENU::EQUIP_ENABLED
  239. add_command(Vocab::status, :status, main_commands_enabled) if CSCA::MENU::STATUS_ENABLED
  240. end
  241. end
  242. #--------------------------------------------------------------------------
  243. # Alias Method; add original commands
  244. #--------------------------------------------------------------------------
  245. alias :csca_commands :add_original_commands
  246. def add_original_commands
  247. add_command("Debug", :cscadebug) if $TEST && CSCA::MENU::DEBUG
  248. add_command(CSCA::MENU::ENCYCLOPEDIA, :encyclopedia) if $imported["CSCA-Encyclopedia"] &&
  249. CSCA::MENU::INCLUDE_ENC && csca_check_switch(CSCA::MENU::ENC_SWITCH)
  250. add_command(CSCA::MENU::DUNGEON_TOOLS, :dungeontools, csca_dt_enabled) if $imported["CSCA-DungeonTools"] &&
  251. CSCA::MENU::INCLUDE_DUN && csca_check_switch(CSCA::MENU::DT_SWITCH)
  252. add_command(CSCA::MENU::TREASURE_MAPS, :treasuremaps) if $imported["CSCA-TreasureMaps"] &&
  253. CSCA::MENU::INCLUDE_MAP && csca_check_switch(CSCA::MENU::MAP_SWITCH)
  254. add_command(CSCA::MENU::ACHIEVEMENTS, :achievements) if $imported["CSCA-Achievements"] &&
  255. CSCA::MENU::INCLUDE_ACH && csca_check_switch(CSCA::MENU::ACH_SWITCH)
  256. add_command(CSCA::MENU::SIDEQUESTS, :sidequests) if $imported["CSCA-SideQuests"] &&
  257. CSCA::MENU::INCLUDE_SQ && csca_check_switch(CSCA::MENU::SQ_SWITCH)
  258. add_command(CSCA::MENU::PROFESSIONS, :professions) if $imported["CSCA-Professions"] &&
  259. CSCA::MENU::INCLUDE_PRF && csca_check_switch(CSCA::MENU::PRF_SWITCH)
  260. add_command(CSCA::MENU::QUESTS, :quests) if $imported["CSCA-QuestSystem"] &&
  261. CSCA::MENU::INCLUDE_QSY && csca_check_switch(CSCA::MENU::QSY_SWITCH)
  262. csca_commands
  263. end
  264. #--------------------------------------------------------------------------
  265. # Alias Method; visible line number
  266. #--------------------------------------------------------------------------
  267. alias :csca_line_number :visible_line_number
  268. def visible_line_number
  269. if CSCA::MENU::LINES > 0
  270. CSCA::MENU::LINES
  271. else
  272. csca_line_number
  273. end
  274. end
  275. #--------------------------------------------------------------------------
  276. # Check if command's switch is on (or 0)
  277. #--------------------------------------------------------------------------
  278. def csca_check_switch(switch_id)
  279. switch_id == 0 ? true : $game_switches[switch_id]
  280. end
  281. #--------------------------------------------------------------------------
  282. # check if Dungeon Tools are enabled
  283. #--------------------------------------------------------------------------
  284. def csca_dt_enabled
  285. $game_switches[CSCA_DUNGEON_TOOLS::ON_OFF] && csca_check_tools
  286. end
  287. #--------------------------------------------------------------------------
  288. # Check if player has at least one Dungeon Tool
  289. #--------------------------------------------------------------------------
  290. def csca_check_tools
  291. return $game_switches[CSCA_DUNGEON_TOOLS::ARROW] ||
  292. $game_switches[CSCA_DUNGEON_TOOLS::BOMB] ||
  293. $game_switches[CSCA_DUNGEON_TOOLS::HOOKSHOT] ||
  294. $game_switches[CSCA_DUNGEON_TOOLS::BOOMERANG] ||
  295. $game_switches[CSCA_DUNGEON_TOOLS::RESET]
  296. end
  297. end
Advertisement
Add Comment
Please, Sign In to add comment