UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Add a custom sub menu to your Main Menu and add sub menus to that menu + more

broken avatar :(
Created 6 years ago
by AllMoDs
0 Members and 1 Guest are viewing this topic.
3,020 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 September 2015
Last active: 3 weeks ago
Posts
256
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
Signature
×
AllMoDs's Groups
redoing some of this menu is in its own menu file  by its self now

this part is for adding a  sub menu to your Main Menu 
warning   do not Precache the pics  you use will get error in coop sooner or latter they will still show
pics
Spoiler: click to open...



follow vid



menu
Spoiler: click to open...
#define    CHOICE_DBZ_1      5
#define    CHOICE_DBZ_2      10
   menuDef
   {
      name         credits_menu
      fullScreen      1            
      rect         0 0 640 480   HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN         // Size and position of the menu
      focusColor      COLOR_FOCUSED   // Menu focus color for text and items
      style         WINDOW_STYLE_SHADER
      background      "sslmenu"
      visible       1
      onOpen
      {      
            setdvar sub_menu "1";
               menuDef
              {
               ///////////////////////////////////////////////////////////
               /////////////////////////pics//////////////////////////
               itemDef                                                      
               {                                                         
                  name         "AllMoDs_Menu_0_pic"  // NEEDS TO BE DONT EDET
                  rect         10 -70 340 280   HORIZONTAL_ALIGN_CENTER HORIZONTAL_ALIGN_CENTER   
                  forecolor      1 1 1 1                               //ALLMoDs\\
                  style         WINDOW_STYLE_SHADER
                  background      "logo_cod2"
                  visible when   (localVarInt( ui_highlight ) == 15);
                  
               }
               itemDef                                                      
               {                                                         
                  name         "AllMoDs_Menu_1_pic" 
                  rect         10 -70 340 280   HORIZONTAL_ALIGN_CENTER HORIZONTAL_ALIGN_CENTER   
                  forecolor      1 1 1 1                               //ALLMoDs\\
                  style         WINDOW_STYLE_SHADER
                  background      "logo_cod2"
                  visible when   (localVarInt( ui_highlight ) == 14);
                  
               }
               itemDef                                                      
               {                                                         
                  name         "AllMoDs_Menu_2_pic"
                  rect         10 -70 340 280   HORIZONTAL_ALIGN_CENTER HORIZONTAL_ALIGN_CENTER   
                  forecolor      1 1 1 1                               //ALLMoDs\\
                  style         WINDOW_STYLE_SHADER
                  background      "specialty_db1"
                  visible when   (localVarInt( ui_highlight ) == 6);
                  
               }
               itemDef                                                      
               {                                                         
                  name         "AllMoDs_Menu_3_pic"
                  rect         10 -70 340 280   HORIZONTAL_ALIGN_CENTER HORIZONTAL_ALIGN_CENTER   
                  forecolor      1 1 1 1                               //ALLMoDs\\
                  style         WINDOW_STYLE_SHADER
                  background      "specialty_db2"
                  visible when   (localVarInt( ui_highlight ) == 7);
                  decoration
               }
               itemDef                                                      
               {                                                         
                  name         AllMoDs_Menu_4_pic      
                  rect         10 -70 340 280   HORIZONTAL_ALIGN_CENTER HORIZONTAL_ALIGN_CENTER   
                  forecolor      1 1 1 1      
                  style         WINDOW_STYLE_SHADER
                  background      "specialty_db3"
                  visible when   (localVarInt( ui_highlight ) == 8);
                  decoration
               }
               itemDef                                                      
               {                                                         
                  name         "AllMoDs_Menu_5_pic"
                  rect         10 -70 340 280   HORIZONTAL_ALIGN_CENTER HORIZONTAL_ALIGN_CENTER   
                  forecolor      1 1 1 1                               //ALLMoDs\\
                  style         WINDOW_STYLE_SHADER
                  background      "specialty_db4"
                  visible when   (localVarInt( ui_highlight ) == 9);
                  decoration
               }
               itemDef                                                      
               {                                                         
                  name         AllMoDs_Menu_6_pic      
                  rect         10 -70 340 280   HORIZONTAL_ALIGN_CENTER HORIZONTAL_ALIGN_CENTER   
                  forecolor      1 1 1 1      
                  style         WINDOW_STYLE_SHADER
                  background      "specialty_db5"
                  visible when   (localVarInt( ui_highlight ) == 10);
                  decoration
               }
               /////////////////////////pics END//////////////////////////
               ///////////////////////////////////text////////////////////////////////////////////
               itemDef
               {
                  name         "AllMoDs_Menu_1_text"
                  rect         -285 -285 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
                  textscale      0.5
                  textstyle      ITEM_TEXTSTYLE_SHADOWEDMORE
                  textfont      UI_FONT_OBJECTIVE
                  textalign      ITEM_ALIGN_CENTER
                  forecolor      1 1 1 1
                  exp text      ("mouse over 1st opt ")
                  visible when   (localVarInt( ui_highlight ) == 6);
                  decoration
               }
               itemDef
               {
                  name         "AllMoDs_Menu_2_text"
                  rect         -285 -285 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
                  textscale      0.5
                  textstyle      ITEM_TEXTSTYLE_SHADOWEDMORE
                  textfont      UI_FONT_OBJECTIVE
                  textalign      ITEM_ALIGN_CENTER
                  forecolor      1 1 1 1
                  exp text      ("mouse over 2nd opt ")
                  visible when   (localVarInt( ui_highlight ) == 7);
                  decoration
               }
               
               itemDef
               {
                  name         "AllMoDs_Menu_3_text"
                  rect         -285 -285 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
                  textscale      0.5
                  textstyle      ITEM_TEXTSTYLE_SHADOWEDMORE
                  textfont      UI_FONT_OBJECTIVE
                  textalign      ITEM_ALIGN_CENTER
                  forecolor      1 1 1 1
                  exp text      ("mouse over 3rd opt ")
                  visible when   (localVarInt( ui_highlight ) == 8);
                  decoration
               }
               
               itemDef
               {
                  name         "AllMoDs_Menu_4_text"
                  rect         -285 -285 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
                  textscale      0.5
                  textstyle      ITEM_TEXTSTYLE_SHADOWEDMORE
                  textfont      UI_FONT_OBJECTIVE
                  textalign      ITEM_ALIGN_CENTER
                  forecolor      1 1 1 1
                  exp text      ("mouse over 4th opt ")
                  visible when   (localVarInt( ui_highlight ) == 9);
                  decoration
               }
               
               itemDef
               {
                  name         "AllMoDs_Menu_5_text"
                  rect         -285 -285 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
                  textscale      0.5
                  textstyle      ITEM_TEXTSTYLE_SHADOWEDMORE
                  textfont      UI_FONT_OBJECTIVE
                  textalign      ITEM_ALIGN_CENTER
                  forecolor      1 1 1 1
                  exp text      ("mouse over 5th opt ")
                  visible when   (localVarInt( ui_highlight ) == 10);
                  decoration
               }
               itemDef
               {
                  name         "AllMoDs_Menu_6_text"
                  rect         -285 -285 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
                  textscale      0.5
                  textstyle      ITEM_TEXTSTYLE_SHADOWEDMORE
                  textfont      UI_FONT_OBJECTIVE
                  textalign      ITEM_ALIGN_CENTER
                  forecolor      1 1 1 1
                  exp text      ("use unused buttons only")
                  visible when   (localVarInt( ui_highlight ) == 1);
                  decoration
               }
               itemDef
               {
                  name         "AllMoDs_Menu_7_text"
                  rect         -285 -285 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
                  textscale      0.5
                  textstyle      ITEM_TEXTSTYLE_SHADOWEDMORE
                  textfont      UI_FONT_OBJECTIVE
                  textalign      ITEM_ALIGN_CENTER
                  forecolor      1 1 1 1
                  exp text      ("use unused buttons only")
                  visible when   (localVarInt( ui_highlight ) == 2);
                  decoration
               }
               /////////////////////////text END//////////////////////////
               ///////////////////////////////////////////////////////////////////////////////
               CHOICE_BUTTON_VIS( 14, "^3EXIT Dragonball Z  Settings ", close credits_menu;, when(dvarInt("sub_menu") == 1 ); )
               CHOICE_BIND( 1, "^3SCUOTER SCAN",  "openScriptMenu AllMoDs_menu allmodsgscnotify", ; )
               CHOICE_KEYBINDHELP
               CHOICE_BIND( 2, "^3Instant Transmission",  "openScriptMenu AllMoDs_menu Transmission", ; )
               CHOICE_KEYBINDHELP
               CHOICE_SEPARATOR( CHOICE_DBZ_1 )
               CHOICE_BUTTON_VIS( 6, "^5thing to set", close credits_menu, when(dvarInt("sub_menu") == 1 ); )            
               CHOICE_BUTTON_VIS( 7, "^4thing to set", close credits_menu, when(dvarInt("sub_menu") == 1 ); )            
               CHOICE_BUTTON_VIS( 8, "^7thing to set", close credits_menu, when(dvarInt("sub_menu") == 1 ); )            
               CHOICE_BUTTON_VIS( 9, "^2thing to set", close credits_menu, when(dvarInt("sub_menu") == 1 ); )
               CHOICE_BUTTON_VIS( 10, "^6thing to set", close credits_menu, when(dvarInt("sub_menu") == 1 ); )            
               CHOICE_SEPARATOR( CHOICE_DBZ_2 )
               
            }
            
      }
 // close credits_menu

main menu button code
Spoiler: click to open...
CHOICE_BUTTON( 8, "^3Dragonball Z  Settings ", open credits_menu; )

this part is for adding sub menus to the  menu game types[like gun game] ,normal , hard mode[zombies  get more heath per round]
:(
We're sorry.
The embdedded media couldn't be retrieved.
View reason
The response was empty.
View media in new tab



sub menu dvars i used in vid
Spoiler: click to open...
setdvar sub_menu "1";

CHOICE_BUTTON_VIS  dvar
when(dvarInt("sub_menu") == ? ) // ? = what ever sub menu your on

pic and tex devar
(dvarInt("sub_menu") == ? ) // ? =  what ever sub menu your on


this part is  for adding new button to your mod to pick up in gsc

1st way adds it to controller settings combat less steps  and easy even for noobs


pic
Spoiler: click to open...
Spoiler: click to open...
creds
AllMoDS
offthewall
BluntStuffy


Step 1
download this gsc put in raw\ui   and replace the 1 that's there //back up old 1 if you like

[/center]


on line 69 you will see this
Spoiler: click to open...
CHOICE_BIND( 33, "^3your button name here",  "openScriptMenu AllMoDs_menu allmodsgscnotify", ; )

replace this
^3your button name here

the ^3 is for color of text

step 2
add this to mod.csv
Spoiler: click to open...
menufile,ui/options_shoot_pc.menu
step 3

setting up the GSc to be notified of the button being pressed
you set with new button you set on the main menu in game // just click it in game on mane menu  and push a button dont use already used buttons when you make your mod every player will need to set what ever buttons they want
will notified  a gsc the same no matter what is picked

in gsc use this setup to pick up the new button being pressed and what you want in it and it can be looped

Spoiler: click to open...
whatever()
{
    self endon("disconnect");
   for(;;)
   {
      self waittill("menuresponse",menu,response);
      {
         if(response == "allmodsgscnotify")
         {
            iprintlnbold("test new button "); // remove after testing
                                your code her
         }
      }
      wait 0.05;
   }
}
thats it all dun build your mod set button on main menu go in game test your new button out
if used cred all above in creds




2nd way is more steps  but adds new button to main menu & BluntStuffy did a tut on this 1st
pic

Spoiler: click to open...

Spoiler: click to open...
creds
BluntStuffy did a tut on this 1st

I had to make this for my mod I needed one button that's not used by default and can be picked up by GSC
I used all the normal ones up like AdsButtonPressed() FragButtonPressed() the only downside I see now is it doesn't save the button after the game is closed 4 some people tested with 5 diff testers
and yes this works coop as  long as they set a button on main menu like in the pic  below dont mater what is set will still
notified a gsc its bin pressed

this can also be set up to set dvars and other stuff pm me for info on that


if you need coop testers check this discord its where i get mine
https://discord.gg/PncbcvT


vid of a coop test

step 1
go to raw/ui/main.menu  // or the name of a  main menu you made or have if  not go to raw/ui/main.menu
open it look for this line
Spoiler: click to open...
"@MENU_QUIT"


will look like this but a number where ? is mine is on line 523 yours will be  around same place i added other stuff to my main.menu needs to be under #ifdef PC some ways down


Spoiler: click to open...
CHOICE_BUTTON_VIS( ?, "@MENU_QUIT", open quit_popmenu, when( !localvarBool( ui_hideBack ) ); )

step 2
put this right above it
Spoiler: click to open...
CHOICE_BIND( ?, "button name here", "openScriptMenu allmods_menu allmodsgscnotify", ; )

you see where the ? is put the number that this has there in the CHOICE_BIND where its ? is then make  the CHOICE_BUTTON_VIS ? one number bigger
Spoiler: click to open...
CHOICE_BUTTON_VIS( ?, "@MENU_QUIT", open quit_popmenu, when( !localvarBool( ui_hideBack ) ); )



will look something like this
Spoiler: click to open...
CHOICE_BIND( 9, "button name here", "openScriptMenu allmods_menu allmodsgscnotify", ; )
CHOICE_BUTTON_VIS( 10, "@MENU_QUIT", open quit_popmenu, when( !localvarBool( ui_hideBack ) ); )
where this is put what you want it to show in game on main menu in this part "button name here"

save the main.menu file and close it

step 3

put this in mod.csv if your dont have a  one  // if you do this should be dun already for your menu file
Spoiler: click to open...
menufile,ui/main.menu

step 4
setting up the GSc to be notified of the button being pressed
you set with new button you set on the main menu in game // just click it in game on mane menu  and push a button dont use already used buttons when you make your mod every player will need to set what ever buttons they want
will notified  a gsc the same no matter what is picked

in gsc use this setup to pick up the new button being pressed and what you want in it and it can be looped

Spoiler: click to open...
whatever()
{
    self endon("disconnect");
   for(;;)
   {
      self waittill("menuresponse",menu,response);
      {
         if(response == "allmodsgscnotify")
         {
            iprintlnbold("test new button "); // remove after testing
                                your code her
         }
      }
      wait 0.05;
   }
}
warning   do not Precache the pics  you use will get error in coop sooner or latter they will still show
thats it all dun build your mod set button on main menu go in game test your new button out
if used cred all above in creds

more getting added to  tut soon
Last Edit: November 15, 2017, 10:58:06 am by AllMoDs
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 September 2015
Last active: 3 weeks ago
Posts
256
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
AllMoDs's Groups
if you change more than what I said in this tut that does not need to be changed
and get errors as a result of doing so
and ask for help I will not give it
broken avatar :(
×
broken avatar :(
Location: 00persia
Date Registered: 20 December 2012
Last active: 1 year ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
nikfar1's Groups
nikfar1's Contact & Social Links
Great tut thanks for sharing

 
Loading ...