dlgevaviewertab.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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/dlgevaviewertab.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 11/09/01 6:03p $*
  29. * *
  30. * $Revision:: 9 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __DLG_EVA_VIEWER_TAB_H
  39. #define __DLG_EVA_VIEWER_TAB_H
  40. #include "childdialog.h"
  41. #include "wwstring.h"
  42. #include "widestring.h"
  43. #include "vector.h"
  44. #include "encyclopediamgr.h"
  45. #include "playertype.h"
  46. ////////////////////////////////////////////////////////////////
  47. // Forward declarations
  48. ////////////////////////////////////////////////////////////////
  49. class ListCtrlClass;
  50. class DialogTextClass;
  51. class ViewerCtrlClass;
  52. ////////////////////////////////////////////////////////////////
  53. //
  54. // EvaViewerObjectClass
  55. //
  56. ////////////////////////////////////////////////////////////////
  57. class EvaViewerObjectClass
  58. {
  59. public:
  60. ////////////////////////////////////////////////////////////////
  61. // Public constructors/destructors
  62. ////////////////////////////////////////////////////////////////
  63. EvaViewerObjectClass (void) :
  64. ID (0),
  65. PlayerType (PLAYERTYPE_NEUTRAL),
  66. MinDistance (0) {}
  67. ~EvaViewerObjectClass (void) {}
  68. ////////////////////////////////////////////////////////////////
  69. // Public operators
  70. ////////////////////////////////////////////////////////////////
  71. bool operator== (const EvaViewerObjectClass &src) const { return false; }
  72. bool operator!= (const EvaViewerObjectClass &src) const { return true; }
  73. ////////////////////////////////////////////////////////////////
  74. // Public methods
  75. ////////////////////////////////////////////////////////////////
  76. int Get_ID (void) const { return ID; }
  77. const WCHAR * Get_Name (void) const { return Name; }
  78. const WCHAR * Get_Description (void) const { return Description; }
  79. const WCHAR * Get_Affiliation (void) const { return Affiliation; }
  80. const char * Get_Model_Name (void) const { return ModelName; }
  81. const char * Get_Anim_Name (void) const { return AnimName; }
  82. const char * Get_Definition_Name (void) const { return DefinitionName; }
  83. float Get_Min_Distance (void) const { return MinDistance; }
  84. int Get_Player_Type (void) const { return PlayerType; }
  85. void Set_ID (int id) { ID = id; }
  86. void Set_Name (const WCHAR *name) { Name = name; }
  87. void Set_Description (const WCHAR *string) { Description = string; }
  88. void Set_Affiliation (const WCHAR *string) { Affiliation = string; }
  89. void Set_Model_Name (const char *name) { ModelName = name; }
  90. void Set_Anim_Name (const char *name) { AnimName = name; }
  91. void Set_Definition_Name (const char *name) { DefinitionName = name; }
  92. void Set_Min_Distance (float dist) { MinDistance = dist; }
  93. void Set_Player_Type (int type) { PlayerType = type; }
  94. protected:
  95. ////////////////////////////////////////////////////////////////
  96. // Protected member data
  97. ////////////////////////////////////////////////////////////////
  98. WideStringClass Name;
  99. WideStringClass Description;
  100. WideStringClass Affiliation;
  101. StringClass ModelName;
  102. StringClass AnimName;
  103. StringClass DefinitionName;
  104. float MinDistance;
  105. int ID;
  106. int PlayerType;
  107. };
  108. ////////////////////////////////////////////////////////////////
  109. //
  110. // EvaViewerTabClass
  111. //
  112. ////////////////////////////////////////////////////////////////
  113. class EvaViewerTabClass : public ChildDialogClass
  114. {
  115. public:
  116. ////////////////////////////////////////////////////////////////
  117. // Public constructors/destructors
  118. ////////////////////////////////////////////////////////////////
  119. EvaViewerTabClass (int resource_id);
  120. ////////////////////////////////////////////////////////////////
  121. // Public methods
  122. ////////////////////////////////////////////////////////////////
  123. //
  124. // Data
  125. //
  126. void Set_INI_Filename (const char *filename) { INIFilename = filename; }
  127. //
  128. // Configuration
  129. //
  130. void Set_List_Ctrl (ListCtrlClass *list_ctrl) { ListCtrl = list_ctrl; }
  131. void Set_Description_Ctrl (DialogTextClass *ctrl) { DescriptionCtrl = ctrl; }
  132. void Set_Affiliation_Ctrl (DialogTextClass *ctrl) { AffiliationCtrl = ctrl; }
  133. void Set_Viewer_Ctrl (ViewerCtrlClass *ctrl) { ViewerCtrl = ctrl; }
  134. void Set_Encyclopedia_Type (EncyclopediaMgrClass::TYPE type) { EncyclopediaType = type; }
  135. //
  136. // Notifications
  137. //
  138. void On_ListCtrl_Sel_Change (ListCtrlClass *list_ctrl, int ctrl_id, int old_index, int new_index);
  139. void On_ViewerCtrl_Model_Loaded (ViewerCtrlClass *viewer_ctrl, int ctrl_id, RenderObjClass *model);
  140. protected:
  141. ////////////////////////////////////////////////////////////////
  142. // Protected methods
  143. ////////////////////////////////////////////////////////////////
  144. void On_Init_Dialog (void);
  145. void On_Destroy_Dialog (void);
  146. void View_Entry (int entry_index);
  147. void Build_Object_List (void);
  148. void Prepare_Model (RenderObjClass *model);
  149. ////////////////////////////////////////////////////////////////
  150. // Static methods
  151. ////////////////////////////////////////////////////////////////
  152. static int CALLBACK ListSortCallback (ListCtrlClass *list_ctrl, int item_index1, int item_index2, uint32 user_param);
  153. ////////////////////////////////////////////////////////////////
  154. // Protected member data
  155. ////////////////////////////////////////////////////////////////
  156. ListCtrlClass * ListCtrl;
  157. DialogTextClass * DescriptionCtrl;
  158. DialogTextClass * AffiliationCtrl;
  159. ViewerCtrlClass * ViewerCtrl;
  160. StringClass INIFilename;
  161. EncyclopediaMgrClass::TYPE EncyclopediaType;
  162. DynamicVectorClass<EvaViewerObjectClass> ObjectList;
  163. };
  164. #endif //__DLG_EVA_VIEWER_TAB_H