+ LOG_INFO("Usage:^3 " GetProgramCommandPrefix() " findat \"0 0 0\"");
+ return;
+ }
+ }
+}
+
+
+// debug_test() allows drawing text from server on the client anywhere in world coordinates.
+
+#ifdef GAMEQC
+REGISTER_NET_TEMP(debug_text_3d);
+#endif
+
+#ifdef CSQC
+
+CLASS(DebugText3d, Object)
+ // reusing existing fields
+ ATTRIB(DebugText3d, origin, vector);
+ ATTRIB(DebugText3d, message, string); // the text (i wanted to use the .text field but then this whole macro-based-inheritance thing shat itself)
+ ATTRIB(DebugText3d, health, float); // text alignment (recycled field)
+ ATTRIB(DebugText3d, hit_time, float); // when it was created
+ ATTRIB(DebugText3d, fade_rate, float); // how fast is should disappear
+ ATTRIB(DebugText3d, velocity, vector);
+
+ CONSTRUCTOR(DebugText3d, vector pos, string msg, float align, float fade_rate_, vector vel) {
+ CONSTRUCT(DebugText3d);
+ this.origin = pos;
+ this.message = strzone(msg);
+ this.health = align;
+ this.hit_time = time;
+ this.fade_rate = fade_rate_;
+ this.velocity = vel;
+ IL_PUSH(g_drawables_2d, this);
+ }
+
+ DESTRUCTOR(DebugText3d) {
+ strunzone(this.message);
+ }
+
+ void DebugText3d_draw2d(DebugText3d this) {
+ float since_created = time - this.hit_time;
+ float alpha_ = 1 - since_created * this.fade_rate;
+
+ if (alpha_ < 0) {
+ delete(this);