DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

[Tutorial] Replace QUIT confirmation messages with graphics
Page 1 of 1
DieHard Wolfers Forum Index -> Code Tutorials View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
Haasboy
DieHard Officer
DieHard Officer


Joined: 23 Jul 2003
Last Visit: 17 Jun 2019

Topics: 58
Posts: 581
Location: South Africa, Johannesburg
southafrica.gif

PostPosted: Fri Feb 04, 2005 10:33 pm
   Subject: [Tutorial] Replace QUIT confirmation messages with graphics
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Bottom of Posts

In this tutorial I'll show you how to replace this confirmation quit messages with a picture, using this tutorial will even save you about +-300 bytes (cann't exactly remember I how much space it freed).

Well here I go, this is all done in one file WL_MENU.C:

But firstly go to the VERSION.H file and add in #define MESSAGE, no go to WL_MENU.C and do the following:

Add in the red, remove the blue

Step 1: Remove the confirmation messages
::: CODE :::
#ifndef MESSAGE
char far endStrings[9][80]=
{
#ifndef SPEAR
   {"Dost thou wish to\nleave with such hasty\nabandon?"},
   {"Chickening out...\nalready?"},
   {"Press N for more carnage.\nPress Y to be a weenie."},
   {"So, you think you can\nquit this easily, huh?"},
   {"Press N to save the world.\nPress Y to abandon it in\nits hour of need."},
   {"Press N if you are brave.\nPress Y to cower in shame."},
   {"Heroes, press N.\nWimps, press Y."},
   {"You are at an intersection.\nA sign says, 'Press Y to quit.'\n>"},
   {"For guns and glory, press N.\nFor work and worry, press Y."}
#else
   ENDSTR1,
   ENDSTR2,
   ENDSTR3,
   ENDSTR4,
   ENDSTR5,
   ENDSTR6,
   ENDSTR7,
   ENDSTR8,
   ENDSTR9
#endif
};
#endif


Step 2: Defining the rest
::: CODE :::
      //
      // QUIT
      //
      case sc_F10:
         CA_CacheGrChunk(STARTFONT+1);

         WindowX=WindowY=0;
         WindowW=320;
         WindowH=160;
         #ifdef JAPAN
         if (GetYorN(7,8,C_QUITMSGPIC))
         #else
            #ifdef SPANISH
         if (Confirm(ENDGAMESTR))
            #else
         #ifdef MESSAGE
         if (GetYorN(14,6,NEW01PIC))
         #else

         if (Confirm(endStrings[US_RndT()&0x7+(US_RndT()&1)]))
         #endif
            #endif
         #endif

::: CODE :::
////////////////////////////////////////////////////////////////////
//
// QUIT THIS INFERNAL GAME!
//
////////////////////////////////////////////////////////////////////
void CP_Quit(void)
{
   int i;


   #ifdef JAPAN
   if (GetYorN(7,11,C_QUITMSGPIC))
   #else

   #ifdef SPANISH
   if (Confirm(ENDGAMESTR))
   #else
   #ifdef MESSAGE
   if (GetYorN(17,2,NEW01PIC))
   #else

   if (Confirm(endStrings[US_RndT()&0x7+(US_RndT()&1)]))
   [color=red]#endif[color]
   #endif

   #endif
   {
      VW_UpdateScreen();
      SD_MusicOff();
      SD_StopSound();
      MenuFadeOut();
      //
      // SHUT-UP THE ADLIB
      //
      for (i=1;i<=0xf5;i++)
         alOut(i,0);
      Quit(NULL);
   }

   DrawMainMenu();
}


The go down to int confirm routine and underneath it add:
::: CODE :::
#ifdef MESSAGE
////////////////////////////////////////////////////////////////////
//
// DRAW MESSAGE & GET Y OR N
//
////////////////////////////////////////////////////////////////////
int GetYorN(int x,int y,int pic)
{
   int xit=0,whichsnd[2]={ESCPRESSEDSND,SHOOTSND};


   CA_CacheGrChunk(pic);
   VWB_DrawPic(x * 8,y * 8,pic);
   UNCACHEGRCHUNK(pic);
   VW_UpdateScreen();
   IN_ClearKeysDown();

   do
   {
      #ifndef SPEAR
      if (Keyboard[sc_Tab] && Keyboard[sc_P] && MS_CheckParm("goobers"))
         PicturePause();
      #endif

   #ifdef SPANISH
   } while(!Keyboard[sc_S] && !Keyboard[sc_N] && !Keyboard[sc_Escape]);
   #else
   } while(!Keyboard[sc_Y] && !Keyboard[sc_N] && !Keyboard[sc_Escape]);
   #endif

   #ifdef SPANISH
   if (Keyboard[sc_S])
   {
      xit=1;
      ShootSnd();
   }

   while(Keyboard[sc_S] || Keyboard[sc_N] || Keyboard[sc_Escape]);

   #else

   if (Keyboard[sc_Y])
   {
      xit=1;
      ShootSnd();
   }

   while(Keyboard[sc_Y] || Keyboard[sc_N] || Keyboard[sc_Escape]);
   #endif

   IN_ClearKeysDown();
   SD_PlaySound(whichsnd[xit]);
   return xit;
}
#endif


That's it for this tutorial, using the this tutorial you can even haven't so that it brings up a picwhen your overwrite a saved game, or starting a new game when playing a game at the time.

Take note that you must also define a new picture in GFXV_WL6.H or GFXV_SOD.H and you can change the NEW01PIC to what ever you want.

_________________
Haasboy Engine - Currently under construction (To be used with future mods - F.A.D.E.D. - Mansion X - Rising Evil Series)
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Tutorials View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [Code] Shading Tutorial & Fixes - Ripper
Author: BrotherTank
80 19557 Wed Apr 29, 2015 5:06 pm
Chris View latest post
No new posts [Code] Add Text to Screen at Skill Level select - Chris
Author: Chris
3 3631 Tue Sep 28, 2010 6:59 pm
Tricob View latest post
No new posts [Code] Blood Splatz Tutorial - Blood Splatters
Author: Dugtrio17
45 16608 Tue Mar 11, 2008 12:02 am
AlumiuN View latest post
No new posts [Code] Creating Animated Static Objects Tutorial
Author: WSJ
15 571 Wed Aug 01, 2007 12:06 pm
Codetech84 View latest post
No new posts [Info] Mirrored Images - walls that are reversed on one side
Author: Guest
4 297 Sat May 03, 2003 12:57 pm
jamez View latest post
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
   You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group