| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- /*
- ** Command & Conquer Renegade(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /***********************************************************************************************
- *** 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 ***
- ***********************************************************************************************
- * *
- * Project Name : Combat *
- * *
- * $Archive:: /Commando/Code/Commando/dlghelpscreen.cpp $*
- * *
- * Author:: Byon Garrabrant *
- * *
- * $Modtime:: 12/14/01 4:07p $*
- * *
- * $Revision:: 8 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #include "dlghelpscreen.h"
- #if 0
- #include "dialogresource.h"
- #include "tabctrl.h"
- #include "dlgevaobjectivestab.h"
- #include "dlgevamaptab.h"
- #include "dlgevadatatab.h"
- #include "dlgevacharacterstab.h"
- #include "dlgevaweaponstab.h"
- #include "dlgevavehiclestab.h"
- #include "dlgevabuildingstab.h"
- #include "cnetwork.h"
- #include "gamemode.h"
- #include "wolgmode.h"
- #include "dialogmgr.h"
- #include "gametype.h"
- #endif
- #include "menubackdrop.h"
- #include "gameinitmgr.h"
- #include "input.h"
- ////////////////////////////////////////////////////////////////
- //
- // HelpScreenDialogClass
- //
- ////////////////////////////////////////////////////////////////
- HelpScreenDialogClass::HelpScreenDialogClass (void) :
- MenuDialogClass ( IDD_HELP_SCREEN )
- {
- return ;
- }
- ////////////////////////////////////////////////////////////////
- //
- // ~HelpScreenDialogClass
- //
- ////////////////////////////////////////////////////////////////
- HelpScreenDialogClass::~HelpScreenDialogClass (void)
- {
- return ;
- }
- ////////////////////////////////////////////////////////////////
- //
- // On_Init_Dialog
- //
- ////////////////////////////////////////////////////////////////
- void
- HelpScreenDialogClass::On_Init_Dialog (void)
- {
- MenuDialogClass::On_Init_Dialog ();
- int key_table[][2] = {
- { IDC_HELP_KEY_FORWARD, INPUT_FUNCTION_MOVE_FORWARD },
- { IDC_HELP_KEY_BACKWARD, INPUT_FUNCTION_MOVE_BACKWARD },
- { IDC_HELP_KEY_LEFT, INPUT_FUNCTION_MOVE_LEFT },
- { IDC_HELP_KEY_RIGHT, INPUT_FUNCTION_MOVE_RIGHT },
- { IDC_HELP_KEY_RETURN, INPUT_FUNCTION_MENU_TOGGLE },
- { IDC_HELP_KEY_WALK, INPUT_FUNCTION_WALK_MODE },
- { IDC_HELP_KEY_CROUCH, INPUT_FUNCTION_CROUCH },
- { IDC_HELP_KEY_JUMP, INPUT_FUNCTION_JUMP },
- { IDC_HELP_KEY_OBJECTIVES, INPUT_FUNCTION_EVA_MISSION_OBJECTIVES_TOGGLE },
- { IDC_HELP_KEY_NEXT_WEAPON, INPUT_FUNCTION_NEXT_WEAPON },
- { IDC_HELP_KEY_ACTION, INPUT_FUNCTION_ACTION },
- { IDC_HELP_KEY_CYCLE_POGS, INPUT_FUNCTION_CYCLE_POG },
- { IDC_HELP_KEY_WEAPON1, INPUT_FUNCTION_SELECT_WEAPON_1 },
- { IDC_HELP_KEY_WEAPON2, INPUT_FUNCTION_SELECT_WEAPON_2 },
- { IDC_HELP_KEY_WEAPON3, INPUT_FUNCTION_SELECT_WEAPON_3 },
- { IDC_HELP_KEY_WEAPON4, INPUT_FUNCTION_SELECT_WEAPON_4 },
- { IDC_HELP_KEY_WEAPON5, INPUT_FUNCTION_SELECT_WEAPON_5 },
- };
- #define KEY_TABLE_SIZE (sizeof(key_table)/sizeof(key_table[0]))
- for ( int i = 0; i < KEY_TABLE_SIZE; i++ ) {
- int key = Input::Get_Primary_Key_For_Function( key_table[i][1] );
- WideStringClass wstr(0,true);
- Input::Get_Translated_Key_Name( key, wstr );
- Set_Dlg_Item_Text( key_table[i][0], wstr );
- }
- return ;
- }
- ////////////////////////////////////////////////////////////////
- //
- // On_Command
- //
- ////////////////////////////////////////////////////////////////
- void
- HelpScreenDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
- {
- switch (ctrl_id)
- {
- case IDOK:
- case IDCANCEL:
- GameInitMgrClass::Continue_Game ();
- break;
- }
- //
- // Allow the base class to process the message (if necessary)
- //
- MenuDialogClass::On_Command (ctrl_id, message_id, param);
- return ;
- }
- ////////////////////////////////////////////////////////////////
- //
- // Display
- //
- ////////////////////////////////////////////////////////////////
- void
- HelpScreenDialogClass::Display (void)
- {
- START_DIALOG (HelpScreenDialogClass);
- return ;
- }
- ////////////////////////////////////////////////////////////////
- //
- // On_Menu_Activate
- //
- ////////////////////////////////////////////////////////////////
- void
- HelpScreenDialogClass::On_Menu_Activate (bool onoff)
- {
- if (onoff) {
- //
- // Replace the backdrop
- //
- MenuBackDropClass * new_backdrop = new MenuBackDropClass;
- new_backdrop->Set_Model( "IF_HELPLOAD" );
- new_backdrop->Set_Animation( "IF_HELPLOAD.IF_HELPLOAD" );
- OldBackdrop = Replace_BackDrop( new_backdrop );
- } else {
- //
- // Restore the old backdrop
- //
- if (OldBackdrop != NULL) {
- OldBackdrop = Replace_BackDrop (OldBackdrop);
- if (OldBackdrop != NULL) {
- delete OldBackdrop;
- OldBackdrop = NULL;
- }
- }
- }
- return ;
- }
- ////////////////////////////////////////////////////////////////
- //
- // On_Destroy
- //
- ////////////////////////////////////////////////////////////////
- void
- HelpScreenDialogClass::On_Destroy (void)
- {
- //
- // Restore the old backdrop
- //
- if (OldBackdrop != NULL) {
- OldBackdrop = Replace_BackDrop (OldBackdrop);
- if (OldBackdrop != NULL) {
- delete OldBackdrop;
- OldBackdrop = NULL;
- }
- }
- return ;
- }
- ////////////////////////////////////////////////////////////////
- //
- // On_Key_Down
- //
- ////////////////////////////////////////////////////////////////
- bool
- HelpScreenDialogClass::On_Key_Down (uint32 key_id, uint32 key_data)
- {
- bool retval = false;
- switch (key_id)
- {
- case VK_RETURN:
- case VK_F1:
- GameInitMgrClass::Continue_Game ();
- break;
- default:
- retval = MenuDialogClass::On_Key_Down (key_id, key_data);
- break;
- }
- return retval;
- }
|