New submenu "HELP"...

Locked
Herr W
Posts: 90
Joined: Tue May 16, 2006 8:53 am

New submenu "HELP"...

Post by Herr W »

Hi everyone!

I'm trying to add a submenu "HELP" to my Monkeys of Doom cell phone fps. Think the easiest (non-coder :rolleyes: ) way is to use former "CINEMATICS" for it. Instead of the RoQ-videos short help texts should pop up. So I created a couple of new menu files (ui_help1.c, ui_help2.c ...) and added the following to ui_cinematics:

Code: Select all

#define ID_CIN_HELP1      80
...
#define ID_CIN_HELP8     87

Code: Select all

typedef struct  {
...
menutext_s     cin_help1;
...
menutext_s     cin_help8;
...

Code: Select all

/*
=====================
UI_CinematicsMenu_Event
=====================
*/

void UI_CinematicsMenu_Event (void* ptr, int event) {
      if( event != QM_ACTIVATED )  {
         return;
      }
      switch ( ((menucommon_s*)ptr)->id ) {

      case ID_CIN_HELP1:
      UI_Help1Menu();
      break;
...
      case ID_CIN_HELP8:
      UI_Help8Menu();
      break;
      }
}

Code: Select all

/*
=====================
UI_CinematicsMenu_Init
=====================
*/
...
        cinematicsMenuInfo.cin_help1.generic.type     = MTYPE_PTEXT;
        cinematicsMenuInfo.cin_help1.generic.flags     = QMF_CENTER_JUSTIFY|QMF_PULSEIFINFOCUS;
        cinematicsMenuInfo.cin_help1.generic.x          = 320;
        cinematicsMenuInfo.cin_help1.generic.y          = y;
        cinematicsMenuInfo.cin_help1.generic.id         = ID_CIN_HELP1;
        cinematicsMenuInfo.cin_help1.generic.callback = UI_CinematicsMenuEvent;
        cinematicsMenuInfo.cin_help1.generic.string     = "W-LAN CONNECTION";
        cinematicsMenuInfo.cin_help1.generic.color      = color_white;
        cinematicsMenuInfo.cin_help1.generic.style      = UI_CENTER|UI_DROPSHADOW;
...
        cinematicsMenuInfo.cin_help2.generic.type     = MTYPE_PTEXT;
        cinematicsMenuInfo.cin_help2.generic.flags     = QMF_CENTER_JUSTIFY|QMF_PULSEIFINFOCUS;
        cinematicsMenuInfo.cin_help2.generic.x          = 320;
        cinematicsMenuInfo.cin_help2.generic.y          = y;
        cinematicsMenuInfo.cin_help2.generic.id         = ID_CIN_HELP2;
        cinematicsMenuInfo.cin_help2.generic.callback = UI_CinematicsMenuEvent;
        cinematicsMenuInfo.cin_help2.generic.string     = "CHANGE AVATAR";
        cinematicsMenuInfo.cin_help2.generic.color      = color_white;
        cinematicsMenuInfo.cin_help2.generic.style      = UI_CENTER|UI_DROPSHADOW;
...

        Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_help1 );
...
        Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_help8 );
...
Next I browsed the code for everything else a submenu might require. Searching the source for "cdkeymenu" (for example) showed hits in
code/q3_ui/ui_atoms.c

Code: Select all

...
/*
===============
UI_Cache
===============
*/
...
UI_CDKeyMenu_Cache();
UI_Help1Menu_Cache();//WW
...
code/q3_ui/ui_cdkey.c

Code: Select all

(not relevant?)
code/q3_ui/ui_local.h

Code: Select all

...
/*
=================
ui_qmenu.c
=================
*/
...
//
//ui_cdkey.c
//
extern void UI_CDKeyMenu( void );
extern void UI_CDKeyMenu_Cache (void );
extern void UI_CDKeyMenu_f( void );

//
//ui_help1.c
//
extern void UI_Help1Menu( void );
extern void UI_Help1Menu_Cache (void );
extern void UI_Help1Menu_f( void );
...
code/q3_ui/ui_setup.c

Code: Select all

(not relevant?)
But something still seems to miss cause the compiler throws out these errors:
Error: L6218E: Undefined symbol UI_Help1Menu_f (referred from monkeyui.h).
Error: L6218E: Undefined symbol UI_Help1Menu_Cache (referred from monkeyui.h).
Error: L6218E: Undefined symbol UI_Help1Menu (referred from monkeyui.h).
- Would be great if someone can help me! :)
[color=#FF0000]Visit MONKEYS of DOOM at [url]http://www.monkeysofdoom.org[/url][/color]
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: New submenu "HELP"...

Post by ^misantropia^ »

Did you add the ui_help*.c files to the build path (Makefile)?
Herr W
Posts: 90
Joined: Tue May 16, 2006 8:53 am

Re: New submenu "HELP"...

Post by Herr W »

Um... no... :rolleyes:

Thanks a lot!
[color=#FF0000]Visit MONKEYS of DOOM at [url]http://www.monkeysofdoom.org[/url][/color]
Locked