X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fdebug.qh;fp=qcsrc%2Fcommon%2Fdebug.qh;h=b26c19d9a7a718d1608da69e0a41c24165227896;hp=b1dea6dcc431a84c1063d36f567047222c3d530c;hb=a1a42d9340bc42ed74055a1bb52a62b53796f61f;hpb=ca48b1e339d35a75bb0e3540e8b570f74b084bf4 diff --git a/qcsrc/common/debug.qh b/qcsrc/common/debug.qh index b1dea6dcc4..b26c19d9a7 100644 --- a/qcsrc/common/debug.qh +++ b/qcsrc/common/debug.qh @@ -427,16 +427,26 @@ CLASS(DebugText3d, Object) return; } - int size = 8; + int size = 11; vector screen_pos = project_3d_to_2d(this.origin) + since_created * this.velocity; - float align = GetResourceAmount(this, RESOURCE_HEALTH); - if (align > 0) - screen_pos.x -= stringwidth(this.message, true, size * '1 1 0') * min(1, align); if (screen_pos.z < 0) return; // behind camera + screen_pos.z = 0; + float align = GetResourceAmount(this, RESOURCE_HEALTH); + string msg; + vector msg_pos; - vector rgb = '1 1 0'; - drawcolorcodedstring2_builtin(screen_pos, this.message, size * '1 1 0', rgb, alpha_, DRAWFLAG_NORMAL); + int n = tokenizebyseparator(this.message, "\n"); + for(int k = 0; k < n; ++k) + { + msg = argv(k); + msg_pos = screen_pos + k * 1.25 * size * eY; + if (align > 0) + msg_pos.x -= stringwidth(msg, true, size * '1 1 0') * min(1, align); + + vector rgb = '1 1 0'; + drawcolorcodedstring2_builtin(msg_pos, msg, size * '1 1 0', rgb, alpha_, DRAWFLAG_NORMAL); + } } ATTRIB(DebugText3d, draw2d, void(DebugText3d), DebugText3d_draw2d); ENDCLASS(DebugText3d)