X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fcenterprint.qc;h=d5601e5a34f86387a532baef847a42e52f903793;hp=3c13fd9c2bdfe2d8724c37194796821e0f6bf675;hb=991de5e6922cd3c283de56c3249624f0f1bfe767;hpb=d5a954d00e5c66bd5e68eadef172e50cf392bc4c diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index 3c13fd9c2..d5601e5a3 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -2,6 +2,8 @@ #include "scoreboard.qh" #include +#include +#include // CenterPrint (#16) @@ -18,7 +20,7 @@ bool centerprint_showing; void centerprint_generic(int new_id, string strMessage, float duration, int countdown_num) { - TC(int, new_id); TC(int, countdown_num); + TC(int, new_id); TC(int, countdown_num); //printf("centerprint_generic(%d, '%s^7', %d, %d);\n", new_id, strMessage, duration, countdown_num); int i, j; @@ -73,9 +75,7 @@ void centerprint_generic(int new_id, string strMessage, float duration, int coun cpm_index = CENTERPRINT_MAX_MSGS - 1; j = cpm_index; } - if(centerprint_messages[j]) - strunzone(centerprint_messages[j]); - centerprint_messages[j] = strzone(strMessage); + strcpy(centerprint_messages[j], strMessage); centerprint_msgID[j] = new_id; if (duration < 0) { @@ -94,7 +94,7 @@ void centerprint_generic(int new_id, string strMessage, float duration, int coun void centerprint_kill(int id) { - TC(int, id); + TC(int, id); centerprint_generic(id, "", 0, 0); } @@ -110,9 +110,7 @@ void reset_centerprint_messages() centerprint_expire_time[i] = 0; centerprint_time[i] = 1; centerprint_msgID[i] = 0; - if(centerprint_messages[i]) - strunzone(centerprint_messages[i]); - centerprint_messages[i] = string_null; + strfree(centerprint_messages[i]); } } float hud_configure_cp_generation_time; @@ -139,16 +137,16 @@ void HUD_CenterPrint () float r; r = random(); if (r > 0.8) - centerprint_generic(floor(r*1000), strcat(sprintf("^3Countdown message at time %s", seconds_tostring(time)), ", seconds left: ^COUNT"), 1, 10); + centerprint_generic(floor(r*1000), sprintf(_("^3Countdown message at time %s, seconds left: ^COUNT"), seconds_tostring(time)), 1, 10); else if (r > 0.55) - centerprint_generic(0, sprintf("^1Multiline message at time %s that\n^1lasts longer than normal", seconds_tostring(time)), 20, 0); + centerprint_generic(0, sprintf(_("^1Multiline message at time %s that\n^1lasts longer than normal"), seconds_tostring(time)), 20, 0); else - centerprint_hud(sprintf("Message at time %s", seconds_tostring(time))); + centerprint_hud(sprintf(_("Message at time %s"), seconds_tostring(time))); hud_configure_cp_generation_time = time + 1 + random()*4; } else { - centerprint_generic(0, sprintf("Centerprint message", seconds_tostring(time)), 10, 0); + centerprint_generic(0, _("Generic message"), 10, 0); hud_configure_cp_generation_time = time + 10 - random()*3; } }