Beispiel #1
0
function dialogs_init()
{
	STRING *file = "#256";
	make_path(file, "messages.ini");
	int i;
	for(i = 0; i < MAX_DIALOG_ENTRIES; i++)
	{
		/*
		[Message 0]
		text=Oh man, nice bell!
		sound=just_stupid_sound.wav
		*/
		STRING *section = "#64";
		str_cpy(section, "Message ");
		str_cat(section, str_for_int(NULL, i));
		char buffer[256];
		ini_read_buffer(file, section, "text", "FIXIT: You forgot a message here!", buffer, 256);
		
		if(strlen(buffer) > 0)
		{
			dialogEntries[i].initialized = 1;
			dialogEntries[i].text = str_create(buffer);
			
			ini_read_buffer(file, section, "sound", "", buffer, 256);
			if(strlen(buffer) > 0)
				dialogEntries[i].sound = snd_create(buffer);
			else
				dialogEntries[i].sound = NULL;
		}
	}
	
	dialogText = txt_create(1, 20);
	dialogText->flags |= CENTER_X | TRANSLUCENT | OUTLINE;
	dialogText->font = dialogFont;
}
Beispiel #2
0
void loadTaunts()
{
   int playerIndex;
   for (playerIndex = 0; playerIndex < MAX_PLAYERS; playerIndex++) {

      SOUND** tauntArr = g_taunts[playerIndex];
      if (tauntArr != null) {

         int tauntNum = 0;
         int loadedTauntIndex = 0;

         int tauntIndex;
         for (tauntIndex = 0; tauntIndex < NUM_MAX_TAUNTS; tauntIndex++) {

            char sndFilename[256];
            sprintf(sndFilename, "taunt_p%d_%d.ogg", playerIndex + 1, tauntIndex);

            if (file_exists(sndFilename)) {

               SOUND* snd = snd_create(sndFilename);
               if (snd != null) {

                  tauntArr[loadedTauntIndex] = snd;

                  tauntNum++;
                  loadedTauntIndex++;
               }
            }
         }

         g_num_taunts[playerIndex] = tauntNum;
      }
   }
}