| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- /*
- ** 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 : Commando *
- * *
- * $Archive:: /Commando/Code/Commando/renegadeplayerterminal.cpp $*
- * *
- * Author:: Patrick Smith *
- * *
- * $Modtime:: 12/17/01 2:18p $*
- * *
- * $Revision:: 5 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #include "renegadeplayerterminal.h"
- #include "dlgcncpurchasemainmenu.h"
- #include "soldier.h"
- #include "playertype.h"
- #include "renegadedialogmgr.h"
- #include "resource.h"
- //////////////////////////////////////////////////////////////////////
- // Global variables
- //////////////////////////////////////////////////////////////////////
- static RenegadePlayerTerminalClass _ThePlayerTerminal;
- //////////////////////////////////////////////////////////////////////
- //
- // RenegadePlayerTerminalClass
- //
- //////////////////////////////////////////////////////////////////////
- RenegadePlayerTerminalClass::RenegadePlayerTerminalClass (void)
- {
- _TheInstance = this;
- return ;
- }
- //////////////////////////////////////////////////////////////////////
- //
- // ~RenegadePlayerTerminalClass
- //
- //////////////////////////////////////////////////////////////////////
- RenegadePlayerTerminalClass::~RenegadePlayerTerminalClass (void)
- {
- _TheInstance = NULL;
- return ;
- }
- //////////////////////////////////////////////////////////////////////
- //
- // Show_Terminal_Dialog
- //
- //////////////////////////////////////////////////////////////////////
- void
- RenegadePlayerTerminalClass::Show_Terminal_Dialog (PurchaseSettingsDefClass::TEAM team)
- {
- //
- // Configure the team setting for the dialog
- //
- CNCPurchaseMainMenuClass *dialog = new CNCPurchaseMainMenuClass;
- dialog->Set_Team (team);
- //
- // Show the dialog
- //
- dialog->Start_Dialog ();
- REF_PTR_RELEASE (dialog);
- return ;
- }
- //////////////////////////////////////////////////////////////////////
- //
- // Display_Terminal
- //
- //////////////////////////////////////////////////////////////////////
- void
- RenegadePlayerTerminalClass::Display_Terminal (SoldierGameObj *player, TYPE type)
- {
- //if (player == NULL) {
- if (player == NULL || player->Get_Player_Data() == NULL) {
- return ;
- }
-
- //
- // Check to ensure this player can access the given terminal
- //
- if (player->Get_Player_Type () == PLAYERTYPE_GDI && type == TYPE_GDI) {
- Show_Terminal_Dialog (PurchaseSettingsDefClass::TEAM_GDI);
- } else if (player->Get_Player_Type () == PLAYERTYPE_NOD && type == TYPE_NOD) {
- Show_Terminal_Dialog (PurchaseSettingsDefClass::TEAM_NOD);
- } else if (type == TYPE_MUTANT) {
-
- //
- // Determine what player terminal to display -- GDI mutant or NOD mutant
- //
- if (player->Get_Player_Type () == PLAYERTYPE_GDI) {
- Show_Terminal_Dialog (PurchaseSettingsDefClass::TEAM_MUTANT_GDI);
- } else {
- Show_Terminal_Dialog (PurchaseSettingsDefClass::TEAM_MUTANT_NOD);
- }
- } else {
-
- //
- // Display a dialog to the user telling them they don't have access to this terminal.
- //
- RenegadeDialogMgrClass::Do_Simple_Dialog (IDD_CNC_PURCHASE_ACCESS_DENIED);
- }
- return ;
- }
- //////////////////////////////////////////////////////////////////////
- //
- // Display_Default_Terminal_For_Player
- //
- //////////////////////////////////////////////////////////////////////
- void
- RenegadePlayerTerminalClass::Display_Default_Terminal_For_Player (SoldierGameObj *player)
- {
- //if (player == NULL) {
- if (player == NULL || player->Get_Player_Data() == NULL) {
- return ;
- }
- if (player->Get_Player_Type () == PLAYERTYPE_GDI) {
- Show_Terminal_Dialog (PurchaseSettingsDefClass::TEAM_GDI);
- } else if (player->Get_Player_Type () == PLAYERTYPE_NOD) {
- Show_Terminal_Dialog (PurchaseSettingsDefClass::TEAM_NOD);
- }
- return ;
- }
|