dlgmpingamechat.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Combat *
  23. * *
  24. * $Archive:: /Commando/Code/commando/dlgmpingamechat.h $*
  25. * *
  26. * Author:: Tom SS *
  27. * *
  28. * $Modtime:: 2/19/02 2:28p $*
  29. * *
  30. * $Revision:: 8 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __DLGMPINGAMECHAT_H__
  39. #define __DLGMPINGAMECHAT_H__
  40. #include "popupdialog.h"
  41. #include "childdialog.h"
  42. #include "resource.h"
  43. #include "sctextobj.h"
  44. ////////////////////////////////////////////////////////////////
  45. //
  46. // MPChatChildDialogClass
  47. //
  48. ////////////////////////////////////////////////////////////////
  49. class MPChatChildDialogClass : public ChildDialogClass
  50. {
  51. public:
  52. ////////////////////////////////////////////////////////////////
  53. // Public constructors/destructors
  54. ////////////////////////////////////////////////////////////////
  55. MPChatChildDialogClass (void);
  56. ////////////////////////////////////////////////////////////////
  57. // Public methods
  58. ////////////////////////////////////////////////////////////////
  59. //
  60. // Configuration
  61. //
  62. void Set_Default_Type (TextMessageEnum message_type) { MessageType = message_type; }
  63. void Set_End_Dialog_On_Send (bool onoff) { EndDialogOnSend = onoff; }
  64. //
  65. // Inherited
  66. //
  67. void On_Init_Dialog (void);
  68. bool On_EditCtrl_Key_Down (EditCtrlClass *edit_ctrl, uint32 key_id, uint32 key_data);
  69. void On_EditCtrl_Change(EditCtrlClass *edit_ctrl, int ctrl_id);
  70. void On_EditCtrl_Enter_Pressed (EditCtrlClass *edit_ctrl, int ctrl_id);
  71. void On_Command (int ctrl_id, int message_id, DWORD param);
  72. protected:
  73. ////////////////////////////////////////////////////////////////
  74. // Protected methods
  75. ////////////////////////////////////////////////////////////////
  76. void Process_Message(void);
  77. void Send_Message(WideStringClass& message, TextMessageEnum type, int recipientID);
  78. bool Process_Commands(const WCHAR* message);
  79. //
  80. // Auto completetion
  81. //
  82. void Auto_Complete_Name (void);
  83. void Complete_Player_Name (const WCHAR *typed_name, WideStringClass &completed_name);
  84. bool Find_Current_Command (const WCHAR * message, int &start_index, int &end_index);
  85. ////////////////////////////////////////////////////////////////
  86. // Protected member data
  87. ////////////////////////////////////////////////////////////////
  88. TextMessageEnum MessageType;
  89. WideStringClass RecipientName;
  90. WideStringClass CurrRecipientName;
  91. bool TestForAutoCompletion;
  92. bool EndDialogOnSend;
  93. };
  94. ////////////////////////////////////////////////////////////////
  95. //
  96. // MPIngameChatPopupClass
  97. //
  98. ////////////////////////////////////////////////////////////////
  99. class MPIngameChatPopupClass : public PopupDialogClass
  100. {
  101. public:
  102. ////////////////////////////////////////////////////////////////
  103. // Public constructors/destructors
  104. ////////////////////////////////////////////////////////////////
  105. MPIngameChatPopupClass (void);
  106. ~MPIngameChatPopupClass (void);
  107. ////////////////////////////////////////////////////////////////
  108. // Public methods
  109. ////////////////////////////////////////////////////////////////
  110. //
  111. // Configuration
  112. //
  113. void Set_Default_Type (TextMessageEnum message_type) { DefaultType = message_type; }
  114. //
  115. // Inherited
  116. //
  117. void On_Init_Dialog (void);
  118. void On_Command (int ctrl_id, int mesage_id, DWORD param);
  119. void Render (void);
  120. //
  121. // Callbacks
  122. //
  123. //void On_ComboBoxCtrl_Sel_Change (ComboBoxCtrlClass *combo_ctrl, int ctrl_id, int old_sel, int new_sel);
  124. protected:
  125. ////////////////////////////////////////////////////////////////
  126. // Protected methods
  127. ////////////////////////////////////////////////////////////////
  128. void Send_Message (void);
  129. void Configure_Recipient_Combobox (void);
  130. void Configure_Message_Log_List (void);
  131. ////////////////////////////////////////////////////////////////
  132. // Protected member data
  133. ////////////////////////////////////////////////////////////////
  134. Render2DClass WindowBackgroundRenderer;
  135. TextMessageEnum DefaultType;
  136. MPChatChildDialogClass * ChatModule;
  137. };
  138. #endif //__DLGMPINGAMECHAT_H__