DlgRestart.cpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. *
  20. * NAME
  21. * $Archive: /Commando/Code/Commando/DlgRestart.cpp $
  22. *
  23. * DESCRIPTION
  24. * Dialog to notify the user that the game requires a restart.
  25. *
  26. * PROGRAMMER
  27. * Denzil E. Long, Jr.
  28. * $Author: Denzil_l $
  29. *
  30. * VERSION INFO
  31. * $Revision: 3 $
  32. * $Modtime: 10/18/01 6:23p $
  33. *
  34. ******************************************************************************/
  35. #include "DlgRestart.h"
  36. #include "Resource.h"
  37. #include "MainLoop.h"
  38. #include "String_IDs.h"
  39. #include <WWTranslateDB\TranslateDB.h>
  40. #include <WWDebug\WWDebug.h>
  41. /******************************************************************************
  42. *
  43. * NAME
  44. * DlgRestart::DoDialog
  45. *
  46. * DESCRIPTION
  47. *
  48. * INPUTS
  49. * NONE
  50. *
  51. * RESULT
  52. * True if dialog created successfully.
  53. *
  54. ******************************************************************************/
  55. bool DlgRestart::DoDialog(void)
  56. {
  57. DlgRestart* popup = new DlgRestart;
  58. if (popup)
  59. {
  60. popup->Start_Dialog();
  61. popup->Set_Title(TRANSLATE(IDS_RESTART_TITLE));
  62. popup->Release_Ref();
  63. }
  64. return (popup != NULL);
  65. }
  66. /******************************************************************************
  67. *
  68. * NAME
  69. * DlgRestart::DlgRestart
  70. *
  71. * DESCRIPTION
  72. * Constructor
  73. *
  74. * INPUTS
  75. * NONE
  76. *
  77. * RESULT
  78. * NONE
  79. *
  80. ******************************************************************************/
  81. DlgRestart::DlgRestart() :
  82. PopupDialogClass(IDD_MESSAGEBOX_OK)
  83. {
  84. WWDEBUG_SAY(("DlgRestart: Instantiated\n"));
  85. }
  86. /******************************************************************************
  87. *
  88. * NAME
  89. * DlgRestart::~DlgRestart
  90. *
  91. * DESCRIPTION
  92. * Destructor
  93. *
  94. * INPUTS
  95. * NONE
  96. *
  97. * RESULT
  98. * NONE
  99. *
  100. ******************************************************************************/
  101. DlgRestart::~DlgRestart()
  102. {
  103. WWDEBUG_SAY(("DlgRestart: Destructing\n"));
  104. }
  105. /******************************************************************************
  106. *
  107. * NAME
  108. * DlgRestart::On_Init_Dialog
  109. *
  110. * DESCRIPTION
  111. * One time initialzation.
  112. *
  113. * INPUTS
  114. * NONE
  115. *
  116. * RESULT
  117. * NONE
  118. *
  119. ******************************************************************************/
  120. void DlgRestart::On_Init_Dialog(void)
  121. {
  122. Set_Dlg_Item_Text(IDC_MESSAGE, TRANSLATE(IDS_RESTART_PROMPT));
  123. PopupDialogClass::On_Init_Dialog();
  124. }
  125. /******************************************************************************
  126. *
  127. * NAME
  128. * DlgRestart::On_Command
  129. *
  130. * DESCRIPTION
  131. * Process command message
  132. *
  133. * INPUTS
  134. * Ctrl - ID of control
  135. * Message -
  136. * Param -
  137. *
  138. * RESULT
  139. * NONE
  140. *
  141. ******************************************************************************/
  142. void DlgRestart::On_Command(int ctrl, int message, DWORD param)
  143. {
  144. if (IDOK == ctrl)
  145. {
  146. Stop_Main_Loop(RESTART_EXITCODE);
  147. End_Dialog();
  148. }
  149. }