mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
GameExecutable: Move some stuff from Menu.cpp into files PART IV
Now it's 4901 lines! Progress!
This commit is contained in:
parent
899d297f7b
commit
16990d713c
157
Sources/SeriousSam/MCustomizeAxis.cpp
Normal file
157
Sources/SeriousSam/MCustomizeAxis.cpp
Normal file
|
@ -0,0 +1,157 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdH.h"
|
||||
#include <Engine/CurrentVersion.h>
|
||||
#include "MenuPrinting.h"
|
||||
#include "MCustomizeAxis.h"
|
||||
|
||||
#define TRIGGER_MG(mg, y, up, down, text, astr) \
|
||||
mg.mg_pmgUp = &up; \
|
||||
mg.mg_pmgDown = &down; \
|
||||
mg.mg_boxOnScreen = BoxMediumRow(y); \
|
||||
gm_lhGadgets.AddTail(mg.mg_lnNode); \
|
||||
mg.mg_astrTexts = astr; \
|
||||
mg.mg_ctTexts = sizeof(astr) / sizeof(astr[0]); \
|
||||
mg.mg_iSelected = 0; \
|
||||
mg.mg_strLabel = text; \
|
||||
mg.mg_strValue = astr[0];
|
||||
|
||||
extern CTString astrNoYes[2];
|
||||
extern void ControlsMenuOn();
|
||||
extern void ControlsMenuOff();
|
||||
|
||||
|
||||
void CCustomizeAxisMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize axis menu
|
||||
gm_mgTitle.mg_strText = TRANS("CUSTOMIZE AXIS");
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
TRIGGER_MG(gm_mgActionTrigger, 0, gm_mgSmoothTrigger, gm_mgMountedTrigger, TRANS("ACTION"), astrNoYes);
|
||||
gm_mgActionTrigger.mg_strTip = TRANS("choose action to customize");
|
||||
|
||||
TRIGGER_MG(gm_mgMountedTrigger, 2, gm_mgActionTrigger, gm_mgSensitivity, TRANS("MOUNTED TO"), astrNoYes);
|
||||
gm_mgMountedTrigger.mg_strTip = TRANS("choose controller axis that will perform the action");
|
||||
|
||||
gm_mgActionTrigger.mg_astrTexts = new CTString[AXIS_ACTIONS_CT];
|
||||
gm_mgActionTrigger.mg_ctTexts = AXIS_ACTIONS_CT;
|
||||
|
||||
gm_mgActionTrigger.mg_pPreTriggerChange = NULL;
|
||||
gm_mgActionTrigger.mg_pOnTriggerChange = NULL;
|
||||
|
||||
// for all available axis type controlers
|
||||
for (INDEX iControler = 0; iControler<AXIS_ACTIONS_CT; iControler++) {
|
||||
gm_mgActionTrigger.mg_astrTexts[iControler] = TranslateConst(CTString(_pGame->gm_astrAxisNames[iControler]), 0);
|
||||
}
|
||||
gm_mgActionTrigger.mg_iSelected = 3;
|
||||
|
||||
INDEX ctAxis = _pInput->GetAvailableAxisCount();
|
||||
gm_mgMountedTrigger.mg_astrTexts = new CTString[ctAxis];
|
||||
gm_mgMountedTrigger.mg_ctTexts = ctAxis;
|
||||
// for all axis actions that can be mounted
|
||||
for (INDEX iAxis = 0; iAxis<ctAxis; iAxis++) {
|
||||
gm_mgMountedTrigger.mg_astrTexts[iAxis] = _pInput->GetAxisTransName(iAxis);
|
||||
}
|
||||
|
||||
gm_mgSensitivity.mg_boxOnScreen = BoxMediumRow(3);
|
||||
gm_mgSensitivity.mg_strText = TRANS("SENSITIVITY");
|
||||
gm_mgSensitivity.mg_pmgUp = &gm_mgMountedTrigger;
|
||||
gm_mgSensitivity.mg_pmgDown = &gm_mgDeadzone;
|
||||
gm_lhGadgets.AddTail(gm_mgSensitivity.mg_lnNode);
|
||||
gm_mgSensitivity.mg_strTip = TRANS("set sensitivity for this axis");
|
||||
|
||||
gm_mgDeadzone.mg_boxOnScreen = BoxMediumRow(4);
|
||||
gm_mgDeadzone.mg_strText = TRANS("DEAD ZONE");
|
||||
gm_mgDeadzone.mg_pmgUp = &gm_mgSensitivity;
|
||||
gm_mgDeadzone.mg_pmgDown = &gm_mgInvertTrigger;
|
||||
gm_lhGadgets.AddTail(gm_mgDeadzone.mg_lnNode);
|
||||
gm_mgDeadzone.mg_strTip = TRANS("set dead zone for this axis");
|
||||
|
||||
TRIGGER_MG(gm_mgInvertTrigger, 5, gm_mgDeadzone, gm_mgRelativeTrigger, TRANS("INVERTED"), astrNoYes);
|
||||
gm_mgInvertTrigger.mg_strTip = TRANS("choose whether to invert this axis or not");
|
||||
TRIGGER_MG(gm_mgRelativeTrigger, 6, gm_mgInvertTrigger, gm_mgSmoothTrigger, TRANS("RELATIVE"), astrNoYes);
|
||||
gm_mgRelativeTrigger.mg_strTip = TRANS("select relative or absolute axis reading");
|
||||
TRIGGER_MG(gm_mgSmoothTrigger, 7, gm_mgRelativeTrigger, gm_mgActionTrigger, TRANS("SMOOTH"), astrNoYes);
|
||||
gm_mgSmoothTrigger.mg_strTip = TRANS("turn this on to filter readings on this axis");
|
||||
}
|
||||
|
||||
CCustomizeAxisMenu::~CCustomizeAxisMenu(void)
|
||||
{
|
||||
delete[] gm_mgActionTrigger.mg_astrTexts;
|
||||
delete[] gm_mgMountedTrigger.mg_astrTexts;
|
||||
}
|
||||
|
||||
void CCustomizeAxisMenu::ObtainActionSettings(void)
|
||||
{
|
||||
ControlsMenuOn();
|
||||
CControls &ctrls = _pGame->gm_ctrlControlsExtra;
|
||||
INDEX iSelectedAction = gm_mgActionTrigger.mg_iSelected;
|
||||
INDEX iMountedAxis = ctrls.ctrl_aaAxisActions[iSelectedAction].aa_iAxisAction;
|
||||
|
||||
gm_mgMountedTrigger.mg_iSelected = iMountedAxis;
|
||||
|
||||
gm_mgSensitivity.mg_iMinPos = 0;
|
||||
gm_mgSensitivity.mg_iMaxPos = 50;
|
||||
gm_mgSensitivity.mg_iCurPos = ctrls.ctrl_aaAxisActions[iSelectedAction].aa_fSensitivity / 2;
|
||||
gm_mgSensitivity.ApplyCurrentPosition();
|
||||
|
||||
gm_mgDeadzone.mg_iMinPos = 0;
|
||||
gm_mgDeadzone.mg_iMaxPos = 50;
|
||||
gm_mgDeadzone.mg_iCurPos = ctrls.ctrl_aaAxisActions[iSelectedAction].aa_fDeadZone / 2;
|
||||
gm_mgDeadzone.ApplyCurrentPosition();
|
||||
|
||||
gm_mgInvertTrigger.mg_iSelected = ctrls.ctrl_aaAxisActions[iSelectedAction].aa_bInvert ? 1 : 0;
|
||||
gm_mgRelativeTrigger.mg_iSelected = ctrls.ctrl_aaAxisActions[iSelectedAction].aa_bRelativeControler ? 1 : 0;
|
||||
gm_mgSmoothTrigger.mg_iSelected = ctrls.ctrl_aaAxisActions[iSelectedAction].aa_bSmooth ? 1 : 0;
|
||||
|
||||
gm_mgActionTrigger.ApplyCurrentSelection();
|
||||
gm_mgMountedTrigger.ApplyCurrentSelection();
|
||||
gm_mgInvertTrigger.ApplyCurrentSelection();
|
||||
gm_mgRelativeTrigger.ApplyCurrentSelection();
|
||||
gm_mgSmoothTrigger.ApplyCurrentSelection();
|
||||
}
|
||||
|
||||
void CCustomizeAxisMenu::ApplyActionSettings(void)
|
||||
{
|
||||
CControls &ctrls = _pGame->gm_ctrlControlsExtra;
|
||||
INDEX iSelectedAction = gm_mgActionTrigger.mg_iSelected;
|
||||
INDEX iMountedAxis = gm_mgMountedTrigger.mg_iSelected;
|
||||
FLOAT fSensitivity =
|
||||
FLOAT(gm_mgSensitivity.mg_iCurPos - gm_mgSensitivity.mg_iMinPos) /
|
||||
FLOAT(gm_mgSensitivity.mg_iMaxPos - gm_mgSensitivity.mg_iMinPos)*100.0f;
|
||||
FLOAT fDeadZone =
|
||||
FLOAT(gm_mgDeadzone.mg_iCurPos - gm_mgDeadzone.mg_iMinPos) /
|
||||
FLOAT(gm_mgDeadzone.mg_iMaxPos - gm_mgDeadzone.mg_iMinPos)*100.0f;
|
||||
|
||||
BOOL bInvert = gm_mgInvertTrigger.mg_iSelected != 0;
|
||||
BOOL bRelative = gm_mgRelativeTrigger.mg_iSelected != 0;
|
||||
BOOL bSmooth = gm_mgSmoothTrigger.mg_iSelected != 0;
|
||||
|
||||
ctrls.ctrl_aaAxisActions[iSelectedAction].aa_iAxisAction = iMountedAxis;
|
||||
if (INDEX(ctrls.ctrl_aaAxisActions[iSelectedAction].aa_fSensitivity) != INDEX(fSensitivity)) {
|
||||
ctrls.ctrl_aaAxisActions[iSelectedAction].aa_fSensitivity = fSensitivity;
|
||||
}
|
||||
if (INDEX(ctrls.ctrl_aaAxisActions[iSelectedAction].aa_fDeadZone) != INDEX(fDeadZone)) {
|
||||
ctrls.ctrl_aaAxisActions[iSelectedAction].aa_fDeadZone = fDeadZone;
|
||||
}
|
||||
ctrls.ctrl_aaAxisActions[iSelectedAction].aa_bInvert = bInvert;
|
||||
ctrls.ctrl_aaAxisActions[iSelectedAction].aa_bRelativeControler = bRelative;
|
||||
ctrls.ctrl_aaAxisActions[iSelectedAction].aa_bSmooth = bSmooth;
|
||||
ctrls.CalculateInfluencesForAllAxis();
|
||||
|
||||
ControlsMenuOff();
|
||||
}
|
||||
|
||||
void CCustomizeAxisMenu::StartMenu(void)
|
||||
{
|
||||
ObtainActionSettings();
|
||||
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void CCustomizeAxisMenu::EndMenu(void)
|
||||
{
|
||||
ApplyActionSettings();
|
||||
CGameMenu::EndMenu();
|
||||
}
|
|
@ -7,10 +7,22 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGSlider.h"
|
||||
#include "MGTitle.h"
|
||||
#include "MGTrigger.h"
|
||||
|
||||
|
||||
class CCustomizeAxisMenu : public CGameMenu {
|
||||
public:
|
||||
CMGTitle gm_mgTitle;
|
||||
CMGTrigger gm_mgActionTrigger;
|
||||
CMGTrigger gm_mgMountedTrigger;
|
||||
CMGSlider gm_mgSensitivity;
|
||||
CMGSlider gm_mgDeadzone;
|
||||
CMGTrigger gm_mgInvertTrigger;
|
||||
CMGTrigger gm_mgRelativeTrigger;
|
||||
CMGTrigger gm_mgSmoothTrigger;
|
||||
|
||||
~CCustomizeAxisMenu(void);
|
||||
void Initialize_t(void);
|
||||
void StartMenu(void);
|
||||
|
|
100
Sources/SeriousSam/MCustomizeKeyboard.cpp
Normal file
100
Sources/SeriousSam/MCustomizeKeyboard.cpp
Normal file
|
@ -0,0 +1,100 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdH.h"
|
||||
#include <Engine/CurrentVersion.h>
|
||||
#include "MenuPrinting.h"
|
||||
#include "MCustomizeKeyboard.h"
|
||||
|
||||
|
||||
void CCustomizeKeyboardMenu::FillListItems(void)
|
||||
{
|
||||
// disable all items first
|
||||
for (INDEX i = 0; i<KEYS_ON_SCREEN; i++) {
|
||||
gm_mgKey[i].mg_bEnabled = FALSE;
|
||||
gm_mgKey[i].mg_iInList = -2;
|
||||
}
|
||||
|
||||
BOOL bHasFirst = FALSE;
|
||||
BOOL bHasLast = FALSE;
|
||||
// set diks to key buttons
|
||||
INDEX iLabel = 0;
|
||||
INDEX ctLabels = _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count();
|
||||
FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itAct)
|
||||
{
|
||||
INDEX iInMenu = iLabel - gm_iListOffset;
|
||||
if ((iLabel >= gm_iListOffset) &&
|
||||
(iLabel<(gm_iListOffset + gm_ctListVisible)))
|
||||
{
|
||||
bHasFirst |= (iLabel == 0);
|
||||
bHasLast |= (iLabel == ctLabels - 1);
|
||||
gm_mgKey[iInMenu].mg_strLabel = TranslateConst(itAct->ba_strName, 0);
|
||||
gm_mgKey[iInMenu].mg_iControlNumber = iLabel;
|
||||
gm_mgKey[iInMenu].SetBindingNames(FALSE);
|
||||
gm_mgKey[iInMenu].mg_strTip = TRANS("Enter - change binding, Backspace - unbind");
|
||||
gm_mgKey[iInMenu].mg_bEnabled = TRUE;
|
||||
gm_mgKey[iInMenu].mg_iInList = iLabel;
|
||||
}
|
||||
iLabel++;
|
||||
}
|
||||
|
||||
// enable/disable up/down arrows
|
||||
gm_mgArrowUp.mg_bEnabled = !bHasFirst && ctLabels>0;
|
||||
gm_mgArrowDn.mg_bEnabled = !bHasLast && ctLabels>0;
|
||||
}
|
||||
|
||||
void CCustomizeKeyboardMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize Audio options menu
|
||||
gm_mgTitle.mg_strText = TRANS("CUSTOMIZE BUTTONS");
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
#define KL_START 3.0f
|
||||
#define KL_STEEP -1.45f
|
||||
for (INDEX iLabel = 0; iLabel<KEYS_ON_SCREEN; iLabel++)
|
||||
{
|
||||
INDEX iPrev = (gm_ctListVisible + iLabel - 1) % KEYS_ON_SCREEN;
|
||||
INDEX iNext = (iLabel + 1) % KEYS_ON_SCREEN;
|
||||
// initialize label entities
|
||||
gm_mgKey[iLabel].mg_boxOnScreen = BoxKeyRow(iLabel);
|
||||
// initialize label gadgets
|
||||
gm_mgKey[iLabel].mg_pmgUp = &gm_mgKey[iPrev];
|
||||
gm_mgKey[iLabel].mg_pmgDown = &gm_mgKey[iNext];
|
||||
gm_mgKey[iLabel].mg_bVisible = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgKey[iLabel].mg_lnNode);
|
||||
}
|
||||
// arrows just exist
|
||||
gm_lhGadgets.AddTail(gm_mgArrowDn.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgArrowUp.mg_lnNode);
|
||||
gm_mgArrowDn.mg_adDirection = AD_DOWN;
|
||||
gm_mgArrowUp.mg_adDirection = AD_UP;
|
||||
gm_mgArrowDn.mg_boxOnScreen = BoxArrow(AD_DOWN);
|
||||
gm_mgArrowUp.mg_boxOnScreen = BoxArrow(AD_UP);
|
||||
gm_mgArrowDn.mg_pmgRight = gm_mgArrowDn.mg_pmgUp =
|
||||
&gm_mgKey[KEYS_ON_SCREEN - 1];
|
||||
gm_mgArrowUp.mg_pmgRight = gm_mgArrowUp.mg_pmgDown =
|
||||
&gm_mgKey[0];
|
||||
|
||||
gm_ctListVisible = KEYS_ON_SCREEN;
|
||||
gm_pmgArrowUp = &gm_mgArrowUp;
|
||||
gm_pmgArrowDn = &gm_mgArrowDn;
|
||||
gm_pmgListTop = &gm_mgKey[0];
|
||||
gm_pmgListBottom = &gm_mgKey[KEYS_ON_SCREEN - 1];
|
||||
}
|
||||
|
||||
extern void ControlsMenuOn();
|
||||
extern void ControlsMenuOff();
|
||||
|
||||
void CCustomizeKeyboardMenu::StartMenu(void)
|
||||
{
|
||||
ControlsMenuOn();
|
||||
gm_iListOffset = 0;
|
||||
gm_ctListTotal = _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count();
|
||||
gm_iListWantedItem = 0;
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
void CCustomizeKeyboardMenu::EndMenu(void)
|
||||
{
|
||||
ControlsMenuOff();
|
||||
CGameMenu::EndMenu();
|
||||
}
|
|
@ -7,10 +7,18 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGArrow.h"
|
||||
#include "MGKeyDefinition.h"
|
||||
#include "MGTitle.h"
|
||||
|
||||
|
||||
class CCustomizeKeyboardMenu : public CGameMenu {
|
||||
public:
|
||||
CMGTitle gm_mgTitle;
|
||||
CMGKeyDefinition gm_mgKey[KEYS_ON_SCREEN];
|
||||
CMGArrow gm_mgArrowUp;
|
||||
CMGArrow gm_mgArrowDn;
|
||||
|
||||
void Initialize_t(void);
|
||||
void StartMenu(void);
|
||||
void EndMenu(void);
|
||||
|
|
23
Sources/SeriousSam/MHighScore.cpp
Normal file
23
Sources/SeriousSam/MHighScore.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdH.h"
|
||||
#include <Engine/CurrentVersion.h>
|
||||
#include "MenuPrinting.h"
|
||||
#include "MHighScore.h"
|
||||
|
||||
|
||||
void CHighScoreMenu::Initialize_t(void)
|
||||
{
|
||||
gm_mgHScore.mg_boxOnScreen = FLOATaabbox2D(FLOAT2D(0, 0), FLOAT2D(1, 0.5));
|
||||
gm_lhGadgets.AddTail(gm_mgHScore.mg_lnNode);
|
||||
|
||||
gm_mgTitle.mg_strText = TRANS("HIGH SCORE TABLE");
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
}
|
||||
|
||||
void CHighScoreMenu::StartMenu(void)
|
||||
{
|
||||
gm_pgmParentMenu = pgmCurrentMenu;
|
||||
CGameMenu::StartMenu();
|
||||
}
|
|
@ -7,10 +7,15 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGHighScore.h"
|
||||
#include "MGTitle.h"
|
||||
|
||||
|
||||
class CHighScoreMenu : public CGameMenu {
|
||||
public:
|
||||
CMGTitle gm_mgTitle;
|
||||
CMGHighScore gm_mgHScore;
|
||||
|
||||
void Initialize_t(void);
|
||||
void StartMenu(void);
|
||||
};
|
||||
|
|
56
Sources/SeriousSam/MNetwork.cpp
Normal file
56
Sources/SeriousSam/MNetwork.cpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdH.h"
|
||||
#include <Engine/CurrentVersion.h>
|
||||
#include "MenuPrinting.h"
|
||||
#include "MNetwork.h"
|
||||
|
||||
|
||||
void CNetworkMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize network menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("NETWORK");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgJoin.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgJoin.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgJoin.mg_pmgUp = &gm_mgLoad;
|
||||
gm_mgJoin.mg_pmgDown = &gm_mgStart;
|
||||
gm_mgJoin.mg_strText = TRANS("JOIN GAME");
|
||||
gm_mgJoin.mg_strTip = TRANS("join a network game");
|
||||
gm_lhGadgets.AddTail(gm_mgJoin.mg_lnNode);
|
||||
gm_mgJoin.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgStart.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgStart.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgStart.mg_pmgUp = &gm_mgJoin;
|
||||
gm_mgStart.mg_pmgDown = &gm_mgQuickLoad;
|
||||
gm_mgStart.mg_strText = TRANS("START SERVER");
|
||||
gm_mgStart.mg_strTip = TRANS("start a network game server");
|
||||
gm_lhGadgets.AddTail(gm_mgStart.mg_lnNode);
|
||||
gm_mgStart.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgQuickLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuickLoad.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgQuickLoad.mg_pmgUp = &gm_mgStart;
|
||||
gm_mgQuickLoad.mg_pmgDown = &gm_mgLoad;
|
||||
gm_mgQuickLoad.mg_strText = TRANS("QUICK LOAD");
|
||||
gm_mgQuickLoad.mg_strTip = TRANS("load a quick-saved game (F9)");
|
||||
gm_lhGadgets.AddTail(gm_mgQuickLoad.mg_lnNode);
|
||||
gm_mgQuickLoad.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgLoad.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgLoad.mg_pmgUp = &gm_mgQuickLoad;
|
||||
gm_mgLoad.mg_pmgDown = &gm_mgJoin;
|
||||
gm_mgLoad.mg_strText = TRANS("LOAD");
|
||||
gm_mgLoad.mg_strTip = TRANS("start server and load a network game (server only)");
|
||||
gm_lhGadgets.AddTail(gm_mgLoad.mg_lnNode);
|
||||
gm_mgLoad.mg_pActivatedFunction = NULL;
|
||||
}
|
||||
|
||||
void CNetworkMenu::StartMenu(void)
|
||||
{
|
||||
CGameMenu::StartMenu();
|
||||
}
|
|
@ -7,10 +7,17 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
|
||||
class CNetworkMenu : public CGameMenu {
|
||||
public:
|
||||
CMGTitle gm_mgTitle;
|
||||
CMGButton gm_mgJoin;
|
||||
CMGButton gm_mgStart;
|
||||
CMGButton gm_mgQuickLoad;
|
||||
CMGButton gm_mgLoad;
|
||||
|
||||
void Initialize_t(void);
|
||||
void StartMenu(void);
|
||||
};
|
||||
|
|
69
Sources/SeriousSam/MOptions.cpp
Normal file
69
Sources/SeriousSam/MOptions.cpp
Normal file
|
@ -0,0 +1,69 @@
|
|||
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
||||
|
||||
#include "StdH.h"
|
||||
#include <Engine/CurrentVersion.h>
|
||||
#include "MenuPrinting.h"
|
||||
#include "MOptions.h"
|
||||
|
||||
|
||||
void COptionsMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize options menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("OPTIONS");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgVideoOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgVideoOptions.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
gm_mgVideoOptions.mg_pmgUp = &gm_mgAddonOptions;
|
||||
gm_mgVideoOptions.mg_pmgDown = &gm_mgAudioOptions;
|
||||
gm_mgVideoOptions.mg_strText = TRANS("VIDEO OPTIONS");
|
||||
gm_mgVideoOptions.mg_strTip = TRANS("set video mode and driver");
|
||||
gm_lhGadgets.AddTail(gm_mgVideoOptions.mg_lnNode);
|
||||
gm_mgVideoOptions.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgAudioOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgAudioOptions.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgAudioOptions.mg_pmgUp = &gm_mgVideoOptions;
|
||||
gm_mgAudioOptions.mg_pmgDown = &gm_mgPlayerProfileOptions;
|
||||
gm_mgAudioOptions.mg_strText = TRANS("AUDIO OPTIONS");
|
||||
gm_mgAudioOptions.mg_strTip = TRANS("set audio quality and volume");
|
||||
gm_lhGadgets.AddTail(gm_mgAudioOptions.mg_lnNode);
|
||||
gm_mgAudioOptions.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgPlayerProfileOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgPlayerProfileOptions.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgPlayerProfileOptions.mg_pmgUp = &gm_mgAudioOptions;
|
||||
gm_mgPlayerProfileOptions.mg_pmgDown = &gm_mgNetworkOptions;
|
||||
gm_mgPlayerProfileOptions.mg_strText = TRANS("PLAYERS AND CONTROLS");
|
||||
gm_mgPlayerProfileOptions.mg_strTip = TRANS("change currently active player or adjust controls");
|
||||
gm_lhGadgets.AddTail(gm_mgPlayerProfileOptions.mg_lnNode);
|
||||
gm_mgPlayerProfileOptions.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgNetworkOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgNetworkOptions.mg_boxOnScreen = BoxBigRow(3);
|
||||
gm_mgNetworkOptions.mg_pmgUp = &gm_mgPlayerProfileOptions;
|
||||
gm_mgNetworkOptions.mg_pmgDown = &gm_mgCustomOptions;
|
||||
gm_mgNetworkOptions.mg_strText = TRANS("NETWORK CONNECTION");
|
||||
gm_mgNetworkOptions.mg_strTip = TRANS("choose your connection parameters");
|
||||
gm_lhGadgets.AddTail(gm_mgNetworkOptions.mg_lnNode);
|
||||
gm_mgNetworkOptions.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgCustomOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgCustomOptions.mg_boxOnScreen = BoxBigRow(4);
|
||||
gm_mgCustomOptions.mg_pmgUp = &gm_mgNetworkOptions;
|
||||
gm_mgCustomOptions.mg_pmgDown = &gm_mgAddonOptions;
|
||||
gm_mgCustomOptions.mg_strText = TRANS("ADVANCED OPTIONS");
|
||||
gm_mgCustomOptions.mg_strTip = TRANS("for advanced users only");
|
||||
gm_lhGadgets.AddTail(gm_mgCustomOptions.mg_lnNode);
|
||||
gm_mgCustomOptions.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgAddonOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgAddonOptions.mg_boxOnScreen = BoxBigRow(5);
|
||||
gm_mgAddonOptions.mg_pmgUp = &gm_mgCustomOptions;
|
||||
gm_mgAddonOptions.mg_pmgDown = &gm_mgVideoOptions;
|
||||
gm_mgAddonOptions.mg_strText = TRANS("EXECUTE ADDON");
|
||||
gm_mgAddonOptions.mg_strTip = TRANS("choose from list of addons to execute");
|
||||
gm_lhGadgets.AddTail(gm_mgAddonOptions.mg_lnNode);
|
||||
gm_mgAddonOptions.mg_pActivatedFunction = NULL;
|
||||
}
|
|
@ -7,10 +7,20 @@
|
|||
#endif
|
||||
|
||||
#include "GameMenu.h"
|
||||
#include "MGButton.h"
|
||||
#include "MGTitle.h"
|
||||
|
||||
|
||||
class COptionsMenu : public CGameMenu {
|
||||
public:
|
||||
CMGTitle gm_mgTitle;
|
||||
CMGButton gm_mgVideoOptions;
|
||||
CMGButton gm_mgAudioOptions;
|
||||
CMGButton gm_mgPlayerProfileOptions;
|
||||
CMGButton gm_mgNetworkOptions;
|
||||
CMGButton gm_mgCustomOptions;
|
||||
CMGButton gm_mgAddonOptions;
|
||||
|
||||
void Initialize_t(void);
|
||||
};
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "MenuPrinting.h"
|
||||
#include "MSplitScreen.h"
|
||||
|
||||
|
||||
void CSplitScreenMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize split screen menu
|
||||
|
|
|
@ -104,17 +104,19 @@ void (*_pAfterLevelChosen)(void);
|
|||
|
||||
// functions for init actions
|
||||
void InitActionsForConfirmMenu();
|
||||
void InitActionsForCustomizeAxisMenu();
|
||||
void InitActionsForMainMenu();
|
||||
void InitActionsForInGameMenu();
|
||||
void InitActionsForNetworkMenu();
|
||||
void InitActionsForNetworkJoinMenu();
|
||||
void InitActionsForNetworkOpenMenu();
|
||||
void InitActionsForOptionsMenu();
|
||||
void InitActionsForSinglePlayerMenu();
|
||||
void InitActionsForSinglePlayerNewMenu();
|
||||
void InitActionsForSplitScreenMenu();
|
||||
void InitActionsForSplitStartMenu();
|
||||
void InitActionsForVarMenu();
|
||||
|
||||
|
||||
// functions to activate when user chose 'yes/no' on confirmation
|
||||
void (*_pConfimedYes)(void) = NULL;
|
||||
void (*_pConfimedNo)(void) = NULL;
|
||||
|
@ -139,7 +141,7 @@ void ConfirmNo(void)
|
|||
}
|
||||
|
||||
|
||||
void ControlsMenuOn()
|
||||
extern void ControlsMenuOn()
|
||||
{
|
||||
_pGame->SavePlayersAndControls();
|
||||
try {
|
||||
|
@ -149,7 +151,7 @@ void ControlsMenuOn()
|
|||
}
|
||||
}
|
||||
|
||||
void ControlsMenuOff()
|
||||
extern void ControlsMenuOff()
|
||||
{
|
||||
try {
|
||||
if (_pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count()>0) {
|
||||
|
@ -217,7 +219,7 @@ static CTextureObject _toLogoMenuB;
|
|||
#define PLACEMENT(x,y,z) CPlacement3D( FLOAT3D( x, y, z), \
|
||||
ANGLE3D( AngleDeg(0.0f), AngleDeg(0.0f), AngleDeg(0.0f)))
|
||||
|
||||
CTString astrNoYes[] = {
|
||||
extern CTString astrNoYes[] = {
|
||||
RADIOTRANS( "No"),
|
||||
RADIOTRANS( "Yes"),
|
||||
};
|
||||
|
@ -360,15 +362,9 @@ CMGArrow mgLSArrowDn;
|
|||
|
||||
// -------- High-score menu
|
||||
CHighScoreMenu gmHighScoreMenu;
|
||||
CMGTitle mgHighScoreTitle;
|
||||
CMGHighScore mgHScore;
|
||||
|
||||
// -------- Customize keyboard menu
|
||||
CCustomizeKeyboardMenu gmCustomizeKeyboardMenu;
|
||||
CMGTitle mgCustomizeKeyboardTitle;
|
||||
CMGKeyDefinition mgKey[KEYS_ON_SCREEN];
|
||||
CMGArrow mgCustomizeArrowUp;
|
||||
CMGArrow mgCustomizeArrowDn;
|
||||
|
||||
// -------- Choose servers menu
|
||||
CServersMenu gmServersMenu;
|
||||
|
@ -380,24 +376,9 @@ CMGButton mgServerRefresh;
|
|||
|
||||
// -------- Customize axis menu
|
||||
CCustomizeAxisMenu gmCustomizeAxisMenu;
|
||||
CMGTitle mgCustomizeAxisTitle;
|
||||
CMGTrigger mgAxisActionTrigger;
|
||||
CMGTrigger mgAxisMountedTrigger;
|
||||
CMGSlider mgAxisSensitivity;
|
||||
CMGSlider mgAxisDeadzone;
|
||||
CMGTrigger mgAxisInvertTrigger;
|
||||
CMGTrigger mgAxisRelativeTrigger;
|
||||
CMGTrigger mgAxisSmoothTrigger;
|
||||
|
||||
// -------- Options menu
|
||||
COptionsMenu gmOptionsMenu;
|
||||
CMGTitle mgOptionsTitle;
|
||||
CMGButton mgVideoOptions;
|
||||
CMGButton mgAudioOptions;
|
||||
CMGButton mgPlayerProfileOptions;
|
||||
CMGButton mgNetworkOptions;
|
||||
CMGButton mgCustomOptions;
|
||||
CMGButton mgAddonOptions;
|
||||
|
||||
// -------- Video options menu
|
||||
CVideoOptionsMenu gmVideoOptionsMenu;
|
||||
|
@ -455,11 +436,6 @@ CMGButton mgAudioOptionsApply;
|
|||
|
||||
// -------- Network menu
|
||||
CNetworkMenu gmNetworkMenu;
|
||||
CMGTitle mgNetworkTitle;
|
||||
CMGButton mgNetworkJoin;
|
||||
CMGButton mgNetworkStart;
|
||||
CMGButton mgNetworkQuickLoad;
|
||||
CMGButton mgNetworkLoad;
|
||||
|
||||
// -------- Network join menu
|
||||
CNetworkJoinMenu gmNetworkJoinMenu;
|
||||
|
@ -2212,18 +2188,20 @@ void InitializeMenus(void)
|
|||
|
||||
gmCustomizeKeyboardMenu.Initialize_t();
|
||||
gmCustomizeKeyboardMenu.gm_strName="CustomizeKeyboard";
|
||||
gmCustomizeKeyboardMenu.gm_pmgSelectedByDefault = &mgKey[0];
|
||||
gmCustomizeKeyboardMenu.gm_pmgSelectedByDefault = &gmCustomizeKeyboardMenu.gm_mgKey[0];
|
||||
gmCustomizeKeyboardMenu.gm_pgmParentMenu = &gmControls;
|
||||
|
||||
gmCustomizeAxisMenu.Initialize_t();
|
||||
gmCustomizeAxisMenu.gm_strName="CustomizeAxis";
|
||||
gmCustomizeAxisMenu.gm_pmgSelectedByDefault = &mgAxisActionTrigger;
|
||||
gmCustomizeAxisMenu.gm_pmgSelectedByDefault = &gmCustomizeAxisMenu.gm_mgActionTrigger;
|
||||
gmCustomizeAxisMenu.gm_pgmParentMenu = &gmControls;
|
||||
InitActionsForCustomizeAxisMenu();
|
||||
|
||||
gmOptionsMenu.Initialize_t();
|
||||
gmOptionsMenu.gm_strName="Options";
|
||||
gmOptionsMenu.gm_pmgSelectedByDefault = &mgVideoOptions;
|
||||
gmOptionsMenu.gm_pmgSelectedByDefault = &gmOptionsMenu.gm_mgVideoOptions;
|
||||
gmOptionsMenu.gm_pgmParentMenu = &gmMainMenu;
|
||||
InitActionsForOptionsMenu();
|
||||
|
||||
gmVideoOptionsMenu.Initialize_t();
|
||||
gmVideoOptionsMenu.gm_strName="VideoOptions";
|
||||
|
@ -2253,8 +2231,9 @@ void InitializeMenus(void)
|
|||
|
||||
gmNetworkMenu.Initialize_t();
|
||||
gmNetworkMenu.gm_strName="Network";
|
||||
gmNetworkMenu.gm_pmgSelectedByDefault = &mgNetworkJoin;
|
||||
gmNetworkMenu.gm_pmgSelectedByDefault = &gmNetworkMenu.gm_mgJoin;
|
||||
gmNetworkMenu.gm_pgmParentMenu = &gmMainMenu;
|
||||
InitActionsForNetworkMenu();
|
||||
|
||||
gmNetworkStartMenu.Initialize_t();
|
||||
gmNetworkStartMenu.gm_strName="NetworkStart";
|
||||
|
@ -3980,320 +3959,33 @@ BOOL CLoadSaveMenu::ParseFile(const CTFileName &fnm, CTString &strName)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void CHighScoreMenu::Initialize_t(void)
|
||||
{
|
||||
mgHScore.mg_boxOnScreen = FLOATaabbox2D(FLOAT2D(0,0), FLOAT2D(1,0.5));
|
||||
gm_lhGadgets.AddTail( mgHScore.mg_lnNode);
|
||||
|
||||
mgHighScoreTitle.mg_strText = TRANS("HIGH SCORE TABLE");
|
||||
mgHighScoreTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail( mgHighScoreTitle.mg_lnNode);
|
||||
}
|
||||
|
||||
void CHighScoreMenu::StartMenu(void)
|
||||
{
|
||||
gm_pgmParentMenu = pgmCurrentMenu;
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
// ------------------------ CCustomizeKeyboardMenu implementation
|
||||
void CCustomizeKeyboardMenu::FillListItems(void)
|
||||
{
|
||||
// disable all items first
|
||||
for(INDEX i=0; i<KEYS_ON_SCREEN; i++) {
|
||||
mgKey[i].mg_bEnabled = FALSE;
|
||||
mgKey[i].mg_iInList = -2;
|
||||
}
|
||||
|
||||
BOOL bHasFirst = FALSE;
|
||||
BOOL bHasLast = FALSE;
|
||||
// set diks to key buttons
|
||||
INDEX iLabel=0;
|
||||
INDEX ctLabels = _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count();
|
||||
FOREACHINLIST( CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itAct)
|
||||
{
|
||||
INDEX iInMenu = iLabel-gm_iListOffset;
|
||||
if( (iLabel>=gm_iListOffset) &&
|
||||
(iLabel<(gm_iListOffset+gm_ctListVisible)) )
|
||||
{
|
||||
bHasFirst|=(iLabel==0);
|
||||
bHasLast |=(iLabel==ctLabels-1);
|
||||
mgKey[iInMenu].mg_strLabel = TranslateConst(itAct->ba_strName, 0);
|
||||
mgKey[iInMenu].mg_iControlNumber = iLabel;
|
||||
mgKey[iInMenu].SetBindingNames(FALSE);
|
||||
mgKey[iInMenu].mg_strTip = TRANS("Enter - change binding, Backspace - unbind");
|
||||
mgKey[iInMenu].mg_bEnabled = TRUE;
|
||||
mgKey[iInMenu].mg_iInList = iLabel;
|
||||
}
|
||||
iLabel++;
|
||||
}
|
||||
|
||||
// enable/disable up/down arrows
|
||||
mgCustomizeArrowUp.mg_bEnabled = !bHasFirst && ctLabels>0;
|
||||
mgCustomizeArrowDn.mg_bEnabled = !bHasLast && ctLabels>0;
|
||||
}
|
||||
|
||||
void CCustomizeKeyboardMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize Audio options menu
|
||||
mgCustomizeKeyboardTitle.mg_strText = TRANS("CUSTOMIZE BUTTONS");
|
||||
mgCustomizeKeyboardTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail( mgCustomizeKeyboardTitle.mg_lnNode);
|
||||
|
||||
#define KL_START 3.0f
|
||||
#define KL_STEEP -1.45f
|
||||
for( INDEX iLabel=0; iLabel<KEYS_ON_SCREEN; iLabel++)
|
||||
{
|
||||
INDEX iPrev = (gm_ctListVisible+iLabel-1)%KEYS_ON_SCREEN;
|
||||
INDEX iNext = (iLabel+1)%KEYS_ON_SCREEN;
|
||||
// initialize label entities
|
||||
mgKey[iLabel].mg_boxOnScreen = BoxKeyRow(iLabel);
|
||||
// initialize label gadgets
|
||||
mgKey[iLabel].mg_pmgUp = &mgKey[iPrev];
|
||||
mgKey[iLabel].mg_pmgDown = &mgKey[iNext];
|
||||
mgKey[iLabel].mg_bVisible = TRUE;
|
||||
gm_lhGadgets.AddTail( mgKey[iLabel].mg_lnNode);
|
||||
}
|
||||
// arrows just exist
|
||||
gm_lhGadgets.AddTail( mgCustomizeArrowDn.mg_lnNode);
|
||||
gm_lhGadgets.AddTail( mgCustomizeArrowUp.mg_lnNode);
|
||||
mgCustomizeArrowDn.mg_adDirection = AD_DOWN;
|
||||
mgCustomizeArrowUp.mg_adDirection = AD_UP;
|
||||
mgCustomizeArrowDn.mg_boxOnScreen = BoxArrow(AD_DOWN);
|
||||
mgCustomizeArrowUp.mg_boxOnScreen = BoxArrow(AD_UP);
|
||||
mgCustomizeArrowDn.mg_pmgRight = mgCustomizeArrowDn.mg_pmgUp =
|
||||
&mgKey[KEYS_ON_SCREEN-1];
|
||||
mgCustomizeArrowUp.mg_pmgRight = mgCustomizeArrowUp.mg_pmgDown =
|
||||
&mgKey[0];
|
||||
|
||||
gm_ctListVisible = KEYS_ON_SCREEN;
|
||||
gm_pmgArrowUp = &mgCustomizeArrowUp;
|
||||
gm_pmgArrowDn = &mgCustomizeArrowDn;
|
||||
gm_pmgListTop = &mgKey[0];
|
||||
gm_pmgListBottom = &mgKey[KEYS_ON_SCREEN-1];
|
||||
}
|
||||
void CCustomizeKeyboardMenu::StartMenu(void)
|
||||
{
|
||||
ControlsMenuOn();
|
||||
gm_iListOffset = 0;
|
||||
gm_ctListTotal = _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count();
|
||||
gm_iListWantedItem = 0;
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
void CCustomizeKeyboardMenu::EndMenu(void)
|
||||
{
|
||||
ControlsMenuOff();
|
||||
CGameMenu::EndMenu();
|
||||
}
|
||||
|
||||
CCustomizeAxisMenu::~CCustomizeAxisMenu(void)
|
||||
{
|
||||
delete[] mgAxisActionTrigger.mg_astrTexts;
|
||||
delete[] mgAxisMountedTrigger.mg_astrTexts;
|
||||
}
|
||||
|
||||
// ------------------------ CCustomizeAxisMenu implementation
|
||||
void PreChangeAxis(INDEX iDummy)
|
||||
{
|
||||
gmCustomizeAxisMenu.ApplyActionSettings();
|
||||
gmCustomizeAxisMenu.ApplyActionSettings();
|
||||
}
|
||||
void PostChangeAxis(INDEX iDummy)
|
||||
{
|
||||
gmCustomizeAxisMenu.ObtainActionSettings();
|
||||
gmCustomizeAxisMenu.ObtainActionSettings();
|
||||
}
|
||||
|
||||
void CCustomizeAxisMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize axis menu
|
||||
mgCustomizeAxisTitle.mg_strText = TRANS("CUSTOMIZE AXIS");
|
||||
mgCustomizeAxisTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail( mgCustomizeAxisTitle.mg_lnNode);
|
||||
|
||||
TRIGGER_MG(mgAxisActionTrigger, 0, mgAxisSmoothTrigger, mgAxisMountedTrigger, TRANS("ACTION"), astrNoYes);
|
||||
mgAxisActionTrigger.mg_strTip = TRANS("choose action to customize");
|
||||
TRIGGER_MG(mgAxisMountedTrigger, 2, mgAxisActionTrigger, mgAxisSensitivity, TRANS("MOUNTED TO"), astrNoYes);
|
||||
mgAxisMountedTrigger.mg_strTip = TRANS("choose controller axis that will perform the action");
|
||||
|
||||
mgAxisActionTrigger.mg_astrTexts = new CTString[ AXIS_ACTIONS_CT];
|
||||
mgAxisActionTrigger.mg_ctTexts = AXIS_ACTIONS_CT;
|
||||
|
||||
mgAxisActionTrigger.mg_pPreTriggerChange = PreChangeAxis;
|
||||
mgAxisActionTrigger.mg_pOnTriggerChange = PostChangeAxis;
|
||||
|
||||
// for all available axis type controlers
|
||||
for( INDEX iControler=0; iControler<AXIS_ACTIONS_CT; iControler++) {
|
||||
mgAxisActionTrigger.mg_astrTexts[ iControler] = TranslateConst(CTString(_pGame->gm_astrAxisNames[ iControler]), 0);
|
||||
}
|
||||
mgAxisActionTrigger.mg_iSelected = 3;
|
||||
|
||||
INDEX ctAxis = _pInput->GetAvailableAxisCount();
|
||||
mgAxisMountedTrigger.mg_astrTexts = new CTString[ ctAxis];
|
||||
mgAxisMountedTrigger.mg_ctTexts = ctAxis;
|
||||
// for all axis actions that can be mounted
|
||||
for( INDEX iAxis=0; iAxis<ctAxis; iAxis++) {
|
||||
mgAxisMountedTrigger.mg_astrTexts[ iAxis] = _pInput->GetAxisTransName( iAxis);
|
||||
}
|
||||
|
||||
mgAxisSensitivity.mg_boxOnScreen = BoxMediumRow(3);
|
||||
mgAxisSensitivity.mg_strText = TRANS("SENSITIVITY");
|
||||
mgAxisSensitivity.mg_pmgUp = &mgAxisMountedTrigger;
|
||||
mgAxisSensitivity.mg_pmgDown = &mgAxisDeadzone;
|
||||
gm_lhGadgets.AddTail( mgAxisSensitivity.mg_lnNode);
|
||||
mgAxisSensitivity.mg_strTip = TRANS("set sensitivity for this axis");
|
||||
|
||||
mgAxisDeadzone.mg_boxOnScreen = BoxMediumRow(4);
|
||||
mgAxisDeadzone.mg_strText = TRANS("DEAD ZONE");
|
||||
mgAxisDeadzone.mg_pmgUp = &mgAxisSensitivity;
|
||||
mgAxisDeadzone.mg_pmgDown = &mgAxisInvertTrigger;
|
||||
gm_lhGadgets.AddTail( mgAxisDeadzone.mg_lnNode);
|
||||
mgAxisDeadzone.mg_strTip = TRANS("set dead zone for this axis");
|
||||
|
||||
TRIGGER_MG(mgAxisInvertTrigger, 5, mgAxisDeadzone, mgAxisRelativeTrigger, TRANS("INVERTED"), astrNoYes);
|
||||
mgAxisInvertTrigger.mg_strTip = TRANS("choose whether to invert this axis or not");
|
||||
TRIGGER_MG(mgAxisRelativeTrigger, 6, mgAxisInvertTrigger, mgAxisSmoothTrigger, TRANS("RELATIVE"), astrNoYes);
|
||||
mgAxisRelativeTrigger.mg_strTip = TRANS("select relative or absolute axis reading");
|
||||
TRIGGER_MG(mgAxisSmoothTrigger, 7, mgAxisRelativeTrigger, mgAxisActionTrigger, TRANS("SMOOTH"), astrNoYes);
|
||||
mgAxisSmoothTrigger.mg_strTip = TRANS("turn this on to filter readings on this axis");
|
||||
}
|
||||
|
||||
void CCustomizeAxisMenu::ObtainActionSettings(void)
|
||||
{
|
||||
ControlsMenuOn();
|
||||
CControls &ctrls = _pGame->gm_ctrlControlsExtra;
|
||||
INDEX iSelectedAction = mgAxisActionTrigger.mg_iSelected;
|
||||
INDEX iMountedAxis = ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_iAxisAction;
|
||||
|
||||
mgAxisMountedTrigger.mg_iSelected = iMountedAxis;
|
||||
|
||||
mgAxisSensitivity.mg_iMinPos = 0;
|
||||
mgAxisSensitivity.mg_iMaxPos = 50;
|
||||
mgAxisSensitivity.mg_iCurPos = ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_fSensitivity/2;
|
||||
mgAxisSensitivity.ApplyCurrentPosition();
|
||||
|
||||
mgAxisDeadzone.mg_iMinPos = 0;
|
||||
mgAxisDeadzone.mg_iMaxPos = 50;
|
||||
mgAxisDeadzone.mg_iCurPos = ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_fDeadZone/2;
|
||||
mgAxisDeadzone.ApplyCurrentPosition();
|
||||
|
||||
mgAxisInvertTrigger.mg_iSelected = ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_bInvert ? 1 : 0;
|
||||
mgAxisRelativeTrigger.mg_iSelected = ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_bRelativeControler ? 1 : 0;
|
||||
mgAxisSmoothTrigger.mg_iSelected = ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_bSmooth ? 1 : 0;
|
||||
|
||||
mgAxisActionTrigger.ApplyCurrentSelection();
|
||||
mgAxisMountedTrigger.ApplyCurrentSelection();
|
||||
mgAxisInvertTrigger.ApplyCurrentSelection();
|
||||
mgAxisRelativeTrigger.ApplyCurrentSelection();
|
||||
mgAxisSmoothTrigger.ApplyCurrentSelection();
|
||||
}
|
||||
|
||||
void CCustomizeAxisMenu::ApplyActionSettings(void)
|
||||
{
|
||||
CControls &ctrls = _pGame->gm_ctrlControlsExtra;
|
||||
INDEX iSelectedAction = mgAxisActionTrigger.mg_iSelected;
|
||||
INDEX iMountedAxis = mgAxisMountedTrigger.mg_iSelected;
|
||||
FLOAT fSensitivity =
|
||||
FLOAT(mgAxisSensitivity.mg_iCurPos-mgAxisSensitivity.mg_iMinPos) /
|
||||
FLOAT(mgAxisSensitivity.mg_iMaxPos-mgAxisSensitivity.mg_iMinPos)*100.0f;
|
||||
FLOAT fDeadZone =
|
||||
FLOAT(mgAxisDeadzone.mg_iCurPos-mgAxisDeadzone.mg_iMinPos) /
|
||||
FLOAT(mgAxisDeadzone.mg_iMaxPos-mgAxisDeadzone.mg_iMinPos)*100.0f;
|
||||
|
||||
BOOL bInvert = mgAxisInvertTrigger.mg_iSelected != 0;
|
||||
BOOL bRelative = mgAxisRelativeTrigger.mg_iSelected != 0;
|
||||
BOOL bSmooth = mgAxisSmoothTrigger.mg_iSelected != 0;
|
||||
|
||||
ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_iAxisAction = iMountedAxis;
|
||||
if (INDEX(ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_fSensitivity)!=INDEX(fSensitivity)) {
|
||||
ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_fSensitivity = fSensitivity;
|
||||
}
|
||||
if (INDEX(ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_fDeadZone)!=INDEX(fDeadZone)) {
|
||||
ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_fDeadZone = fDeadZone;
|
||||
}
|
||||
ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_bInvert = bInvert;
|
||||
ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_bRelativeControler = bRelative;
|
||||
ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_bSmooth = bSmooth;
|
||||
ctrls.CalculateInfluencesForAllAxis();
|
||||
ControlsMenuOff();
|
||||
}
|
||||
|
||||
void CCustomizeAxisMenu::StartMenu(void)
|
||||
{
|
||||
ObtainActionSettings();
|
||||
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void CCustomizeAxisMenu::EndMenu(void)
|
||||
{
|
||||
ApplyActionSettings();
|
||||
CGameMenu::EndMenu();
|
||||
void InitActionsForCustomizeAxisMenu() {
|
||||
gmCustomizeAxisMenu.gm_mgActionTrigger.mg_pPreTriggerChange = PreChangeAxis;
|
||||
gmCustomizeAxisMenu.gm_mgActionTrigger.mg_pOnTriggerChange = PostChangeAxis;
|
||||
}
|
||||
|
||||
// ------------------------ COptionsMenu implementation
|
||||
void COptionsMenu::Initialize_t(void)
|
||||
void InitActionsForOptionsMenu()
|
||||
{
|
||||
// intialize options menu
|
||||
mgOptionsTitle.mg_boxOnScreen = BoxTitle();
|
||||
mgOptionsTitle.mg_strText = TRANS("OPTIONS");
|
||||
gm_lhGadgets.AddTail( mgOptionsTitle.mg_lnNode);
|
||||
|
||||
mgVideoOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
mgVideoOptions.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
mgVideoOptions.mg_pmgUp = &mgAddonOptions;
|
||||
mgVideoOptions.mg_pmgDown = &mgAudioOptions;
|
||||
mgVideoOptions.mg_strText = TRANS("VIDEO OPTIONS");
|
||||
mgVideoOptions.mg_strTip = TRANS("set video mode and driver");
|
||||
gm_lhGadgets.AddTail( mgVideoOptions.mg_lnNode);
|
||||
mgVideoOptions.mg_pActivatedFunction = &StartVideoOptionsMenu;
|
||||
|
||||
mgAudioOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
mgAudioOptions.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
mgAudioOptions.mg_pmgUp = &mgVideoOptions;
|
||||
mgAudioOptions.mg_pmgDown = &mgPlayerProfileOptions;
|
||||
mgAudioOptions.mg_strText = TRANS("AUDIO OPTIONS");
|
||||
mgAudioOptions.mg_strTip = TRANS("set audio quality and volume");
|
||||
gm_lhGadgets.AddTail( mgAudioOptions.mg_lnNode);
|
||||
mgAudioOptions.mg_pActivatedFunction = &StartAudioOptionsMenu;
|
||||
|
||||
mgPlayerProfileOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
mgPlayerProfileOptions.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
mgPlayerProfileOptions.mg_pmgUp = &mgAudioOptions;
|
||||
mgPlayerProfileOptions.mg_pmgDown = &mgNetworkOptions;
|
||||
mgPlayerProfileOptions.mg_strText = TRANS("PLAYERS AND CONTROLS");
|
||||
mgPlayerProfileOptions.mg_strTip = TRANS("change currently active player or adjust controls");
|
||||
gm_lhGadgets.AddTail( mgPlayerProfileOptions.mg_lnNode);
|
||||
mgPlayerProfileOptions.mg_pActivatedFunction = &StartChangePlayerMenuFromOptions;
|
||||
|
||||
mgNetworkOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
mgNetworkOptions.mg_boxOnScreen = BoxBigRow(3);
|
||||
mgNetworkOptions.mg_pmgUp = &mgPlayerProfileOptions;
|
||||
mgNetworkOptions.mg_pmgDown = &mgCustomOptions;
|
||||
mgNetworkOptions.mg_strText = TRANS("NETWORK CONNECTION");
|
||||
mgNetworkOptions.mg_strTip = TRANS("choose your connection parameters");
|
||||
gm_lhGadgets.AddTail( mgNetworkOptions.mg_lnNode);
|
||||
mgNetworkOptions.mg_pActivatedFunction = &StartNetworkSettingsMenu;
|
||||
|
||||
mgCustomOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
mgCustomOptions.mg_boxOnScreen = BoxBigRow(4);
|
||||
mgCustomOptions.mg_pmgUp = &mgNetworkOptions;
|
||||
mgCustomOptions.mg_pmgDown = &mgAddonOptions;
|
||||
mgCustomOptions.mg_strText = TRANS("ADVANCED OPTIONS");
|
||||
mgCustomOptions.mg_strTip = TRANS("for advanced users only");
|
||||
gm_lhGadgets.AddTail( mgCustomOptions.mg_lnNode);
|
||||
mgCustomOptions.mg_pActivatedFunction = &StartCustomLoadMenu;
|
||||
|
||||
mgAddonOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
mgAddonOptions.mg_boxOnScreen = BoxBigRow(5);
|
||||
mgAddonOptions.mg_pmgUp = &mgCustomOptions;
|
||||
mgAddonOptions.mg_pmgDown = &mgVideoOptions;
|
||||
mgAddonOptions.mg_strText = TRANS("EXECUTE ADDON");
|
||||
mgAddonOptions.mg_strTip = TRANS("choose from list of addons to execute");
|
||||
gm_lhGadgets.AddTail( mgAddonOptions.mg_lnNode);
|
||||
mgAddonOptions.mg_pActivatedFunction = &StartAddonsLoadMenu;
|
||||
gmOptionsMenu.gm_mgVideoOptions.mg_pActivatedFunction = &StartVideoOptionsMenu;
|
||||
gmOptionsMenu.gm_mgAudioOptions.mg_pActivatedFunction = &StartAudioOptionsMenu;
|
||||
gmOptionsMenu.gm_mgPlayerProfileOptions.mg_pActivatedFunction = &StartChangePlayerMenuFromOptions;
|
||||
gmOptionsMenu.gm_mgNetworkOptions.mg_pActivatedFunction = &StartNetworkSettingsMenu;
|
||||
gmOptionsMenu.gm_mgCustomOptions.mg_pActivatedFunction = &StartCustomLoadMenu;
|
||||
gmOptionsMenu.gm_mgAddonOptions.mg_pActivatedFunction = &StartAddonsLoadMenu;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------ CVideoOptionsMenu implementation
|
||||
|
||||
static void FillResolutionsList(void)
|
||||
{
|
||||
// free resolutions
|
||||
|
@ -4761,61 +4453,12 @@ BOOL CServersMenu::OnKeyDown(int iVKey)
|
|||
// __Evolution
|
||||
|
||||
// ------------------------ CNetworkMenu implementation
|
||||
void CNetworkMenu::Initialize_t(void)
|
||||
void InitActionsForNetworkMenu()
|
||||
{
|
||||
// intialize network menu
|
||||
mgNetworkTitle.mg_boxOnScreen = BoxTitle();
|
||||
mgNetworkTitle.mg_strText = TRANS("NETWORK");
|
||||
gm_lhGadgets.AddTail( mgNetworkTitle.mg_lnNode);
|
||||
|
||||
mgNetworkJoin.mg_bfsFontSize = BFS_LARGE;
|
||||
mgNetworkJoin.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
mgNetworkJoin.mg_pmgUp = &mgNetworkLoad;
|
||||
mgNetworkJoin.mg_pmgDown = &mgNetworkStart;
|
||||
mgNetworkJoin.mg_strText = TRANS("JOIN GAME");
|
||||
mgNetworkJoin.mg_strTip = TRANS("join a network game");
|
||||
gm_lhGadgets.AddTail( mgNetworkJoin.mg_lnNode);
|
||||
mgNetworkJoin.mg_pActivatedFunction = &StartNetworkJoinMenu;
|
||||
|
||||
mgNetworkStart.mg_bfsFontSize = BFS_LARGE;
|
||||
mgNetworkStart.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
mgNetworkStart.mg_pmgUp = &mgNetworkJoin;
|
||||
mgNetworkStart.mg_pmgDown = &mgNetworkQuickLoad;
|
||||
mgNetworkStart.mg_strText = TRANS("START SERVER");
|
||||
mgNetworkStart.mg_strTip = TRANS("start a network game server");
|
||||
gm_lhGadgets.AddTail( mgNetworkStart.mg_lnNode);
|
||||
mgNetworkStart.mg_pActivatedFunction = &StartNetworkStartMenu;
|
||||
|
||||
mgNetworkQuickLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
mgNetworkQuickLoad.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
mgNetworkQuickLoad.mg_pmgUp = &mgNetworkStart;
|
||||
mgNetworkQuickLoad.mg_pmgDown = &mgNetworkLoad;
|
||||
mgNetworkQuickLoad.mg_strText = TRANS("QUICK LOAD");
|
||||
mgNetworkQuickLoad.mg_strTip = TRANS("load a quick-saved game (F9)");
|
||||
gm_lhGadgets.AddTail( mgNetworkQuickLoad.mg_lnNode);
|
||||
mgNetworkQuickLoad.mg_pActivatedFunction = &StartNetworkQuickLoadMenu;
|
||||
|
||||
mgNetworkLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
mgNetworkLoad.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
mgNetworkLoad.mg_pmgUp = &mgNetworkQuickLoad;
|
||||
mgNetworkLoad.mg_pmgDown = &mgNetworkJoin;
|
||||
mgNetworkLoad.mg_strText = TRANS("LOAD");
|
||||
mgNetworkLoad.mg_strTip = TRANS("start server and load a network game (server only)");
|
||||
gm_lhGadgets.AddTail( mgNetworkLoad.mg_lnNode);
|
||||
mgNetworkLoad.mg_pActivatedFunction = &StartNetworkLoadMenu;
|
||||
|
||||
}
|
||||
|
||||
void CNetworkMenu::StartMenu(void)
|
||||
{
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void UpdateNetworkLevel(INDEX iDummy)
|
||||
{
|
||||
ValidateLevelForFlags(_pGame->gam_strCustomLevel,
|
||||
GetSpawnFlagsForGameType(mgNetworkGameType.mg_iSelected));
|
||||
mgNetworkLevel.mg_strText = FindLevelByFileName(_pGame->gam_strCustomLevel).li_strName;
|
||||
gmNetworkMenu.gm_mgJoin.mg_pActivatedFunction = &StartNetworkJoinMenu;
|
||||
gmNetworkMenu.gm_mgStart.mg_pActivatedFunction = &StartNetworkStartMenu;
|
||||
gmNetworkMenu.gm_mgQuickLoad.mg_pActivatedFunction = &StartNetworkQuickLoadMenu;
|
||||
gmNetworkMenu.gm_mgLoad.mg_pActivatedFunction = &StartNetworkLoadMenu;
|
||||
}
|
||||
|
||||
// ------------------------ CNetworkJoinMenu implementation
|
||||
|
@ -4827,6 +4470,13 @@ void InitActionsForNetworkJoinMenu()
|
|||
}
|
||||
|
||||
// ------------------------ CNetworkStartMenu implementation
|
||||
void UpdateNetworkLevel(INDEX iDummy)
|
||||
{
|
||||
ValidateLevelForFlags(_pGame->gam_strCustomLevel,
|
||||
GetSpawnFlagsForGameType(mgNetworkGameType.mg_iSelected));
|
||||
mgNetworkLevel.mg_strText = FindLevelByFileName(_pGame->gam_strCustomLevel).li_strName;
|
||||
}
|
||||
|
||||
void CNetworkStartMenu::Initialize_t(void)
|
||||
{
|
||||
// title
|
||||
|
|
|
@ -183,6 +183,8 @@ copy Release\$(TargetName).map $(SolutionDir)..\Bin\ >nul </Command>
|
|||
<ClCompile Include="LevelInfo.cpp" />
|
||||
<ClCompile Include="MainWindow.cpp" />
|
||||
<ClCompile Include="MConfirm.cpp" />
|
||||
<ClCompile Include="MCustomizeAxis.cpp" />
|
||||
<ClCompile Include="MCustomizeKeyboard.cpp" />
|
||||
<ClCompile Include="MDisabled.cpp" />
|
||||
<ClCompile Include="Menu.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
|
||||
|
@ -210,11 +212,14 @@ copy Release\$(TargetName).map $(SolutionDir)..\Bin\ >nul </Command>
|
|||
<ClCompile Include="MGTitle.cpp" />
|
||||
<ClCompile Include="MGTrigger.cpp" />
|
||||
<ClCompile Include="MGVarButton.cpp" />
|
||||
<ClCompile Include="MHighScore.cpp" />
|
||||
<ClCompile Include="MInGame.cpp" />
|
||||
<ClCompile Include="MLevels.cpp" />
|
||||
<ClCompile Include="MMain.cpp" />
|
||||
<ClCompile Include="MNetwork.cpp" />
|
||||
<ClCompile Include="MNetworkJoin.cpp" />
|
||||
<ClCompile Include="MNetworkOpen.cpp" />
|
||||
<ClCompile Include="MOptions.cpp" />
|
||||
<ClCompile Include="MSinglePlayer.cpp" />
|
||||
<ClCompile Include="MSinglePlayerNew.cpp" />
|
||||
<ClCompile Include="MSplitScreen.cpp" />
|
||||
|
|
|
@ -156,6 +156,21 @@
|
|||
<ClCompile Include="MNetworkJoin.cpp">
|
||||
<Filter>Source Files\Menus</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MNetwork.cpp">
|
||||
<Filter>Source Files\Menus</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MOptions.cpp">
|
||||
<Filter>Source Files\Menus</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MHighScore.cpp">
|
||||
<Filter>Source Files\Menus</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MCustomizeAxis.cpp">
|
||||
<Filter>Source Files\Menus</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MCustomizeKeyboard.cpp">
|
||||
<Filter>Source Files\Menus</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CDCheck.h">
|
||||
|
|
Loading…
Reference in New Issue
Block a user