|
| View previous topic :: View next topic |
| Author |
Message |
ingo Registered User

Joined: 14 Nov 2004 Posts: 7 Location: Badby
|
Posted: Fri Feb 25, 2005 1:31 am Post subject: Editing the Menus [In Progress] |
|
|
When editing menus, there are a lot of things to learn. For example, you have to:
1. Have the text link
2. Tell that where to go
3. Make it load up a new menu
4. Make sure that the new menu knows where to go back to
5. Make a text link here
6. Etc...
Therefore, if you want to change around the order of the menu, this is simple. Just open wl_menu.c, and search for "far MainMenu". You will find this:
| Quote: | ...
{1,STR_NG,CP_NewGame},
{1,STR_SD,CP_Sound},
{1,STR_CL,CP_Control},
... |
If you for some reason wanted new game under sound, you'd switch the two lines around. Bearing in mind that if you move the last line, the last one doesn't have a comma at the end, and all the others do.
Now that part was pretty simple, but it's about to get worse. If we first, open up wl_menu.h, and search for "CP_New", you will find this:
| Quote: | void CP_NewGame(void);
void CP_Sound(void);
...
void CP_Quit(void);
void CP_Options(void);
... |
We have defined a new menu link. Now, go back to wl_menu.c, and search for "far MainMenu". Scroll down a bit until you see this:
| Quote: | ...
{1,"Options",CP_Options},
#ifndef GOODTIMES
#ifndef SPEAR
#ifdef SPANISH
// {2,"Ve esto!",CP_ReadThis},
#else
// {2,"Read This!",CP_ReadThis},
#end if
#end if
#end if
... |
We have now replaced the "Read This" with "Options".
To be updated...
OLD CRAP:
Our first mission in this tutorial is to remove the ReadThis (we will get it back later), and replacing it with an Options Menu. So...
Open wl_menu.h and search for: "CTL_H". Underneath this, write:
| Code: | OPT_X 75
OPT_Y 55
OPT_W 178
OPT_H 13*10+6 |
I will explain what these mean later!
Now scroll down to "DrawChangeView (int view);" and add this below it:
| Code: | | void DrawOptScreen(void); |
Also, scroll down to "CP_ChangeView" and add this below it:
| Code: | | void CP_Options (void); |
Then a little further down, you will see: "changeview,". Underneath add:
Now open wl_menu.c, and search for "NewItems". Above this add:
| Code: | | OptItems={OPT_X,OPT_Y,6,-1,56}; |
Now, find "{2,Read This!,CP_ReadThis}." and delete the whole line. Now just up a little, where "{1,STR_CV...." is, add this line underneath it:
| Code: | | {1,"Options",CP_Options}, |
Now find "far CtrlMenu[]". Under this routine, add:
| Code: | far OptMenu[]=
{
{1,"ReadMe",CP_ReadThis}.
{0,"Future Menu Things",0},
{1,"Future Menu Things",0},
}, |
The first number shows wether its active or not (1 = active), the second is the text shown, and the 3rd is what the menu links to. Where I've wrote 0, they are void, and don't go anywhere!
Now find "CP_Control", and above the routine.. write this:
| Code: | ////////////////////////////
// OPTIONS MENU
////////////////////////////
void CP_Options (void)
{
int which;
#ifdef SPEAR //this is where images are cahced!
//UnCacheLump (OPTIONS_LUMP_START,OPTIONS_LUMP_END);
//CacheLump (CONTROL_LUMP_START,CONTROL_LUMP_END);
#endif
DrawOptScreen();
MenuFadeIn();
WaitKeyUp();
do
{
which=HandleMenu(&OptItems,&OptMenu[0],NULL);
} while(which>=0)
MenuFadeOut();
#ifdef SPEAR //this is where images are cahced!
//UnCacheLump (CONTROL_LUMP_START,CONTROL_LUMP_END);
//CacheLump (OPTIONS_LUMP_START,OPTIONS_LUMP_END);
#endif
} |
As we will be keeping the OPTIONS logo, there is no need to Cache or UnCache anything.
Now search for "DrawCtlScreen(void)", and above it write:
[code]//////////////////
//DRAW OPTIONS SCREEN
//////////////////
void DrawOptScreen(void)
{
int i;
ClearMScreen();
VWB_DrawPic(80,0,C_CONTROLPIC);
VWB_DrawPic(112,184,C_MOUSEBACKPIC);
DrawWindow(OPT_X-8,OPT_Y-5,OPT_W,OPT_H,BKGDCOLOR);
WindowX=0;
WindowW=320;
SETFONTCOLOR(TEXTCOLOR,BKGDCOLOR);
DrawMenu(&OptItems,&OptMenu[0]);
//PICK FIRST AVALIABLE SPOT
if (OptItems.curpos<0 || !OptMenu[OptItems.curpos].active)
for(i=0;i<6;i++)
if (OptMenu[i].active)
{
OptItems.curpos=i;
break;
}
DrawMenuGun(&OptItems);
VW_UpdateScreen();
}
This should give you a Options Menu, which takes you to a choice of Read This and two blank menus.
Will update soon! _________________ ~ Ingo
Stop trying to hit me, and hit me!
Last edited by ingo on Sun Feb 27, 2005 12:27 am; edited 1 time in total |
|
| Back to top |
|
 |
Deathshead Newbie

Joined: 25 Feb 2005 Posts: 4
|
Posted: Fri Feb 25, 2005 4:05 am Post subject: |
|
|
Hey, way cool Jamez.
Thanks alot. This will definately help me. Awesome. _________________ My Spider Sense is tingling...AND I LIKE IT!!! |
|
| Back to top |
|
 |
ingo Registered User

Joined: 14 Nov 2004 Posts: 7 Location: Badby
|
Posted: Fri Feb 25, 2005 11:36 pm Post subject: |
|
|
| Deathshead wrote: | Hey, way cool Jamez.
Thanks alot. This will definately help me. Awesome. |
Will update it in a few hours! _________________ ~ Ingo
Stop trying to hit me, and hit me! |
|
| Back to top |
|
 |
|
Watch this topic for replies
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You cannot delete your posts in this forum You can vote in polls in this forum
|
|
|