InstallMenuDialog.cpp 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Installer *
  23. * *
  24. * $Archive:: /Commando/Code/Installer/InstallMenuDialog.c $*
  25. * *
  26. * $Author:: Ian_l $*
  27. * *
  28. * $Modtime:: 12/14/01 11:05a $*
  29. * *
  30. * $Revision:: 5 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. // Includes.
  36. #include "InstallMenuDialog.h"
  37. #include "AssetMgr.h"
  38. #include "HAnim.h"
  39. #include "MenuBackDrop.h"
  40. #include "Scene.h"
  41. #include "Translator.h"
  42. /***********************************************************************************************
  43. * InstallMenuDialogClass::InstallMenuDialogClass -- Constructor *
  44. * *
  45. * INPUT: *
  46. * *
  47. * OUTPUT: *
  48. * *
  49. * WARNINGS: *
  50. * *
  51. * HISTORY: *
  52. * 08/22/01 IML : Created. *
  53. *=============================================================================================*/
  54. InstallMenuDialogClass::InstallMenuDialogClass (int resourceid)
  55. : CallbackMenuDialogClass (resourceid)
  56. {
  57. // If a model has not yet been specified...
  58. if (Get_BackDrop()->Peek_Model() == NULL) {
  59. const char *basemodelname = "IF_BACK01";
  60. const char *baseanimname = "IF_BACK01.IF_BACK01";
  61. const unsigned supplementalmodelcount = 2;
  62. const char *supplementalmodelname [supplementalmodelcount] = {"IN_EVA", "IN_RENLOGO"};
  63. const char *supplementalanimname [supplementalmodelcount] = {"IN_EVA.IN_EVA", "IN_RENLOGO.IN_RENLOGO"};
  64. Get_BackDrop()->Set_Model (basemodelname);
  65. Get_BackDrop()->Set_Animation (baseanimname);
  66. for (unsigned m = 0; m < supplementalmodelcount; m++) {
  67. RenderObjClass *supplementalmodel;
  68. HAnimClass *supplementalanim;
  69. supplementalmodel = WW3DAssetManager::Get_Instance()->Create_Render_Obj (supplementalmodelname [m]);
  70. if (supplementalmodel != NULL) {
  71. Get_BackDrop()->Peek_Scene()->Add_Render_Object (supplementalmodel);
  72. }
  73. supplementalanim = WW3DAssetManager::Get_Instance()->Get_HAnim (supplementalanimname [m]);
  74. if (supplementalanim != NULL) {
  75. supplementalmodel->Set_Animation (supplementalanim, 0, RenderObjClass::ANIM_MODE_LOOP);
  76. REF_PTR_RELEASE (supplementalanim);
  77. }
  78. REF_PTR_RELEASE (supplementalmodel);
  79. }
  80. }
  81. }
  82. /***********************************************************************************************
  83. * InstallMenuDialogClass::~InstallMenuDialogClass -- Destructor *
  84. * *
  85. * INPUT: *
  86. * *
  87. * OUTPUT: *
  88. * *
  89. * WARNINGS: *
  90. * *
  91. * HISTORY: *
  92. * 08/22/01 IML : Created. *
  93. *=============================================================================================*/
  94. InstallMenuDialogClass::~InstallMenuDialogClass()
  95. {
  96. }
  97. /***********************************************************************************************
  98. * InstallMenuDialogClass::On_Command -- *
  99. * *
  100. * INPUT: *
  101. * *
  102. * OUTPUT: *
  103. * *
  104. * WARNINGS: *
  105. * *
  106. * HISTORY: *
  107. * 08/22/01 IML : Created. *
  108. *=============================================================================================*/
  109. void InstallMenuDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
  110. {
  111. switch (ctrl_id)
  112. {
  113. case IDCANCEL:
  114. {
  115. MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_EXIT_SETUP), TxWideStringClass (IDS_PROMPT_EXIT_SETUP), MessageBoxClass::MESSAGE_BOX_TYPE_YES_NO, this);
  116. return;
  117. }
  118. case IDOK:
  119. case IDC_BUTTON_BACK:
  120. break;
  121. default:
  122. break;
  123. }
  124. MenuDialogClass::On_Command (ctrl_id, message_id, param);
  125. }