X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fnet_notice.qc;h=fb9958b08fcbd186fd151b65afb89462d442a357;hb=a37826300e6ea1f6bf1947575c10bb8930f25d9e;hp=625e091dcc68994ca9a3e5bdd8f4a327f3a1cff9;hpb=8a390ed02bde47c98a5e6bd47c7eb9b1cb3cd1dc;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/net_notice.qc b/qcsrc/common/net_notice.qc index 625e091dc..fb9958b08 100644 --- a/qcsrc/common/net_notice.qc +++ b/qcsrc/common/net_notice.qc @@ -1,3 +1,5 @@ +#include "net_notice.qh" + #ifdef SVQC void sv_notice_join_think() { @@ -5,10 +7,10 @@ void sv_notice_join_think() float argc = tokenizebyseparator(autocvar_sv_join_notices, "|"); if(argc > 0) { - float i; - for(i = argc - 1; i >= 0; --i) - sv_notice_to(self.owner, argv(i), autocvar_sv_join_notices_time, FALSE); - } + float i; + for(i = argc - 1; i >= 0; --i) + sv_notice_to(self.owner, argv(i), autocvar_sv_join_notices_time, false); + } remove(self); } @@ -21,7 +23,7 @@ void sv_notice_join() entity n = spawn(); n.owner = self; n.think = sv_notice_join_think; - n.nextthink = time + 1; + n.nextthink = time + 1; } void sv_notice_to(entity _to, string _notice, float _howlong, float _modal) @@ -39,15 +41,12 @@ void sv_notice_toall(string _notice, float _howlong, float _modal) entity _head; FOR_EACH_REALCLIENT(_head) sv_notice_to(_head, _notice, _howlong, _modal); - + } #endif // SVQC #ifdef CSQC -void SUB_Remove() -{ remove(self); } - void cl_notice_read() { entity _notice; @@ -64,53 +63,53 @@ float cl_notice_run() { entity _notes; string _notice; - float m = FALSE; - + float m = false; + _notes = findchain(classname, "sv_notice"); if(!_notes) - return FALSE; + return false; #define M1 30 #define M2 10 - + vector v1, v2 = '0 0 0', v3; v1 = '1 1 0' * M1; v2_x = vid_conwidth - (2 * M1); v2_y = vid_conheight - (2 * M1); - + drawfill(v1, v2, '0 0 0', 0.5, DRAWFLAG_NORMAL); v1 = '1 1 0' * (M1 + M2); v2_x = vid_conwidth - (2 * (M1 + M2)); v2_y = vid_conheight - (2 * (M1 + M2)); drawfill(v1, v2, '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL); v3 = v1 + '10 10 0'; - + #define OUT(s,z) drawcolorcodedstring(v3, s, '1 1 0' * z, 1, DRAWFLAG_NORMAL); v3_y += z + 4 - + OUT(_("^1Server notices:"), 32); - + //drawcolorcodedstring(v1 + '5 5 0', "^1Server notices:", '32 32 0', 1, DRAWFLAG_NORMAL); while(_notes) { - + _notice = sprintf(_("^7%s (^3%d sec left)"), _notes.netname , rint(_notes.alpha - time)); OUT(_notice, 16); - if(_notes.skin) - m = TRUE; - + if(_notes.skin) + m = true; + if(_notes.alpha <= time) { _notes.think = SUB_Remove; _notes.nextthink = time; } - - _notes = _notes.chain; + + _notes = _notes.chain; } - + #undef OUT #undef M1 #undef M2 - + return m; }