core/smn_hudtext.cpp
changeset 3855 d8ba5eddf543
parent 3743 a98686a77974
child 3872 4c93f74cae51
     1.1 --- a/core/smn_hudtext.cpp	Tue Mar 19 11:19:19 2013 -0400
     1.2 +++ b/core/smn_hudtext.cpp	Tue Mar 19 11:19:38 2013 -0400
     1.3 @@ -37,7 +37,9 @@
     1.4  #include "HandleSys.h"
     1.5  #include "logic_bridge.h"
     1.6  
     1.7 -#if SOURCE_ENGINE == SE_CSGO
     1.8 +#if SOURCE_ENGINE == SE_DOTA
     1.9 +#include <game/shared/protobuf/usermessages.pb.h>
    1.10 +#elif SOURCE_ENGINE == SE_CSGO
    1.11  #include <game/shared/csgo/protobuf/cstrike15_usermessages.pb.h>
    1.12  #endif
    1.13  
    1.14 @@ -316,8 +318,26 @@
    1.15  
    1.16  	players[0] = client;
    1.17  
    1.18 -#if SOURCE_ENGINE == SE_CSGO
    1.19 -	// If or when we need to support multiple games per engine with this, we can switch to reflection
    1.20 +#if SOURCE_ENGINE == SE_DOTA
    1.21 +	CUserMsg_HudMsg *msg = (CUserMsg_HudMsg *)g_UserMsgs.StartProtobufMessage(g_HudMsgNum, players, 1, 0);
    1.22 +	msg->set_channel(textparms.channel & 0xFF);
    1.23 +
    1.24 +	msg->set_x(textparms.x);
    1.25 +	msg->set_y(textparms.y);
    1.26 +
    1.27 +	Color c1(textparms.r1, textparms.g1, textparms.b1, textparms.a1);
    1.28 +	msg->set_color1(c1.GetRawColor());
    1.29 +
    1.30 +	Color c2(textparms.r2, textparms.g2, textparms.b2, textparms.a2);
    1.31 +	msg->set_color2(c2.GetRawColor());
    1.32 +
    1.33 +	msg->set_effect(textparms.effect);
    1.34 +	msg->set_fade_in_time(textparms.fadeinTime);
    1.35 +	msg->set_fade_out_time(textparms.fadeoutTime);
    1.36 +	msg->set_hold_time(textparms.holdTime);
    1.37 +	msg->set_fx_time(textparms.fxTime);
    1.38 +	msg->set_message(pMessage);
    1.39 +#elif SOURCE_ENGINE == SE_CSGO
    1.40  	CCSUsrMsg_HudMsg *msg = (CCSUsrMsg_HudMsg *)g_UserMsgs.StartProtobufMessage(g_HudMsgNum, players, 1, 0);
    1.41  	msg->set_channel(textparms.channel & 0xFF);
    1.42