Exemple #1
0
void HU_Ticker(void)
{
	// tick down message counter if message is up
	if (::g->message_counter && !--::g->message_counter)
	{
		::g->message_on = false;
		::g->message_nottobefuckedwith = false;
	}

	if ( ( m_inDemoMode.GetBool() == false && m_show_messages.GetBool() ) || ::g->message_dontfuckwithme)
	{

		// display message if necessary
		if ((::g->plr->message && !::g->message_nottobefuckedwith)
			|| (::g->plr->message && ::g->message_dontfuckwithme))
		{
			HUlib_addMessageToSText(&::g->w_message, 0, ::g->plr->message);
			::g->plr->message = 0;
			::g->message_on = true;
			::g->message_counter = HU_MSGTIMEOUT;
			::g->message_nottobefuckedwith = ::g->message_dontfuckwithme;
			::g->message_dontfuckwithme = 0;
		}

	} // else ::g->message_on = false;
}
Exemple #2
0
void HU_Ticker(void)
{
    const dboolean  idmypos = plr->cheats & CF_MYPOS;

    // tick down message counter if message is up
    if (((!menuactive && !paused && !consoleactive) || inhelpscreens || message_dontpause) && !idbehold
        && !idmypos && message_counter && !--message_counter)
    {
        message_on = false;
        message_nottobefuckedwith = false;

        if (message_dontpause)
        {
            message_dontpause = false;
            blurred = false;
        }

        message_external = false;
    }

    if (idbehold)
    {
        // [BH] display message for IDBEHOLDx cheat
        if (!message_counter)
            message_counter = HU_MSGTIMEOUT;
        else if (message_counter > 132)
            message_counter--;

        HUlib_addMessageToSText(&w_message, 0, s_STSTR_BEHOLD);
        message_on = true;
    }
    else if (idmypos)
    {
        // [BH] display and constantly update message for IDMYPOS cheat
        char    buffer[80];

        if (!message_counter)
            message_counter = HU_MSGTIMEOUT;
        else if (message_counter > 132)
            message_counter--;

        if (automapactive && !am_followmode)
        {
            int x = (m_x + m_w / 2) >> MAPBITS;
            int y = (m_y + m_h / 2) >> MAPBITS;

            M_snprintf(buffer, sizeof(buffer), s_STSTR_MYPOS, direction, x, y,
                R_PointInSubsector(x, y)->sector->floorheight / FRACUNIT);
        }
        else
        {
Exemple #3
0
void HU_Ticker(void)
{

    int i, rc;
    char c;

    // tick down message counter if message is up
    if (message_counter && !--message_counter)
    {
        message_on = false;
        message_nottobefuckedwith = false;
    }

    if (showMessages || message_dontfuckwithme)
    {

        // display message if necessary
        if ((plr->message && !message_nottobefuckedwith)
                || (plr->message && message_dontfuckwithme))
        {
            HUlib_addMessageToSText(&w_message, 0, plr->message);
            plr->message = 0;
            message_on = true;
            message_counter = HU_MSGTIMEOUT;
            message_nottobefuckedwith = message_dontfuckwithme;
            message_dontfuckwithme = 0;
        }

    } // else message_on = false;

    // check for incoming chat characters
    if (netgame)
    {
        for (i=0 ; i<MAXPLAYERS; i++)
        {
            if (!playeringame[i])
                continue;
            if (i != consoleplayer
                    && (c = players[i].cmd.chatchar))
            {
                if (c <= HU_BROADCAST)
                    chat_dest[i] = c;
                else
                {
                    rc = HUlib_keyInIText(&w_inputbuffer[i], c);
                    if (rc && c == KEY_ENTER)
                    {
                        if (w_inputbuffer[i].l.len
                                && (chat_dest[i] == consoleplayer+1
                                    || chat_dest[i] == HU_BROADCAST))
                        {
                            HUlib_addMessageToSText(&w_message,
                                                    DEH_String(player_names[i]),
                                                    w_inputbuffer[i].l.l);

                            message_nottobefuckedwith = true;
                            message_on = true;
                            message_counter = HU_MSGTIMEOUT;
                            if ( gamemode == commercial )
                                S_StartSound(0, sfx_radio);
                            else
                                S_StartSound(0, sfx_tink);
                        }
                        HUlib_resetIText(&w_inputbuffer[i]);
                    }
                }
                players[i].cmd.chatchar = 0;
            }
        }
    }

}
Exemple #4
0
//
// HU_Ticker()
//
// Update the hud displays once per frame
//
// Passed nothing, returns nothing
//
void HU_Ticker(void)
{
  // killough 11/98: support counter for message list as well as regular msg
  if (message_list_counter && !--message_list_counter)
  {
    reviewing_message = message_list_on = false;
    if (hud_list_bgon && scaledviewheight < 200) // killough 11/98
      R_FillBackScreen();
  }

  // tick down message counter if message is up
  if (message_counter && !--message_counter)
    reviewing_message = message_on = message_nottobefuckedwith = false;

  // if messages on, or "Messages Off" is being displayed
  // this allows the notification of turning messages off to be seen
  // display message if necessary

  if ((showMessages || message_dontfuckwithme) && plr->message &&
      (!message_nottobefuckedwith || message_dontfuckwithme))
  {
    //post the message to the message widget
    HUlib_addMessageToSText(&w_message, 0, plr->message);

    //jff 2/26/98 add message to refresh text widget too
    HUlib_addMessageToMText(&w_rtext, 0, plr->message);

    // clear the message to avoid posting multiple times
    plr->message = 0;

    // killough 11/98: display message list, possibly timed
    if (message_list)
    {
      if (hud_msg_timed || message_dontfuckwithme) // Messages Off => timed
        message_list_counter = hud_msg_count;
      message_list_on = true;
    }
    else
    {
      message_on = true;       // note a message is displayed
      // start the message persistence counter
      message_counter = message_count;
    }

    has_message = true;        // killough 12/98

    // transfer "Messages Off" exception to the "being displayed" variable
    message_nottobefuckedwith = message_dontfuckwithme;

    // clear the flag that "Messages Off" is being posted
    message_dontfuckwithme = 0;
  }

  // check for incoming chat characters
  if (netgame)
  {
    int i, rc;
    char c;

    for (i = 0; i < MAXPLAYERS; i++)
    {
      if (!playeringame[i])
        continue;
      if (i != consoleplayer
          && (c = players[i].cmd.chatchar))
      {
        if (c <= HU_BROADCAST)
          chat_dest[i] = c;
        else
        {
          if (c >= 'a' && c <= 'z')
            c = (char) shiftxform[(unsigned char) c];
          rc = HUlib_keyInIText(&w_inputbuffer[i], c);
          if (rc && c == KEYD_ENTER)
          {
            if (w_inputbuffer[i].l.len
                && (chat_dest[i] == consoleplayer + 1
                    || chat_dest[i] == HU_BROADCAST))
            {
              HUlib_addMessageToSText(&w_message,
                                      player_names[i],
                                      w_inputbuffer[i].l.l);

              has_message = true;        // killough 12/98
              message_nottobefuckedwith = true;
              message_on = true;
              message_counter = chat_count;  // killough 11/98
              S_StartSound(0, gamemode == commercial ?
                           sfx_radio : sfx_tink);
            }
            HUlib_resetIText(&w_inputbuffer[i]);
          }
        }
        players[i].cmd.chatchar = 0;
      }
    }
  }
}