Beispiel #1
0
static void PrintClientStats( gclient_t *cl, const playerStat_t *columns, int *bestStats )
{
	char		line[2 * DEFAULT_CONSOLE_WIDTH + 1]; // extra space for color codes
	char		*p = line;
	const char	*e = line + sizeof(line);
	int			stats[STAT_MAX];
	int			pad;
	int			i;

	GetStats(stats, cl);

	pad = MAX_NAME_LEN - Q_PrintStrlen(cl->pers.netname);
	p += Com_sprintf(p, e - p, "%s%s" S_COLOR_WHITE, cl->pers.netname, Spaces(pad));

	for (i = 0; columns[i] != STAT_MAX; i++) {
		playerStat_t stat = columns[i];
		char *value = va("%i", stats[stat]);
		int len = strlen(value);

		if (statCol[stat].disabled)
			continue;

		if (stats[stat] >= 1000 && len > statCol[stat].width) {
			value = va("%ik", stats[stat] / 1000);
			len = strlen(value);
		}
		if (len > statCol[stat].width) {
			value = "";
			len = 0;
		}

		pad = statCol[stat].width - len;
		if (stats[stat] == bestStats[stat]) {
			p += Com_sprintf(p, e - p, S_COLOR_GREEN " %s%s" S_COLOR_WHITE, value, Spaces(pad));
		} else {
			p += Com_sprintf(p, e - p, " %s%s", value, Spaces(pad));
		}
	}

	trap_SendServerCommand(-1, va("print \"%s\n\"", line));
}
Beispiel #2
0
static void PrintStatsHeader( const playerStat_t *columns )
{
	char		line[DEFAULT_CONSOLE_WIDTH + 1];
	char		*p = line;
	const char	*e = line + sizeof(line);
	int			pad;
	int			i;

	pad = MAX_NAME_LEN - STRLEN("Name");
	p += Com_sprintf(p, e - p, "Name%s", Spaces(pad));

	for (i = 0; columns[i] != STAT_MAX; i++) {
		playerStat_t stat = columns[i];

		if (statCol[stat].disabled)
			continue;

		pad = statCol[stat].width - strlen(statCol[stat].shortLabel);
		p += Com_sprintf(p, e - p, " %s%s", statCol[stat].shortLabel, Spaces(pad));
	}

	trap_SendServerCommand(-1, va("print \"%s\n\"", line));

}
U0 Song()
{
  SettingsPush; //See $LK,"SettingsPush","MN:SettingsPush"$
  Fs->text_attr=BLACK<<4+WHITE;
  Fs->task_end_cb=&SndTaskEndCB;
  MusicSettingsRst;
  music_tempo= 2.480;
  music_stacatto_factor= 0.9;
  try {
    while (!ScanKey) {
      DocClear;
      "$$BG,BLACK$$$$FG,WHITE$$\n\n\n\n\nWait for the end...";
      NewLine(5);
      Spaces(17);
      PutSprite($IB+BP,"<1>",1,"::/TempleOS/Demo/Graphics/SpritePut.CPP.Z,1"$);
      Play("3e.GsGe.GsFe.EsG4e.CsDe.EsEe.EsDqCe.CsB");
      NewLine;
      Play("e.AsAe.AsBe.CsBe.CsA3e.G4sA3e.GsEqGe.GsG");
      NewLine;
      Play("e.GsGe.GsFe.EsG4e.CsDe.EsEe.EsDqCC");
      NewLine;
      Play("DDCBh.CqR");
      NewLine;
      Play("3(Ge.G");
      NewLine;
      Play("sFe.EsG4e.CsDhEq.CeR");
      NewLine;
      Play("q(Ae.A");
      NewLine;
      Play("sBe.CsBe.CsA3hGq.EeR");
      NewLine;
      Play("q(Ge.G");
      NewLine;
      Play("sFe.EsG4e.CsDhEqCC");
      NewLine;
      Play("DDCBh.CqR");
      NewLine;
      Play("etEEGqCsDCDCFCFCqAetCDBBD3G4FCF");
      NewLine;
      Play("EEGqCsDCDCFCFCqAetCDBBD3G4FCF");
      NewLine;
    }
  } catch
    CatchAll;
  DocClear;
  SettingsPop;
}
Beispiel #4
0
static void G_LogStatsHeader(void)
{
	char header[STRLEN("SH: Num")
		+ ARRAY_LEN(logColumns) * (STAT_COL_WIDTH + 1)
		+ 1 + STRLEN("Team")
		+ 1 + STRLEN("Name\n") + 1];
	int  i;

	Q_strncpyz(header, "SH: Num", sizeof(header));
	for (i = 0; i < ARRAY_LEN(logColumns); i++) {
		const statColumn_t	*col = statCol + logColumns[i];
		const char			*label;

		if (col->label && strlen(col->label) <= STAT_COL_WIDTH) {
			label = col->label;
		} else {
			label = col->shortLabel;
		}

		Q_strcat(header, sizeof(header), va(" %s%s",
				Spaces(STAT_COL_WIDTH - strlen(label)), label));
	}
	G_LogPrintf(LOG_GAME_STATS, "%s %s %s\n", header, "Team", "Name");
}