mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
GameExecutable: Some improvements. Idk how to name it.
Add some empty lines. Move some files. Replace long repeating variable names with shorter preprocessors.
This commit is contained in:
parent
d9cd480103
commit
66cc1d014f
339
Sources/SeriousSam/GameMenu.cpp
Normal file
339
Sources/SeriousSam/GameMenu.cpp
Normal file
|
@ -0,0 +1,339 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdH.h"
|
||||
#include <Engine/CurrentVersion.h>
|
||||
#include "MenuPrinting.h"
|
||||
#include "GameMenu.h"
|
||||
|
||||
|
||||
CGameMenu::CGameMenu(void)
|
||||
{
|
||||
gm_pgmParentMenu = NULL;
|
||||
gm_pmgSelectedByDefault = NULL;
|
||||
gm_pmgArrowUp = NULL;
|
||||
gm_pmgArrowDn = NULL;
|
||||
gm_pmgListTop = NULL;
|
||||
gm_pmgListBottom = NULL;
|
||||
gm_iListOffset = 0;
|
||||
gm_ctListVisible = 0;
|
||||
gm_ctListTotal = 0;
|
||||
gm_bPopup = FALSE;
|
||||
}
|
||||
|
||||
void CGameMenu::Initialize_t(void)
|
||||
{
|
||||
}
|
||||
|
||||
void CGameMenu::Destroy(void)
|
||||
{
|
||||
}
|
||||
|
||||
void CGameMenu::FillListItems(void)
|
||||
{
|
||||
ASSERT(FALSE); // must be implemented to scroll up/down
|
||||
}
|
||||
|
||||
void CGameMenu::KillAllFocuses(void)
|
||||
{
|
||||
// for each menu gadget in menu
|
||||
FOREACHINLIST(CMenuGadget, mg_lnNode, gm_lhGadgets, itmg) {
|
||||
itmg->mg_bFocused = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void CGameMenu::Think(void)
|
||||
{
|
||||
}
|
||||
|
||||
// +-1 -> hit top/bottom when pressing up/down on keyboard
|
||||
// +-2 -> pressed pageup/pagedown on keyboard
|
||||
// +-3 -> pressed arrow up/down button in menu
|
||||
// +-4 -> scrolling with mouse wheel
|
||||
void CGameMenu::ScrollList(INDEX iDir)
|
||||
{
|
||||
// if not valid for scrolling
|
||||
if (gm_ctListTotal <= 0
|
||||
|| gm_pmgArrowUp == NULL || gm_pmgArrowDn == NULL
|
||||
|| gm_pmgListTop == NULL || gm_pmgListBottom == NULL) {
|
||||
// do nothing
|
||||
return;
|
||||
}
|
||||
|
||||
INDEX iOldTopKey = gm_iListOffset;
|
||||
// change offset
|
||||
switch (iDir) {
|
||||
case -1:
|
||||
gm_iListOffset -= 1;
|
||||
break;
|
||||
case -4:
|
||||
gm_iListOffset -= 3;
|
||||
break;
|
||||
case -2:
|
||||
case -3:
|
||||
gm_iListOffset -= gm_ctListVisible;
|
||||
break;
|
||||
case +1:
|
||||
gm_iListOffset += 1;
|
||||
break;
|
||||
case +4:
|
||||
gm_iListOffset += 3;
|
||||
break;
|
||||
case +2:
|
||||
case +3:
|
||||
gm_iListOffset += gm_ctListVisible;
|
||||
break;
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
if (gm_ctListTotal <= gm_ctListVisible) {
|
||||
gm_iListOffset = 0;
|
||||
}
|
||||
else {
|
||||
gm_iListOffset = Clamp(gm_iListOffset, INDEX(0), INDEX(gm_ctListTotal - gm_ctListVisible));
|
||||
}
|
||||
|
||||
// set new names
|
||||
FillListItems();
|
||||
|
||||
// if scroling with wheel
|
||||
if (iDir == +4 || iDir == -4) {
|
||||
// no focus changing
|
||||
return;
|
||||
}
|
||||
|
||||
// delete all focuses
|
||||
FOREACHINLIST(CMenuGadget, mg_lnNode, pgmCurrentMenu->gm_lhGadgets, itmg) {
|
||||
itmg->OnKillFocus();
|
||||
}
|
||||
|
||||
// set new focus
|
||||
const INDEX iFirst = 0;
|
||||
const INDEX iLast = gm_ctListVisible - 1;
|
||||
switch (iDir) {
|
||||
case +1:
|
||||
gm_pmgListBottom->OnSetFocus();
|
||||
break;
|
||||
case +2:
|
||||
if (gm_iListOffset != iOldTopKey) {
|
||||
gm_pmgListTop->OnSetFocus();
|
||||
}
|
||||
else {
|
||||
gm_pmgListBottom->OnSetFocus();
|
||||
}
|
||||
break;
|
||||
case +3:
|
||||
gm_pmgArrowDn->OnSetFocus();
|
||||
break;
|
||||
case -1:
|
||||
gm_pmgListTop->OnSetFocus();
|
||||
break;
|
||||
case -2:
|
||||
gm_pmgListTop->OnSetFocus();
|
||||
break;
|
||||
case -3:
|
||||
gm_pmgArrowUp->OnSetFocus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CGameMenu::OnChar(MSG msg)
|
||||
{
|
||||
// find curently active gadget
|
||||
CMenuGadget *pmgActive = NULL;
|
||||
// for each menu gadget in menu
|
||||
FOREACHINLIST(CMenuGadget, mg_lnNode, pgmCurrentMenu->gm_lhGadgets, itmg) {
|
||||
// if focused
|
||||
if (itmg->mg_bFocused) {
|
||||
// remember as active
|
||||
pmgActive = &itmg.Current();
|
||||
}
|
||||
}
|
||||
|
||||
// if none focused
|
||||
if (pmgActive == NULL) {
|
||||
// do nothing
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// if active gadget handles it
|
||||
if (pmgActive->OnChar(msg)) {
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// key is not handled
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// return TRUE if handled
|
||||
BOOL CGameMenu::OnKeyDown(int iVKey)
|
||||
{
|
||||
// find curently active gadget
|
||||
CMenuGadget *pmgActive = NULL;
|
||||
// for each menu gadget in menu
|
||||
FOREACHINLIST(CMenuGadget, mg_lnNode, pgmCurrentMenu->gm_lhGadgets, itmg) {
|
||||
// if focused
|
||||
if (itmg->mg_bFocused) {
|
||||
// remember as active
|
||||
pmgActive = &itmg.Current();
|
||||
}
|
||||
}
|
||||
|
||||
// if none focused
|
||||
if (pmgActive == NULL) {
|
||||
// do nothing
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// if active gadget handles it
|
||||
if (pmgActive->OnKeyDown(iVKey)) {
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// process normal in menu movement
|
||||
switch (iVKey) {
|
||||
case VK_PRIOR:
|
||||
ScrollList(-2);
|
||||
return TRUE;
|
||||
case VK_NEXT:
|
||||
ScrollList(+2);
|
||||
return TRUE;
|
||||
|
||||
case 11:
|
||||
ScrollList(-4);
|
||||
return TRUE;
|
||||
case 10:
|
||||
ScrollList(+4);
|
||||
return TRUE;
|
||||
|
||||
case VK_UP:
|
||||
// if this is top button in list
|
||||
if (pmgActive == gm_pmgListTop) {
|
||||
// scroll list up
|
||||
ScrollList(-1);
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
// if we can go up
|
||||
if (pmgActive->mg_pmgUp != NULL && pmgActive->mg_pmgUp->mg_bVisible) {
|
||||
// call lose focus to still active gadget and
|
||||
pmgActive->OnKillFocus();
|
||||
// set focus to new one
|
||||
pmgActive = pmgActive->mg_pmgUp;
|
||||
pmgActive->OnSetFocus();
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case VK_DOWN:
|
||||
// if this is bottom button in list
|
||||
if (pmgActive == gm_pmgListBottom) {
|
||||
// scroll list down
|
||||
ScrollList(+1);
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
// if we can go down
|
||||
if (pmgActive->mg_pmgDown != NULL && pmgActive->mg_pmgDown->mg_bVisible) {
|
||||
// call lose focus to still active gadget and
|
||||
pmgActive->OnKillFocus();
|
||||
// set focus to new one
|
||||
pmgActive = pmgActive->mg_pmgDown;
|
||||
pmgActive->OnSetFocus();
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case VK_LEFT:
|
||||
// if we can go left
|
||||
if (pmgActive->mg_pmgLeft != NULL) {
|
||||
// call lose focus to still active gadget and
|
||||
pmgActive->OnKillFocus();
|
||||
// set focus to new one
|
||||
if (!pmgActive->mg_pmgLeft->mg_bVisible && gm_pmgSelectedByDefault != NULL) {
|
||||
pmgActive = gm_pmgSelectedByDefault;
|
||||
}
|
||||
else {
|
||||
pmgActive = pmgActive->mg_pmgLeft;
|
||||
}
|
||||
pmgActive->OnSetFocus();
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case VK_RIGHT:
|
||||
// if we can go right
|
||||
if (pmgActive->mg_pmgRight != NULL) {
|
||||
// call lose focus to still active gadget and
|
||||
pmgActive->OnKillFocus();
|
||||
// set focus to new one
|
||||
if (!pmgActive->mg_pmgRight->mg_bVisible && gm_pmgSelectedByDefault != NULL) {
|
||||
pmgActive = gm_pmgSelectedByDefault;
|
||||
}
|
||||
else {
|
||||
pmgActive = pmgActive->mg_pmgRight;
|
||||
}
|
||||
pmgActive->OnSetFocus();
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// key is not handled
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CGameMenu::StartMenu(void)
|
||||
{
|
||||
// for each menu gadget in menu
|
||||
FOREACHINLIST(CMenuGadget, mg_lnNode, gm_lhGadgets, itmg)
|
||||
{
|
||||
itmg->mg_bFocused = FALSE;
|
||||
// call appear
|
||||
itmg->Appear();
|
||||
}
|
||||
|
||||
// if there is a list
|
||||
if (gm_pmgListTop != NULL) {
|
||||
// scroll it so that the wanted tem is centered
|
||||
gm_iListOffset = gm_iListWantedItem - gm_ctListVisible / 2;
|
||||
// clamp the scrolling
|
||||
gm_iListOffset = Clamp(gm_iListOffset, 0L, Max(0L, gm_ctListTotal - gm_ctListVisible));
|
||||
|
||||
// fill the list
|
||||
FillListItems();
|
||||
|
||||
// for each menu gadget in menu
|
||||
FOREACHINLIST(CMenuGadget, mg_lnNode, gm_lhGadgets, itmg) {
|
||||
// if in list, but disabled
|
||||
if (itmg->mg_iInList == -2) {
|
||||
// hide it
|
||||
itmg->mg_bVisible = FALSE;
|
||||
// if in list
|
||||
}
|
||||
else if (itmg->mg_iInList >= 0) {
|
||||
// show it
|
||||
itmg->mg_bVisible = TRUE;
|
||||
}
|
||||
// if wanted
|
||||
if (itmg->mg_iInList == gm_iListWantedItem) {
|
||||
// focus it
|
||||
itmg->OnSetFocus();
|
||||
gm_pmgSelectedByDefault = itmg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGameMenu::EndMenu(void)
|
||||
{
|
||||
// for each menu gadget in menu
|
||||
FOREACHINLIST(CMenuGadget, mg_lnNode, gm_lhGadgets, itmg)
|
||||
{
|
||||
// call disappear
|
||||
itmg->Disappear();
|
||||
}
|
||||
}
|
|
@ -7,10 +7,10 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGSlider.h"
|
||||
#include "MGTrigger.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGSlider.h"
|
||||
#include "GUI/Components/MGTrigger.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CAudioOptionsMenu : public CGameMenu {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
|
||||
|
||||
class CConfirmMenu : public CGameMenu {
|
||||
|
|
|
@ -7,10 +7,11 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGSlider.h"
|
||||
#include "MGTitle.h"
|
||||
#include "MGTrigger.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGSlider.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
#include "GUI/Components/MGTrigger.h"
|
||||
|
||||
|
||||
class CControlsMenu : public CGameMenu {
|
||||
public:
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGSlider.h"
|
||||
#include "MGTitle.h"
|
||||
#include "MGTrigger.h"
|
||||
#include "GUI/Components/MGSlider.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
#include "GUI/Components/MGTrigger.h"
|
||||
|
||||
|
||||
class CCustomizeAxisMenu : public CGameMenu {
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGArrow.h"
|
||||
#include "MGKeyDefinition.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGArrow.h"
|
||||
#include "GUI/Components/MGKeyDefinition.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CCustomizeKeyboardMenu : public CGameMenu {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CDisabledMenu : public CGameMenu {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGHighScore.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGHighScore.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CHighScoreMenu : public CGameMenu {
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CInGameMenu : public CGameMenu {
|
||||
public:
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGArrow.h"
|
||||
#include "MGLevelButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGArrow.h"
|
||||
#include "GUI/Components/MGLevelButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CLevelsMenu : public CGameMenu {
|
||||
public:
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGArrow.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGFileButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGArrow.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGFileButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
#define SAVELOAD_BUTTONS_CT 14
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
|
||||
|
||||
class CMainMenu : public CGameMenu {
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CNetworkMenu : public CGameMenu {
|
||||
public:
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CNetworkJoinMenu : public CGameMenu {
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGEdit.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGEdit.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CNetworkOpenMenu : public CGameMenu {
|
||||
public:
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGEdit.h"
|
||||
#include "MGTitle.h"
|
||||
#include "MGTrigger.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGEdit.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
#include "GUI/Components/MGTrigger.h"
|
||||
|
||||
|
||||
class CNetworkStartMenu : public CGameMenu {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class COptionsMenu : public CGameMenu {
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGEdit.h"
|
||||
#include "MGModel.h"
|
||||
#include "MGTrigger.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGEdit.h"
|
||||
#include "GUI/Components/MGModel.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
#include "GUI/Components/MGTrigger.h"
|
||||
|
||||
|
||||
class CPlayerProfileMenu : public CGameMenu {
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGChangePlayer.h"
|
||||
#include "MGTitle.h"
|
||||
#include "MGTrigger.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGChangePlayer.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
#include "GUI/Components/MGTrigger.h"
|
||||
|
||||
|
||||
class CSelectPlayersMenu : public CGameMenu {
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGEdit.h"
|
||||
#include "MGServerList.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGEdit.h"
|
||||
#include "GUI/Components/MGServerList.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CServersMenu : public CGameMenu {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CSinglePlayerMenu : public CGameMenu {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CSinglePlayerNewMenu : public CGameMenu {
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
|
||||
|
||||
class CSplitScreenMenu : public CGameMenu {
|
||||
public:
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "MGTrigger.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
#include "GUI/Components/MGTrigger.h"
|
||||
|
||||
|
||||
class CSplitStartMenu : public CGameMenu {
|
||||
public:
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGArrow.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
#include "MGVarButton.h"
|
||||
#include "GUI/Components/MGArrow.h"
|
||||
#include "GUI/Components/MGButton.h"
|
||||
#include "GUI/Components/MGTitle.h"
|
||||
#include "GUI/Components/MGVarButton.h"
|
||||
|
||||
|
||||
class CVarMenu : public CGameMenu {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -142,6 +142,34 @@ BOOL IsMenuEnabled(const CTString &strMenuName)
|
|||
return pFunc(strMenuName);
|
||||
}
|
||||
|
||||
// initialize game type strings table
|
||||
void InitGameTypes(void)
|
||||
{
|
||||
// get function that will provide us the info about gametype
|
||||
CShellSymbol *pss = _pShell->GetSymbol("GetGameTypeNameSS", /*bDeclaredOnly=*/ TRUE);
|
||||
// if none
|
||||
if (pss == NULL) {
|
||||
// error
|
||||
astrGameTypeRadioTexts[0] = "<???>";
|
||||
ctGameTypeRadioTexts = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
// for each mode
|
||||
for (ctGameTypeRadioTexts = 0; ctGameTypeRadioTexts<ARRAYCOUNT(astrGameTypeRadioTexts); ctGameTypeRadioTexts++) {
|
||||
// get the text
|
||||
CTString(*pFunc)(INDEX) = (CTString(*)(INDEX))pss->ss_pvValue;
|
||||
CTString strMode = pFunc(ctGameTypeRadioTexts);
|
||||
// if no mode modes
|
||||
if (strMode == "") {
|
||||
// stop
|
||||
break;
|
||||
}
|
||||
// add that mode
|
||||
astrGameTypeRadioTexts[ctGameTypeRadioTexts] = strMode;
|
||||
}
|
||||
}
|
||||
|
||||
int qsort_CompareFileInfos_NameUp(const void *elem1, const void *elem2)
|
||||
{
|
||||
const CFileInfo &fi1 = **(CFileInfo **)elem1;
|
||||
|
|
|
@ -38,6 +38,7 @@ extern CTString astrSoundAPIRadioTexts[3];
|
|||
|
||||
ULONG GetSpawnFlagsForGameType(INDEX iGameType);
|
||||
BOOL IsMenuEnabled(const CTString &strMenuName);
|
||||
void InitGameTypes(void);
|
||||
|
||||
int qsort_CompareFileInfos_NameUp(const void *elem1, const void *elem2);
|
||||
int qsort_CompareFileInfos_NameDn(const void *elem1, const void *elem2);
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<OutDir>Debug\</OutDir>
|
||||
<IntDir>Debug\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(SolutionDir);$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Include;$(IncludePath)</IncludePath>
|
||||
<IncludePath>$(SolutionDir);$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Include;$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\Bin\Debug;$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Lib;$(LibraryPath)</LibraryPath>
|
||||
<GenerateManifest>true</GenerateManifest>
|
||||
<EmbedManifest>true</EmbedManifest>
|
||||
|
@ -67,7 +67,7 @@
|
|||
<OutDir>Release\</OutDir>
|
||||
<IntDir>Release\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(SolutionDir);$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Include;$(IncludePath)</IncludePath>
|
||||
<IncludePath>$(SolutionDir);$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Include;$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\Bin;$(SolutionDir)..\Tools.Win32\Libraries\DX8SDK\Lib;$(LibraryPath)</LibraryPath>
|
||||
<GenerateManifest>true</GenerateManifest>
|
||||
<EmbedManifest>true</EmbedManifest>
|
||||
|
@ -178,7 +178,23 @@ copy Release\$(TargetName).map $(SolutionDir)..\Bin\ >nul </Command>
|
|||
<ItemGroup>
|
||||
<ClCompile Include="CmdLine.cpp" />
|
||||
<ClCompile Include="Credits.cpp" />
|
||||
<ClCompile Include="GameMenu.cpp" />
|
||||
<ClCompile Include="GLSettings.cpp" />
|
||||
<ClCompile Include="GUI\Components\MenuGadget.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGArrow.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGButton.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGChangePlayer.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGEdit.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGFileButton.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGHighScore.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGKeyDefinition.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGLevelButton.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGModel.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGServerList.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGSlider.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGTitle.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGTrigger.cpp" />
|
||||
<ClCompile Include="GUI\Components\MGVarButton.cpp" />
|
||||
<ClCompile Include="LCDDrawing.cpp" />
|
||||
<ClCompile Include="LevelInfo.cpp" />
|
||||
<ClCompile Include="MainWindow.cpp" />
|
||||
|
@ -194,26 +210,26 @@ copy Release\$(TargetName).map $(SolutionDir)..\Bin\ >nul </Command>
|
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">StdH.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MenuGadget.cpp" />
|
||||
<ClCompile Include="MenuPrinting.cpp" />
|
||||
<ClInclude Include="GUI\Components\MenuGadget.h" />
|
||||
<ClInclude Include="GUI\Components\MGArrow.h" />
|
||||
<ClInclude Include="GUI\Components\MGButton.h" />
|
||||
<ClInclude Include="GUI\Components\MGChangePlayer.h" />
|
||||
<ClInclude Include="GUI\Components\MGEdit.h" />
|
||||
<ClInclude Include="GUI\Components\MGFileButton.h" />
|
||||
<ClInclude Include="GUI\Components\MGHighScore.h" />
|
||||
<ClInclude Include="GUI\Components\MGKeyDefinition.h" />
|
||||
<ClInclude Include="GUI\Components\MGLevelButton.h" />
|
||||
<ClInclude Include="GUI\Components\MGModel.h" />
|
||||
<ClInclude Include="GUI\Components\MGServerList.h" />
|
||||
<ClInclude Include="GUI\Components\MGSlider.h" />
|
||||
<ClInclude Include="GUI\Components\MGTitle.h" />
|
||||
<ClInclude Include="GUI\Components\MGTrigger.h" />
|
||||
<ClInclude Include="GUI\Components\MGVarButton.h" />
|
||||
<ClInclude Include="MenuStuff.h">
|
||||
<FileType>CppCode</FileType>
|
||||
</ClInclude>
|
||||
<ClCompile Include="MenuStuff.cpp" />
|
||||
<ClCompile Include="MGArrow.cpp" />
|
||||
<ClCompile Include="MGButton.cpp" />
|
||||
<ClCompile Include="MGChangePlayer.cpp" />
|
||||
<ClCompile Include="MGEdit.cpp" />
|
||||
<ClCompile Include="MGFileButton.cpp" />
|
||||
<ClCompile Include="MGHighScore.cpp" />
|
||||
<ClCompile Include="MGKeyDefinition.cpp" />
|
||||
<ClCompile Include="MGLevelButton.cpp" />
|
||||
<ClCompile Include="MGModel.cpp" />
|
||||
<ClCompile Include="MGServerList.cpp" />
|
||||
<ClCompile Include="MGSlider.cpp" />
|
||||
<ClCompile Include="MGTitle.cpp" />
|
||||
<ClCompile Include="MGTrigger.cpp" />
|
||||
<ClCompile Include="MGVarButton.cpp" />
|
||||
<ClCompile Include="MHighScore.cpp" />
|
||||
<ClCompile Include="MInGame.cpp" />
|
||||
<ClCompile Include="MLevels.cpp" />
|
||||
|
@ -269,20 +285,6 @@ copy Release\$(TargetName).map $(SolutionDir)..\Bin\ >nul </Command>
|
|||
<ClInclude Include="Menu.h" />
|
||||
<ClInclude Include="MenuGadget.h" />
|
||||
<ClInclude Include="MenuPrinting.h" />
|
||||
<ClInclude Include="MGArrow.h" />
|
||||
<ClInclude Include="MGButton.h" />
|
||||
<ClInclude Include="MGChangePlayer.h" />
|
||||
<ClInclude Include="MGEdit.h" />
|
||||
<ClInclude Include="MGFileButton.h" />
|
||||
<ClInclude Include="MGHighScore.h" />
|
||||
<ClInclude Include="MGKeyDefinition.h" />
|
||||
<ClInclude Include="MGLevelButton.h" />
|
||||
<ClInclude Include="MGModel.h" />
|
||||
<ClInclude Include="MGServerList.h" />
|
||||
<ClInclude Include="MGSlider.h" />
|
||||
<ClInclude Include="MGTitle.h" />
|
||||
<ClInclude Include="MGTrigger.h" />
|
||||
<ClInclude Include="MGVarButton.h" />
|
||||
<ClInclude Include="MHighScore.h" />
|
||||
<ClInclude Include="MInGame.h" />
|
||||
<ClInclude Include="MLevels.h" />
|
||||
|
|
|
@ -66,51 +66,6 @@
|
|||
<ClCompile Include="VarList.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGVarButton.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MenuGadget.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGArrow.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGButton.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGChangePlayer.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGEdit.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGFileButton.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGHighScore.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGKeyDefinition.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGLevelButton.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGModel.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGServerList.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGSlider.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGTitle.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MGTrigger.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MenuStuff.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
@ -192,6 +147,54 @@
|
|||
<ClCompile Include="MPlayerProfile.cpp">
|
||||
<Filter>Source Files\Menus</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GameMenu.cpp">
|
||||
<Filter>Source Files\Menus</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGHighScore.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGServerList.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGButton.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGFileButton.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGKeyDefinition.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGModel.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGSlider.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGTitle.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGTrigger.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGVarButton.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MenuGadget.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGChangePlayer.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGLevelButton.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGArrow.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GUI\Components\MGEdit.cpp">
|
||||
<Filter>Source Files\Gadgets</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CDCheck.h">
|
||||
|
@ -239,48 +242,6 @@
|
|||
<ClInclude Include="ArrowDir.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGVarButton.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGArrow.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGButton.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGChangePlayer.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGEdit.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGFileButton.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGHighScore.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGKeyDefinition.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGLevelButton.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGModel.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGServerList.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGSlider.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGTitle.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MGTrigger.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GameMenu.h">
|
||||
<Filter>Header Files\Menus headers</Filter>
|
||||
</ClInclude>
|
||||
|
@ -374,6 +335,51 @@
|
|||
<ClInclude Include="MenuStuff.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGModel.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGVarButton.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGTrigger.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGTitle.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGSlider.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGServerList.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGLevelButton.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGKeyDefinition.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGHighScore.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGEdit.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGButton.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGArrow.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGFileButton.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MGChangePlayer.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GUI\Components\MenuGadget.h">
|
||||
<Filter>Header Files\Gadgets headers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="SeriousSam.rc">
|
||||
|
|
Loading…
Reference in New Issue
Block a user