doom3-bfg/neo/d3xp/menus/MenuScreen.h

1846 lines
50 KiB
C
Raw Normal View History

2012-11-26 18:58:24 +00:00
/*
===========================================================================
Doom 3 BFG Edition GPL Source Code
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
2012-11-26 18:58:24 +00:00
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
2012-11-26 18:58:24 +00:00
Doom 3 BFG Edition Source Code 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.
Doom 3 BFG Edition Source Code 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 Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#ifndef __MENUSCREEN_H__
#define __MENUSCREEN_H__
#include "../../renderer/tr_local.h"
enum mainMenuTransition_t
{
2012-11-26 18:58:24 +00:00
MENU_TRANSITION_INVALID = -1,
MENU_TRANSITION_SIMPLE,
MENU_TRANSITION_ADVANCE,
MENU_TRANSITION_BACK,
MENU_TRANSITION_FORCE
};
enum cursorState_t
{
2012-11-26 18:58:24 +00:00
CURSOR_NONE,
CURSOR_IN_COMBAT,
CURSOR_TALK,
CURSOR_GRABBER,
CURSOR_ITEM,
};
/*
================================================
idLBRowBlock
2012-11-26 18:58:24 +00:00
================================================
*/
class idLBRowBlock
{
2012-11-26 18:58:24 +00:00
public:
idLBRowBlock() : lastTime( 0 ), startIndex( 0 ) {}
2012-11-26 18:58:24 +00:00
int lastTime;
int startIndex;
idList< idLeaderboardCallback::row_t > rows;
};
enum leaderboardFilterMode_t
{
2012-11-26 18:58:24 +00:00
LEADERBOARD_FILTER_OVERALL = 0,
LEADERBOARD_FILTER_MYSCORE = 1,
LEADERBOARD_FILTER_FRIENDS = 2
};
/*
================================================
idLBCache
2012-11-26 18:58:24 +00:00
================================================
*/
class idLBCache
{
2012-11-26 18:58:24 +00:00
public:
static const int NUM_ROW_BLOCKS = 5;
static const leaderboardFilterMode_t DEFAULT_LEADERBOARD_FILTER = LEADERBOARD_FILTER_OVERALL;
2012-11-26 18:58:24 +00:00
idLBCache() :
def( NULL ),
filter( DEFAULT_LEADERBOARD_FILTER ),
pendingDef( NULL ),
pendingFilter( DEFAULT_LEADERBOARD_FILTER ),
requestingRows( false ),
loadingNewLeaderboard( false ),
numRowsInLeaderboard( 0 ),
2012-11-26 18:58:24 +00:00
entryIndex( 0 ),
rowOffset( 0 ),
localIndex( -1 ),
errorCode( LEADERBOARD_DISPLAY_ERROR_NONE ) {}
2012-11-26 18:58:24 +00:00
void Pump();
void Reset();
void SetLeaderboard( const leaderboardDefinition_t* def_, leaderboardFilterMode_t filter_ = DEFAULT_LEADERBOARD_FILTER );
2012-11-26 18:58:24 +00:00
void CycleFilter();
leaderboardFilterMode_t GetFilter() const
{
return filter;
}
2012-11-26 18:58:24 +00:00
idStr GetFilterStrType();
bool Scroll( int amount );
bool ScrollOffset( int amount );
idLBRowBlock* FindFreeRowBlock();
void Update( const idLeaderboardCallback* callback );
const idLeaderboardCallback::row_t* GetLeaderboardRow( int row );
const leaderboardDefinition_t* GetLeaderboard() const
{
return def;
}
int GetNumRowsInLeaderboard() const
{
return numRowsInLeaderboard;
}
int GetEntryIndex() const
{
return entryIndex;
}
int GetRowOffset() const
{
return rowOffset;
}
int GetLocalIndex() const
{
return localIndex;
}
leaderboardDisplayError_t GetErrorCode() const
{
return errorCode;
}
bool IsRequestingRows() const
{
return requestingRows;
}
bool IsLoadingNewLeaderboard() const
{
return loadingNewLeaderboard;
}
void SetEntryIndex( int value )
{
entryIndex = value;
}
void SetRowOffset( int value )
{
rowOffset = value;
}
void DisplayGamerCardUI( const idLeaderboardCallback::row_t* row );
2012-11-26 18:58:24 +00:00
private:
leaderboardDisplayError_t CallbackErrorToDisplayError( leaderboardError_t errorCode );
2012-11-26 18:58:24 +00:00
idLBRowBlock rowBlocks[NUM_ROW_BLOCKS];
const leaderboardDefinition_t* def;
2012-11-26 18:58:24 +00:00
leaderboardFilterMode_t filter;
2012-11-26 18:58:24 +00:00
// Pending def and filter are simply used to queue up SetLeaderboard calls when the system is currently
// busy waiting on results from a previous SetLeaderboard/GetLeaderboardRow call.
// This is so we only have ONE request in-flight at any given time.
const leaderboardDefinition_t* pendingDef;
2012-11-26 18:58:24 +00:00
leaderboardFilterMode_t pendingFilter;
2012-11-26 18:58:24 +00:00
bool requestingRows; // True while requested rows are in flight
bool loadingNewLeaderboard; // True when changing to a new leaderboard (or filter type)
2012-11-26 18:58:24 +00:00
int numRowsInLeaderboard; // Total rows in this leaderboard (they won't all be cached though)
int entryIndex; // Relative row offset (from top of viewing window)
int rowOffset; // Absolute row offset
int localIndex; // Row for the master local user (-1 means not on leaderboard)
2012-11-26 18:58:24 +00:00
leaderboardDisplayError_t errorCode; // Error state of the leaderboard
};
/*
================================================
idMenuScreen
================================================
*/
class idMenuScreen : public idMenuWidget
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen();
virtual ~idMenuScreen();
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void UpdateCmds();
virtual void HandleMenu( const mainMenuTransition_t type );
2012-11-26 18:58:24 +00:00
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual void ObserveEvent( const idMenuWidget& widget, const idWidgetEvent& event );
virtual void SetScreenGui( idSWF* gui )
{
menuGUI = gui;
}
2012-11-26 18:58:24 +00:00
protected:
idSWF* menuGUI;
2012-11-26 18:58:24 +00:00
mainMenuTransition_t transition;
2012-11-26 18:58:24 +00:00
};
/*
================================================
idMenuScreen_PDA_UserData
================================================
*/
class idMenuScreen_PDA_UserData : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_PDA_UserData() {}
2012-11-26 18:58:24 +00:00
virtual ~idMenuScreen_PDA_UserData() {}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
idMenuWidget_PDA_UserData* GetUserData()
{
return &pdaUserData;
}
idMenuWidget_PDA_Objective* GetObjective()
{
return &pdaObjectiveSimple;
}
idMenuWidget_PDA_AudioFiles* GetAudioFiles()
{
return &pdaAudioFiles;
}
private:
2012-11-26 18:58:24 +00:00
idMenuWidget_PDA_UserData pdaUserData;
idMenuWidget_PDA_Objective pdaObjectiveSimple;
idMenuWidget_PDA_AudioFiles pdaAudioFiles;
};
/*
================================================
idMenuScreen_PDA_UserEmails
================================================
*/
class idMenuScreen_PDA_UserEmails : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_PDA_UserEmails() :
2012-11-26 18:58:24 +00:00
readingEmails( false ),
scrollEmailInfo( false )
{
2012-11-26 18:58:24 +00:00
}
virtual ~idMenuScreen_PDA_UserEmails()
{
2012-11-26 18:58:24 +00:00
}
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
virtual void ObserveEvent( const idMenuWidget& widget, const idWidgetEvent& event );
idMenuWidget_PDA_EmailInbox& GetInbox()
{
return pdaInbox;
}
2012-11-26 18:58:24 +00:00
bool ScrollCorrectList( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget );
2012-11-26 18:58:24 +00:00
void ShowEmail( bool show );
void UpdateEmail();
private:
2012-11-26 18:58:24 +00:00
idMenuWidget_PDA_EmailInbox pdaInbox;
idMenuWidget_InfoBox emailInfo;
idMenuWidget_ScrollBar emailScrollbar;
bool readingEmails;
bool scrollEmailInfo;
};
/*
================================================
idMenuScreen_PDA_UserData
================================================
*/
class idMenuScreen_PDA_VideoDisks : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_PDA_VideoDisks() :
activeVideo( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual ~idMenuScreen_PDA_VideoDisks()
{
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
void ToggleVideoDiskPlay();
void UpdateVideoDetails();
void SelectedVideoToPlay( int index );
void ClearActiveVideo()
{
activeVideo = NULL;
}
const idDeclVideo* GetActiveVideo()
{
return activeVideo;
}
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_ScrollBar scrollbar;
idMenuWidget_DynamicList pdaVideoList;
idMenuWidget_PDA_VideoInfo videoDetails;
idList< idList< idStr, TAG_IDLIB_LIST_MENU>, TAG_IDLIB_LIST_MENU > videoItems;
const idDeclVideo* activeVideo;
2012-11-26 18:58:24 +00:00
};
/*
================================================
idMenuScreen_PDA_UserData
================================================
*/
class idMenuScreen_PDA_Inventory : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_PDA_Inventory()
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
void EquipWeapon();
const char* GetWeaponName( int index );
2012-11-26 18:58:24 +00:00
bool IsVisibleWeapon( int index );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_Carousel itemList;
idMenuWidget_InfoBox infoBox;
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Root
//================================================
//*/
class idMenuScreen_Shell_Root : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Root() :
2012-11-26 18:58:24 +00:00
options( NULL ),
helpWidget( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
void HandleExitGameBtn();
int GetRootIndex();
void SetRootIndex( int index );
idMenuWidget_Help* GetHelpWidget()
{
return helpWidget;
}
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
idMenuWidget_Help* helpWidget;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Pause
//================================================
//*/
class idMenuScreen_Shell_Pause : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Pause() :
2012-11-26 18:58:24 +00:00
options( NULL ),
isMpPause( false )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
void HandleExitGameBtn();
void HandleRestartBtn();
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
2012-11-26 18:58:24 +00:00
bool isMpPause;
};
//*
//================================================
//idMenuScreen_Shell_PressStart
//================================================
//*/
class idMenuScreen_Shell_PressStart : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_PressStart() :
2012-11-26 18:58:24 +00:00
startButton( NULL ),
options( NULL ),
itemList( NULL ),
doomCover( NULL ),
doom2Cover( NULL ),
doom3Cover( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
private:
idMenuWidget_Button* startButton;
idMenuWidget_DynamicList* options;
idMenuWidget_Carousel* itemList;
const idMaterial* doomCover;
const idMaterial* doom2Cover;
const idMaterial* doom3Cover;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
//idMenuScreen_Shell_PressStart
//================================================
//*/
class idMenuScreen_Shell_GameSelect : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_GameSelect() :
2012-11-26 18:58:24 +00:00
startButton( NULL ),
options( NULL ),
itemList( NULL ),
doomCover( NULL ),
doom2Cover( NULL ),
doom3Cover( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
private:
idMenuWidget_Button* startButton;
idMenuWidget_DynamicList* options;
idMenuWidget_Carousel* itemList;
const idMaterial* doomCover;
const idMaterial* doom2Cover;
const idMaterial* doom3Cover;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Singleplayer
//================================================
//*/
class idMenuScreen_Shell_Singleplayer : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Singleplayer() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL ),
canContinue( false )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
void SetCanContinue( bool valid )
{
canContinue = valid;
}
2012-11-26 18:58:24 +00:00
void ContinueGame();
private:
bool canContinue;
idMenuWidget_DynamicList* options;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Settings
//================================================
//*/
class idMenuScreen_Shell_Settings : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Settings() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
struct creditInfo_t
{
2012-11-26 18:58:24 +00:00
creditInfo_t()
{
2012-11-26 18:58:24 +00:00
type = -1;
entry = "";
}
creditInfo_t( int t, const char* val )
{
2012-11-26 18:58:24 +00:00
type = t;
entry = val;
}
2012-11-26 18:58:24 +00:00
int type;
idStr entry;
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Credits
//================================================
//*/
class idMenuScreen_Shell_Credits : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Credits() :
2012-11-26 18:58:24 +00:00
btnBack( NULL ),
creditIndex( 0 )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
void SetupCreditList();
void UpdateCredits();
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
idList< creditInfo_t > creditList;
int creditIndex;
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Resolution
//================================================
//*/
class idMenuScreen_Shell_Resolution : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Resolution() :
options( NULL ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
struct optionData_t
{
optionData_t()
{
2012-11-26 18:58:24 +00:00
fullscreen = -1;
vidmode = -1;
}
optionData_t( int f, int v )
{
2012-11-26 18:58:24 +00:00
fullscreen = f;
vidmode = v;
}
optionData_t( const optionData_t& other )
{
2012-11-26 18:58:24 +00:00
fullscreen = other.fullscreen;
vidmode = other.vidmode;
}
const optionData_t& operator=( const optionData_t& other )
{
2012-11-26 18:58:24 +00:00
fullscreen = other.fullscreen;
vidmode = other.vidmode;
return *this;
}
bool operator==( const optionData_t& other ) const
{
2012-11-26 18:58:24 +00:00
return ( fullscreen == other.fullscreen ) && ( ( vidmode == other.vidmode ) || ( fullscreen == 0 ) );
}
int fullscreen;
int vidmode;
};
idList<optionData_t> optionData;
2012-11-26 18:58:24 +00:00
optionData_t originalOption;
idMenuWidget_DynamicList* options;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Difficulty
//================================================
//*/
class idMenuScreen_Shell_Difficulty : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Difficulty() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL ),
nightmareUnlocked( false )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
bool nightmareUnlocked;
idMenuWidget_DynamicList* options;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Playstation
//================================================
//*/
class idMenuScreen_Shell_Playstation : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Playstation() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_ModeSelect
//================================================
//*/
class idMenuScreen_Shell_ModeSelect : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_ModeSelect() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_GameBrowser
//================================================
//*/
class idMenuScreen_Shell_GameBrowser : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_GameBrowser() :
listWidget( NULL ),
btnBack( NULL )
{
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandle = false );
2012-11-26 18:58:24 +00:00
void UpdateServerList();
void OnServerListReady();
void DescribeServer( const serverInfo_t& server, const int index );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_GameBrowserList* listWidget;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Leaderboards
//================================================
//*/
class idMenuScreen_Shell_Leaderboards : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Leaderboards() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL ),
refreshLeaderboard( false ),
refreshWhenMasterIsOnline( false ),
lbIndex( 0 ),
btnPrev( NULL ),
btnNext( NULL ),
lbHeading( NULL ),
btnPageDwn( NULL ),
btnPageUp( NULL )
{
2012-11-26 18:58:24 +00:00
}
2012-11-26 18:58:24 +00:00
virtual ~idMenuScreen_Shell_Leaderboards();
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
void UpdateLeaderboard( const idLeaderboardCallback* callback );
2012-11-26 18:58:24 +00:00
void PumpLBCache();
void RefreshLeaderboard();
void ShowMessage( bool show, idStr message, bool spinner );
void ClearLeaderboard();
void SetLeaderboardIndex();
2012-11-26 18:58:24 +00:00
protected:
struct doomLeaderboard_t
{
doomLeaderboard_t() : lb( NULL ) { }
doomLeaderboard_t( const leaderboardDefinition_t* _lb, idStr _name )
{
lb = _lb;
name = _name;
}
const leaderboardDefinition_t* lb;
2012-11-26 18:58:24 +00:00
idStr name;
};
2012-11-26 18:58:24 +00:00
idList< doomLeaderboard_t > leaderboards;
idMenuWidget_DynamicList* options;
idMenuWidget_Button* btnBack;
idMenuWidget_Button* btnPrev;
idMenuWidget_Button* btnNext;
idMenuWidget_Button* btnPageDwn;
idMenuWidget_Button* btnPageUp;
idLBCache* lbCache;
idSWFTextInstance* lbHeading;
2012-11-26 18:58:24 +00:00
int lbIndex;
bool refreshLeaderboard;
bool refreshWhenMasterIsOnline;
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Bindings
//================================================
//*/
class idMenuScreen_Shell_Bindings : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Bindings() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL ),
blinder( NULL ),
restoreDefault( NULL ),
txtBlinder( NULL ),
bindingsChanged( false )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
void SetBinding( int keyNum );
void UpdateBindingDisplay();
void ToggleWait( bool wait );
void SetBindingChanged( bool changed )
{
bindingsChanged = changed;
}
2012-11-26 18:58:24 +00:00
protected:
void HandleRestoreDefaults();
idMenuWidget_DynamicList* options;
idMenuWidget_Button* restoreDefault;
idSWFSpriteInstance* blinder;
idSWFSpriteInstance* txtBlinder;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
bool bindingsChanged;
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Dev
//================================================
//*/
class idMenuScreen_Shell_Dev : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
struct devOption_t
{
devOption_t()
{
2012-11-26 18:58:24 +00:00
map = "";
name = "";
};
devOption_t( const char* m, const char* n )
{
2012-11-26 18:58:24 +00:00
map = m;
name = n;
}
const char* map;
const char* name;
2012-11-26 18:58:24 +00:00
};
idMenuScreen_Shell_Dev() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
void SetupDevOptions();
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
idList< devOption_t, TAG_IDLIB_LIST_MENU > devOptions;
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_NewGame
//================================================
//*/
class idMenuScreen_Shell_NewGame : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_NewGame() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Load
//================================================
//*/
class idMenuScreen_Shell_Load : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Load() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL ),
btnDelete( NULL ),
saveInfo( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
void UpdateSaveEnumerations();
void LoadDamagedGame( int index );
void LoadGame( int index );
void DeleteGame( int index );
saveGameDetailsList_t GetSortedSaves() const
{
return sortedSaves;
}
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
idMenuWidget_Shell_SaveInfo* saveInfo;
idMenuWidget_Button* btnBack;
idMenuWidget_Button* btnDelete;
2012-11-26 18:58:24 +00:00
saveGameDetailsList_t sortedSaves;
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Save
//================================================
//*/
class idMenuScreen_Shell_Save : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_Save() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL ),
btnDelete( NULL ),
saveInfo( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
saveGameDetailsList_t GetSortedSaves() const
{
return sortedSaves;
}
2012-11-26 18:58:24 +00:00
void UpdateSaveEnumerations();
void SaveGame( int index );
void DeleteGame( int index );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_Button* btnBack;
idMenuWidget_DynamicList* options;
idMenuWidget_Shell_SaveInfo* saveInfo;
idMenuWidget_Button* btnDelete;
2012-11-26 18:58:24 +00:00
saveGameDetailsList_t sortedSaves;
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_GameOptions
//================================================
//*/
class idMenuScreen_Shell_GameOptions : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
/*
================================================
idMenuDataSource_GameSettings
================================================
*/
class idMenuDataSource_GameSettings : public idMenuDataSource
{
2012-11-26 18:58:24 +00:00
public:
enum gameSettingFields_t
{
2012-11-26 18:58:24 +00:00
GAME_FIELD_FOV,
GAME_FIELD_CHECKPOINTS,
GAME_FIELD_AUTO_SWITCH,
GAME_FIELD_AUTO_RELOAD,
GAME_FIELD_AIM_ASSIST,
GAME_FIELD_ALWAYS_SPRINT,
GAME_FIELD_FLASHLIGHT_SHADOWS,
MAX_GAME_FIELDS
};
2012-11-26 18:58:24 +00:00
idMenuDataSource_GameSettings();
2012-11-26 18:58:24 +00:00
// loads data
virtual void LoadData();
2012-11-26 18:58:24 +00:00
// submits data
virtual void CommitData();
2012-11-26 18:58:24 +00:00
// says whether something changed with the data
virtual bool IsDataChanged() const;
2012-11-26 18:58:24 +00:00
// retrieves a particular field for reading or updating
virtual idSWFScriptVar GetField( const int fieldIndex ) const
{
return fields[ fieldIndex ];
}
2012-11-26 18:58:24 +00:00
virtual void AdjustField( const int fieldIndex, const int adjustAmount );
2012-11-26 18:58:24 +00:00
private:
idStaticList< idSWFScriptVar, MAX_GAME_FIELDS > fields;
idStaticList< idSWFScriptVar, MAX_GAME_FIELDS > originalFields;
};
idMenuScreen_Shell_GameOptions() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
2012-11-26 18:58:24 +00:00
idMenuDataSource_GameSettings systemData;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_GameOptions
//================================================
//*/
class idMenuScreen_Shell_MatchSettings : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
/*
================================================
idMenuDataSource_MatchSettings
================================================
*/
class idMenuDataSource_MatchSettings : public idMenuDataSource
{
2012-11-26 18:58:24 +00:00
public:
enum matchSettingFields_t
{
2012-11-26 18:58:24 +00:00
MATCH_FIELD_MODE,
MATCH_FIELD_MAP,
MATCH_FIELD_TIME,
MATCH_FIELD_SCORE,
MAX_MATCH_FIELDS
};
2012-11-26 18:58:24 +00:00
idMenuDataSource_MatchSettings();
2012-11-26 18:58:24 +00:00
// loads data
virtual void LoadData();
2012-11-26 18:58:24 +00:00
// submits data
virtual void CommitData();
2012-11-26 18:58:24 +00:00
// says whether something changed with the data
virtual bool IsDataChanged() const;
// retrieves a particular field for reading or updating
virtual idSWFScriptVar GetField( const int fieldIndex ) const
{
return fields[ fieldIndex ];
}
2012-11-26 18:58:24 +00:00
virtual void AdjustField( const int fieldIndex, const int adjustAmount );
bool MapChanged()
{
return updateMap;
}
void ClearMapChanged()
{
updateMap = false;
}
2012-11-26 18:58:24 +00:00
private:
void GetModeName( int index, idStr& name );
void GetMapName( int index, idStr& name );
2012-11-26 18:58:24 +00:00
idStaticList< idSWFScriptVar, MAX_MATCH_FIELDS > fields;
idStaticList< idSWFScriptVar, MAX_MATCH_FIELDS > originalFields;
bool updateMap;
};
idMenuScreen_Shell_MatchSettings() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
2012-11-26 18:58:24 +00:00
idMenuDataSource_MatchSettings matchData;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Controls
//================================================
//*/
class idMenuScreen_Shell_Controls : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
/*
================================================
idMenuDataSource_ControlSettings
================================================
*/
class idMenuDataSource_ControlSettings : public idMenuDataSource
{
2012-11-26 18:58:24 +00:00
public:
enum controlSettingFields_t
{
2012-11-26 18:58:24 +00:00
CONTROLS_FIELD_INVERT_MOUSE,
CONTROLS_FIELD_GAMEPAD_ENABLED,
CONTROLS_FIELD_MOUSE_SENS,
2012-11-26 18:58:24 +00:00
MAX_CONTROL_FIELDS
};
2012-11-26 18:58:24 +00:00
idMenuDataSource_ControlSettings();
2012-11-26 18:58:24 +00:00
// loads data
virtual void LoadData();
2012-11-26 18:58:24 +00:00
// submits data
virtual void CommitData();
2012-11-26 18:58:24 +00:00
// says whether something changed with the data
virtual bool IsDataChanged() const;
2012-11-26 18:58:24 +00:00
// retrieves a particular field for reading or updating
virtual idSWFScriptVar GetField( const int fieldIndex ) const
{
return fields[ fieldIndex ];
}
2012-11-26 18:58:24 +00:00
virtual void AdjustField( const int fieldIndex, const int adjustAmount );
2012-11-26 18:58:24 +00:00
private:
idStaticList< idSWFScriptVar, MAX_CONTROL_FIELDS > fields;
idStaticList< idSWFScriptVar, MAX_CONTROL_FIELDS > originalFields;
};
idMenuScreen_Shell_Controls() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
2012-11-26 18:58:24 +00:00
idMenuDataSource_ControlSettings controlData;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Controls
//================================================
//*/
class idMenuScreen_Shell_Gamepad : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
/*
================================================
idMenuDataSource_ControlSettings
================================================
*/
class idMenuDataSource_GamepadSettings : public idMenuDataSource
{
2012-11-26 18:58:24 +00:00
public:
enum controlSettingFields_t
{
2012-11-26 18:58:24 +00:00
GAMEPAD_FIELD_LEFTY,
GAMEPAD_FIELD_INVERT,
GAMEPAD_FIELD_VIBRATE,
GAMEPAD_FIELD_HOR_SENS,
2012-11-26 18:58:24 +00:00
GAMEPAD_FIELD_VERT_SENS,
GAMEPAD_FIELD_ACCELERATION,
GAMEPAD_FIELD_THRESHOLD,
MAX_GAMEPAD_FIELDS
};
2012-11-26 18:58:24 +00:00
idMenuDataSource_GamepadSettings();
2012-11-26 18:58:24 +00:00
// loads data
virtual void LoadData();
2012-11-26 18:58:24 +00:00
// submits data
virtual void CommitData();
2012-11-26 18:58:24 +00:00
// says whether something changed with the data
virtual bool IsDataChanged() const;
2012-11-26 18:58:24 +00:00
// retrieves a particular field for reading or updating
virtual idSWFScriptVar GetField( const int fieldIndex ) const
{
return fields[ fieldIndex ];
}
2012-11-26 18:58:24 +00:00
virtual void AdjustField( const int fieldIndex, const int adjustAmount );
2012-11-26 18:58:24 +00:00
private:
idStaticList< idSWFScriptVar, MAX_GAMEPAD_FIELDS > fields;
idStaticList< idSWFScriptVar, MAX_GAMEPAD_FIELDS > originalFields;
};
idMenuScreen_Shell_Gamepad() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
2012-11-26 18:58:24 +00:00
idMenuDataSource_GamepadSettings gamepadData;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_ControllerLayout
//================================================
//*/
class idMenuScreen_Shell_ControllerLayout : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
/*
================================================
idMenuDataSource_ControlSettings
================================================
*/
class idMenuDataSource_LayoutSettings : public idMenuDataSource
{
2012-11-26 18:58:24 +00:00
public:
enum controlSettingFields_t
{
2012-11-26 18:58:24 +00:00
LAYOUT_FIELD_LAYOUT,
MAX_LAYOUT_FIELDS,
};
2012-11-26 18:58:24 +00:00
idMenuDataSource_LayoutSettings();
2012-11-26 18:58:24 +00:00
// loads data
virtual void LoadData();
2012-11-26 18:58:24 +00:00
// submits data
virtual void CommitData();
2012-11-26 18:58:24 +00:00
// says whether something changed with the data
virtual bool IsDataChanged() const;
2012-11-26 18:58:24 +00:00
// retrieves a particular field for reading or updating
virtual idSWFScriptVar GetField( const int fieldIndex ) const
{
return fields[ fieldIndex ];
}
2012-11-26 18:58:24 +00:00
virtual void AdjustField( const int fieldIndex, const int adjustAmount );
2012-11-26 18:58:24 +00:00
private:
idStaticList< idSWFScriptVar, MAX_LAYOUT_FIELDS > fields;
idStaticList< idSWFScriptVar, MAX_LAYOUT_FIELDS > originalFields;
};
2012-11-26 18:58:24 +00:00
idMenuScreen_Shell_ControllerLayout() :
btnBack( NULL ),
options( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
void UpdateBindingInfo();
private:
idMenuDataSource_LayoutSettings layoutData;
idMenuWidget_DynamicList* options;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_SystemOptions
//================================================
//*/
class idMenuScreen_Shell_SystemOptions : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
/*
================================================
idMenuDataSource_SystemSettings
================================================
*/
class idMenuDataSource_SystemSettings : public idMenuDataSource
{
2012-11-26 18:58:24 +00:00
public:
enum systemSettingFields_t
{
2012-11-26 18:58:24 +00:00
SYSTEM_FIELD_FULLSCREEN,
SYSTEM_FIELD_FRAMERATE,
SYSTEM_FIELD_VSYNC,
SYSTEM_FIELD_ANTIALIASING,
SYSTEM_FIELD_MOTIONBLUR,
SYSTEM_FIELD_LODBIAS,
SYSTEM_FIELD_BRIGHTNESS,
SYSTEM_FIELD_VOLUME,
MAX_SYSTEM_FIELDS
};
2012-11-26 18:58:24 +00:00
idMenuDataSource_SystemSettings();
2012-11-26 18:58:24 +00:00
// loads data
virtual void LoadData();
2012-11-26 18:58:24 +00:00
// submits data
virtual void CommitData();
2012-11-26 18:58:24 +00:00
// says whether something changed with the data
virtual bool IsDataChanged() const;
2012-11-26 18:58:24 +00:00
// retrieves a particular field for reading
virtual idSWFScriptVar GetField( const int fieldIndex ) const;
2012-11-26 18:58:24 +00:00
// updates a particular field value
virtual void AdjustField( const int fieldIndex, const int adjustAmount );
2012-11-26 18:58:24 +00:00
bool IsRestartRequired() const;
2012-11-26 18:58:24 +00:00
private:
int originalFramerate;
int originalAntialias;
int originalMotionBlur;
int originalVsync;
float originalBrightness;
float originalVolume;
2012-11-26 18:58:24 +00:00
idList<vidMode_t> modeList;
};
idMenuScreen_Shell_SystemOptions() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
2012-11-26 18:58:24 +00:00
idMenuDataSource_SystemSettings systemData;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_Stereoscopics
//================================================
//*/
class idMenuScreen_Shell_Stereoscopics : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
/*
================================================
idMenuDataSource_StereoSettings
================================================
*/
class idMenuDataSource_StereoSettings : public idMenuDataSource
{
2012-11-26 18:58:24 +00:00
public:
enum stereoSettingFields_t
{
2012-11-26 18:58:24 +00:00
STEREO_FIELD_ENABLE,
STEREO_FIELD_SEPERATION,
STEREO_FIELD_SWAP_EYES,
MAX_STEREO_FIELDS
};
2012-11-26 18:58:24 +00:00
idMenuDataSource_StereoSettings();
2012-11-26 18:58:24 +00:00
// loads data
virtual void LoadData();
2012-11-26 18:58:24 +00:00
// submits data
virtual void CommitData();
2012-11-26 18:58:24 +00:00
// says whether something changed with the data
virtual bool IsDataChanged() const;
2012-11-26 18:58:24 +00:00
// retrieves a particular field for reading or updating
virtual idSWFScriptVar GetField( const int fieldIndex ) const;
2012-11-26 18:58:24 +00:00
virtual void AdjustField( const int fieldIndex, const int adjustAmount );
2012-11-26 18:58:24 +00:00
bool IsRestartRequired() const;
2012-11-26 18:58:24 +00:00
private:
idStaticList< idSWFScriptVar, MAX_STEREO_FIELDS > fields;
idStaticList< idSWFScriptVar, MAX_STEREO_FIELDS > originalFields;
};
idMenuScreen_Shell_Stereoscopics() :
2012-11-26 18:58:24 +00:00
options( NULL ),
btnBack( NULL ),
leftEyeMat( NULL ),
rightEyeMat( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
private:
idMenuWidget_DynamicList* options;
2012-11-26 18:58:24 +00:00
idMenuDataSource_StereoSettings stereoData;
idMenuWidget_Button* btnBack;
const idMaterial* leftEyeMat;
const idMaterial* rightEyeMat;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_PartyLobby
//================================================
//*/
class idMenuScreen_Shell_PartyLobby : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_PartyLobby() :
2012-11-26 18:58:24 +00:00
options( NULL ),
lobby( NULL ),
isHost( false ),
isPeer( false ),
btnBack( NULL ),
inParty( false )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
void UpdateOptions();
void UpdateLobby();
bool CanKickSelectedPlayer( lobbyUserID_t& luid );
2012-11-26 18:58:24 +00:00
void ShowLeaderboards();
2012-11-26 18:58:24 +00:00
private:
bool isHost;
bool isPeer;
bool inParty;
idMenuWidget_DynamicList* options;
idMenuWidget_LobbyList* lobby;
idMenuWidget_Button* btnBack;
idList< idList< idStr, TAG_IDLIB_LIST_MENU >, TAG_IDLIB_LIST_MENU > menuOptions;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Shell_GameLobby
//================================================
//*/
class idMenuScreen_Shell_GameLobby : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Shell_GameLobby() :
2012-11-26 18:58:24 +00:00
options( NULL ),
lobby( NULL ),
longCountdown( 0 ),
shortCountdown( 0 ),
longCountRemaining( 0 ),
isPeer( false ),
isHost( false ),
privateGameLobby( true ),
btnBack( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
void UpdateLobby();
bool CanKickSelectedPlayer( lobbyUserID_t& luid );
2012-11-26 18:58:24 +00:00
private:
int longCountdown;
int longCountRemaining;
int shortCountdown;
2012-11-26 18:58:24 +00:00
bool isHost;
bool isPeer;
bool privateGameLobby;
idMenuWidget_DynamicList* options;
idMenuWidget_LobbyList* lobby;
idMenuWidget_Button* btnBack;
2012-11-26 18:58:24 +00:00
idList< idList< idStr, TAG_IDLIB_LIST_MENU >, TAG_IDLIB_LIST_MENU > menuOptions;
};
//*
//================================================
//idMenuScreen_HUD
//================================================
//*/
class idMenuScreen_HUD : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_HUD() :
2012-11-26 18:58:24 +00:00
weaponInfo( NULL ),
playerInfo( NULL ),
audioLog( NULL ),
communication( NULL ),
oxygen( NULL ),
stamina( NULL ),
weaponName( NULL ),
weaponImg( NULL ),
weaponPills( NULL ),
locationName( NULL ),
downloadPda( NULL ),
downloadVideo( NULL ),
newPDA( NULL ),
newVideo( NULL ),
objective( NULL ),
objectiveComplete( NULL ),
tipInfo( NULL ),
healthBorder( NULL ),
healthPulse( NULL ),
armorFrame( NULL ),
security( NULL ),
securityText( NULL ),
newPDADownload( NULL ),
newPDAHeading( NULL ),
2012-11-26 18:58:24 +00:00
newPDAName( NULL ),
newVideoDownload( NULL ),
newVideoHeading( NULL ),
audioLogPrevTime( 0 ),
commPrevTime( 0 ),
oxygenComm( false ),
inVaccuum( false ),
ammoInfo( NULL ),
newWeapon( NULL ),
pickupInfo( NULL ),
cursorState( CURSOR_NONE ),
cursorInCombat( 0 ),
cursorTalking( 0 ),
cursorItem( 0 ),
cursorGrabber( 0 ),
cursorNone( 0 ),
talkCursor( NULL ),
combatCursor( NULL ),
grabberCursor( NULL ),
bsInfo( NULL ),
soulcubeInfo( NULL ),
mpInfo( NULL ),
mpHitInfo( NULL ),
mpTime( NULL ),
mpMessage( NULL ),
mpChat( NULL ),
mpWeapons( NULL ),
newItem( NULL ),
respawnMessage( NULL ),
flashlight( NULL ),
mpChatObject( NULL ),
showSoulCubeInfoOnLoad( false ),
mpConnection( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual void HideScreen( const mainMenuTransition_t transitionType );
void UpdateHealthArmor( idPlayer* player );
void UpdateStamina( idPlayer* player );
void UpdateLocation( idPlayer* player );
void UpdateWeaponInfo( idPlayer* player );
void UpdateWeaponStates( idPlayer* player, bool weaponChanged );
void ShowTip( const char* title, const char* tip );
2012-11-26 18:58:24 +00:00
void HideTip();
void DownloadVideo();
void DownloadPDA( const idDeclPDA* pda, bool newSecurity );
2012-11-26 18:58:24 +00:00
void UpdatedSecurity();
void ToggleNewVideo( bool show );
void ClearNewPDAInfo();
void ToggleNewPDA( bool show );
void UpdateAudioLog( bool show );
void UpdateCommunication( bool show, idPlayer* player );
2012-11-26 18:58:24 +00:00
void UpdateOxygen( bool show, int val = 0 );
void SetupObjective( const idStr& title, const idStr& desc, const idMaterial* screenshot );
void SetupObjectiveComplete( const idStr& title );
2012-11-26 18:58:24 +00:00
void ShowObjective( bool complete );
void HideObjective( bool complete );
void GiveWeapon( idPlayer* player, int weaponIndex );
void UpdatePickupInfo( int index, const idStr& name );
2012-11-26 18:58:24 +00:00
bool IsPickupListReady();
void ShowPickups();
void SetCursorState( idPlayer* player, cursorState_t state, int set );
void SetCursorText( const idStr& action, const idStr& focus );
2012-11-26 18:58:24 +00:00
void UpdateCursorState();
void CombatCursorFlash();
void UpdateSoulCube( bool ready );
void ShowRespawnMessage( bool show );
void SetShowSoulCubeOnLoad( bool show )
{
showSoulCubeInfoOnLoad = show;
}
2012-11-26 18:58:24 +00:00
// MULTIPLAYER
2012-11-26 18:58:24 +00:00
void ToggleMPInfo( bool show, bool showTeams, bool isCTF = false );
void SetFlagState( int team, int state );
void SetTeamScore( int team, int score );
void SetTeam( int team );
void TriggerHitTarget( bool show, const idStr& target, int color = 0 );
2012-11-26 18:58:24 +00:00
void ToggleLagged( bool show );
void UpdateGameTime( const char* time );
void UpdateMessage( bool show, const idStr& message );
void ShowNewItem( const char* name, const char* icon );
void UpdateFlashlight( idPlayer* player );
void UpdateChattingHud( idPlayer* player );
private:
idSWFScriptObject* weaponInfo;
idSWFScriptObject* playerInfo;
idSWFScriptObject* stamina;
idSWFScriptObject* weaponName;
idSWFScriptObject* weaponPills;
idSWFScriptObject* downloadPda;
idSWFScriptObject* downloadVideo;
idSWFScriptObject* tipInfo;
idSWFScriptObject* mpChat;
idSWFScriptObject* mpWeapons;
idSWFSpriteInstance* healthBorder;
idSWFSpriteInstance* healthPulse;
idSWFSpriteInstance* armorFrame;
idSWFSpriteInstance* security;
idSWFSpriteInstance* newPDADownload;
idSWFSpriteInstance* newVideoDownload;
idSWFSpriteInstance* newPDA;
idSWFSpriteInstance* newVideo;
idSWFSpriteInstance* audioLog;
idSWFSpriteInstance* communication;
idSWFSpriteInstance* oxygen;
idSWFSpriteInstance* objective;
idSWFSpriteInstance* objectiveComplete;
idSWFSpriteInstance* ammoInfo;
idSWFSpriteInstance* weaponImg;
idSWFSpriteInstance* newWeapon;
idSWFSpriteInstance* pickupInfo;
idSWFSpriteInstance* talkCursor;
idSWFSpriteInstance* combatCursor;
idSWFSpriteInstance* grabberCursor;
idSWFSpriteInstance* bsInfo;
idSWFSpriteInstance* soulcubeInfo;
idSWFSpriteInstance* newItem;
idSWFSpriteInstance* respawnMessage;
idSWFSpriteInstance* flashlight;
idSWFSpriteInstance* mpChatObject;
idSWFSpriteInstance* mpConnection;
idSWFSpriteInstance* mpInfo;
idSWFSpriteInstance* mpHitInfo;
idSWFTextInstance* locationName;
idSWFTextInstance* securityText;
idSWFTextInstance* newPDAName;
idSWFTextInstance* newPDAHeading;
idSWFTextInstance* newVideoHeading;
idSWFTextInstance* mpMessage;
idSWFTextInstance* mpTime;
2012-11-26 18:58:24 +00:00
int audioLogPrevTime;
int commPrevTime;
2012-11-26 18:58:24 +00:00
bool oxygenComm;
bool inVaccuum;
2012-11-26 18:58:24 +00:00
idStr objTitle;
idStr objDesc;
const idMaterial* objScreenshot;
2012-11-26 18:58:24 +00:00
idStr objCompleteTitle;
2012-11-26 18:58:24 +00:00
cursorState_t cursorState;
int cursorInCombat;
int cursorTalking;
int cursorItem;
int cursorGrabber;
int cursorNone;
idStr cursorAction;
idStr cursorFocus;
2012-11-26 18:58:24 +00:00
bool showSoulCubeInfoOnLoad;
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Scoreboard
//================================================
//*/
class idMenuScreen_Scoreboard : public idMenuScreen
{
2012-11-26 18:58:24 +00:00
public:
idMenuScreen_Scoreboard() :
playerList( NULL )
{
2012-11-26 18:58:24 +00:00
}
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
virtual void Update();
virtual void ShowScreen( const mainMenuTransition_t transitionType );
virtual bool HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled = false );
2012-11-26 18:58:24 +00:00
virtual void SetPlayerData( idList< scoreboardInfo_t, TAG_IDLIB_LIST_MENU > data );
virtual void UpdateTeamScores( int r, int b );
virtual void UpdateGameInfo( idStr gameInfo );
virtual void UpdateSpectating( idStr spectating, idStr follow );
virtual void UpdateHighlight();
2012-11-26 18:58:24 +00:00
protected:
idMenuWidget_ScoreboardList* playerList;
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Scoreboard_CTF
//================================================
//*/
class idMenuScreen_Scoreboard_CTF : public idMenuScreen_Scoreboard
{
2012-11-26 18:58:24 +00:00
public:
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
};
//*
//================================================
2012-11-26 18:58:24 +00:00
//idMenuScreen_Scoreboard_Team
//================================================
//*/
class idMenuScreen_Scoreboard_Team : public idMenuScreen_Scoreboard
{
2012-11-26 18:58:24 +00:00
public:
virtual void Initialize( idMenuHandler* data );
2012-11-26 18:58:24 +00:00
};
/*
========================
InvitePartyOrFriends
Invites the master local user's party, if he's in one and the party isn't in the lobby already.
Otherwise brings up the invite friends system menu.
========================
*/
inline void InvitePartyOrFriends()
{
const idLocalUser* const user = session->GetSignInManager().GetMasterLocalUser();
if( user != NULL && user->IsInParty() && user->GetPartyCount() > 1 && !session->IsPlatformPartyInLobby() )
{
2012-11-26 18:58:24 +00:00
session->InviteParty();
}
else
{
2012-11-26 18:58:24 +00:00
session->InviteFriends();
}
}
#endif