Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
5.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "cbase.h"
  7. #include "usermessages.h"
  8. #include "shake.h"
  9. #include "voice_gamemgr.h"
  10. // NVNT include to register in haptic user messages
  11. #include "haptics/haptic_msgs.h"
  12. void RegisterUserMessages()
  13. {
  14. usermessages->Register( "Geiger", 1 ); // geiger info data
  15. usermessages->Register( "Train", 1 ); // train control data
  16. usermessages->Register( "HudText", -1 );
  17. usermessages->Register( "SayText", -1 );
  18. usermessages->Register( "SayText2", -1 );
  19. usermessages->Register( "TextMsg", -1 );
  20. usermessages->Register( "ResetHUD", 1 ); // called every respawn
  21. usermessages->Register( "GameTitle", 0 ); // show game title
  22. usermessages->Register( "ItemPickup", -1 ); // for item history on screen
  23. usermessages->Register( "ShowMenu", -1 ); // show hud menu
  24. usermessages->Register( "Shake", 13 ); // shake view
  25. usermessages->Register( "Fade", 10 ); // fade HUD in/out
  26. usermessages->Register( "VGUIMenu", -1 ); // Show VGUI menu
  27. usermessages->Register( "Rumble", 3 ); // Send a rumble to a controller
  28. usermessages->Register( "CloseCaption", -1 ); // Show a caption (by string id number)(duration in 10th of a second)
  29. usermessages->Register( "SendAudio", -1 ); // play radion command
  30. usermessages->Register( "VoiceMask", VOICE_MAX_PLAYERS_DW*4 * 2 + 1 );
  31. usermessages->Register( "RequestState", 0 );
  32. usermessages->Register( "Damage", -1 ); // for HUD damage indicators
  33. usermessages->Register( "HintText", -1 ); // Displays hint text display
  34. usermessages->Register( "KeyHintText", -1 ); // Displays hint text display
  35. usermessages->Register( "HudMsg", -1 );
  36. usermessages->Register( "AmmoDenied", 2 );
  37. usermessages->Register( "AchievementEvent", -1 );
  38. usermessages->Register( "UpdateRadar", -1 );
  39. usermessages->Register( "VoiceSubtitle", 3 );
  40. usermessages->Register( "HudNotify", 2 ); // Type, bForceDisplay
  41. usermessages->Register( "HudNotifyCustom", -1 );
  42. usermessages->Register( "PlayerStatsUpdate", -1 );
  43. usermessages->Register( "MapStatsUpdate", -1 );
  44. usermessages->Register( "PlayerIgnited", 3 );
  45. usermessages->Register( "PlayerIgnitedInv", 3 );
  46. usermessages->Register( "HudArenaNotify", 2 );
  47. usermessages->Register( "UpdateAchievement", -1 );
  48. //=============================================================================
  49. // HPE_BEGIN:
  50. // [msmith] Training Messages
  51. //=============================================================================
  52. usermessages->Register( "TrainingMsg", -1 ); // Displays a training message
  53. usermessages->Register( "TrainingObjective", -1 ); // Displays a training objective
  54. //=============================================================================
  55. // HPE_END
  56. //=============================================================================
  57. usermessages->Register( "DamageDodged", -1 );
  58. usermessages->Register( "PlayerJarated", 2 );
  59. usermessages->Register( "PlayerExtinguished", 2 );
  60. usermessages->Register( "PlayerJaratedFade", 2 );
  61. usermessages->Register( "PlayerShieldBlocked", 2 );
  62. usermessages->Register( "BreakModel", -1 );
  63. usermessages->Register( "CheapBreakModel", -1 );
  64. usermessages->Register( "BreakModel_Pumpkin", -1 );
  65. usermessages->Register( "BreakModelRocketDud", -1 );
  66. // Voting
  67. usermessages->Register( "CallVoteFailed", -1 );
  68. usermessages->Register( "VoteStart", -1 );
  69. usermessages->Register( "VotePass", -1 );
  70. usermessages->Register( "VoteFailed", 2 );
  71. usermessages->Register( "VoteSetup", -1 ); // Initiates client-side voting UI
  72. usermessages->Register( "PlayerBonusPoints", 3 );
  73. usermessages->Register( "RDTeamPointsChanged", 4 );
  74. usermessages->Register( "SpawnFlyingBird", -1 );
  75. usermessages->Register( "PlayerGodRayEffect", -1 );
  76. usermessages->Register( "PlayerTeleportHomeEffect", -1 );
  77. usermessages->Register( "MVMStatsReset", -1 );
  78. usermessages->Register( "MVMPlayerEvent", -1 );
  79. usermessages->Register( "MVMResetPlayerStats", -1 );
  80. usermessages->Register( "MVMWaveFailed", 0 );
  81. usermessages->Register( "MVMAnnouncement", 2 ); // Send an enumerated message
  82. usermessages->Register( "MVMPlayerUpgradedEvent", 9 ); // PlayerIdx(1), WaveIdx(1), ItemDef(2), AttributeDef(2), Quality(1), cost(2)
  83. usermessages->Register( "MVMVictory", 2 ); // IsKicking(1), time(1) (seconds)
  84. usermessages->Register( "MVMWaveChange", 15 ); // ServerWaveID(2), deaths(1), damageBot(4), damageGiant(4), damageTank(4)
  85. usermessages->Register( "MVMLocalPlayerUpgradesClear", 1 ); // Count(1)
  86. usermessages->Register( "MVMLocalPlayerUpgradesValue", 6 ); // Class(1), ItemDef(2), Upgrade(1), cost(2)
  87. usermessages->Register( "MVMResetPlayerWaveSpendingStats", 1 ); // Wave(1)
  88. usermessages->Register( "MVMLocalPlayerWaveSpendingValue", 12 ); // PlayerIdx(8), Wave(1), Type(1), Cost(2)
  89. usermessages->Register( "MVMResetPlayerUpgradeSpending", -1 );
  90. usermessages->Register( "MVMServerKickTimeUpdate", 1 ); // time(1) (seconds)
  91. usermessages->Register( "PlayerLoadoutUpdated", -1 );
  92. usermessages->Register( "PlayerTauntSoundLoopStart", -1 );
  93. usermessages->Register( "PlayerTauntSoundLoopEnd", -1 );
  94. usermessages->Register( "ForcePlayerViewAngles", -1 );
  95. usermessages->Register( "BonusDucks", 2 ); // ent index, ignoretimer
  96. usermessages->Register( "EOTLDuckEvent", 7 ); // IsCreated (vs IsPickedUp), ID of Creator, ID of Victim, ID of Toucher, iDuckTeam, Count, IsGolden
  97. usermessages->Register( "PlayerPickupWeapon", -1 );
  98. usermessages->Register( "QuestObjectiveCompleted", 8 + 2 + 2 + 2 ); // ItemID(8) + StandardPoints(2) + BonusPoints(2) + ObjectiveDef(2)
  99. usermessages->Register( "AutoBalanceVolunteer", -1 );
  100. usermessages->Register( "AutoBalanceVolunteer_Cancel", -1 );
  101. // NVNT register haptic user messages
  102. RegisterHapticMessages();
  103. }