dlghelpscreen.cpp 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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/dlghelpscreen.cpp $*
  25. * *
  26. * Author:: Byon Garrabrant *
  27. * *
  28. * $Modtime:: 12/14/01 4:07p $*
  29. * *
  30. * $Revision:: 8 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #include "dlghelpscreen.h"
  36. #if 0
  37. #include "dialogresource.h"
  38. #include "tabctrl.h"
  39. #include "dlgevaobjectivestab.h"
  40. #include "dlgevamaptab.h"
  41. #include "dlgevadatatab.h"
  42. #include "dlgevacharacterstab.h"
  43. #include "dlgevaweaponstab.h"
  44. #include "dlgevavehiclestab.h"
  45. #include "dlgevabuildingstab.h"
  46. #include "cnetwork.h"
  47. #include "gamemode.h"
  48. #include "wolgmode.h"
  49. #include "dialogmgr.h"
  50. #include "gametype.h"
  51. #endif
  52. #include "menubackdrop.h"
  53. #include "gameinitmgr.h"
  54. #include "input.h"
  55. ////////////////////////////////////////////////////////////////
  56. //
  57. // HelpScreenDialogClass
  58. //
  59. ////////////////////////////////////////////////////////////////
  60. HelpScreenDialogClass::HelpScreenDialogClass (void) :
  61. MenuDialogClass ( IDD_HELP_SCREEN )
  62. {
  63. return ;
  64. }
  65. ////////////////////////////////////////////////////////////////
  66. //
  67. // ~HelpScreenDialogClass
  68. //
  69. ////////////////////////////////////////////////////////////////
  70. HelpScreenDialogClass::~HelpScreenDialogClass (void)
  71. {
  72. return ;
  73. }
  74. ////////////////////////////////////////////////////////////////
  75. //
  76. // On_Init_Dialog
  77. //
  78. ////////////////////////////////////////////////////////////////
  79. void
  80. HelpScreenDialogClass::On_Init_Dialog (void)
  81. {
  82. MenuDialogClass::On_Init_Dialog ();
  83. int key_table[][2] = {
  84. { IDC_HELP_KEY_FORWARD, INPUT_FUNCTION_MOVE_FORWARD },
  85. { IDC_HELP_KEY_BACKWARD, INPUT_FUNCTION_MOVE_BACKWARD },
  86. { IDC_HELP_KEY_LEFT, INPUT_FUNCTION_MOVE_LEFT },
  87. { IDC_HELP_KEY_RIGHT, INPUT_FUNCTION_MOVE_RIGHT },
  88. { IDC_HELP_KEY_RETURN, INPUT_FUNCTION_MENU_TOGGLE },
  89. { IDC_HELP_KEY_WALK, INPUT_FUNCTION_WALK_MODE },
  90. { IDC_HELP_KEY_CROUCH, INPUT_FUNCTION_CROUCH },
  91. { IDC_HELP_KEY_JUMP, INPUT_FUNCTION_JUMP },
  92. { IDC_HELP_KEY_OBJECTIVES, INPUT_FUNCTION_EVA_MISSION_OBJECTIVES_TOGGLE },
  93. { IDC_HELP_KEY_NEXT_WEAPON, INPUT_FUNCTION_NEXT_WEAPON },
  94. { IDC_HELP_KEY_ACTION, INPUT_FUNCTION_ACTION },
  95. { IDC_HELP_KEY_CYCLE_POGS, INPUT_FUNCTION_CYCLE_POG },
  96. { IDC_HELP_KEY_WEAPON1, INPUT_FUNCTION_SELECT_WEAPON_1 },
  97. { IDC_HELP_KEY_WEAPON2, INPUT_FUNCTION_SELECT_WEAPON_2 },
  98. { IDC_HELP_KEY_WEAPON3, INPUT_FUNCTION_SELECT_WEAPON_3 },
  99. { IDC_HELP_KEY_WEAPON4, INPUT_FUNCTION_SELECT_WEAPON_4 },
  100. { IDC_HELP_KEY_WEAPON5, INPUT_FUNCTION_SELECT_WEAPON_5 },
  101. };
  102. #define KEY_TABLE_SIZE (sizeof(key_table)/sizeof(key_table[0]))
  103. for ( int i = 0; i < KEY_TABLE_SIZE; i++ ) {
  104. int key = Input::Get_Primary_Key_For_Function( key_table[i][1] );
  105. WideStringClass wstr(0,true);
  106. Input::Get_Translated_Key_Name( key, wstr );
  107. Set_Dlg_Item_Text( key_table[i][0], wstr );
  108. }
  109. return ;
  110. }
  111. ////////////////////////////////////////////////////////////////
  112. //
  113. // On_Command
  114. //
  115. ////////////////////////////////////////////////////////////////
  116. void
  117. HelpScreenDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
  118. {
  119. switch (ctrl_id)
  120. {
  121. case IDOK:
  122. case IDCANCEL:
  123. GameInitMgrClass::Continue_Game ();
  124. break;
  125. }
  126. //
  127. // Allow the base class to process the message (if necessary)
  128. //
  129. MenuDialogClass::On_Command (ctrl_id, message_id, param);
  130. return ;
  131. }
  132. ////////////////////////////////////////////////////////////////
  133. //
  134. // Display
  135. //
  136. ////////////////////////////////////////////////////////////////
  137. void
  138. HelpScreenDialogClass::Display (void)
  139. {
  140. START_DIALOG (HelpScreenDialogClass);
  141. return ;
  142. }
  143. ////////////////////////////////////////////////////////////////
  144. //
  145. // On_Menu_Activate
  146. //
  147. ////////////////////////////////////////////////////////////////
  148. void
  149. HelpScreenDialogClass::On_Menu_Activate (bool onoff)
  150. {
  151. if (onoff) {
  152. //
  153. // Replace the backdrop
  154. //
  155. MenuBackDropClass * new_backdrop = new MenuBackDropClass;
  156. new_backdrop->Set_Model( "IF_HELPLOAD" );
  157. new_backdrop->Set_Animation( "IF_HELPLOAD.IF_HELPLOAD" );
  158. OldBackdrop = Replace_BackDrop( new_backdrop );
  159. } else {
  160. //
  161. // Restore the old backdrop
  162. //
  163. if (OldBackdrop != NULL) {
  164. OldBackdrop = Replace_BackDrop (OldBackdrop);
  165. if (OldBackdrop != NULL) {
  166. delete OldBackdrop;
  167. OldBackdrop = NULL;
  168. }
  169. }
  170. }
  171. return ;
  172. }
  173. ////////////////////////////////////////////////////////////////
  174. //
  175. // On_Destroy
  176. //
  177. ////////////////////////////////////////////////////////////////
  178. void
  179. HelpScreenDialogClass::On_Destroy (void)
  180. {
  181. //
  182. // Restore the old backdrop
  183. //
  184. if (OldBackdrop != NULL) {
  185. OldBackdrop = Replace_BackDrop (OldBackdrop);
  186. if (OldBackdrop != NULL) {
  187. delete OldBackdrop;
  188. OldBackdrop = NULL;
  189. }
  190. }
  191. return ;
  192. }
  193. ////////////////////////////////////////////////////////////////
  194. //
  195. // On_Key_Down
  196. //
  197. ////////////////////////////////////////////////////////////////
  198. bool
  199. HelpScreenDialogClass::On_Key_Down (uint32 key_id, uint32 key_data)
  200. {
  201. bool retval = false;
  202. switch (key_id)
  203. {
  204. case VK_RETURN:
  205. case VK_F1:
  206. GameInitMgrClass::Continue_Game ();
  207. break;
  208. default:
  209. retval = MenuDialogClass::On_Key_Down (key_id, key_data);
  210. break;
  211. }
  212. return retval;
  213. }