Introduction Makes a message window pop up in the menu when certain command indexes are highlighted. Useful if you want to warn the user of any penalties for changing the difficulty in-game, or as part of a menu guide system, or whatever.
Features Nut much to say; it's a window that appear in the main menu only when certain commands are highlighted.
Script
Munkis' Main Menu Message
CODE
#------------------------------------------------------------------------------- # * Munkis' Menu Message # * V 1.0 # * Made by munkis # ╔══════════╗ # ║ FEATURES ║ # ╚══════════╝ # * Makes a message window pop up when you highlight certain items in the # menu. Useful if you have a difficulty selector and you want to penalize # the player for changing it mid-game. # # * V 1.0: Initial release #------------------------------------------------------------------------------- module MNK_Menu_Pop WINDOWS = [] #--->Don't touch. #------------------------------------------------------------------------------ # * START Config #------------------------------------------------------------------------------ # * This is the config area. Here's a list of what everything does: # # 1: Pop-up window x # 2: Pop-up window y # 3: Pop-up window width # 4: Pop-up window height # 5[0..n]: Pop-up window icon # 6[0..n]: Pop-up window messages # 7[0..n]: Command window indexes that will make the window appear when # highlighted #------------------------------------------------------------------------------ WINDOWS[0] = 0 WINDOWS[1] = 0 WINDOWS[2] = Graphics.width WINDOWS[3] = 55 WINDOWS[4] = [] #--->Don't touch. WINDOWS[5] = [] #--->Don't touch. WINDOWS[6] = [] #--->Don't touch. #------------------------------------------------------------------------------ # * START Icon Config #------------------------------------------------------------------------------ # * This is the icon config area. This array needs to have icon indexes for # ALL of the commands in the menu, not just the particular indexes listed in # the WINDOWS[6] array. Just use zero for the commands that don't have a # window pop-up. #------------------------------------------------------------------------------ WINDOWS[4][0] = 0 WINDOWS[4][1] = 137 WINDOWS[4][2] = 0 WINDOWS[4][3] = 142 WINDOWS[4][4] = 0 WINDOWS[4][6] = 0 #------------------------------------------------------------------------------ # * END Icon Config #------------------------------------------------------------------------------ # * START Message Config #------------------------------------------------------------------------------ # * This is the message config area. This array needs to have strings for ALL # of the commands in the menu, not just the particular indexes listed in the # WINDOWS[6] array. Just use "" for the commands that don't have a window # pop-up. #------------------------------------------------------------------------------ WINDOWS[5][0] = "" WINDOWS[5][1] = "Look at and use skills. MEDIC!!" WINDOWS[5][2] = "" WINDOWS[5][3] = "Can you show me where it hurts?" WINDOWS[5][4] = "" WINDOWS[5][6] = "" #------------------------------------------------------------------------------ # * END Message Config #------------------------------------------------------------------------------ # * START Index List Config #------------------------------------------------------------------------------ # * This is the index list config config area. This array only controls what # commands get windows, it doesn't have anything to do with the text (that's # explained above). #------------------------------------------------------------------------------ WINDOWS[6][0] = 1 WINDOWS[6][1] = 3 #------------------------------------------------------------------------------ # * END Index List Config #------------------------------------------------------------------------------ # * END Config #------------------------------------------------------------------------------ end class Menu_Pop < Window_Base def initialize super(MNK_Menu_Pop::WINDOWS[0],MNK_Menu_Pop::WINDOWS[1],MNK_Menu_Pop::WINDOWS[2],MNK_Menu_Pop::WINDOWS[3]) self.visible = false end def show_message(window_contents) self.visible = true create_contents refresh(window_contents) end def refresh(window_contents) self.contents.clear x = 0 draw_icon (MNK_Menu_Pop::WINDOWS[4][window_contents], x, 0) x += Graphics.width-55 draw_icon (MNK_Menu_Pop::WINDOWS[4][window_contents], x, 0) x = 24 self.contents.draw_text(x-39, 0, Graphics.width, WLH, MNK_Menu_Pop::WINDOWS[5][window_contents], 1) return end end class Scene_Menu < Scene_Base alias munkis_menupop_start start alias munkis_menupop_update update alias munkis_menupop_terminate terminate def start munkis_menupop_start @menupop = Menu_Pop.new() end def show_message(window_contents) @menupop.show_message(@window_contents) end def update munkis_menupop_update if @window_contents != @command_window.index @window_contents = @command_window.index end for i in 0...MNK_Menu_Pop::WINDOWS[6].size if @window_contents == MNK_Menu_Pop::WINDOWS[6][i] self.show_message(@window_contents) break else @menupop.visible = false end end @menupop.update end def terminate munkis_menupop_terminate @menupop.dispose return end end
Customization Apart from the usual X,Y,width and height of the window, you can also change what messages/icons are used in the window.
Compatibility No known issues.
Screenshot Not sure if that's necessary...
DEMO ...or that either.
Installation Place in MATERIALS, above MAIN.
FAQ Q: ZOMG teh scriptz doesn't werk!!! A: First of all, be more specific. Second, all reports typed in chat-speak or 1337-speak will be ignored.
Terms and Conditions I don't mind this script being posted or linked on other sites AS LONG AS YOU GIVE CREDIT!!! Same goes for using this in your project. Contact me if you want to use this in a commercial project.
Credits Credit goes to me for the script.
Pera
Feb 8 2012, 11:39 AM
Nice script, and handy too. I think that this can be used as a quick info about something like equip, status... KUTGW (Keep Up The Good Work)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.