[XP] Sub Menu

Started by monkeydash, January 16, 2011, 03:48:40 pm

Previous topic - Next topic

monkeydash

January 16, 2011, 03:48:40 pm Last Edit: January 22, 2011, 04:25:14 pm by monkeydash
Sub Menu
Authors: Monkeydashunderscore
Version: 1.0
Type: Menu
Key Term: Custom Menu System



Introduction

Creates a SubMenu to tidy up your main one if you are using a lot of scripts and add ons.


Features


  • One SubMenu




Screenshots

N/A Looks just like a regular menu. I'm sure you can edit it to make it snazzy though.


Demo

None Required


Script


Spoiler: ShowHide

#==================================
#
#Monkeydashunderscore's SubMenu
#
#If you have a lot of add ons and your main menu is getting crowded, then this
#is what you need.
#
#This is currently set up to work with
#
#Quest log and Achievements by game_guy
#Passive Augments by Xelias
#Books by Forever Zero
#
#So if you have those installed then you are nearly done.
#=================
#Config instructions below.
#
#FIRST go to Scene_Menu (THIS SECTION TAKEN FROM BLIZZARDS TRICKS)
#
#    Find where it says:
#
#    s1 = $data_system.words.item
#    s2 = $data_system.words.skill
#    s3 = $data_system.words.equip
#    s4 = "Status"
#    s5 = "Save"
#    s6 = "End Game"
#    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
#
#    EDIT this so it looks like this:
#
#    s1 = $data_system.words.item
#    s2 = $data_system.words.skill
#    s3 = $data_system.words.equip
#    s4 = "Status"
#    s5 = "NEW_OPTION"
#    s6 = "Save"
#    s7 = "End Game"
#    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
#
#    See the added option and the 's7' in the brackets at the end.
#    Change NEW_OPTION to the name of what you want your Submenu to be for
#    example "Info".
#
#   Now find:
#
#   when 4  # save
#        if $game_system.save_disabled
#          $game_system.se_play($data_system.buzzer_se)
#          return
#        end
#        $game_system.se_play($data_system.decision_se)
#        $scene = Scene_Save.new
#      when 5  # end game
#        $game_system.se_play($data_system.decision_se)
#        $scene = Scene_End.new
#      end
#
#    CHANGE it to:
#
#   when 4  # SubMenu
#        $game_system.se_play($data_system.decision_se)
#        $scene = Scene_SubMenu.new
#      when 5  # save
#        if $game_system.save_disabled
#          $game_system.se_play($data_system.buzzer_se)
#          return
#        end
#        $game_system.se_play($data_system.decision_se)
#        $scene = Scene_Save.new
#      when 6  # end game
#        $game_system.se_play($data_system.decision_se)
#        $scene = Scene_End.new
#      end
#
#      THIS ADDS THE SUBMENU TO THE MAIN MENU
#===================
#      USING THE SAME PRINCIPLE EDIT THIS SUBMENU SCRIPT TO ADD ANY OTHER SCRIPTS
#
#      IN YOUR OTHER SCRIPTS FIND A LINE THAT IS SOMETHING LIKE
#
#     $scene = Scene_Menu.new
#
#    OR
#
#    $scene = Scene_Map.new
#
#   CHANGE IT TO
#
#    $scene = Scene_SubMenu.new
#
#   THEN FIND THE CLASS NAME OF THE OTHER SCRIPT SO YOU KNOW WHAT TO ADD TO THIS.
#
#===================================


class Scene_SubMenu

 def initialize(menu_index = 0)
   @menu_index = menu_index
   end

 def main
 
   s1 = "Quests"
   s2 = "Notes"
   s3 = "Perks"
   s4 = "Achievements"
 
   @command_window = Window_Command.new(160, [s1, s2, s3, s4])
   @command_window.index = @menu_index
 
     # Make status window
   @status_window = Window_MenuStatus.new
   @status_window.x = 160
   @status_window.y = 0
   
   Graphics.transition
loop do
 Graphics.update
 Input.update
 update

 if $scene != self
   break
 end
end


Graphics.freeze
 @command_window.dispose
 @status_window.dispose
end
 
def update
 @command_window.update
 @status_window.update

 if @command_window.active
   update_command
   return
 end

 if @status_window.active
   update_status
   return
 end
end

def update_command
 if Input.trigger?(Input::B)
   $game_system.se_play($data_system.cancel_se)
   $scene = Scene_Menu.new
   return
 end
 
if Input.trigger?(Input::C)
 if $game_party.actors.size == 0 and @command_window.index < 4
   $game_system.se_play($data_system.buzzer_se)
   return
 end
 case @command_window.index
 when 0
 $game_system.se_play($data_system.decision_se)
 $scene = Scene_Quest.new

  when 1
 $game_system.se_play($data_system.decision_se)
 $scene = Scene_Book.new

 when 2
 $game_system.se_play($data_system.decision_se)
 $scene = Scene_Passive.new

 when 3
 $game_system.se_play($data_system.decision_se)
 $scene = Scene_Achievements.new

 end
   return
 end
end

def update_status
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Make command window active
     @command_window.active = true
     @status_window.active = false
     @status_window.index = -1
     return
   end
 end
 end



Instructions

In the Script


Compatibility

Should work with anything. Though if you have a script that affects your Main Menu, you may need to edit that instead of Scene_Menu


Credits and Thanks


  • Monkeydashunderscore

  • Blizzard




Wizered67

You should put the script in code tags rather than quotes. It would look much better in my opinion. Anyway, decent script. I guess it could be helpful if you need a second menu.

Blizzard

Key Term "Menu" does not exist.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

monkeydash

Sorry. Wasnt sure what that was.

Blizzard

January 17, 2011, 05:10:53 am #4 Last Edit: January 22, 2011, 05:23:33 am by Blizzard
Now you removed the Key Term completely. :/ Please take a better look at the template.

EDIT: Now you messed up the header big time. I guess you just don't want your script to go into the database.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

monkeydash

If that's not right, then I don't know what is.

The Niche

I hate to disrupt your learning curve and stuff but this really should go in the database. The problem is that you fucked up the size for the key term. Also, I believe that the version number should be 1.0
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

monkeydash

But the Key Term has no special size in the template  :???:

ForeverZer0

Quote from: monkeydash on January 22, 2011, 04:24:39 pm
But the Key Term has no special size in the template  :???:


It will be normal sized since the large font size is escaped before it: [/size]
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

Now it's correct. "Key Term" has to be written exactly like that. Not "KEY TERM", not "Key term", not "key term" but "Key Term".
Yes, it has no special size, but the capitalization of the letters matter.
It's ok to have anything as version, it doesn't even have to be a number (there is a script with "unknown" as version in the database if I remember right). Only the space after the colon is important as well.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

The Niche

Duuuude...when I eventually start scripting, that is gonna be my biggest problem...>.<
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

monkeydash

QuoteNow you messed up the header big time.


This seems like an exaggeration considering all that was wrong was that there was a 't' instead of a 'T'.

Had me panicking.

Blizzard

Actually I wrote that when I saw that you wrote it all in caps and had 2 key terms or something like that.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

monkeydash

Did I? Oh well. Its sorted now