mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-12-24 23:04:51 +01:00
GameExecutable: Replace 4-spaced tabs with 2-spaced.
This commit is contained in:
parent
80471f5041
commit
4cb76b506f
|
@ -72,7 +72,7 @@ void InitGLSettings(void)
|
|||
{
|
||||
strmFile.Open_t( CTString("Scripts\\GLSettings\\GLSettings.lst"), CTStream::OM_READ);
|
||||
INDEX iIndex = 0;
|
||||
do
|
||||
do
|
||||
{
|
||||
achrLine [0] = 0;
|
||||
achrRenderer[0] = 0;
|
||||
|
@ -89,7 +89,7 @@ void InitGLSettings(void)
|
|||
se.se_fnmScript = CTString(achrScript);
|
||||
_lhSettings.AddTail( se.se_lnNode);
|
||||
}
|
||||
while( !strmFile.AtEOF());
|
||||
while( !strmFile.AtEOF());
|
||||
}
|
||||
|
||||
// ignore errors
|
||||
|
|
|
@ -21,33 +21,33 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CMGArrow::Render(CDrawPort *pdp)
|
||||
{
|
||||
SetFontMedium(pdp);
|
||||
SetFontMedium(pdp);
|
||||
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
COLOR col = GetCurrentColor();
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
COLOR col = GetCurrentColor();
|
||||
|
||||
CTString str;
|
||||
if (mg_adDirection == AD_NONE) {
|
||||
str = "???";
|
||||
} else if (mg_adDirection == AD_UP) {
|
||||
str = TRANS("Page Up");
|
||||
} else if (mg_adDirection == AD_DOWN) {
|
||||
str = TRANS("Page Down");
|
||||
} else {
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
CTString str;
|
||||
if (mg_adDirection == AD_NONE) {
|
||||
str = "???";
|
||||
} else if (mg_adDirection == AD_UP) {
|
||||
str = TRANS("Page Up");
|
||||
} else if (mg_adDirection == AD_DOWN) {
|
||||
str = TRANS("Page Down");
|
||||
} else {
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
|
||||
PIX pixI = box.Min()(1);
|
||||
PIX pixJ = box.Min()(2);
|
||||
pdp->PutText(str, pixI, pixJ, col);
|
||||
PIX pixI = box.Min()(1);
|
||||
PIX pixJ = box.Min()(2);
|
||||
pdp->PutText(str, pixI, pixJ, col);
|
||||
}
|
||||
|
||||
void CMGArrow::OnActivate(void)
|
||||
{
|
||||
if (mg_adDirection == AD_UP) {
|
||||
pgmCurrentMenu->ScrollList(-3);
|
||||
}
|
||||
else if (mg_adDirection == AD_DOWN) {
|
||||
pgmCurrentMenu->ScrollList(+3);
|
||||
}
|
||||
if (mg_adDirection == AD_UP) {
|
||||
pgmCurrentMenu->ScrollList(-3);
|
||||
}
|
||||
else if (mg_adDirection == AD_DOWN) {
|
||||
pgmCurrentMenu->ScrollList(+3);
|
||||
}
|
||||
}
|
|
@ -24,29 +24,29 @@ extern CSoundData *_psdPress;
|
|||
|
||||
void CMGChangePlayer::OnActivate(void)
|
||||
{
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
_iLocalPlayer = mg_iLocalPlayer;
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
_iLocalPlayer = mg_iLocalPlayer;
|
||||
|
||||
if (_pGame->gm_aiMenuLocalPlayers[mg_iLocalPlayer] < 0)
|
||||
_pGame->gm_aiMenuLocalPlayers[mg_iLocalPlayer] = 0;
|
||||
if (_pGame->gm_aiMenuLocalPlayers[mg_iLocalPlayer] < 0)
|
||||
_pGame->gm_aiMenuLocalPlayers[mg_iLocalPlayer] = 0;
|
||||
|
||||
_pGUIM->gmPlayerProfile.gm_piCurrentPlayer = &_pGame->gm_aiMenuLocalPlayers[mg_iLocalPlayer];
|
||||
_pGUIM->gmPlayerProfile.gm_pgmParentMenu = &_pGUIM->gmSelectPlayersMenu;
|
||||
_pGUIM->gmPlayerProfile.gm_piCurrentPlayer = &_pGame->gm_aiMenuLocalPlayers[mg_iLocalPlayer];
|
||||
_pGUIM->gmPlayerProfile.gm_pgmParentMenu = &_pGUIM->gmSelectPlayersMenu;
|
||||
|
||||
extern BOOL _bPlayerMenuFromSinglePlayer;
|
||||
_bPlayerMenuFromSinglePlayer = FALSE;
|
||||
ChangeToMenu(&_pGUIM->gmPlayerProfile);
|
||||
extern BOOL _bPlayerMenuFromSinglePlayer;
|
||||
_bPlayerMenuFromSinglePlayer = FALSE;
|
||||
ChangeToMenu(&_pGUIM->gmPlayerProfile);
|
||||
}
|
||||
|
||||
void CMGChangePlayer::SetPlayerText(void)
|
||||
{
|
||||
INDEX iPlayer = _pGame->gm_aiMenuLocalPlayers[mg_iLocalPlayer];
|
||||
CPlayerCharacter &pc = _pGame->gm_apcPlayers[iPlayer];
|
||||
INDEX iPlayer = _pGame->gm_aiMenuLocalPlayers[mg_iLocalPlayer];
|
||||
CPlayerCharacter &pc = _pGame->gm_apcPlayers[iPlayer];
|
||||
|
||||
if (iPlayer<0 || iPlayer>7) {
|
||||
mg_strText = "????";
|
||||
} else {
|
||||
mg_strText.PrintF(TRANS("Player %d: %s\n"), mg_iLocalPlayer + 1, pc.GetNameForPrinting());
|
||||
}
|
||||
if (iPlayer<0 || iPlayer>7) {
|
||||
mg_strText = "????";
|
||||
} else {
|
||||
mg_strText.PrintF(TRANS("Player %d: %s\n"), mg_iLocalPlayer + 1, pc.GetNameForPrinting());
|
||||
}
|
||||
}
|
|
@ -25,143 +25,143 @@ extern BOOL _bEditingString;
|
|||
|
||||
CMGEdit::CMGEdit(void)
|
||||
{
|
||||
mg_pstrToChange = NULL;
|
||||
mg_ctMaxStringLen = 70;
|
||||
Clear();
|
||||
mg_pstrToChange = NULL;
|
||||
mg_ctMaxStringLen = 70;
|
||||
Clear();
|
||||
}
|
||||
|
||||
void CMGEdit::Clear(void)
|
||||
{
|
||||
mg_iCursorPos = 0;
|
||||
mg_bEditing = FALSE;
|
||||
_bEditingString = FALSE;
|
||||
mg_iCursorPos = 0;
|
||||
mg_bEditing = FALSE;
|
||||
_bEditingString = FALSE;
|
||||
}
|
||||
|
||||
void CMGEdit::OnActivate(void)
|
||||
{
|
||||
if (!mg_bEnabled) {
|
||||
return;
|
||||
}
|
||||
ASSERT(mg_pstrToChange != NULL);
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
SetText(mg_strText);
|
||||
mg_iCursorPos = strlen(mg_strText);
|
||||
mg_bEditing = TRUE;
|
||||
_bEditingString = TRUE;
|
||||
if (!mg_bEnabled) {
|
||||
return;
|
||||
}
|
||||
ASSERT(mg_pstrToChange != NULL);
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
SetText(mg_strText);
|
||||
mg_iCursorPos = strlen(mg_strText);
|
||||
mg_bEditing = TRUE;
|
||||
_bEditingString = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// focus lost
|
||||
void CMGEdit::OnKillFocus(void)
|
||||
{
|
||||
// go out of editing mode
|
||||
if (mg_bEditing) {
|
||||
OnKeyDown(VK_RETURN);
|
||||
Clear();
|
||||
}
|
||||
// proceed
|
||||
CMenuGadget::OnKillFocus();
|
||||
// go out of editing mode
|
||||
if (mg_bEditing) {
|
||||
OnKeyDown(VK_RETURN);
|
||||
Clear();
|
||||
}
|
||||
// proceed
|
||||
CMenuGadget::OnKillFocus();
|
||||
}
|
||||
|
||||
// helper function for deleting char(s) from string
|
||||
static void Key_BackDel(CTString &str, INDEX &iPos, BOOL bShift, BOOL bRight)
|
||||
{
|
||||
// do nothing if string is empty
|
||||
INDEX ctChars = strlen(str);
|
||||
if (ctChars == 0) return;
|
||||
if (bRight && iPos<ctChars) { // DELETE key
|
||||
if (bShift) {
|
||||
// delete to end of line
|
||||
str.TrimRight(iPos);
|
||||
} else {
|
||||
// delete only one char
|
||||
str.DeleteChar(iPos);
|
||||
}
|
||||
}
|
||||
if (!bRight && iPos>0) { // BACKSPACE key
|
||||
if (bShift) {
|
||||
// delete to start of line
|
||||
str.TrimLeft(ctChars - iPos);
|
||||
iPos = 0;
|
||||
} else {
|
||||
// delete only one char
|
||||
str.DeleteChar(iPos - 1);
|
||||
iPos--;
|
||||
}
|
||||
}
|
||||
// do nothing if string is empty
|
||||
INDEX ctChars = strlen(str);
|
||||
if (ctChars == 0) return;
|
||||
if (bRight && iPos<ctChars) { // DELETE key
|
||||
if (bShift) {
|
||||
// delete to end of line
|
||||
str.TrimRight(iPos);
|
||||
} else {
|
||||
// delete only one char
|
||||
str.DeleteChar(iPos);
|
||||
}
|
||||
}
|
||||
if (!bRight && iPos>0) { // BACKSPACE key
|
||||
if (bShift) {
|
||||
// delete to start of line
|
||||
str.TrimLeft(ctChars - iPos);
|
||||
iPos = 0;
|
||||
} else {
|
||||
// delete only one char
|
||||
str.DeleteChar(iPos - 1);
|
||||
iPos--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// key/mouse button pressed
|
||||
BOOL CMGEdit::OnKeyDown(int iVKey)
|
||||
{
|
||||
// if not in edit mode
|
||||
if (!mg_bEditing) {
|
||||
// behave like normal gadget
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
}
|
||||
// if not in edit mode
|
||||
if (!mg_bEditing) {
|
||||
// behave like normal gadget
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
}
|
||||
|
||||
// finish editing?
|
||||
BOOL bShift = GetKeyState(VK_SHIFT) & 0x8000;
|
||||
switch (iVKey) {
|
||||
case VK_UP: case VK_DOWN:
|
||||
case VK_RETURN: case VK_LBUTTON: *mg_pstrToChange = mg_strText; Clear(); OnStringChanged(); break;
|
||||
case VK_ESCAPE: case VK_RBUTTON: mg_strText = *mg_pstrToChange; Clear(); OnStringCanceled(); break;
|
||||
case VK_LEFT: if (mg_iCursorPos > 0) mg_iCursorPos--; break;
|
||||
case VK_RIGHT: if (mg_iCursorPos < strlen(mg_strText)) mg_iCursorPos++; break;
|
||||
case VK_HOME: mg_iCursorPos = 0; break;
|
||||
case VK_END: mg_iCursorPos = strlen(mg_strText); break;
|
||||
case VK_BACK: Key_BackDel(mg_strText, mg_iCursorPos, bShift, FALSE); break;
|
||||
case VK_DELETE: Key_BackDel(mg_strText, mg_iCursorPos, bShift, TRUE); break;
|
||||
default: break; // ignore all other special keys
|
||||
}
|
||||
// finish editing?
|
||||
BOOL bShift = GetKeyState(VK_SHIFT) & 0x8000;
|
||||
switch (iVKey) {
|
||||
case VK_UP: case VK_DOWN:
|
||||
case VK_RETURN: case VK_LBUTTON: *mg_pstrToChange = mg_strText; Clear(); OnStringChanged(); break;
|
||||
case VK_ESCAPE: case VK_RBUTTON: mg_strText = *mg_pstrToChange; Clear(); OnStringCanceled(); break;
|
||||
case VK_LEFT: if (mg_iCursorPos > 0) mg_iCursorPos--; break;
|
||||
case VK_RIGHT: if (mg_iCursorPos < strlen(mg_strText)) mg_iCursorPos++; break;
|
||||
case VK_HOME: mg_iCursorPos = 0; break;
|
||||
case VK_END: mg_iCursorPos = strlen(mg_strText); break;
|
||||
case VK_BACK: Key_BackDel(mg_strText, mg_iCursorPos, bShift, FALSE); break;
|
||||
case VK_DELETE: Key_BackDel(mg_strText, mg_iCursorPos, bShift, TRUE); break;
|
||||
default: break; // ignore all other special keys
|
||||
}
|
||||
|
||||
// key is handled
|
||||
return TRUE;
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// char typed
|
||||
BOOL CMGEdit::OnChar(MSG msg)
|
||||
{
|
||||
// if not in edit mode
|
||||
if (!mg_bEditing) {
|
||||
// behave like normal gadget
|
||||
return CMenuGadget::OnChar(msg);
|
||||
}
|
||||
// only chars are allowed
|
||||
const INDEX ctFullLen = mg_strText.Length();
|
||||
const INDEX ctNakedLen = mg_strText.LengthNaked();
|
||||
mg_iCursorPos = Clamp(mg_iCursorPos, 0L, ctFullLen);
|
||||
int iVKey = msg.wParam;
|
||||
if (isprint(iVKey) && ctNakedLen <= mg_ctMaxStringLen) {
|
||||
mg_strText.InsertChar(mg_iCursorPos, (char)iVKey);
|
||||
mg_iCursorPos++;
|
||||
}
|
||||
// key is handled
|
||||
return TRUE;
|
||||
// if not in edit mode
|
||||
if (!mg_bEditing) {
|
||||
// behave like normal gadget
|
||||
return CMenuGadget::OnChar(msg);
|
||||
}
|
||||
// only chars are allowed
|
||||
const INDEX ctFullLen = mg_strText.Length();
|
||||
const INDEX ctNakedLen = mg_strText.LengthNaked();
|
||||
mg_iCursorPos = Clamp(mg_iCursorPos, 0L, ctFullLen);
|
||||
int iVKey = msg.wParam;
|
||||
if (isprint(iVKey) && ctNakedLen <= mg_ctMaxStringLen) {
|
||||
mg_strText.InsertChar(mg_iCursorPos, (char)iVKey);
|
||||
mg_iCursorPos++;
|
||||
}
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CMGEdit::Render(CDrawPort *pdp)
|
||||
{
|
||||
if (mg_bEditing) {
|
||||
mg_iTextMode = -1;
|
||||
} else if (mg_bFocused) {
|
||||
mg_iTextMode = 0;
|
||||
} else {
|
||||
mg_iTextMode = 1;
|
||||
}
|
||||
if (mg_bEditing) {
|
||||
mg_iTextMode = -1;
|
||||
} else if (mg_bFocused) {
|
||||
mg_iTextMode = 0;
|
||||
} else {
|
||||
mg_iTextMode = 1;
|
||||
}
|
||||
|
||||
if (mg_strText == "" && !mg_bEditing) {
|
||||
if (mg_bfsFontSize == BFS_SMALL) {
|
||||
mg_strText = "*";
|
||||
} else {
|
||||
mg_strText = TRANS("<none>");
|
||||
}
|
||||
CMGButton::Render(pdp);
|
||||
mg_strText = "";
|
||||
} else {
|
||||
CMGButton::Render(pdp);
|
||||
}
|
||||
if (mg_strText == "" && !mg_bEditing) {
|
||||
if (mg_bfsFontSize == BFS_SMALL) {
|
||||
mg_strText = "*";
|
||||
} else {
|
||||
mg_strText = TRANS("<none>");
|
||||
}
|
||||
CMGButton::Render(pdp);
|
||||
mg_strText = "";
|
||||
} else {
|
||||
CMGButton::Render(pdp);
|
||||
}
|
||||
}
|
||||
|
||||
void CMGEdit::OnStringChanged(void)
|
||||
|
|
|
@ -24,74 +24,74 @@ extern CSoundData *_psdPress;
|
|||
|
||||
CMGFileButton::CMGFileButton(void)
|
||||
{
|
||||
mg_iState = FBS_NORMAL;
|
||||
mg_iState = FBS_NORMAL;
|
||||
}
|
||||
|
||||
// refresh current text from description
|
||||
void CMGFileButton::RefreshText(void)
|
||||
{
|
||||
mg_strText = mg_strDes;
|
||||
mg_strText.OnlyFirstLine();
|
||||
mg_strInfo = mg_strDes;
|
||||
mg_strInfo.RemovePrefix(mg_strText);
|
||||
mg_strInfo.DeleteChar(0);
|
||||
mg_strText = mg_strDes;
|
||||
mg_strText.OnlyFirstLine();
|
||||
mg_strInfo = mg_strDes;
|
||||
mg_strInfo.RemovePrefix(mg_strText);
|
||||
mg_strInfo.DeleteChar(0);
|
||||
}
|
||||
|
||||
void CMGFileButton::SaveDescription(void)
|
||||
{
|
||||
CTFileName fnFileNameDescription = mg_fnm.NoExt() + ".des";
|
||||
try {
|
||||
mg_strDes.Save_t(fnFileNameDescription);
|
||||
} catch (char *strError) {
|
||||
CPrintF("%s\n", strError);
|
||||
}
|
||||
CTFileName fnFileNameDescription = mg_fnm.NoExt() + ".des";
|
||||
try {
|
||||
mg_strDes.Save_t(fnFileNameDescription);
|
||||
} catch (char *strError) {
|
||||
CPrintF("%s\n", strError);
|
||||
}
|
||||
}
|
||||
|
||||
CMGFileButton *_pmgFileToSave = NULL;
|
||||
void OnFileSaveOK(void)
|
||||
{
|
||||
if (_pmgFileToSave != NULL) {
|
||||
_pmgFileToSave->SaveYes();
|
||||
}
|
||||
if (_pmgFileToSave != NULL) {
|
||||
_pmgFileToSave->SaveYes();
|
||||
}
|
||||
}
|
||||
|
||||
void CMGFileButton::DoSave(void)
|
||||
{
|
||||
if (FileExistsForWriting(mg_fnm)) {
|
||||
_pmgFileToSave = this;
|
||||
extern void SaveConfirm(void);
|
||||
SaveConfirm();
|
||||
} else {
|
||||
SaveYes();
|
||||
}
|
||||
if (FileExistsForWriting(mg_fnm)) {
|
||||
_pmgFileToSave = this;
|
||||
extern void SaveConfirm(void);
|
||||
SaveConfirm();
|
||||
} else {
|
||||
SaveYes();
|
||||
}
|
||||
}
|
||||
|
||||
void CMGFileButton::SaveYes(void)
|
||||
{
|
||||
ASSERT(_pGUIM->gmLoadSaveMenu.gm_bSave);
|
||||
// call saving function
|
||||
BOOL bSucceeded = _pGUIM->gmLoadSaveMenu.gm_pAfterFileChosen(mg_fnm);
|
||||
// if saved
|
||||
if (bSucceeded) {
|
||||
// save the description too
|
||||
SaveDescription();
|
||||
}
|
||||
ASSERT(_pGUIM->gmLoadSaveMenu.gm_bSave);
|
||||
// call saving function
|
||||
BOOL bSucceeded = _pGUIM->gmLoadSaveMenu.gm_pAfterFileChosen(mg_fnm);
|
||||
// if saved
|
||||
if (bSucceeded) {
|
||||
// save the description too
|
||||
SaveDescription();
|
||||
}
|
||||
}
|
||||
|
||||
void CMGFileButton::DoLoad(void)
|
||||
{
|
||||
ASSERT(!_pGUIM->gmLoadSaveMenu.gm_bSave);
|
||||
// if no file
|
||||
if (!FileExists(mg_fnm)) {
|
||||
// do nothing
|
||||
return;
|
||||
}
|
||||
if (_pGUIM->gmLoadSaveMenu.gm_pgmNextMenu != NULL) {
|
||||
_pGUIM->gmLoadSaveMenu.gm_pgmParentMenu = _pGUIM->gmLoadSaveMenu.gm_pgmNextMenu;
|
||||
}
|
||||
// call loading function
|
||||
BOOL bSucceeded = _pGUIM->gmLoadSaveMenu.gm_pAfterFileChosen(mg_fnm);
|
||||
ASSERT(bSucceeded);
|
||||
ASSERT(!_pGUIM->gmLoadSaveMenu.gm_bSave);
|
||||
// if no file
|
||||
if (!FileExists(mg_fnm)) {
|
||||
// do nothing
|
||||
return;
|
||||
}
|
||||
if (_pGUIM->gmLoadSaveMenu.gm_pgmNextMenu != NULL) {
|
||||
_pGUIM->gmLoadSaveMenu.gm_pgmParentMenu = _pGUIM->gmLoadSaveMenu.gm_pgmNextMenu;
|
||||
}
|
||||
// call loading function
|
||||
BOOL bSucceeded = _pGUIM->gmLoadSaveMenu.gm_pAfterFileChosen(mg_fnm);
|
||||
ASSERT(bSucceeded);
|
||||
}
|
||||
|
||||
static CTString _strTmpDescription;
|
||||
|
@ -99,144 +99,144 @@ static CTString _strOrgDescription;
|
|||
|
||||
void CMGFileButton::StartEdit(void)
|
||||
{
|
||||
CMGEdit::OnActivate();
|
||||
CMGEdit::OnActivate();
|
||||
}
|
||||
|
||||
void CMGFileButton::OnActivate(void)
|
||||
{
|
||||
if (mg_fnm == "") {
|
||||
return;
|
||||
}
|
||||
if (mg_fnm == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
|
||||
// if loading
|
||||
if (!_pGUIM->gmLoadSaveMenu.gm_bSave) {
|
||||
// load now
|
||||
DoLoad();
|
||||
// if saving
|
||||
} else {
|
||||
// switch to editing mode
|
||||
BOOL bWasEmpty = mg_strText == EMPTYSLOTSTRING;
|
||||
mg_strDes = _pGUIM->gmLoadSaveMenu.gm_strSaveDes;
|
||||
RefreshText();
|
||||
_strOrgDescription = _strTmpDescription = mg_strText;
|
||||
// if loading
|
||||
if (!_pGUIM->gmLoadSaveMenu.gm_bSave) {
|
||||
// load now
|
||||
DoLoad();
|
||||
// if saving
|
||||
} else {
|
||||
// switch to editing mode
|
||||
BOOL bWasEmpty = mg_strText == EMPTYSLOTSTRING;
|
||||
mg_strDes = _pGUIM->gmLoadSaveMenu.gm_strSaveDes;
|
||||
RefreshText();
|
||||
_strOrgDescription = _strTmpDescription = mg_strText;
|
||||
|
||||
if (bWasEmpty) {
|
||||
_strOrgDescription = EMPTYSLOTSTRING;
|
||||
}
|
||||
if (bWasEmpty) {
|
||||
_strOrgDescription = EMPTYSLOTSTRING;
|
||||
}
|
||||
|
||||
mg_pstrToChange = &_strTmpDescription;
|
||||
StartEdit();
|
||||
mg_iState = FBS_SAVENAME;
|
||||
}
|
||||
mg_pstrToChange = &_strTmpDescription;
|
||||
StartEdit();
|
||||
mg_iState = FBS_SAVENAME;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CMGFileButton::OnKeyDown(int iVKey)
|
||||
{
|
||||
if (mg_iState == FBS_NORMAL) {
|
||||
if (_pGUIM->gmLoadSaveMenu.gm_bSave || _pGUIM->gmLoadSaveMenu.gm_bManage) {
|
||||
if (iVKey == VK_F2) {
|
||||
if (FileExistsForWriting(mg_fnm)) {
|
||||
// switch to renaming mode
|
||||
_strOrgDescription = mg_strText;
|
||||
_strTmpDescription = mg_strText;
|
||||
mg_pstrToChange = &_strTmpDescription;
|
||||
StartEdit();
|
||||
mg_iState = FBS_RENAME;
|
||||
}
|
||||
return TRUE;
|
||||
if (mg_iState == FBS_NORMAL) {
|
||||
if (_pGUIM->gmLoadSaveMenu.gm_bSave || _pGUIM->gmLoadSaveMenu.gm_bManage) {
|
||||
if (iVKey == VK_F2) {
|
||||
if (FileExistsForWriting(mg_fnm)) {
|
||||
// switch to renaming mode
|
||||
_strOrgDescription = mg_strText;
|
||||
_strTmpDescription = mg_strText;
|
||||
mg_pstrToChange = &_strTmpDescription;
|
||||
StartEdit();
|
||||
mg_iState = FBS_RENAME;
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
} else if (iVKey == VK_DELETE) {
|
||||
if (FileExistsForWriting(mg_fnm)) {
|
||||
// delete the file, its description and thumbnail
|
||||
RemoveFile(mg_fnm);
|
||||
RemoveFile(mg_fnm.NoExt() + ".des");
|
||||
RemoveFile(mg_fnm.NoExt() + "Tbn.tex");
|
||||
// refresh menu
|
||||
_pGUIM->gmLoadSaveMenu.EndMenu();
|
||||
_pGUIM->gmLoadSaveMenu.StartMenu();
|
||||
OnSetFocus();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
} else {
|
||||
// go out of editing mode
|
||||
if (mg_bEditing) {
|
||||
if (iVKey == VK_UP || iVKey == VK_DOWN) {
|
||||
CMGEdit::OnKeyDown(VK_ESCAPE);
|
||||
}
|
||||
}
|
||||
return CMGEdit::OnKeyDown(iVKey);
|
||||
}
|
||||
} else if (iVKey == VK_DELETE) {
|
||||
if (FileExistsForWriting(mg_fnm)) {
|
||||
// delete the file, its description and thumbnail
|
||||
RemoveFile(mg_fnm);
|
||||
RemoveFile(mg_fnm.NoExt() + ".des");
|
||||
RemoveFile(mg_fnm.NoExt() + "Tbn.tex");
|
||||
// refresh menu
|
||||
_pGUIM->gmLoadSaveMenu.EndMenu();
|
||||
_pGUIM->gmLoadSaveMenu.StartMenu();
|
||||
OnSetFocus();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
} else {
|
||||
// go out of editing mode
|
||||
if (mg_bEditing) {
|
||||
if (iVKey == VK_UP || iVKey == VK_DOWN) {
|
||||
CMGEdit::OnKeyDown(VK_ESCAPE);
|
||||
}
|
||||
}
|
||||
return CMGEdit::OnKeyDown(iVKey);
|
||||
}
|
||||
}
|
||||
|
||||
void CMGFileButton::OnSetFocus(void)
|
||||
{
|
||||
mg_iState = FBS_NORMAL;
|
||||
mg_iState = FBS_NORMAL;
|
||||
|
||||
if (_pGUIM->gmLoadSaveMenu.gm_bAllowThumbnails && mg_bEnabled) {
|
||||
SetThumbnail(mg_fnm);
|
||||
} else {
|
||||
ClearThumbnail();
|
||||
}
|
||||
if (_pGUIM->gmLoadSaveMenu.gm_bAllowThumbnails && mg_bEnabled) {
|
||||
SetThumbnail(mg_fnm);
|
||||
} else {
|
||||
ClearThumbnail();
|
||||
}
|
||||
|
||||
pgmCurrentMenu->KillAllFocuses();
|
||||
CMGButton::OnSetFocus();
|
||||
pgmCurrentMenu->KillAllFocuses();
|
||||
CMGButton::OnSetFocus();
|
||||
}
|
||||
|
||||
void CMGFileButton::OnKillFocus(void)
|
||||
{
|
||||
// go out of editing mode
|
||||
if (mg_bEditing) {
|
||||
OnKeyDown(VK_ESCAPE);
|
||||
}
|
||||
// go out of editing mode
|
||||
if (mg_bEditing) {
|
||||
OnKeyDown(VK_ESCAPE);
|
||||
}
|
||||
|
||||
CMGEdit::OnKillFocus();
|
||||
CMGEdit::OnKillFocus();
|
||||
}
|
||||
|
||||
// override from edit gadget
|
||||
void CMGFileButton::OnStringChanged(void)
|
||||
{
|
||||
// if saving
|
||||
if (mg_iState == FBS_SAVENAME) {
|
||||
// do the save
|
||||
mg_strDes = _strTmpDescription + "\n" + mg_strInfo;
|
||||
DoSave();
|
||||
// if renaming
|
||||
} else if (mg_iState == FBS_RENAME) {
|
||||
// do the rename
|
||||
mg_strDes = _strTmpDescription + "\n" + mg_strInfo;
|
||||
SaveDescription();
|
||||
// refresh menu
|
||||
_pGUIM->gmLoadSaveMenu.EndMenu();
|
||||
_pGUIM->gmLoadSaveMenu.StartMenu();
|
||||
OnSetFocus();
|
||||
}
|
||||
// if saving
|
||||
if (mg_iState == FBS_SAVENAME) {
|
||||
// do the save
|
||||
mg_strDes = _strTmpDescription + "\n" + mg_strInfo;
|
||||
DoSave();
|
||||
// if renaming
|
||||
} else if (mg_iState == FBS_RENAME) {
|
||||
// do the rename
|
||||
mg_strDes = _strTmpDescription + "\n" + mg_strInfo;
|
||||
SaveDescription();
|
||||
// refresh menu
|
||||
_pGUIM->gmLoadSaveMenu.EndMenu();
|
||||
_pGUIM->gmLoadSaveMenu.StartMenu();
|
||||
OnSetFocus();
|
||||
}
|
||||
}
|
||||
void CMGFileButton::OnStringCanceled(void)
|
||||
{
|
||||
mg_strText = _strOrgDescription;
|
||||
mg_strText = _strOrgDescription;
|
||||
}
|
||||
|
||||
void CMGFileButton::Render(CDrawPort *pdp)
|
||||
{
|
||||
// render original gadget first
|
||||
CMGEdit::Render(pdp);
|
||||
// render original gadget first
|
||||
CMGEdit::Render(pdp);
|
||||
|
||||
// if currently selected
|
||||
if (mg_bFocused && mg_bEnabled) {
|
||||
// add info at the bottom if screen
|
||||
SetFontMedium(pdp);
|
||||
// if currently selected
|
||||
if (mg_bFocused && mg_bEnabled) {
|
||||
// add info at the bottom if screen
|
||||
SetFontMedium(pdp);
|
||||
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, BoxSaveLoad(15.0));
|
||||
PIX pixI = box.Min()(1);
|
||||
PIX pixJ = box.Min()(2);
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, BoxSaveLoad(15.0));
|
||||
PIX pixI = box.Min()(1);
|
||||
PIX pixJ = box.Min()(2);
|
||||
|
||||
COLOR col = LCDGetColor(C_mlGREEN | 255, "file info");
|
||||
pdp->PutText(mg_strInfo, pixI, pixJ, col);
|
||||
}
|
||||
COLOR col = LCDGetColor(C_mlGREEN | 255, "file info");
|
||||
pdp->PutText(mg_strInfo, pixI, pixJ, col);
|
||||
}
|
||||
}
|
|
@ -21,81 +21,81 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#define HSCOLUMNS 6
|
||||
CTString strHighScores[HIGHSCORE_COUNT + 1][HSCOLUMNS];
|
||||
FLOAT afI[HSCOLUMNS] = {
|
||||
0.12f, 0.15f, 0.6f, 0.7f, 0.78f, 0.9f
|
||||
0.12f, 0.15f, 0.6f, 0.7f, 0.78f, 0.9f
|
||||
};
|
||||
|
||||
|
||||
void CMGHighScore::Render(CDrawPort *pdp)
|
||||
{
|
||||
SetFontMedium(pdp);
|
||||
SetFontMedium(pdp);
|
||||
|
||||
COLOR colHeader = LCDGetColor(C_GREEN | 255, "hiscore header");
|
||||
COLOR colData = LCDGetColor(C_mdGREEN | 255, "hiscore data");
|
||||
COLOR colLastSet = LCDGetColor(C_mlGREEN | 255, "hiscore last set");
|
||||
INDEX iLastSet = _pGame->gm_iLastSetHighScore;
|
||||
COLOR colHeader = LCDGetColor(C_GREEN | 255, "hiscore header");
|
||||
COLOR colData = LCDGetColor(C_mdGREEN | 255, "hiscore data");
|
||||
COLOR colLastSet = LCDGetColor(C_mlGREEN | 255, "hiscore last set");
|
||||
INDEX iLastSet = _pGame->gm_iLastSetHighScore;
|
||||
|
||||
CTString strText;
|
||||
CTString strText;
|
||||
|
||||
strHighScores[0][0] = TRANS("No.");
|
||||
strHighScores[0][1] = TRANS("Player Name");
|
||||
strHighScores[0][2] = TRANS("Difficulty");
|
||||
strHighScores[0][3] = TRANS("Time");
|
||||
strHighScores[0][4] = TRANS("Kills");
|
||||
strHighScores[0][5] = TRANS("Score");
|
||||
strHighScores[0][0] = TRANS("No.");
|
||||
strHighScores[0][1] = TRANS("Player Name");
|
||||
strHighScores[0][2] = TRANS("Difficulty");
|
||||
strHighScores[0][3] = TRANS("Time");
|
||||
strHighScores[0][4] = TRANS("Kills");
|
||||
strHighScores[0][5] = TRANS("Score");
|
||||
|
||||
{for (INDEX i = 0; i<HIGHSCORE_COUNT; i++) {
|
||||
switch (_pGame->gm_ahseHighScores[i].hse_gdDifficulty) {
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
case (CSessionProperties::GameDifficulty) - 100:
|
||||
strHighScores[i + 1][1] = "---";
|
||||
continue;
|
||||
break;
|
||||
case CSessionProperties::GD_TOURIST:
|
||||
strHighScores[i + 1][2] = TRANS("Tourist");
|
||||
break;
|
||||
case CSessionProperties::GD_EASY:
|
||||
strHighScores[i + 1][2] = TRANS("Easy");
|
||||
break;
|
||||
case CSessionProperties::GD_NORMAL:
|
||||
strHighScores[i + 1][2] = TRANS("Normal");
|
||||
break;
|
||||
case CSessionProperties::GD_HARD:
|
||||
strHighScores[i + 1][2] = TRANS("Hard");
|
||||
break;
|
||||
case CSessionProperties::GD_EXTREME:
|
||||
strHighScores[i + 1][2] = TRANS("Serious");
|
||||
break;
|
||||
case CSessionProperties::GD_EXTREME + 1:
|
||||
strHighScores[i + 1][2] = TRANS("Mental");
|
||||
break;
|
||||
}
|
||||
strHighScores[i + 1][0].PrintF("%d", i + 1);
|
||||
strHighScores[i + 1][1] = _pGame->gm_ahseHighScores[i].hse_strPlayer;
|
||||
strHighScores[i + 1][3] = TimeToString(_pGame->gm_ahseHighScores[i].hse_tmTime);
|
||||
strHighScores[i + 1][4].PrintF("%03d", _pGame->gm_ahseHighScores[i].hse_ctKills);
|
||||
strHighScores[i + 1][5].PrintF("%9d", _pGame->gm_ahseHighScores[i].hse_ctScore);
|
||||
}}
|
||||
{for (INDEX i = 0; i<HIGHSCORE_COUNT; i++) {
|
||||
switch (_pGame->gm_ahseHighScores[i].hse_gdDifficulty) {
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
case (CSessionProperties::GameDifficulty) - 100:
|
||||
strHighScores[i + 1][1] = "---";
|
||||
continue;
|
||||
break;
|
||||
case CSessionProperties::GD_TOURIST:
|
||||
strHighScores[i + 1][2] = TRANS("Tourist");
|
||||
break;
|
||||
case CSessionProperties::GD_EASY:
|
||||
strHighScores[i + 1][2] = TRANS("Easy");
|
||||
break;
|
||||
case CSessionProperties::GD_NORMAL:
|
||||
strHighScores[i + 1][2] = TRANS("Normal");
|
||||
break;
|
||||
case CSessionProperties::GD_HARD:
|
||||
strHighScores[i + 1][2] = TRANS("Hard");
|
||||
break;
|
||||
case CSessionProperties::GD_EXTREME:
|
||||
strHighScores[i + 1][2] = TRANS("Serious");
|
||||
break;
|
||||
case CSessionProperties::GD_EXTREME + 1:
|
||||
strHighScores[i + 1][2] = TRANS("Mental");
|
||||
break;
|
||||
}
|
||||
strHighScores[i + 1][0].PrintF("%d", i + 1);
|
||||
strHighScores[i + 1][1] = _pGame->gm_ahseHighScores[i].hse_strPlayer;
|
||||
strHighScores[i + 1][3] = TimeToString(_pGame->gm_ahseHighScores[i].hse_tmTime);
|
||||
strHighScores[i + 1][4].PrintF("%03d", _pGame->gm_ahseHighScores[i].hse_ctKills);
|
||||
strHighScores[i + 1][5].PrintF("%9d", _pGame->gm_ahseHighScores[i].hse_ctScore);
|
||||
}}
|
||||
|
||||
PIX pixJ = pdp->GetHeight()*0.25f;
|
||||
{for (INDEX iRow = 0; iRow<HIGHSCORE_COUNT + 1; iRow++) {
|
||||
COLOR col = (iRow == 0) ? colHeader : colData;
|
||||
if (iLastSet != -1 && iRow - 1 == iLastSet) {
|
||||
col = colLastSet;
|
||||
}
|
||||
{for (INDEX iColumn = 0; iColumn<HSCOLUMNS; iColumn++) {
|
||||
PIX pixI = pdp->GetWidth()*afI[iColumn];
|
||||
if (iColumn == 1) {
|
||||
pdp->PutText(strHighScores[iRow][iColumn], pixI, pixJ, col);
|
||||
}
|
||||
else {
|
||||
pdp->PutTextR(strHighScores[iRow][iColumn], pixI, pixJ, col);
|
||||
}
|
||||
}}
|
||||
if (iRow == 0) {
|
||||
pixJ += pdp->GetHeight()*0.06f;
|
||||
} else {
|
||||
pixJ += pdp->GetHeight()*0.04f;
|
||||
}
|
||||
}}
|
||||
PIX pixJ = pdp->GetHeight()*0.25f;
|
||||
{for (INDEX iRow = 0; iRow<HIGHSCORE_COUNT + 1; iRow++) {
|
||||
COLOR col = (iRow == 0) ? colHeader : colData;
|
||||
if (iLastSet != -1 && iRow - 1 == iLastSet) {
|
||||
col = colLastSet;
|
||||
}
|
||||
{for (INDEX iColumn = 0; iColumn<HSCOLUMNS; iColumn++) {
|
||||
PIX pixI = pdp->GetWidth()*afI[iColumn];
|
||||
if (iColumn == 1) {
|
||||
pdp->PutText(strHighScores[iRow][iColumn], pixI, pixJ, col);
|
||||
}
|
||||
else {
|
||||
pdp->PutTextR(strHighScores[iRow][iColumn], pixI, pixJ, col);
|
||||
}
|
||||
}}
|
||||
if (iRow == 0) {
|
||||
pixJ += pdp->GetHeight()*0.06f;
|
||||
} else {
|
||||
pixJ += pdp->GetHeight()*0.04f;
|
||||
}
|
||||
}}
|
||||
}
|
|
@ -26,197 +26,197 @@ extern BOOL _bDefiningKey;
|
|||
|
||||
CMGKeyDefinition::CMGKeyDefinition(void)
|
||||
{
|
||||
mg_iState = DOING_NOTHING;
|
||||
mg_iState = DOING_NOTHING;
|
||||
}
|
||||
|
||||
void CMGKeyDefinition::OnActivate(void)
|
||||
{
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
SetBindingNames(/*bDefining=*/TRUE);
|
||||
mg_iState = RELEASE_RETURN_WAITING;
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
SetBindingNames(/*bDefining=*/TRUE);
|
||||
mg_iState = RELEASE_RETURN_WAITING;
|
||||
}
|
||||
|
||||
BOOL CMGKeyDefinition::OnKeyDown(int iVKey)
|
||||
{
|
||||
// if waiting for a key definition
|
||||
if (mg_iState == PRESS_KEY_WAITING) {
|
||||
// do nothing
|
||||
return TRUE;
|
||||
}
|
||||
// if waiting for a key definition
|
||||
if (mg_iState == PRESS_KEY_WAITING) {
|
||||
// do nothing
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// if backspace pressed
|
||||
if (iVKey == VK_BACK) {
|
||||
// clear both keys
|
||||
DefineKey(KID_NONE);
|
||||
// message is processed
|
||||
return TRUE;
|
||||
}
|
||||
// if backspace pressed
|
||||
if (iVKey == VK_BACK) {
|
||||
// clear both keys
|
||||
DefineKey(KID_NONE);
|
||||
// message is processed
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
}
|
||||
|
||||
// set names for both key bindings
|
||||
void CMGKeyDefinition::SetBindingNames(BOOL bDefining)
|
||||
{
|
||||
// find the button
|
||||
INDEX ict = 0;
|
||||
INDEX iDik = 0;
|
||||
FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itba) {
|
||||
if (ict == mg_iControlNumber) {
|
||||
CButtonAction &ba = *itba;
|
||||
// get the current bindings and names
|
||||
INDEX iKey1 = ba.ba_iFirstKey;
|
||||
INDEX iKey2 = ba.ba_iSecondKey;
|
||||
BOOL bKey1Bound = iKey1 != KID_NONE;
|
||||
BOOL bKey2Bound = iKey2 != KID_NONE;
|
||||
CTString strKey1 = _pInput->GetButtonTransName(iKey1);
|
||||
CTString strKey2 = _pInput->GetButtonTransName(iKey2);
|
||||
// find the button
|
||||
INDEX ict = 0;
|
||||
INDEX iDik = 0;
|
||||
FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itba) {
|
||||
if (ict == mg_iControlNumber) {
|
||||
CButtonAction &ba = *itba;
|
||||
// get the current bindings and names
|
||||
INDEX iKey1 = ba.ba_iFirstKey;
|
||||
INDEX iKey2 = ba.ba_iSecondKey;
|
||||
BOOL bKey1Bound = iKey1 != KID_NONE;
|
||||
BOOL bKey2Bound = iKey2 != KID_NONE;
|
||||
CTString strKey1 = _pInput->GetButtonTransName(iKey1);
|
||||
CTString strKey2 = _pInput->GetButtonTransName(iKey2);
|
||||
|
||||
// if defining
|
||||
if (bDefining) {
|
||||
// if only first key is defined
|
||||
if (bKey1Bound && !bKey2Bound) {
|
||||
// put question mark for second key
|
||||
mg_strBinding = strKey1 + TRANS(" or ") + "?";
|
||||
// otherwise
|
||||
} else {
|
||||
// put question mark only
|
||||
mg_strBinding = "?";
|
||||
}
|
||||
// if not defining
|
||||
}
|
||||
else {
|
||||
// if second key is defined
|
||||
if (bKey2Bound) {
|
||||
// add both
|
||||
mg_strBinding = strKey1 + TRANS(" or ") + strKey2;
|
||||
// if second key is undefined
|
||||
} else {
|
||||
// display only first one
|
||||
mg_strBinding = strKey1;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
ict++;
|
||||
}
|
||||
// if defining
|
||||
if (bDefining) {
|
||||
// if only first key is defined
|
||||
if (bKey1Bound && !bKey2Bound) {
|
||||
// put question mark for second key
|
||||
mg_strBinding = strKey1 + TRANS(" or ") + "?";
|
||||
// otherwise
|
||||
} else {
|
||||
// put question mark only
|
||||
mg_strBinding = "?";
|
||||
}
|
||||
// if not defining
|
||||
}
|
||||
else {
|
||||
// if second key is defined
|
||||
if (bKey2Bound) {
|
||||
// add both
|
||||
mg_strBinding = strKey1 + TRANS(" or ") + strKey2;
|
||||
// if second key is undefined
|
||||
} else {
|
||||
// display only first one
|
||||
mg_strBinding = strKey1;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
ict++;
|
||||
}
|
||||
|
||||
// if not found, put errorneous string
|
||||
mg_strBinding = "???";
|
||||
// if not found, put errorneous string
|
||||
mg_strBinding = "???";
|
||||
}
|
||||
|
||||
void CMGKeyDefinition::Appear(void)
|
||||
{
|
||||
SetBindingNames(/*bDefining=*/FALSE);
|
||||
CMenuGadget::Appear();
|
||||
SetBindingNames(/*bDefining=*/FALSE);
|
||||
CMenuGadget::Appear();
|
||||
}
|
||||
|
||||
void CMGKeyDefinition::Disappear(void)
|
||||
{
|
||||
CMenuGadget::Disappear();
|
||||
CMenuGadget::Disappear();
|
||||
}
|
||||
|
||||
void CMGKeyDefinition::DefineKey(INDEX iDik)
|
||||
{
|
||||
// for each button in controls
|
||||
INDEX ict = 0;
|
||||
FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itba) {
|
||||
CButtonAction &ba = *itba;
|
||||
// if it is this one
|
||||
if (ict == mg_iControlNumber) {
|
||||
// if should clear
|
||||
if (iDik == KID_NONE) {
|
||||
// unbind both
|
||||
ba.ba_iFirstKey = KID_NONE;
|
||||
ba.ba_iSecondKey = KID_NONE;
|
||||
}
|
||||
// if first key is unbound, or both keys are bound
|
||||
if (ba.ba_iFirstKey == KID_NONE || ba.ba_iSecondKey != KID_NONE) {
|
||||
// bind first key
|
||||
ba.ba_iFirstKey = iDik;
|
||||
// clear second key
|
||||
ba.ba_iSecondKey = KID_NONE;
|
||||
// if only first key bound
|
||||
} else {
|
||||
// bind second key
|
||||
ba.ba_iSecondKey = iDik;
|
||||
}
|
||||
// if it is not this one
|
||||
} else {
|
||||
// clear bindings that contain this key
|
||||
if (ba.ba_iFirstKey == iDik) {
|
||||
ba.ba_iFirstKey = KID_NONE;
|
||||
}
|
||||
if (ba.ba_iSecondKey == iDik) {
|
||||
ba.ba_iSecondKey = KID_NONE;
|
||||
}
|
||||
}
|
||||
ict++;
|
||||
}
|
||||
// for each button in controls
|
||||
INDEX ict = 0;
|
||||
FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itba) {
|
||||
CButtonAction &ba = *itba;
|
||||
// if it is this one
|
||||
if (ict == mg_iControlNumber) {
|
||||
// if should clear
|
||||
if (iDik == KID_NONE) {
|
||||
// unbind both
|
||||
ba.ba_iFirstKey = KID_NONE;
|
||||
ba.ba_iSecondKey = KID_NONE;
|
||||
}
|
||||
// if first key is unbound, or both keys are bound
|
||||
if (ba.ba_iFirstKey == KID_NONE || ba.ba_iSecondKey != KID_NONE) {
|
||||
// bind first key
|
||||
ba.ba_iFirstKey = iDik;
|
||||
// clear second key
|
||||
ba.ba_iSecondKey = KID_NONE;
|
||||
// if only first key bound
|
||||
} else {
|
||||
// bind second key
|
||||
ba.ba_iSecondKey = iDik;
|
||||
}
|
||||
// if it is not this one
|
||||
} else {
|
||||
// clear bindings that contain this key
|
||||
if (ba.ba_iFirstKey == iDik) {
|
||||
ba.ba_iFirstKey = KID_NONE;
|
||||
}
|
||||
if (ba.ba_iSecondKey == iDik) {
|
||||
ba.ba_iSecondKey = KID_NONE;
|
||||
}
|
||||
}
|
||||
ict++;
|
||||
}
|
||||
|
||||
SetBindingNames(/*bDefining=*/FALSE);
|
||||
SetBindingNames(/*bDefining=*/FALSE);
|
||||
}
|
||||
|
||||
void CMGKeyDefinition::Think(void)
|
||||
{
|
||||
if (mg_iState == RELEASE_RETURN_WAITING)
|
||||
{
|
||||
_bDefiningKey = TRUE;
|
||||
extern BOOL _bMouseUsedLast;
|
||||
_bMouseUsedLast = FALSE;
|
||||
_pInput->SetJoyPolling(TRUE);
|
||||
_pInput->GetInput(FALSE);
|
||||
if (_pInput->IsInputEnabled() &&
|
||||
!_pInput->GetButtonState(KID_ENTER) &&
|
||||
!_pInput->GetButtonState(KID_MOUSE1))
|
||||
{
|
||||
mg_iState = PRESS_KEY_WAITING;
|
||||
}
|
||||
}
|
||||
else if (mg_iState == PRESS_KEY_WAITING)
|
||||
{
|
||||
_pInput->SetJoyPolling(TRUE);
|
||||
_pInput->GetInput(FALSE);
|
||||
for (INDEX iDik = 0; iDik<MAX_OVERALL_BUTTONS; iDik++)
|
||||
{
|
||||
if (_pInput->GetButtonState(iDik))
|
||||
{
|
||||
// skip keys that cannot be defined
|
||||
if (iDik == KID_TILDE) {
|
||||
continue;
|
||||
}
|
||||
// if escape not pressed
|
||||
if (iDik != KID_ESCAPE) {
|
||||
// define the new key
|
||||
DefineKey(iDik);
|
||||
// if escape pressed
|
||||
} else {
|
||||
// undefine the key
|
||||
DefineKey(KID_NONE);
|
||||
}
|
||||
if (mg_iState == RELEASE_RETURN_WAITING)
|
||||
{
|
||||
_bDefiningKey = TRUE;
|
||||
extern BOOL _bMouseUsedLast;
|
||||
_bMouseUsedLast = FALSE;
|
||||
_pInput->SetJoyPolling(TRUE);
|
||||
_pInput->GetInput(FALSE);
|
||||
if (_pInput->IsInputEnabled() &&
|
||||
!_pInput->GetButtonState(KID_ENTER) &&
|
||||
!_pInput->GetButtonState(KID_MOUSE1))
|
||||
{
|
||||
mg_iState = PRESS_KEY_WAITING;
|
||||
}
|
||||
}
|
||||
else if (mg_iState == PRESS_KEY_WAITING)
|
||||
{
|
||||
_pInput->SetJoyPolling(TRUE);
|
||||
_pInput->GetInput(FALSE);
|
||||
for (INDEX iDik = 0; iDik<MAX_OVERALL_BUTTONS; iDik++)
|
||||
{
|
||||
if (_pInput->GetButtonState(iDik))
|
||||
{
|
||||
// skip keys that cannot be defined
|
||||
if (iDik == KID_TILDE) {
|
||||
continue;
|
||||
}
|
||||
// if escape not pressed
|
||||
if (iDik != KID_ESCAPE) {
|
||||
// define the new key
|
||||
DefineKey(iDik);
|
||||
// if escape pressed
|
||||
} else {
|
||||
// undefine the key
|
||||
DefineKey(KID_NONE);
|
||||
}
|
||||
|
||||
// end defining loop
|
||||
mg_iState = DOING_NOTHING;
|
||||
_bDefiningKey = FALSE;
|
||||
// refresh all buttons
|
||||
pgmCurrentMenu->FillListItems();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// end defining loop
|
||||
mg_iState = DOING_NOTHING;
|
||||
_bDefiningKey = FALSE;
|
||||
// refresh all buttons
|
||||
pgmCurrentMenu->FillListItems();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMGKeyDefinition::Render(CDrawPort *pdp)
|
||||
{
|
||||
SetFontMedium(pdp);
|
||||
SetFontMedium(pdp);
|
||||
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIL = box.Min()(1) + box.Size()(1)*0.45f;
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixJ = box.Min()(2);
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIL = box.Min()(1) + box.Size()(1)*0.45f;
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixJ = box.Min()(2);
|
||||
|
||||
COLOR col = GetCurrentColor();
|
||||
pdp->PutTextR(mg_strLabel, pixIL, pixJ, col);
|
||||
pdp->PutText(mg_strBinding, pixIR, pixJ, col);
|
||||
COLOR col = GetCurrentColor();
|
||||
pdp->PutTextR(mg_strLabel, pixIL, pixJ, col);
|
||||
pdp->PutText(mg_strBinding, pixIR, pixJ, col);
|
||||
}
|
|
@ -23,15 +23,15 @@ extern CSoundData *_psdPress;
|
|||
|
||||
void CMGLevelButton::OnActivate(void)
|
||||
{
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
_pGame->gam_strCustomLevel = mg_fnmLevel;
|
||||
extern void(*_pAfterLevelChosen)(void);
|
||||
_pAfterLevelChosen();
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
_pGame->gam_strCustomLevel = mg_fnmLevel;
|
||||
extern void(*_pAfterLevelChosen)(void);
|
||||
_pAfterLevelChosen();
|
||||
}
|
||||
|
||||
void CMGLevelButton::OnSetFocus(void)
|
||||
{
|
||||
SetThumbnail(mg_fnmLevel);
|
||||
CMGButton::OnSetFocus();
|
||||
SetThumbnail(mg_fnmLevel);
|
||||
CMGButton::OnSetFocus();
|
||||
}
|
|
@ -23,103 +23,103 @@ extern INDEX sam_bWideScreen;
|
|||
|
||||
CMGModel::CMGModel(void)
|
||||
{
|
||||
mg_fFloorY = 0;
|
||||
mg_fFloorY = 0;
|
||||
}
|
||||
|
||||
void CMGModel::Render(CDrawPort *pdp)
|
||||
{
|
||||
// if no model
|
||||
if (mg_moModel.GetData() == NULL) {
|
||||
// just render text
|
||||
mg_strText = TRANS("No model");
|
||||
CMGButton::Render(pdp);
|
||||
return;
|
||||
}
|
||||
// if no model
|
||||
if (mg_moModel.GetData() == NULL) {
|
||||
// just render text
|
||||
mg_strText = TRANS("No model");
|
||||
CMGButton::Render(pdp);
|
||||
return;
|
||||
}
|
||||
|
||||
// get position on screen
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
CDrawPort dpModel(pdp, box);
|
||||
dpModel.Lock();
|
||||
dpModel.FillZBuffer(1.0f);
|
||||
// get position on screen
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
CDrawPort dpModel(pdp, box);
|
||||
dpModel.Lock();
|
||||
dpModel.FillZBuffer(1.0f);
|
||||
|
||||
LCDSetDrawport(&dpModel);
|
||||
// clear menu here
|
||||
dpModel.Fill(C_BLACK | 255);
|
||||
LCDRenderClouds1();
|
||||
LCDRenderClouds2();
|
||||
LCDSetDrawport(&dpModel);
|
||||
// clear menu here
|
||||
dpModel.Fill(C_BLACK | 255);
|
||||
LCDRenderClouds1();
|
||||
LCDRenderClouds2();
|
||||
|
||||
// prepare projection
|
||||
CRenderModel rmRenderModel;
|
||||
CPerspectiveProjection3D pr;
|
||||
pr.FOVL() = sam_bWideScreen ? AngleDeg(45.0f) : AngleDeg(30.0f);
|
||||
pr.ScreenBBoxL() = FLOATaabbox2D(
|
||||
FLOAT2D(0.0f, 0.0f),
|
||||
FLOAT2D((float)dpModel.GetWidth(), (float)dpModel.GetHeight())
|
||||
);
|
||||
pr.AspectRatioL() = 1.0f;
|
||||
pr.FrontClipDistanceL() = 0.3f;
|
||||
pr.ViewerPlacementL() = CPlacement3D(FLOAT3D(0, 0, 0), ANGLE3D(0, 0, 0));
|
||||
// prepare projection
|
||||
CRenderModel rmRenderModel;
|
||||
CPerspectiveProjection3D pr;
|
||||
pr.FOVL() = sam_bWideScreen ? AngleDeg(45.0f) : AngleDeg(30.0f);
|
||||
pr.ScreenBBoxL() = FLOATaabbox2D(
|
||||
FLOAT2D(0.0f, 0.0f),
|
||||
FLOAT2D((float)dpModel.GetWidth(), (float)dpModel.GetHeight())
|
||||
);
|
||||
pr.AspectRatioL() = 1.0f;
|
||||
pr.FrontClipDistanceL() = 0.3f;
|
||||
pr.ViewerPlacementL() = CPlacement3D(FLOAT3D(0, 0, 0), ANGLE3D(0, 0, 0));
|
||||
|
||||
// initialize remdering
|
||||
CAnyProjection3D apr;
|
||||
apr = pr;
|
||||
BeginModelRenderingView(apr, &dpModel);
|
||||
rmRenderModel.rm_vLightDirection = FLOAT3D(0.2f, -0.2f, -0.2f);
|
||||
// initialize remdering
|
||||
CAnyProjection3D apr;
|
||||
apr = pr;
|
||||
BeginModelRenderingView(apr, &dpModel);
|
||||
rmRenderModel.rm_vLightDirection = FLOAT3D(0.2f, -0.2f, -0.2f);
|
||||
|
||||
// if model needs floor
|
||||
if (mg_moFloor.GetData() != NULL) {
|
||||
// set floor's position
|
||||
CPlacement3D pl = mg_plModel;
|
||||
pl.pl_OrientationAngle = ANGLE3D(0, 0, 0);
|
||||
pl.pl_PositionVector = mg_plModel.pl_PositionVector;
|
||||
pl.pl_PositionVector(2) += mg_fFloorY;
|
||||
rmRenderModel.SetObjectPlacement(pl);
|
||||
// if model needs floor
|
||||
if (mg_moFloor.GetData() != NULL) {
|
||||
// set floor's position
|
||||
CPlacement3D pl = mg_plModel;
|
||||
pl.pl_OrientationAngle = ANGLE3D(0, 0, 0);
|
||||
pl.pl_PositionVector = mg_plModel.pl_PositionVector;
|
||||
pl.pl_PositionVector(2) += mg_fFloorY;
|
||||
rmRenderModel.SetObjectPlacement(pl);
|
||||
|
||||
// render the floor
|
||||
rmRenderModel.rm_colLight = C_WHITE;
|
||||
rmRenderModel.rm_colAmbient = C_WHITE;
|
||||
mg_moFloor.SetupModelRendering(rmRenderModel);
|
||||
mg_moFloor.RenderModel(rmRenderModel);
|
||||
}
|
||||
// render the floor
|
||||
rmRenderModel.rm_colLight = C_WHITE;
|
||||
rmRenderModel.rm_colAmbient = C_WHITE;
|
||||
mg_moFloor.SetupModelRendering(rmRenderModel);
|
||||
mg_moFloor.RenderModel(rmRenderModel);
|
||||
}
|
||||
|
||||
// set model's position
|
||||
CPlacement3D pl;
|
||||
pl.pl_OrientationAngle = mg_plModel.pl_OrientationAngle;
|
||||
pl.pl_PositionVector = mg_plModel.pl_PositionVector;
|
||||
extern FLOAT sam_fPlayerOffset;
|
||||
pl.pl_PositionVector(3) += sam_fPlayerOffset;
|
||||
rmRenderModel.SetObjectPlacement(pl);
|
||||
// set model's position
|
||||
CPlacement3D pl;
|
||||
pl.pl_OrientationAngle = mg_plModel.pl_OrientationAngle;
|
||||
pl.pl_PositionVector = mg_plModel.pl_PositionVector;
|
||||
extern FLOAT sam_fPlayerOffset;
|
||||
pl.pl_PositionVector(3) += sam_fPlayerOffset;
|
||||
rmRenderModel.SetObjectPlacement(pl);
|
||||
|
||||
// render the model
|
||||
rmRenderModel.rm_colLight = LerpColor(C_BLACK, C_WHITE, 0.4f) | CT_OPAQUE;
|
||||
rmRenderModel.rm_colAmbient = LerpColor(C_BLACK, C_WHITE, 0.2f) | CT_OPAQUE;
|
||||
mg_moModel.SetupModelRendering(rmRenderModel);
|
||||
FLOATplane3D plFloorPlane = FLOATplane3D(FLOAT3D(0.0f, 1.0f, 0.0f),
|
||||
mg_plModel.pl_PositionVector(2) + mg_fFloorY);
|
||||
FLOAT3D vShadowLightDir = FLOAT3D(-0.2f, -0.4f, -0.6f);
|
||||
CPlacement3D plLightPlacement = CPlacement3D(
|
||||
mg_plModel.pl_PositionVector +
|
||||
vShadowLightDir*mg_plModel.pl_PositionVector(3) * 5,
|
||||
ANGLE3D(0, 0, 0));
|
||||
mg_moModel.RenderShadow(rmRenderModel, plLightPlacement, 200.0f, 200.0f, 1.0f, plFloorPlane);
|
||||
mg_moModel.RenderModel(rmRenderModel);
|
||||
EndModelRenderingView();
|
||||
// render the model
|
||||
rmRenderModel.rm_colLight = LerpColor(C_BLACK, C_WHITE, 0.4f) | CT_OPAQUE;
|
||||
rmRenderModel.rm_colAmbient = LerpColor(C_BLACK, C_WHITE, 0.2f) | CT_OPAQUE;
|
||||
mg_moModel.SetupModelRendering(rmRenderModel);
|
||||
FLOATplane3D plFloorPlane = FLOATplane3D(FLOAT3D(0.0f, 1.0f, 0.0f),
|
||||
mg_plModel.pl_PositionVector(2) + mg_fFloorY);
|
||||
FLOAT3D vShadowLightDir = FLOAT3D(-0.2f, -0.4f, -0.6f);
|
||||
CPlacement3D plLightPlacement = CPlacement3D(
|
||||
mg_plModel.pl_PositionVector +
|
||||
vShadowLightDir*mg_plModel.pl_PositionVector(3) * 5,
|
||||
ANGLE3D(0, 0, 0));
|
||||
mg_moModel.RenderShadow(rmRenderModel, plLightPlacement, 200.0f, 200.0f, 1.0f, plFloorPlane);
|
||||
mg_moModel.RenderModel(rmRenderModel);
|
||||
EndModelRenderingView();
|
||||
|
||||
LCDScreenBox(LCDGetColor(C_GREEN, "model box") | GetCurrentColor());
|
||||
LCDScreenBox(LCDGetColor(C_GREEN, "model box") | GetCurrentColor());
|
||||
|
||||
dpModel.Unlock();
|
||||
dpModel.Unlock();
|
||||
|
||||
pdp->Unlock();
|
||||
pdp->Lock();
|
||||
LCDSetDrawport(pdp);
|
||||
pdp->Unlock();
|
||||
pdp->Lock();
|
||||
LCDSetDrawport(pdp);
|
||||
|
||||
// print the model name
|
||||
{
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, BoxPlayerModelName());
|
||||
COLOR col = GetCurrentColor();
|
||||
// print the model name
|
||||
{
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, BoxPlayerModelName());
|
||||
COLOR col = GetCurrentColor();
|
||||
|
||||
PIX pixI = box.Min()(1);
|
||||
PIX pixJ = box.Max()(2);
|
||||
pdp->PutText(mg_strText, pixI, pixJ, col);
|
||||
}
|
||||
PIX pixI = box.Min()(1);
|
||||
PIX pixJ = box.Max()(2);
|
||||
pdp->PutText(mg_strText, pixI, pixJ, col);
|
||||
}
|
||||
}
|
|
@ -25,51 +25,51 @@ extern CSoundData *_psdPress;
|
|||
|
||||
FLOATaabbox2D GetBoxPartHoriz(const FLOATaabbox2D &box, FLOAT fMin, FLOAT fMax)
|
||||
{
|
||||
FLOAT fBoxMin = box.Min()(1);
|
||||
FLOAT fBoxSize = box.Size()(1);
|
||||
FLOAT fBoxMin = box.Min()(1);
|
||||
FLOAT fBoxSize = box.Size()(1);
|
||||
|
||||
return FLOATaabbox2D(
|
||||
FLOAT2D(fBoxMin + fBoxSize*fMin, box.Min()(2)),
|
||||
FLOAT2D(fBoxMin + fBoxSize*fMax, box.Max()(2)));
|
||||
return FLOATaabbox2D(
|
||||
FLOAT2D(fBoxMin + fBoxSize*fMin, box.Min()(2)),
|
||||
FLOAT2D(fBoxMin + fBoxSize*fMax, box.Max()(2)));
|
||||
}
|
||||
|
||||
void PrintInBox(CDrawPort *pdp, PIX pixI, PIX pixJ, PIX pixSizeI, CTString str, COLOR col)
|
||||
{
|
||||
str = str.Undecorated();
|
||||
PIX pixCharSize = pdp->dp_pixTextCharSpacing + pdp->dp_FontData->fd_pixCharWidth;
|
||||
str.TrimRight(pixSizeI / pixCharSize);
|
||||
str = str.Undecorated();
|
||||
PIX pixCharSize = pdp->dp_pixTextCharSpacing + pdp->dp_FontData->fd_pixCharWidth;
|
||||
str.TrimRight(pixSizeI / pixCharSize);
|
||||
|
||||
// print text
|
||||
pdp->PutText(str, pixI, pixJ, col);
|
||||
// print text
|
||||
pdp->PutText(str, pixI, pixJ, col);
|
||||
}
|
||||
|
||||
CMGServerList::CMGServerList()
|
||||
{
|
||||
mg_iSelected = 0;
|
||||
mg_iFirstOnScreen = 0;
|
||||
mg_ctOnScreen = 10;
|
||||
mg_pixMinI = 0;
|
||||
mg_pixMaxI = 0;
|
||||
mg_pixListMinJ = 0;
|
||||
mg_pixListStepJ = 0;
|
||||
mg_pixDragJ = -1;
|
||||
mg_iDragLine = -1;
|
||||
mg_pixMouseDrag = -1;
|
||||
// by default, sort by ping, best on top
|
||||
mg_iSort = 2;
|
||||
mg_bSortDown = FALSE;
|
||||
mg_iSelected = 0;
|
||||
mg_iFirstOnScreen = 0;
|
||||
mg_ctOnScreen = 10;
|
||||
mg_pixMinI = 0;
|
||||
mg_pixMaxI = 0;
|
||||
mg_pixListMinJ = 0;
|
||||
mg_pixListStepJ = 0;
|
||||
mg_pixDragJ = -1;
|
||||
mg_iDragLine = -1;
|
||||
mg_pixMouseDrag = -1;
|
||||
// by default, sort by ping, best on top
|
||||
mg_iSort = 2;
|
||||
mg_bSortDown = FALSE;
|
||||
}
|
||||
void CMGServerList::AdjustFirstOnScreen(void)
|
||||
{
|
||||
INDEX ctSessions = _lhServers.Count();
|
||||
mg_iSelected = Clamp(mg_iSelected, 0L, ClampDn(ctSessions - 1L, 0L));
|
||||
mg_iFirstOnScreen = Clamp(mg_iFirstOnScreen, 0L, ClampDn(ctSessions - mg_ctOnScreen, 0L));
|
||||
INDEX ctSessions = _lhServers.Count();
|
||||
mg_iSelected = Clamp(mg_iSelected, 0L, ClampDn(ctSessions - 1L, 0L));
|
||||
mg_iFirstOnScreen = Clamp(mg_iFirstOnScreen, 0L, ClampDn(ctSessions - mg_ctOnScreen, 0L));
|
||||
|
||||
if (mg_iSelected<mg_iFirstOnScreen) {
|
||||
mg_iFirstOnScreen = ClampUp(mg_iSelected, ClampDn(ctSessions - mg_ctOnScreen - 1L, 0L));
|
||||
} else if (mg_iSelected >= mg_iFirstOnScreen + mg_ctOnScreen) {
|
||||
mg_iFirstOnScreen = ClampDn(mg_iSelected - mg_ctOnScreen + 1L, 0L);
|
||||
}
|
||||
if (mg_iSelected<mg_iFirstOnScreen) {
|
||||
mg_iFirstOnScreen = ClampUp(mg_iSelected, ClampDn(ctSessions - mg_ctOnScreen - 1L, 0L));
|
||||
} else if (mg_iSelected >= mg_iFirstOnScreen + mg_ctOnScreen) {
|
||||
mg_iFirstOnScreen = ClampDn(mg_iSelected - mg_ctOnScreen + 1L, 0L);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL _iSort = 0;
|
||||
|
@ -77,25 +77,25 @@ BOOL _bSortDown = FALSE;
|
|||
|
||||
int CompareSessions(const void *pv0, const void *pv1)
|
||||
{
|
||||
const CNetworkSession &ns0 = **(const CNetworkSession **)pv0;
|
||||
const CNetworkSession &ns1 = **(const CNetworkSession **)pv1;
|
||||
const CNetworkSession &ns0 = **(const CNetworkSession **)pv0;
|
||||
const CNetworkSession &ns1 = **(const CNetworkSession **)pv1;
|
||||
|
||||
int iResult = 0;
|
||||
switch (_iSort) {
|
||||
case 0: iResult = stricmp(ns0.ns_strSession, ns1.ns_strSession); break;
|
||||
case 1: iResult = stricmp(ns0.ns_strWorld, ns1.ns_strWorld); break;
|
||||
case 2: iResult = Sgn(ns0.ns_tmPing - ns1.ns_tmPing); break;
|
||||
case 3: iResult = Sgn(ns0.ns_ctPlayers - ns1.ns_ctPlayers); break;
|
||||
case 4: iResult = stricmp(ns0.ns_strGameType, ns1.ns_strGameType); break;
|
||||
case 5: iResult = stricmp(ns0.ns_strMod, ns1.ns_strMod); break;
|
||||
case 6: iResult = stricmp(ns0.ns_strVer, ns1.ns_strVer); break;
|
||||
}
|
||||
int iResult = 0;
|
||||
switch (_iSort) {
|
||||
case 0: iResult = stricmp(ns0.ns_strSession, ns1.ns_strSession); break;
|
||||
case 1: iResult = stricmp(ns0.ns_strWorld, ns1.ns_strWorld); break;
|
||||
case 2: iResult = Sgn(ns0.ns_tmPing - ns1.ns_tmPing); break;
|
||||
case 3: iResult = Sgn(ns0.ns_ctPlayers - ns1.ns_ctPlayers); break;
|
||||
case 4: iResult = stricmp(ns0.ns_strGameType, ns1.ns_strGameType); break;
|
||||
case 5: iResult = stricmp(ns0.ns_strMod, ns1.ns_strMod); break;
|
||||
case 6: iResult = stricmp(ns0.ns_strVer, ns1.ns_strVer); break;
|
||||
}
|
||||
|
||||
if (iResult == 0) { // make sure we always have unique order when resorting
|
||||
return stricmp(ns0.ns_strAddress, ns1.ns_strAddress);;
|
||||
}
|
||||
if (iResult == 0) { // make sure we always have unique order when resorting
|
||||
return stricmp(ns0.ns_strAddress, ns1.ns_strAddress);;
|
||||
}
|
||||
|
||||
return _bSortDown ? -iResult : iResult;
|
||||
return _bSortDown ? -iResult : iResult;
|
||||
}
|
||||
|
||||
extern CMGButton mgServerColumn[7];
|
||||
|
@ -103,351 +103,351 @@ extern CMGEdit mgServerFilter[7];
|
|||
|
||||
void SortAndFilterServers(void)
|
||||
{
|
||||
{FORDELETELIST(CNetworkSession, ns_lnNode, _lhServers, itns) {
|
||||
delete &*itns;
|
||||
}}
|
||||
{FORDELETELIST(CNetworkSession, ns_lnNode, _lhServers, itns) {
|
||||
delete &*itns;
|
||||
}}
|
||||
|
||||
{FOREACHINLIST(CNetworkSession, ns_lnNode, _pNetwork->ga_lhEnumeratedSessions, itns) {
|
||||
CNetworkSession &ns = *itns;
|
||||
extern CTString _strServerFilter[7];
|
||||
if (_strServerFilter[0] != "" && !ns.ns_strSession.Matches("*" + _strServerFilter[0] + "*")) continue;
|
||||
if (_strServerFilter[1] != "" && !ns.ns_strWorld.Matches("*" + _strServerFilter[1] + "*")) continue;
|
||||
if (_strServerFilter[2] != "") {
|
||||
char strCompare[3] = { 0, 0, 0 };
|
||||
int iPing = 0;
|
||||
_strServerFilter[2].ScanF("%2[<>=]%d", strCompare, &iPing);
|
||||
if (strcmp(strCompare, "<") == 0 && !(int(ns.ns_tmPing * 1000)< iPing)) continue;
|
||||
if (strcmp(strCompare, "<=") == 0 && !(int(ns.ns_tmPing * 1000) <= iPing)) continue;
|
||||
if (strcmp(strCompare, ">") == 0 && !(int(ns.ns_tmPing * 1000)> iPing)) continue;
|
||||
if (strcmp(strCompare, ">=") == 0 && !(int(ns.ns_tmPing * 1000) >= iPing)) continue;
|
||||
if (strcmp(strCompare, "=") == 0 && !(int(ns.ns_tmPing * 1000) == iPing)) continue;
|
||||
}
|
||||
if (_strServerFilter[3] != "") {
|
||||
char strCompare[3] = { 0, 0, 0 };
|
||||
int iPlayers = 0;
|
||||
_strServerFilter[3].ScanF("%2[<>=]%d", strCompare, &iPlayers);
|
||||
if (strcmp(strCompare, "<") == 0 && !(ns.ns_ctPlayers< iPlayers)) continue;
|
||||
if (strcmp(strCompare, "<=") == 0 && !(ns.ns_ctPlayers <= iPlayers)) continue;
|
||||
if (strcmp(strCompare, ">") == 0 && !(ns.ns_ctPlayers> iPlayers)) continue;
|
||||
if (strcmp(strCompare, ">=") == 0 && !(ns.ns_ctPlayers >= iPlayers)) continue;
|
||||
if (strcmp(strCompare, "=") == 0 && !(ns.ns_ctPlayers == iPlayers)) continue;
|
||||
}
|
||||
if (_strServerFilter[4] != "" && !ns.ns_strGameType.Matches("*" + _strServerFilter[4] + "*")) continue;
|
||||
if (_strServerFilter[5] != "" && !ns.ns_strMod.Matches("*" + _strServerFilter[5] + "*")) continue;
|
||||
if (_strServerFilter[6] != "" && !ns.ns_strVer.Matches("*" + _strServerFilter[6] + "*")) continue;
|
||||
{FOREACHINLIST(CNetworkSession, ns_lnNode, _pNetwork->ga_lhEnumeratedSessions, itns) {
|
||||
CNetworkSession &ns = *itns;
|
||||
extern CTString _strServerFilter[7];
|
||||
if (_strServerFilter[0] != "" && !ns.ns_strSession.Matches("*" + _strServerFilter[0] + "*")) continue;
|
||||
if (_strServerFilter[1] != "" && !ns.ns_strWorld.Matches("*" + _strServerFilter[1] + "*")) continue;
|
||||
if (_strServerFilter[2] != "") {
|
||||
char strCompare[3] = { 0, 0, 0 };
|
||||
int iPing = 0;
|
||||
_strServerFilter[2].ScanF("%2[<>=]%d", strCompare, &iPing);
|
||||
if (strcmp(strCompare, "<") == 0 && !(int(ns.ns_tmPing * 1000)< iPing)) continue;
|
||||
if (strcmp(strCompare, "<=") == 0 && !(int(ns.ns_tmPing * 1000) <= iPing)) continue;
|
||||
if (strcmp(strCompare, ">") == 0 && !(int(ns.ns_tmPing * 1000)> iPing)) continue;
|
||||
if (strcmp(strCompare, ">=") == 0 && !(int(ns.ns_tmPing * 1000) >= iPing)) continue;
|
||||
if (strcmp(strCompare, "=") == 0 && !(int(ns.ns_tmPing * 1000) == iPing)) continue;
|
||||
}
|
||||
if (_strServerFilter[3] != "") {
|
||||
char strCompare[3] = { 0, 0, 0 };
|
||||
int iPlayers = 0;
|
||||
_strServerFilter[3].ScanF("%2[<>=]%d", strCompare, &iPlayers);
|
||||
if (strcmp(strCompare, "<") == 0 && !(ns.ns_ctPlayers< iPlayers)) continue;
|
||||
if (strcmp(strCompare, "<=") == 0 && !(ns.ns_ctPlayers <= iPlayers)) continue;
|
||||
if (strcmp(strCompare, ">") == 0 && !(ns.ns_ctPlayers> iPlayers)) continue;
|
||||
if (strcmp(strCompare, ">=") == 0 && !(ns.ns_ctPlayers >= iPlayers)) continue;
|
||||
if (strcmp(strCompare, "=") == 0 && !(ns.ns_ctPlayers == iPlayers)) continue;
|
||||
}
|
||||
if (_strServerFilter[4] != "" && !ns.ns_strGameType.Matches("*" + _strServerFilter[4] + "*")) continue;
|
||||
if (_strServerFilter[5] != "" && !ns.ns_strMod.Matches("*" + _strServerFilter[5] + "*")) continue;
|
||||
if (_strServerFilter[6] != "" && !ns.ns_strVer.Matches("*" + _strServerFilter[6] + "*")) continue;
|
||||
|
||||
CNetworkSession *pnsNew = new CNetworkSession;
|
||||
pnsNew->Copy(*itns);
|
||||
_lhServers.AddTail(pnsNew->ns_lnNode);
|
||||
}
|
||||
CNetworkSession *pnsNew = new CNetworkSession;
|
||||
pnsNew->Copy(*itns);
|
||||
_lhServers.AddTail(pnsNew->ns_lnNode);
|
||||
}
|
||||
}
|
||||
|
||||
_lhServers.Sort(CompareSessions, offsetof(CNetworkSession, ns_lnNode));
|
||||
_lhServers.Sort(CompareSessions, offsetof(CNetworkSession, ns_lnNode));
|
||||
}
|
||||
|
||||
void CMGServerList::Render(CDrawPort *pdp)
|
||||
{
|
||||
_iSort = mg_iSort;
|
||||
_bSortDown = mg_bSortDown;
|
||||
SortAndFilterServers();
|
||||
_iSort = mg_iSort;
|
||||
_bSortDown = mg_bSortDown;
|
||||
SortAndFilterServers();
|
||||
|
||||
SetFontSmall(pdp);
|
||||
BOOL bFocusedBefore = mg_bFocused;
|
||||
mg_bFocused = FALSE;
|
||||
SetFontSmall(pdp);
|
||||
BOOL bFocusedBefore = mg_bFocused;
|
||||
mg_bFocused = FALSE;
|
||||
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
COLOR col = GetCurrentColor();
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
COLOR col = GetCurrentColor();
|
||||
|
||||
PIX pixDPSizeI = pdp->GetWidth();
|
||||
PIX pixDPSizeJ = pdp->GetHeight();
|
||||
PIX pixCharSizeI = pdp->dp_pixTextCharSpacing + pdp->dp_FontData->fd_pixCharWidth;
|
||||
PIX pixCharSizeJ = pdp->dp_pixTextLineSpacing + pdp->dp_FontData->fd_pixCharHeight + 1;
|
||||
PIX pixLineSize = 1;
|
||||
PIX pixSliderSizeI = 10;
|
||||
PIX pixOuterMargin = 20;
|
||||
PIX pixDPSizeI = pdp->GetWidth();
|
||||
PIX pixDPSizeJ = pdp->GetHeight();
|
||||
PIX pixCharSizeI = pdp->dp_pixTextCharSpacing + pdp->dp_FontData->fd_pixCharWidth;
|
||||
PIX pixCharSizeJ = pdp->dp_pixTextLineSpacing + pdp->dp_FontData->fd_pixCharHeight + 1;
|
||||
PIX pixLineSize = 1;
|
||||
PIX pixSliderSizeI = 10;
|
||||
PIX pixOuterMargin = 20;
|
||||
|
||||
INDEX ctSessions = _lhServers.Count();
|
||||
INDEX iSession = 0;
|
||||
INDEX ctSessions = _lhServers.Count();
|
||||
INDEX iSession = 0;
|
||||
|
||||
INDEX ctColumns[7];
|
||||
{for (INDEX i = 0; i<ARRAYCOUNT(ctColumns); i++) {
|
||||
ctColumns[i] = mgServerColumn[i].mg_strText.Length() + 1;
|
||||
}}
|
||||
INDEX ctColumns[7];
|
||||
{for (INDEX i = 0; i<ARRAYCOUNT(ctColumns); i++) {
|
||||
ctColumns[i] = mgServerColumn[i].mg_strText.Length() + 1;
|
||||
}}
|
||||
|
||||
PIX pixSizePing = Max(PIX(pixCharSizeI * 5), pixCharSizeI*ctColumns[2]) + pixLineSize * 2;
|
||||
PIX pixSizePlayerCt = Max(PIX(pixCharSizeI * 5), pixCharSizeI*ctColumns[3]) + pixLineSize * 2;
|
||||
PIX pixSizeGameType = Max(Min(PIX(pixCharSizeI * 20), PIX(pixDPSizeI*0.2f)), pixCharSizeI*ctColumns[4]) + pixLineSize * 2;
|
||||
PIX pixSizeMapName = Max(PIX(pixDPSizeI*0.25f), pixCharSizeI*ctColumns[1]) + pixLineSize * 2;
|
||||
PIX pixSizeMod = Max(Min(PIX(pixCharSizeI * 11), PIX(pixDPSizeI*0.2f)), pixCharSizeI*ctColumns[5]) + pixLineSize * 2;
|
||||
PIX pixSizeVer = Max(PIX(pixCharSizeI * 7), pixCharSizeI*ctColumns[6]) + pixLineSize * 2;
|
||||
PIX pixSizePing = Max(PIX(pixCharSizeI * 5), pixCharSizeI*ctColumns[2]) + pixLineSize * 2;
|
||||
PIX pixSizePlayerCt = Max(PIX(pixCharSizeI * 5), pixCharSizeI*ctColumns[3]) + pixLineSize * 2;
|
||||
PIX pixSizeGameType = Max(Min(PIX(pixCharSizeI * 20), PIX(pixDPSizeI*0.2f)), pixCharSizeI*ctColumns[4]) + pixLineSize * 2;
|
||||
PIX pixSizeMapName = Max(PIX(pixDPSizeI*0.25f), pixCharSizeI*ctColumns[1]) + pixLineSize * 2;
|
||||
PIX pixSizeMod = Max(Min(PIX(pixCharSizeI * 11), PIX(pixDPSizeI*0.2f)), pixCharSizeI*ctColumns[5]) + pixLineSize * 2;
|
||||
PIX pixSizeVer = Max(PIX(pixCharSizeI * 7), pixCharSizeI*ctColumns[6]) + pixLineSize * 2;
|
||||
|
||||
PIX apixSeparatorI[9];
|
||||
apixSeparatorI[0] = pixOuterMargin;
|
||||
apixSeparatorI[8] = pixDPSizeI - pixOuterMargin - pixLineSize;
|
||||
apixSeparatorI[7] = apixSeparatorI[8] - pixSliderSizeI - pixLineSize;
|
||||
apixSeparatorI[6] = apixSeparatorI[7] - pixSizeVer - pixLineSize;
|
||||
apixSeparatorI[5] = apixSeparatorI[6] - pixSizeMod - pixLineSize;
|
||||
apixSeparatorI[4] = apixSeparatorI[5] - pixSizeGameType - pixLineSize;
|
||||
apixSeparatorI[3] = apixSeparatorI[4] - pixSizePlayerCt - pixLineSize;
|
||||
apixSeparatorI[2] = apixSeparatorI[3] - pixSizePing - pixLineSize;
|
||||
apixSeparatorI[1] = apixSeparatorI[2] - pixSizeMapName - pixLineSize;
|
||||
apixSeparatorI[1] = apixSeparatorI[2] - pixSizeMapName - pixLineSize;
|
||||
PIX pixSizeServerName = apixSeparatorI[1] - apixSeparatorI[0] - pixLineSize;
|
||||
PIX apixSeparatorI[9];
|
||||
apixSeparatorI[0] = pixOuterMargin;
|
||||
apixSeparatorI[8] = pixDPSizeI - pixOuterMargin - pixLineSize;
|
||||
apixSeparatorI[7] = apixSeparatorI[8] - pixSliderSizeI - pixLineSize;
|
||||
apixSeparatorI[6] = apixSeparatorI[7] - pixSizeVer - pixLineSize;
|
||||
apixSeparatorI[5] = apixSeparatorI[6] - pixSizeMod - pixLineSize;
|
||||
apixSeparatorI[4] = apixSeparatorI[5] - pixSizeGameType - pixLineSize;
|
||||
apixSeparatorI[3] = apixSeparatorI[4] - pixSizePlayerCt - pixLineSize;
|
||||
apixSeparatorI[2] = apixSeparatorI[3] - pixSizePing - pixLineSize;
|
||||
apixSeparatorI[1] = apixSeparatorI[2] - pixSizeMapName - pixLineSize;
|
||||
apixSeparatorI[1] = apixSeparatorI[2] - pixSizeMapName - pixLineSize;
|
||||
PIX pixSizeServerName = apixSeparatorI[1] - apixSeparatorI[0] - pixLineSize;
|
||||
|
||||
PIX pixTopJ = pixDPSizeJ*0.15f;
|
||||
PIX pixBottomJ = pixDPSizeJ*0.82f;
|
||||
PIX pixTopJ = pixDPSizeJ*0.15f;
|
||||
PIX pixBottomJ = pixDPSizeJ*0.82f;
|
||||
|
||||
PIX pixFilterTopJ = pixTopJ + pixLineSize * 3 + pixCharSizeJ + pixLineSize * 3;
|
||||
PIX pixListTopJ = pixFilterTopJ + pixLineSize + pixCharSizeJ + pixLineSize;
|
||||
INDEX ctSessionsOnScreen = (pixBottomJ - pixListTopJ) / pixCharSizeJ;
|
||||
pixBottomJ = pixListTopJ + pixCharSizeJ*ctSessionsOnScreen + pixLineSize * 2;
|
||||
PIX pixFilterTopJ = pixTopJ + pixLineSize * 3 + pixCharSizeJ + pixLineSize * 3;
|
||||
PIX pixListTopJ = pixFilterTopJ + pixLineSize + pixCharSizeJ + pixLineSize;
|
||||
INDEX ctSessionsOnScreen = (pixBottomJ - pixListTopJ) / pixCharSizeJ;
|
||||
pixBottomJ = pixListTopJ + pixCharSizeJ*ctSessionsOnScreen + pixLineSize * 2;
|
||||
|
||||
mg_pixMinI = apixSeparatorI[0];
|
||||
mg_pixMaxI = apixSeparatorI[5];
|
||||
mg_pixListMinJ = pixListTopJ;
|
||||
mg_pixListStepJ = pixCharSizeJ;
|
||||
mg_pixSBMinI = apixSeparatorI[7];
|
||||
mg_pixSBMaxI = apixSeparatorI[8];
|
||||
mg_pixSBMinJ = pixListTopJ;
|
||||
mg_pixSBMaxJ = pixBottomJ;
|
||||
mg_pixHeaderMinJ = pixTopJ;
|
||||
mg_pixHeaderMidJ = pixTopJ + pixLineSize + pixCharSizeJ;
|
||||
mg_pixHeaderMaxJ = pixTopJ + (pixLineSize + pixCharSizeJ) * 2;
|
||||
memcpy(mg_pixHeaderI, apixSeparatorI, sizeof(mg_pixHeaderI));
|
||||
mg_pixMinI = apixSeparatorI[0];
|
||||
mg_pixMaxI = apixSeparatorI[5];
|
||||
mg_pixListMinJ = pixListTopJ;
|
||||
mg_pixListStepJ = pixCharSizeJ;
|
||||
mg_pixSBMinI = apixSeparatorI[7];
|
||||
mg_pixSBMaxI = apixSeparatorI[8];
|
||||
mg_pixSBMinJ = pixListTopJ;
|
||||
mg_pixSBMaxJ = pixBottomJ;
|
||||
mg_pixHeaderMinJ = pixTopJ;
|
||||
mg_pixHeaderMidJ = pixTopJ + pixLineSize + pixCharSizeJ;
|
||||
mg_pixHeaderMaxJ = pixTopJ + (pixLineSize + pixCharSizeJ) * 2;
|
||||
memcpy(mg_pixHeaderI, apixSeparatorI, sizeof(mg_pixHeaderI));
|
||||
|
||||
{for (INDEX i = 0; i<ARRAYCOUNT(mgServerFilter); i++) {
|
||||
mgServerColumn[i].mg_boxOnScreen = PixBoxToFloatBox(pdp,
|
||||
PIXaabbox2D(PIX2D(apixSeparatorI[i] + pixCharSizeI / 2, pixTopJ + pixLineSize * 4), PIX2D(apixSeparatorI[i + 1] - pixCharSizeI / 2, pixTopJ + pixLineSize * 4 + pixCharSizeJ)));
|
||||
mgServerFilter[i].mg_boxOnScreen = PixBoxToFloatBox(pdp,
|
||||
PIXaabbox2D(PIX2D(apixSeparatorI[i] + pixCharSizeI / 2, pixFilterTopJ), PIX2D(apixSeparatorI[i + 1] - pixCharSizeI / 2, pixFilterTopJ + pixCharSizeJ)));
|
||||
}}
|
||||
{for (INDEX i = 0; i<ARRAYCOUNT(mgServerFilter); i++) {
|
||||
mgServerColumn[i].mg_boxOnScreen = PixBoxToFloatBox(pdp,
|
||||
PIXaabbox2D(PIX2D(apixSeparatorI[i] + pixCharSizeI / 2, pixTopJ + pixLineSize * 4), PIX2D(apixSeparatorI[i + 1] - pixCharSizeI / 2, pixTopJ + pixLineSize * 4 + pixCharSizeJ)));
|
||||
mgServerFilter[i].mg_boxOnScreen = PixBoxToFloatBox(pdp,
|
||||
PIXaabbox2D(PIX2D(apixSeparatorI[i] + pixCharSizeI / 2, pixFilterTopJ), PIX2D(apixSeparatorI[i + 1] - pixCharSizeI / 2, pixFilterTopJ + pixCharSizeJ)));
|
||||
}}
|
||||
|
||||
for (INDEX i = 0; i<ARRAYCOUNT(apixSeparatorI); i++) {
|
||||
pdp->DrawLine(apixSeparatorI[i], pixTopJ, apixSeparatorI[i], pixBottomJ, col | CT_OPAQUE);
|
||||
}
|
||||
pdp->DrawLine(apixSeparatorI[0], pixTopJ, apixSeparatorI[8], pixTopJ, col | CT_OPAQUE);
|
||||
pdp->DrawLine(apixSeparatorI[0], pixListTopJ - pixLineSize, apixSeparatorI[8], pixListTopJ - pixLineSize, col | CT_OPAQUE);
|
||||
pdp->DrawLine(apixSeparatorI[0], pixBottomJ, apixSeparatorI[8], pixBottomJ, col | CT_OPAQUE);
|
||||
for (INDEX i = 0; i<ARRAYCOUNT(apixSeparatorI); i++) {
|
||||
pdp->DrawLine(apixSeparatorI[i], pixTopJ, apixSeparatorI[i], pixBottomJ, col | CT_OPAQUE);
|
||||
}
|
||||
pdp->DrawLine(apixSeparatorI[0], pixTopJ, apixSeparatorI[8], pixTopJ, col | CT_OPAQUE);
|
||||
pdp->DrawLine(apixSeparatorI[0], pixListTopJ - pixLineSize, apixSeparatorI[8], pixListTopJ - pixLineSize, col | CT_OPAQUE);
|
||||
pdp->DrawLine(apixSeparatorI[0], pixBottomJ, apixSeparatorI[8], pixBottomJ, col | CT_OPAQUE);
|
||||
|
||||
PIXaabbox2D boxHandle = GetScrollBarHandleBox();
|
||||
pdp->Fill(boxHandle.Min()(1) + 2, boxHandle.Min()(2) + 2, boxHandle.Size()(1) - 3, boxHandle.Size()(2) - 3, col | CT_OPAQUE);
|
||||
PIXaabbox2D boxHandle = GetScrollBarHandleBox();
|
||||
pdp->Fill(boxHandle.Min()(1) + 2, boxHandle.Min()(2) + 2, boxHandle.Size()(1) - 3, boxHandle.Size()(2) - 3, col | CT_OPAQUE);
|
||||
|
||||
PIX pixJ = pixTopJ + pixLineSize * 2 + 1;
|
||||
PIX pixJ = pixTopJ + pixLineSize * 2 + 1;
|
||||
|
||||
mg_ctOnScreen = ctSessionsOnScreen;
|
||||
AdjustFirstOnScreen();
|
||||
mg_ctOnScreen = ctSessionsOnScreen;
|
||||
AdjustFirstOnScreen();
|
||||
|
||||
if (_lhServers.Count() == 0) {
|
||||
if (_pNetwork->ga_strEnumerationStatus != "") {
|
||||
mg_bFocused = TRUE;
|
||||
COLOR colItem = GetCurrentColor();
|
||||
PrintInBox(pdp, apixSeparatorI[0] + pixCharSizeI, pixListTopJ + pixCharSizeJ + pixLineSize + 1, apixSeparatorI[1] - apixSeparatorI[0],
|
||||
TRANS("searching..."), colItem);
|
||||
}
|
||||
} else {
|
||||
FOREACHINLIST(CNetworkSession, ns_lnNode, _lhServers, itns) {
|
||||
CNetworkSession &ns = *itns;
|
||||
if (_lhServers.Count() == 0) {
|
||||
if (_pNetwork->ga_strEnumerationStatus != "") {
|
||||
mg_bFocused = TRUE;
|
||||
COLOR colItem = GetCurrentColor();
|
||||
PrintInBox(pdp, apixSeparatorI[0] + pixCharSizeI, pixListTopJ + pixCharSizeJ + pixLineSize + 1, apixSeparatorI[1] - apixSeparatorI[0],
|
||||
TRANS("searching..."), colItem);
|
||||
}
|
||||
} else {
|
||||
FOREACHINLIST(CNetworkSession, ns_lnNode, _lhServers, itns) {
|
||||
CNetworkSession &ns = *itns;
|
||||
|
||||
if (iSession<mg_iFirstOnScreen || iSession >= mg_iFirstOnScreen + ctSessionsOnScreen) {
|
||||
iSession++;
|
||||
continue;
|
||||
}
|
||||
if (iSession<mg_iFirstOnScreen || iSession >= mg_iFirstOnScreen + ctSessionsOnScreen) {
|
||||
iSession++;
|
||||
continue;
|
||||
}
|
||||
|
||||
PIX pixJ = pixListTopJ + (iSession - mg_iFirstOnScreen)*pixCharSizeJ + pixLineSize + 1;
|
||||
PIX pixJ = pixListTopJ + (iSession - mg_iFirstOnScreen)*pixCharSizeJ + pixLineSize + 1;
|
||||
|
||||
mg_bFocused = bFocusedBefore&&iSession == mg_iSelected;
|
||||
COLOR colItem = GetCurrentColor();
|
||||
mg_bFocused = bFocusedBefore&&iSession == mg_iSelected;
|
||||
COLOR colItem = GetCurrentColor();
|
||||
|
||||
if (ns.ns_strVer != _SE_VER_STRING) {
|
||||
colItem = MulColors(colItem, 0xA0A0A0FF);
|
||||
}
|
||||
if (ns.ns_strVer != _SE_VER_STRING) {
|
||||
colItem = MulColors(colItem, 0xA0A0A0FF);
|
||||
}
|
||||
|
||||
CTString strPing(0, "%4d", INDEX(ns.ns_tmPing * 1000));
|
||||
CTString strPlayersCt(0, "%2d/%2d", ns.ns_ctPlayers, ns.ns_ctMaxPlayers);
|
||||
CTString strMod = ns.ns_strMod;
|
||||
if (strMod == "") {
|
||||
strMod = "SeriousSam";
|
||||
}
|
||||
PrintInBox(pdp, apixSeparatorI[0] + pixCharSizeI / 2, pixJ, apixSeparatorI[1] - apixSeparatorI[0] - pixCharSizeI, ns.ns_strSession, colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[1] + pixCharSizeI / 2, pixJ, apixSeparatorI[2] - apixSeparatorI[1] - pixCharSizeI, TranslateConst(ns.ns_strWorld), colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[2] + pixCharSizeI / 2, pixJ, apixSeparatorI[3] - apixSeparatorI[2] - pixCharSizeI, strPing, colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[3] + pixCharSizeI / 2, pixJ, apixSeparatorI[4] - apixSeparatorI[3] - pixCharSizeI, strPlayersCt, colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[4] + pixCharSizeI / 2, pixJ, apixSeparatorI[5] - apixSeparatorI[4] - pixCharSizeI, TranslateConst(ns.ns_strGameType), colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[5] + pixCharSizeI / 2, pixJ, apixSeparatorI[6] - apixSeparatorI[5] - pixCharSizeI, TranslateConst(strMod), colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[6] + pixCharSizeI / 2, pixJ, apixSeparatorI[7] - apixSeparatorI[6] - pixCharSizeI, ns.ns_strVer, colItem);
|
||||
CTString strPing(0, "%4d", INDEX(ns.ns_tmPing * 1000));
|
||||
CTString strPlayersCt(0, "%2d/%2d", ns.ns_ctPlayers, ns.ns_ctMaxPlayers);
|
||||
CTString strMod = ns.ns_strMod;
|
||||
if (strMod == "") {
|
||||
strMod = "SeriousSam";
|
||||
}
|
||||
PrintInBox(pdp, apixSeparatorI[0] + pixCharSizeI / 2, pixJ, apixSeparatorI[1] - apixSeparatorI[0] - pixCharSizeI, ns.ns_strSession, colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[1] + pixCharSizeI / 2, pixJ, apixSeparatorI[2] - apixSeparatorI[1] - pixCharSizeI, TranslateConst(ns.ns_strWorld), colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[2] + pixCharSizeI / 2, pixJ, apixSeparatorI[3] - apixSeparatorI[2] - pixCharSizeI, strPing, colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[3] + pixCharSizeI / 2, pixJ, apixSeparatorI[4] - apixSeparatorI[3] - pixCharSizeI, strPlayersCt, colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[4] + pixCharSizeI / 2, pixJ, apixSeparatorI[5] - apixSeparatorI[4] - pixCharSizeI, TranslateConst(ns.ns_strGameType), colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[5] + pixCharSizeI / 2, pixJ, apixSeparatorI[6] - apixSeparatorI[5] - pixCharSizeI, TranslateConst(strMod), colItem);
|
||||
PrintInBox(pdp, apixSeparatorI[6] + pixCharSizeI / 2, pixJ, apixSeparatorI[7] - apixSeparatorI[6] - pixCharSizeI, ns.ns_strVer, colItem);
|
||||
|
||||
iSession++;
|
||||
}
|
||||
}
|
||||
iSession++;
|
||||
}
|
||||
}
|
||||
|
||||
mg_bFocused = bFocusedBefore;
|
||||
mg_bFocused = bFocusedBefore;
|
||||
}
|
||||
|
||||
static INDEX SliderPixToIndex(PIX pixOffset, INDEX iVisible, INDEX iTotal, PIXaabbox2D boxFull)
|
||||
{
|
||||
FLOAT fSize = ClampUp(FLOAT(iVisible) / iTotal, 1.0f);
|
||||
PIX pixFull = boxFull.Size()(2);
|
||||
PIX pixSize = PIX(pixFull*fSize);
|
||||
if (pixSize >= boxFull.Size()(2)) {
|
||||
return 0;
|
||||
}
|
||||
return (iTotal*pixOffset) / pixFull;
|
||||
FLOAT fSize = ClampUp(FLOAT(iVisible) / iTotal, 1.0f);
|
||||
PIX pixFull = boxFull.Size()(2);
|
||||
PIX pixSize = PIX(pixFull*fSize);
|
||||
if (pixSize >= boxFull.Size()(2)) {
|
||||
return 0;
|
||||
}
|
||||
return (iTotal*pixOffset) / pixFull;
|
||||
}
|
||||
|
||||
static PIXaabbox2D GetSliderBox(INDEX iFirst, INDEX iVisible, INDEX iTotal,
|
||||
PIXaabbox2D boxFull)
|
||||
PIXaabbox2D boxFull)
|
||||
{
|
||||
if (iTotal <= 0) {
|
||||
return boxFull;
|
||||
}
|
||||
FLOAT fSize = ClampUp(FLOAT(iVisible) / iTotal, 1.0f);
|
||||
PIX pixFull = boxFull.Size()(2);
|
||||
PIX pixSize = PIX(pixFull*fSize);
|
||||
pixSize = ClampDn(pixSize, boxFull.Size()(1));
|
||||
PIX pixTop = pixFull*(FLOAT(iFirst) / iTotal) + boxFull.Min()(2);
|
||||
PIX pixI0 = boxFull.Min()(1);
|
||||
PIX pixI1 = boxFull.Max()(1);
|
||||
return PIXaabbox2D(PIX2D(pixI0, pixTop), PIX2D(pixI1, pixTop + pixSize));
|
||||
if (iTotal <= 0) {
|
||||
return boxFull;
|
||||
}
|
||||
FLOAT fSize = ClampUp(FLOAT(iVisible) / iTotal, 1.0f);
|
||||
PIX pixFull = boxFull.Size()(2);
|
||||
PIX pixSize = PIX(pixFull*fSize);
|
||||
pixSize = ClampDn(pixSize, boxFull.Size()(1));
|
||||
PIX pixTop = pixFull*(FLOAT(iFirst) / iTotal) + boxFull.Min()(2);
|
||||
PIX pixI0 = boxFull.Min()(1);
|
||||
PIX pixI1 = boxFull.Max()(1);
|
||||
return PIXaabbox2D(PIX2D(pixI0, pixTop), PIX2D(pixI1, pixTop + pixSize));
|
||||
}
|
||||
|
||||
PIXaabbox2D CMGServerList::GetScrollBarFullBox(void)
|
||||
{
|
||||
return PIXaabbox2D(PIX2D(mg_pixSBMinI, mg_pixSBMinJ), PIX2D(mg_pixSBMaxI, mg_pixSBMaxJ));
|
||||
return PIXaabbox2D(PIX2D(mg_pixSBMinI, mg_pixSBMinJ), PIX2D(mg_pixSBMaxI, mg_pixSBMaxJ));
|
||||
}
|
||||
|
||||
PIXaabbox2D CMGServerList::GetScrollBarHandleBox(void)
|
||||
{
|
||||
return GetSliderBox(mg_iFirstOnScreen, mg_ctOnScreen, _lhServers.Count(), GetScrollBarFullBox());
|
||||
return GetSliderBox(mg_iFirstOnScreen, mg_ctOnScreen, _lhServers.Count(), GetScrollBarFullBox());
|
||||
}
|
||||
|
||||
void CMGServerList::OnMouseOver(PIX pixI, PIX pixJ)
|
||||
{
|
||||
mg_pixMouseI = pixI;
|
||||
mg_pixMouseJ = pixJ;
|
||||
mg_pixMouseI = pixI;
|
||||
mg_pixMouseJ = pixJ;
|
||||
|
||||
if (!(GetKeyState(VK_LBUTTON) & 0x8000)) {
|
||||
mg_pixDragJ = -1;
|
||||
}
|
||||
if (!(GetKeyState(VK_LBUTTON) & 0x8000)) {
|
||||
mg_pixDragJ = -1;
|
||||
}
|
||||
|
||||
BOOL bInSlider = (pixI >= mg_pixSBMinI && pixI <= mg_pixSBMaxI && pixJ >= mg_pixSBMinJ && pixJ <= mg_pixSBMaxJ);
|
||||
if (mg_pixDragJ >= 0 && bInSlider) {
|
||||
PIX pixDelta = pixJ - mg_pixDragJ;
|
||||
INDEX ctSessions = _lhServers.Count();
|
||||
INDEX iWantedLine = mg_iDragLine +
|
||||
SliderPixToIndex(pixDelta, mg_ctOnScreen, ctSessions, GetScrollBarFullBox());
|
||||
mg_iFirstOnScreen = Clamp(iWantedLine, 0L, ClampDn(ctSessions - mg_ctOnScreen, 0L));
|
||||
mg_iSelected = Clamp(mg_iSelected, mg_iFirstOnScreen, mg_iFirstOnScreen + mg_ctOnScreen - 1L);
|
||||
// AdjustFirstOnScreen();
|
||||
return;
|
||||
}
|
||||
BOOL bInSlider = (pixI >= mg_pixSBMinI && pixI <= mg_pixSBMaxI && pixJ >= mg_pixSBMinJ && pixJ <= mg_pixSBMaxJ);
|
||||
if (mg_pixDragJ >= 0 && bInSlider) {
|
||||
PIX pixDelta = pixJ - mg_pixDragJ;
|
||||
INDEX ctSessions = _lhServers.Count();
|
||||
INDEX iWantedLine = mg_iDragLine +
|
||||
SliderPixToIndex(pixDelta, mg_ctOnScreen, ctSessions, GetScrollBarFullBox());
|
||||
mg_iFirstOnScreen = Clamp(iWantedLine, 0L, ClampDn(ctSessions - mg_ctOnScreen, 0L));
|
||||
mg_iSelected = Clamp(mg_iSelected, mg_iFirstOnScreen, mg_iFirstOnScreen + mg_ctOnScreen - 1L);
|
||||
// AdjustFirstOnScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
// if some server is selected
|
||||
if (pixI >= mg_pixMinI && pixI <= mg_pixMaxI) {
|
||||
INDEX iOnScreen = (pixJ - mg_pixListMinJ) / mg_pixListStepJ;
|
||||
if (iOnScreen >= 0 && iOnScreen<mg_ctOnScreen) {
|
||||
// put focus on it
|
||||
mg_iSelected = mg_iFirstOnScreen + iOnScreen;
|
||||
AdjustFirstOnScreen();
|
||||
mg_pixMouseDrag = -1;
|
||||
}
|
||||
} else if (bInSlider) {
|
||||
mg_pixMouseDrag = pixJ;
|
||||
}
|
||||
// if some server is selected
|
||||
if (pixI >= mg_pixMinI && pixI <= mg_pixMaxI) {
|
||||
INDEX iOnScreen = (pixJ - mg_pixListMinJ) / mg_pixListStepJ;
|
||||
if (iOnScreen >= 0 && iOnScreen<mg_ctOnScreen) {
|
||||
// put focus on it
|
||||
mg_iSelected = mg_iFirstOnScreen + iOnScreen;
|
||||
AdjustFirstOnScreen();
|
||||
mg_pixMouseDrag = -1;
|
||||
}
|
||||
} else if (bInSlider) {
|
||||
mg_pixMouseDrag = pixJ;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CMGServerList::OnKeyDown(int iVKey)
|
||||
{
|
||||
switch (iVKey) {
|
||||
case VK_UP:
|
||||
mg_iSelected -= 1;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case VK_DOWN:
|
||||
mg_iSelected += 1;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case VK_PRIOR:
|
||||
mg_iSelected -= mg_ctOnScreen - 1;
|
||||
mg_iFirstOnScreen -= mg_ctOnScreen - 1;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case VK_NEXT:
|
||||
mg_iSelected += mg_ctOnScreen - 1;
|
||||
mg_iFirstOnScreen += mg_ctOnScreen - 1;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case 11:
|
||||
mg_iSelected -= 3;
|
||||
mg_iFirstOnScreen -= 3;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case 10:
|
||||
mg_iSelected += 3;
|
||||
mg_iFirstOnScreen += 3;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case VK_LBUTTON:
|
||||
/* if (mg_pixMouseJ>=mg_pixHeaderMinJ && mg_pixMouseJ<=mg_pixHeaderMidJ
|
||||
&& mg_pixMouseI>=mg_pixHeaderI[0] && mg_pixMouseI<=mg_pixHeaderI[7]) {
|
||||
INDEX iNewSort = mg_iSort;
|
||||
if (mg_pixMouseI<=mg_pixHeaderI[1]) {
|
||||
iNewSort = 0;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[2]) {
|
||||
iNewSort = 1;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[3]) {
|
||||
iNewSort = 2;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[4]) {
|
||||
iNewSort = 3;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[5]) {
|
||||
iNewSort = 4;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[6]) {
|
||||
iNewSort = 5;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[7]) {
|
||||
iNewSort = 6;
|
||||
}
|
||||
if (iNewSort==mg_iSort) {
|
||||
mg_bSortDown = !mg_bSortDown;
|
||||
} else {
|
||||
mg_bSortDown = FALSE;
|
||||
}
|
||||
mg_iSort = iNewSort;
|
||||
break;
|
||||
} else */if (mg_pixMouseDrag >= 0) {
|
||||
mg_pixDragJ = mg_pixMouseDrag;
|
||||
mg_iDragLine = mg_iFirstOnScreen;
|
||||
break;
|
||||
}
|
||||
case VK_RETURN:
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
{INDEX i = 0;
|
||||
FOREACHINLIST(CNetworkSession, ns_lnNode, _lhServers, itns) {
|
||||
if (i == mg_iSelected) {
|
||||
switch (iVKey) {
|
||||
case VK_UP:
|
||||
mg_iSelected -= 1;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case VK_DOWN:
|
||||
mg_iSelected += 1;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case VK_PRIOR:
|
||||
mg_iSelected -= mg_ctOnScreen - 1;
|
||||
mg_iFirstOnScreen -= mg_ctOnScreen - 1;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case VK_NEXT:
|
||||
mg_iSelected += mg_ctOnScreen - 1;
|
||||
mg_iFirstOnScreen += mg_ctOnScreen - 1;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case 11:
|
||||
mg_iSelected -= 3;
|
||||
mg_iFirstOnScreen -= 3;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case 10:
|
||||
mg_iSelected += 3;
|
||||
mg_iFirstOnScreen += 3;
|
||||
AdjustFirstOnScreen();
|
||||
break;
|
||||
case VK_LBUTTON:
|
||||
/* if (mg_pixMouseJ>=mg_pixHeaderMinJ && mg_pixMouseJ<=mg_pixHeaderMidJ
|
||||
&& mg_pixMouseI>=mg_pixHeaderI[0] && mg_pixMouseI<=mg_pixHeaderI[7]) {
|
||||
INDEX iNewSort = mg_iSort;
|
||||
if (mg_pixMouseI<=mg_pixHeaderI[1]) {
|
||||
iNewSort = 0;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[2]) {
|
||||
iNewSort = 1;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[3]) {
|
||||
iNewSort = 2;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[4]) {
|
||||
iNewSort = 3;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[5]) {
|
||||
iNewSort = 4;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[6]) {
|
||||
iNewSort = 5;
|
||||
} else if (mg_pixMouseI<=mg_pixHeaderI[7]) {
|
||||
iNewSort = 6;
|
||||
}
|
||||
if (iNewSort==mg_iSort) {
|
||||
mg_bSortDown = !mg_bSortDown;
|
||||
} else {
|
||||
mg_bSortDown = FALSE;
|
||||
}
|
||||
mg_iSort = iNewSort;
|
||||
break;
|
||||
} else */if (mg_pixMouseDrag >= 0) {
|
||||
mg_pixDragJ = mg_pixMouseDrag;
|
||||
mg_iDragLine = mg_iFirstOnScreen;
|
||||
break;
|
||||
}
|
||||
case VK_RETURN:
|
||||
PlayMenuSound(_psdPress);
|
||||
IFeel_PlayEffect("Menu_press");
|
||||
{INDEX i = 0;
|
||||
FOREACHINLIST(CNetworkSession, ns_lnNode, _lhServers, itns) {
|
||||
if (i == mg_iSelected) {
|
||||
|
||||
char strAddress[256];
|
||||
int iPort;
|
||||
itns->ns_strAddress.ScanF("%200[^:]:%d", &strAddress, &iPort);
|
||||
_pGame->gam_strJoinAddress = strAddress;
|
||||
_pShell->SetINDEX("net_iPort", iPort);
|
||||
extern void StartSelectPlayersMenuFromServers(void);
|
||||
StartSelectPlayersMenuFromServers();
|
||||
return TRUE;
|
||||
}
|
||||
i++;
|
||||
}}
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
char strAddress[256];
|
||||
int iPort;
|
||||
itns->ns_strAddress.ScanF("%200[^:]:%d", &strAddress, &iPort);
|
||||
_pGame->gam_strJoinAddress = strAddress;
|
||||
_pShell->SetINDEX("net_iPort", iPort);
|
||||
extern void StartSelectPlayersMenuFromServers(void);
|
||||
StartSelectPlayersMenuFromServers();
|
||||
return TRUE;
|
||||
}
|
||||
i++;
|
||||
}}
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CMGServerList::OnSetFocus(void)
|
||||
{
|
||||
mg_bFocused = TRUE;
|
||||
mg_bFocused = TRUE;
|
||||
}
|
||||
|
||||
void CMGServerList::OnKillFocus(void)
|
||||
{
|
||||
mg_bFocused = FALSE;
|
||||
mg_bFocused = FALSE;
|
||||
}
|
|
@ -25,101 +25,101 @@ extern INDEX sam_bWideScreen;
|
|||
|
||||
CMGSlider::CMGSlider()
|
||||
{
|
||||
mg_iMinPos = 0;
|
||||
mg_iMaxPos = 16;
|
||||
mg_iCurPos = 8;
|
||||
mg_pOnSliderChange = NULL;
|
||||
mg_fFactor = 1.0f;
|
||||
mg_iMinPos = 0;
|
||||
mg_iMaxPos = 16;
|
||||
mg_iCurPos = 8;
|
||||
mg_pOnSliderChange = NULL;
|
||||
mg_fFactor = 1.0f;
|
||||
}
|
||||
|
||||
void CMGSlider::ApplyCurrentPosition(void)
|
||||
{
|
||||
mg_iCurPos = Clamp(mg_iCurPos, mg_iMinPos, mg_iMaxPos);
|
||||
FLOAT fStretch = FLOAT(mg_iCurPos) / (mg_iMaxPos - mg_iMinPos);
|
||||
mg_fFactor = fStretch;
|
||||
mg_iCurPos = Clamp(mg_iCurPos, mg_iMinPos, mg_iMaxPos);
|
||||
FLOAT fStretch = FLOAT(mg_iCurPos) / (mg_iMaxPos - mg_iMinPos);
|
||||
mg_fFactor = fStretch;
|
||||
|
||||
if (mg_pOnSliderChange != NULL) {
|
||||
mg_pOnSliderChange(mg_iCurPos);
|
||||
}
|
||||
if (mg_pOnSliderChange != NULL) {
|
||||
mg_pOnSliderChange(mg_iCurPos);
|
||||
}
|
||||
}
|
||||
|
||||
void CMGSlider::ApplyGivenPosition(INDEX iMin, INDEX iMax, INDEX iCur)
|
||||
{
|
||||
mg_iMinPos = iMin;
|
||||
mg_iMaxPos = iMax;
|
||||
mg_iCurPos = iCur;
|
||||
ApplyCurrentPosition();
|
||||
mg_iMinPos = iMin;
|
||||
mg_iMaxPos = iMax;
|
||||
mg_iCurPos = iCur;
|
||||
ApplyCurrentPosition();
|
||||
}
|
||||
|
||||
|
||||
BOOL CMGSlider::OnKeyDown(int iVKey)
|
||||
{
|
||||
// if scrolling left
|
||||
if ((iVKey == VK_BACK || iVKey == VK_LEFT) && mg_iCurPos>mg_iMinPos) {
|
||||
mg_iCurPos--;
|
||||
ApplyCurrentPosition();
|
||||
return TRUE;
|
||||
// if scrolling right
|
||||
} else if ((iVKey == VK_RETURN || iVKey == VK_RIGHT) && mg_iCurPos<mg_iMaxPos) {
|
||||
mg_iCurPos++;
|
||||
ApplyCurrentPosition();
|
||||
return TRUE;
|
||||
// if lmb pressed
|
||||
} else if (iVKey == VK_LBUTTON) {
|
||||
// get position of slider box on screen
|
||||
PIXaabbox2D boxSlider = GetSliderBox();
|
||||
// if mouse is within
|
||||
if (boxSlider >= PIX2D(_pixCursorPosI, _pixCursorPosJ)) {
|
||||
// set new position exactly where mouse pointer is
|
||||
FLOAT fRatio = FLOAT(_pixCursorPosI - boxSlider.Min()(1)) / boxSlider.Size()(1);
|
||||
fRatio = (fRatio - 0.01f) / (0.99f - 0.01f);
|
||||
fRatio = Clamp(fRatio, 0.0f, 1.0f);
|
||||
mg_iCurPos = fRatio*(mg_iMaxPos - mg_iMinPos) + mg_iMinPos;
|
||||
ApplyCurrentPosition();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
// if scrolling left
|
||||
if ((iVKey == VK_BACK || iVKey == VK_LEFT) && mg_iCurPos>mg_iMinPos) {
|
||||
mg_iCurPos--;
|
||||
ApplyCurrentPosition();
|
||||
return TRUE;
|
||||
// if scrolling right
|
||||
} else if ((iVKey == VK_RETURN || iVKey == VK_RIGHT) && mg_iCurPos<mg_iMaxPos) {
|
||||
mg_iCurPos++;
|
||||
ApplyCurrentPosition();
|
||||
return TRUE;
|
||||
// if lmb pressed
|
||||
} else if (iVKey == VK_LBUTTON) {
|
||||
// get position of slider box on screen
|
||||
PIXaabbox2D boxSlider = GetSliderBox();
|
||||
// if mouse is within
|
||||
if (boxSlider >= PIX2D(_pixCursorPosI, _pixCursorPosJ)) {
|
||||
// set new position exactly where mouse pointer is
|
||||
FLOAT fRatio = FLOAT(_pixCursorPosI - boxSlider.Min()(1)) / boxSlider.Size()(1);
|
||||
fRatio = (fRatio - 0.01f) / (0.99f - 0.01f);
|
||||
fRatio = Clamp(fRatio, 0.0f, 1.0f);
|
||||
mg_iCurPos = fRatio*(mg_iMaxPos - mg_iMinPos) + mg_iMinPos;
|
||||
ApplyCurrentPosition();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
}
|
||||
|
||||
PIXaabbox2D CMGSlider::GetSliderBox(void)
|
||||
{
|
||||
extern CDrawPort *pdp;
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixJ = box.Min()(2);
|
||||
PIX pixJSize = box.Size()(2)*0.95f;
|
||||
PIX pixISizeR = box.Size()(1)*0.45f;
|
||||
if (sam_bWideScreen) pixJSize++;
|
||||
return PIXaabbox2D(PIX2D(pixIR + 1, pixJ + 1), PIX2D(pixIR + pixISizeR - 2, pixJ + pixJSize - 2));
|
||||
extern CDrawPort *pdp;
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixJ = box.Min()(2);
|
||||
PIX pixJSize = box.Size()(2)*0.95f;
|
||||
PIX pixISizeR = box.Size()(1)*0.45f;
|
||||
if (sam_bWideScreen) pixJSize++;
|
||||
return PIXaabbox2D(PIX2D(pixIR + 1, pixJ + 1), PIX2D(pixIR + pixISizeR - 2, pixJ + pixJSize - 2));
|
||||
}
|
||||
|
||||
void CMGSlider::Render(CDrawPort *pdp)
|
||||
{
|
||||
SetFontMedium(pdp);
|
||||
SetFontMedium(pdp);
|
||||
|
||||
// get geometry
|
||||
COLOR col = GetCurrentColor();
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIL = box.Min()(1) + box.Size()(1)*0.45f;
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixJ = box.Min()(2);
|
||||
PIX pixJSize = box.Size()(2)*0.95f;
|
||||
PIX pixISizeR = box.Size()(1)*0.45f;
|
||||
if (sam_bWideScreen) pixJSize++;
|
||||
// get geometry
|
||||
COLOR col = GetCurrentColor();
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIL = box.Min()(1) + box.Size()(1)*0.45f;
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixJ = box.Min()(2);
|
||||
PIX pixJSize = box.Size()(2)*0.95f;
|
||||
PIX pixISizeR = box.Size()(1)*0.45f;
|
||||
if (sam_bWideScreen) pixJSize++;
|
||||
|
||||
// print text left of slider
|
||||
pdp->PutTextR(mg_strText, pixIL, pixJ, col);
|
||||
// print text left of slider
|
||||
pdp->PutTextR(mg_strText, pixIL, pixJ, col);
|
||||
|
||||
// draw box around slider
|
||||
LCDDrawBox(0, -1, PIXaabbox2D(PIX2D(pixIR + 1, pixJ), PIX2D(pixIR + pixISizeR - 2, pixJ + pixJSize - 2)),
|
||||
LCDGetColor(C_GREEN | 255, "slider box"));
|
||||
// draw box around slider
|
||||
LCDDrawBox(0, -1, PIXaabbox2D(PIX2D(pixIR + 1, pixJ), PIX2D(pixIR + pixISizeR - 2, pixJ + pixJSize - 2)),
|
||||
LCDGetColor(C_GREEN | 255, "slider box"));
|
||||
|
||||
// draw filled part of slider
|
||||
pdp->Fill(pixIR + 2, pixJ + 1, (pixISizeR - 5)*mg_fFactor, (pixJSize - 4), col);
|
||||
// draw filled part of slider
|
||||
pdp->Fill(pixIR + 2, pixJ + 1, (pixISizeR - 5)*mg_fFactor, (pixJSize - 4), col);
|
||||
|
||||
// print percentage text
|
||||
CTString strPercentage;
|
||||
strPercentage.PrintF("%d%%", (int)floor(mg_fFactor * 100 + 0.5f));
|
||||
pdp->PutTextC(strPercentage, pixIR + pixISizeR / 2, pixJ + 1, col);
|
||||
// print percentage text
|
||||
CTString strPercentage;
|
||||
strPercentage.PrintF("%d%%", (int)floor(mg_fFactor * 100 + 0.5f));
|
||||
pdp->PutTextC(strPercentage, pixIR + pixISizeR / 2, pixJ + 1, col);
|
||||
}
|
|
@ -21,11 +21,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CMGTitle::Render(CDrawPort *pdp)
|
||||
{
|
||||
SetFontTitle(pdp);
|
||||
SetFontTitle(pdp);
|
||||
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixI = box.Center()(1);
|
||||
PIX pixJ = box.Min()(2);
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixI = box.Center()(1);
|
||||
PIX pixJ = box.Min()(2);
|
||||
|
||||
pdp->PutTextC(mg_strText, pixI, pixJ, LCDGetColor(C_WHITE | CT_OPAQUE, "title"));
|
||||
pdp->PutTextC(mg_strText, pixI, pixJ, LCDGetColor(C_WHITE | CT_OPAQUE, "title"));
|
||||
}
|
|
@ -21,101 +21,101 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
INDEX GetNewLoopValue(int iVKey, INDEX iCurrent, INDEX ctMembers)
|
||||
{
|
||||
INDEX iPrev = (iCurrent + ctMembers - 1) % ctMembers;
|
||||
INDEX iNext = (iCurrent + 1) % ctMembers;
|
||||
// return and right arrow set new text
|
||||
if (iVKey == VK_RETURN || iVKey == VK_LBUTTON || iVKey == VK_RIGHT)
|
||||
{
|
||||
return iNext;
|
||||
// left arrow and backspace sets prev text
|
||||
} else if ((iVKey == VK_BACK || iVKey == VK_RBUTTON) || (iVKey == VK_LEFT)) {
|
||||
return iPrev;
|
||||
}
|
||||
return iCurrent;
|
||||
INDEX iPrev = (iCurrent + ctMembers - 1) % ctMembers;
|
||||
INDEX iNext = (iCurrent + 1) % ctMembers;
|
||||
// return and right arrow set new text
|
||||
if (iVKey == VK_RETURN || iVKey == VK_LBUTTON || iVKey == VK_RIGHT)
|
||||
{
|
||||
return iNext;
|
||||
// left arrow and backspace sets prev text
|
||||
} else if ((iVKey == VK_BACK || iVKey == VK_RBUTTON) || (iVKey == VK_LEFT)) {
|
||||
return iPrev;
|
||||
}
|
||||
return iCurrent;
|
||||
}
|
||||
|
||||
CMGTrigger::CMGTrigger(void)
|
||||
{
|
||||
mg_pPreTriggerChange = NULL;
|
||||
mg_pOnTriggerChange = NULL;
|
||||
mg_iCenterI = 0;
|
||||
mg_bVisual = FALSE;
|
||||
mg_pPreTriggerChange = NULL;
|
||||
mg_pOnTriggerChange = NULL;
|
||||
mg_iCenterI = 0;
|
||||
mg_bVisual = FALSE;
|
||||
}
|
||||
|
||||
void CMGTrigger::ApplyCurrentSelection(void)
|
||||
{
|
||||
mg_iSelected = Clamp(mg_iSelected, 0L, mg_ctTexts - 1L);
|
||||
mg_strValue = mg_astrTexts[mg_iSelected];
|
||||
mg_iSelected = Clamp(mg_iSelected, 0L, mg_ctTexts - 1L);
|
||||
mg_strValue = mg_astrTexts[mg_iSelected];
|
||||
}
|
||||
|
||||
void CMGTrigger::OnSetNextInList(int iVKey)
|
||||
{
|
||||
if (mg_pPreTriggerChange != NULL) {
|
||||
mg_pPreTriggerChange(mg_iSelected);
|
||||
}
|
||||
if (mg_pPreTriggerChange != NULL) {
|
||||
mg_pPreTriggerChange(mg_iSelected);
|
||||
}
|
||||
|
||||
mg_iSelected = GetNewLoopValue(iVKey, mg_iSelected, mg_ctTexts);
|
||||
mg_strValue = mg_astrTexts[mg_iSelected];
|
||||
mg_iSelected = GetNewLoopValue(iVKey, mg_iSelected, mg_ctTexts);
|
||||
mg_strValue = mg_astrTexts[mg_iSelected];
|
||||
|
||||
if (mg_pOnTriggerChange != NULL) {
|
||||
(*mg_pOnTriggerChange)(mg_iSelected);
|
||||
}
|
||||
if (mg_pOnTriggerChange != NULL) {
|
||||
(*mg_pOnTriggerChange)(mg_iSelected);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CMGTrigger::OnKeyDown(int iVKey)
|
||||
{
|
||||
if ((iVKey == VK_RETURN || iVKey == VK_LBUTTON) ||
|
||||
(iVKey == VK_LEFT) ||
|
||||
(iVKey == VK_BACK || iVKey == VK_RBUTTON) ||
|
||||
(iVKey == VK_RIGHT))
|
||||
{
|
||||
// key is handled
|
||||
if (mg_bEnabled) OnSetNextInList(iVKey);
|
||||
return TRUE;
|
||||
}
|
||||
// key is not handled
|
||||
return FALSE;
|
||||
if ((iVKey == VK_RETURN || iVKey == VK_LBUTTON) ||
|
||||
(iVKey == VK_LEFT) ||
|
||||
(iVKey == VK_BACK || iVKey == VK_RBUTTON) ||
|
||||
(iVKey == VK_RIGHT))
|
||||
{
|
||||
// key is handled
|
||||
if (mg_bEnabled) OnSetNextInList(iVKey);
|
||||
return TRUE;
|
||||
}
|
||||
// key is not handled
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CMGTrigger::Render(CDrawPort *pdp)
|
||||
{
|
||||
SetFontMedium(pdp);
|
||||
SetFontMedium(pdp);
|
||||
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIL = box.Min()(1) + box.Size()(1)*0.45f;
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixJ = box.Min()(2);
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIL = box.Min()(1) + box.Size()(1)*0.45f;
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixJ = box.Min()(2);
|
||||
|
||||
COLOR col = GetCurrentColor();
|
||||
if (!mg_bVisual || mg_strValue == "") {
|
||||
CTString strValue = mg_strValue;
|
||||
if (mg_bVisual) {
|
||||
strValue = TRANS("none");
|
||||
}
|
||||
COLOR col = GetCurrentColor();
|
||||
if (!mg_bVisual || mg_strValue == "") {
|
||||
CTString strValue = mg_strValue;
|
||||
if (mg_bVisual) {
|
||||
strValue = TRANS("none");
|
||||
}
|
||||
|
||||
if (mg_iCenterI == -1) {
|
||||
pdp->PutText(mg_strLabel, box.Min()(1), pixJ, col);
|
||||
pdp->PutTextR(strValue, box.Max()(1), pixJ, col);
|
||||
} else {
|
||||
pdp->PutTextR(mg_strLabel, pixIL, pixJ, col);
|
||||
pdp->PutText(strValue, pixIR, pixJ, col);
|
||||
}
|
||||
} else {
|
||||
CTString strLabel = mg_strLabel + ": ";
|
||||
pdp->PutText(strLabel, box.Min()(1), pixJ, col);
|
||||
CTextureObject to;
|
||||
try {
|
||||
to.SetData_t(mg_strValue);
|
||||
CTextureData *ptd = (CTextureData *)to.GetData();
|
||||
PIX pixSize = box.Size()(2);
|
||||
PIX pixCX = box.Max()(1) - pixSize / 2;
|
||||
PIX pixCY = box.Center()(2);
|
||||
pdp->PutTexture(&to, PIXaabbox2D(
|
||||
PIX2D(pixCX - pixSize / 2, pixCY - pixSize / 2),
|
||||
PIX2D(pixCX - pixSize / 2 + pixSize, pixCY - pixSize / 2 + pixSize)), C_WHITE | 255);
|
||||
} catch (char *strError) {
|
||||
CPrintF("%s\n", strError);
|
||||
}
|
||||
to.SetData(NULL);
|
||||
}
|
||||
if (mg_iCenterI == -1) {
|
||||
pdp->PutText(mg_strLabel, box.Min()(1), pixJ, col);
|
||||
pdp->PutTextR(strValue, box.Max()(1), pixJ, col);
|
||||
} else {
|
||||
pdp->PutTextR(mg_strLabel, pixIL, pixJ, col);
|
||||
pdp->PutText(strValue, pixIR, pixJ, col);
|
||||
}
|
||||
} else {
|
||||
CTString strLabel = mg_strLabel + ": ";
|
||||
pdp->PutText(strLabel, box.Min()(1), pixJ, col);
|
||||
CTextureObject to;
|
||||
try {
|
||||
to.SetData_t(mg_strValue);
|
||||
CTextureData *ptd = (CTextureData *)to.GetData();
|
||||
PIX pixSize = box.Size()(2);
|
||||
PIX pixCX = box.Max()(1) - pixSize / 2;
|
||||
PIX pixCY = box.Center()(2);
|
||||
pdp->PutTexture(&to, PIXaabbox2D(
|
||||
PIX2D(pixCX - pixSize / 2, pixCY - pixSize / 2),
|
||||
PIX2D(pixCX - pixSize / 2 + pixSize, pixCY - pixSize / 2 + pixSize)), C_WHITE | 255);
|
||||
} catch (char *strError) {
|
||||
CPrintF("%s\n", strError);
|
||||
}
|
||||
to.SetData(NULL);
|
||||
}
|
||||
}
|
|
@ -25,156 +25,156 @@ extern PIX _pixCursorPosJ;
|
|||
|
||||
BOOL CMGVarButton::IsSeparator(void)
|
||||
{
|
||||
if (mg_pvsVar == NULL) return FALSE;
|
||||
return mg_pvsVar->vs_bSeparator;
|
||||
if (mg_pvsVar == NULL) return FALSE;
|
||||
return mg_pvsVar->vs_bSeparator;
|
||||
}
|
||||
|
||||
BOOL CMGVarButton::IsEnabled(void)
|
||||
{
|
||||
return(_gmRunningGameMode == GM_NONE
|
||||
|| mg_pvsVar == NULL
|
||||
|| mg_pvsVar->vs_bCanChangeInGame);
|
||||
return(_gmRunningGameMode == GM_NONE
|
||||
|| mg_pvsVar == NULL
|
||||
|| mg_pvsVar->vs_bCanChangeInGame);
|
||||
}
|
||||
|
||||
// return slider position on scren
|
||||
PIXaabbox2D CMGVarButton::GetSliderBox(void)
|
||||
{
|
||||
extern CDrawPort *pdp;
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixJ = box.Min()(2);
|
||||
PIX pixISize = box.Size()(1)*0.13f;
|
||||
PIX pixJSize = box.Size()(2);
|
||||
return PIXaabbox2D(PIX2D(pixIR, pixJ + 1), PIX2D(pixIR + pixISize - 4, pixJ + pixJSize - 6));
|
||||
extern CDrawPort *pdp;
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixJ = box.Min()(2);
|
||||
PIX pixISize = box.Size()(1)*0.13f;
|
||||
PIX pixJSize = box.Size()(2);
|
||||
return PIXaabbox2D(PIX2D(pixIR, pixJ + 1), PIX2D(pixIR + pixISize - 4, pixJ + pixJSize - 6));
|
||||
}
|
||||
|
||||
extern BOOL _bVarChanged;
|
||||
BOOL CMGVarButton::OnKeyDown(int iVKey)
|
||||
{
|
||||
if (mg_pvsVar == NULL || mg_pvsVar->vs_bSeparator || !mg_pvsVar->Validate() || !mg_bEnabled) {
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
}
|
||||
if (mg_pvsVar == NULL || mg_pvsVar->vs_bSeparator || !mg_pvsVar->Validate() || !mg_bEnabled) {
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
}
|
||||
|
||||
// handle slider
|
||||
if (mg_pvsVar->vs_iSlider && !mg_pvsVar->vs_bCustom) {
|
||||
// ignore RMB
|
||||
if (iVKey == VK_RBUTTON) return TRUE;
|
||||
// handle LMB
|
||||
if (iVKey == VK_LBUTTON) {
|
||||
// get position of slider box on screen
|
||||
PIXaabbox2D boxSlider = GetSliderBox();
|
||||
// if mouse is within
|
||||
if (boxSlider >= PIX2D(_pixCursorPosI, _pixCursorPosJ)) {
|
||||
// set new position exactly where mouse pointer is
|
||||
mg_pvsVar->vs_iValue = (FLOAT)(_pixCursorPosI - boxSlider.Min()(1)) / boxSlider.Size()(1) * (mg_pvsVar->vs_ctValues);
|
||||
_bVarChanged = TRUE;
|
||||
}
|
||||
// handled
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
// handle slider
|
||||
if (mg_pvsVar->vs_iSlider && !mg_pvsVar->vs_bCustom) {
|
||||
// ignore RMB
|
||||
if (iVKey == VK_RBUTTON) return TRUE;
|
||||
// handle LMB
|
||||
if (iVKey == VK_LBUTTON) {
|
||||
// get position of slider box on screen
|
||||
PIXaabbox2D boxSlider = GetSliderBox();
|
||||
// if mouse is within
|
||||
if (boxSlider >= PIX2D(_pixCursorPosI, _pixCursorPosJ)) {
|
||||
// set new position exactly where mouse pointer is
|
||||
mg_pvsVar->vs_iValue = (FLOAT)(_pixCursorPosI - boxSlider.Min()(1)) / boxSlider.Size()(1) * (mg_pvsVar->vs_ctValues);
|
||||
_bVarChanged = TRUE;
|
||||
}
|
||||
// handled
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (iVKey == VK_RETURN) {
|
||||
FlushVarSettings(TRUE);
|
||||
void MenuGoToParent(void);
|
||||
MenuGoToParent();
|
||||
return TRUE;
|
||||
}
|
||||
if (iVKey == VK_RETURN) {
|
||||
FlushVarSettings(TRUE);
|
||||
void MenuGoToParent(void);
|
||||
MenuGoToParent();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (iVKey == VK_LBUTTON || iVKey == VK_RIGHT) {
|
||||
if (mg_pvsVar != NULL) {
|
||||
INDEX iOldValue = mg_pvsVar->vs_iValue;
|
||||
mg_pvsVar->vs_iValue++;
|
||||
if (mg_pvsVar->vs_iValue >= mg_pvsVar->vs_ctValues) {
|
||||
// wrap non-sliders, clamp sliders
|
||||
if (mg_pvsVar->vs_iSlider) mg_pvsVar->vs_iValue = mg_pvsVar->vs_ctValues - 1L;
|
||||
else mg_pvsVar->vs_iValue = 0;
|
||||
}
|
||||
if (iOldValue != mg_pvsVar->vs_iValue) {
|
||||
_bVarChanged = TRUE;
|
||||
mg_pvsVar->vs_bCustom = FALSE;
|
||||
mg_pvsVar->Validate();
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
if (iVKey == VK_LBUTTON || iVKey == VK_RIGHT) {
|
||||
if (mg_pvsVar != NULL) {
|
||||
INDEX iOldValue = mg_pvsVar->vs_iValue;
|
||||
mg_pvsVar->vs_iValue++;
|
||||
if (mg_pvsVar->vs_iValue >= mg_pvsVar->vs_ctValues) {
|
||||
// wrap non-sliders, clamp sliders
|
||||
if (mg_pvsVar->vs_iSlider) mg_pvsVar->vs_iValue = mg_pvsVar->vs_ctValues - 1L;
|
||||
else mg_pvsVar->vs_iValue = 0;
|
||||
}
|
||||
if (iOldValue != mg_pvsVar->vs_iValue) {
|
||||
_bVarChanged = TRUE;
|
||||
mg_pvsVar->vs_bCustom = FALSE;
|
||||
mg_pvsVar->Validate();
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (iVKey == VK_LEFT || iVKey == VK_RBUTTON) {
|
||||
if (mg_pvsVar != NULL) {
|
||||
INDEX iOldValue = mg_pvsVar->vs_iValue;
|
||||
mg_pvsVar->vs_iValue--;
|
||||
if (mg_pvsVar->vs_iValue<0) {
|
||||
// wrap non-sliders, clamp sliders
|
||||
if (mg_pvsVar->vs_iSlider) mg_pvsVar->vs_iValue = 0;
|
||||
else mg_pvsVar->vs_iValue = mg_pvsVar->vs_ctValues - 1L;
|
||||
}
|
||||
if (iOldValue != mg_pvsVar->vs_iValue) {
|
||||
_bVarChanged = TRUE;
|
||||
mg_pvsVar->vs_bCustom = FALSE;
|
||||
mg_pvsVar->Validate();
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
if (iVKey == VK_LEFT || iVKey == VK_RBUTTON) {
|
||||
if (mg_pvsVar != NULL) {
|
||||
INDEX iOldValue = mg_pvsVar->vs_iValue;
|
||||
mg_pvsVar->vs_iValue--;
|
||||
if (mg_pvsVar->vs_iValue<0) {
|
||||
// wrap non-sliders, clamp sliders
|
||||
if (mg_pvsVar->vs_iSlider) mg_pvsVar->vs_iValue = 0;
|
||||
else mg_pvsVar->vs_iValue = mg_pvsVar->vs_ctValues - 1L;
|
||||
}
|
||||
if (iOldValue != mg_pvsVar->vs_iValue) {
|
||||
_bVarChanged = TRUE;
|
||||
mg_pvsVar->vs_bCustom = FALSE;
|
||||
mg_pvsVar->Validate();
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// not handled
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
// not handled
|
||||
return CMenuGadget::OnKeyDown(iVKey);
|
||||
}
|
||||
|
||||
void CMGVarButton::Render(CDrawPort *pdp)
|
||||
{
|
||||
if (mg_pvsVar == NULL) {
|
||||
return;
|
||||
}
|
||||
if (mg_pvsVar == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
SetFontMedium(pdp);
|
||||
SetFontMedium(pdp);
|
||||
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIL = box.Min()(1) + box.Size()(1)*0.45f;
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixIC = box.Center()(1);
|
||||
PIX pixJ = box.Min()(2);
|
||||
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
|
||||
PIX pixIL = box.Min()(1) + box.Size()(1)*0.45f;
|
||||
PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
|
||||
PIX pixIC = box.Center()(1);
|
||||
PIX pixJ = box.Min()(2);
|
||||
|
||||
if (mg_pvsVar->vs_bSeparator)
|
||||
{
|
||||
mg_bEnabled = FALSE;
|
||||
COLOR col = LCDGetColor(C_WHITE | 255, "separator");
|
||||
CTString strText = mg_pvsVar->vs_strName;
|
||||
pdp->PutTextC(strText, pixIC, pixJ, col);
|
||||
} else if (mg_pvsVar->Validate()) {
|
||||
// check whether the variable is disabled
|
||||
if (mg_pvsVar->vs_strFilter != "") mg_bEnabled = _pShell->GetINDEX(mg_pvsVar->vs_strFilter);
|
||||
COLOR col = GetCurrentColor();
|
||||
pdp->PutTextR(mg_pvsVar->vs_strName, pixIL, pixJ, col);
|
||||
// custom is by default
|
||||
CTString strText = TRANS("Custom");
|
||||
if (!mg_pvsVar->vs_bCustom)
|
||||
{ // not custom!
|
||||
strText = mg_pvsVar->vs_astrTexts[mg_pvsVar->vs_iValue];
|
||||
// need slider?
|
||||
if (mg_pvsVar->vs_iSlider>0) {
|
||||
// draw box around slider
|
||||
PIX pixISize = box.Size()(1)*0.13f;
|
||||
PIX pixJSize = box.Size()(2);
|
||||
LCDDrawBox(0, -1, PIXaabbox2D(PIX2D(pixIR, pixJ + 1), PIX2D(pixIR + pixISize - 4, pixJ + pixJSize - 6)),
|
||||
LCDGetColor(C_GREEN | 255, "slider box"));
|
||||
if (mg_pvsVar->vs_bSeparator)
|
||||
{
|
||||
mg_bEnabled = FALSE;
|
||||
COLOR col = LCDGetColor(C_WHITE | 255, "separator");
|
||||
CTString strText = mg_pvsVar->vs_strName;
|
||||
pdp->PutTextC(strText, pixIC, pixJ, col);
|
||||
} else if (mg_pvsVar->Validate()) {
|
||||
// check whether the variable is disabled
|
||||
if (mg_pvsVar->vs_strFilter != "") mg_bEnabled = _pShell->GetINDEX(mg_pvsVar->vs_strFilter);
|
||||
COLOR col = GetCurrentColor();
|
||||
pdp->PutTextR(mg_pvsVar->vs_strName, pixIL, pixJ, col);
|
||||
// custom is by default
|
||||
CTString strText = TRANS("Custom");
|
||||
if (!mg_pvsVar->vs_bCustom)
|
||||
{ // not custom!
|
||||
strText = mg_pvsVar->vs_astrTexts[mg_pvsVar->vs_iValue];
|
||||
// need slider?
|
||||
if (mg_pvsVar->vs_iSlider>0) {
|
||||
// draw box around slider
|
||||
PIX pixISize = box.Size()(1)*0.13f;
|
||||
PIX pixJSize = box.Size()(2);
|
||||
LCDDrawBox(0, -1, PIXaabbox2D(PIX2D(pixIR, pixJ + 1), PIX2D(pixIR + pixISize - 4, pixJ + pixJSize - 6)),
|
||||
LCDGetColor(C_GREEN | 255, "slider box"));
|
||||
|
||||
// draw filled part of slider
|
||||
if (mg_pvsVar->vs_iSlider == 1) {
|
||||
// fill slider
|
||||
FLOAT fFactor = (FLOAT)(mg_pvsVar->vs_iValue + 1) / mg_pvsVar->vs_ctValues;
|
||||
pdp->Fill(pixIR + 1, pixJ + 2, (pixISize - 6)*fFactor, pixJSize - 9, col);
|
||||
} else {
|
||||
// ratio slider
|
||||
ASSERT(mg_pvsVar->vs_iSlider == 2);
|
||||
FLOAT fUnitWidth = (FLOAT)(pixISize - 5) / mg_pvsVar->vs_ctValues;
|
||||
pdp->Fill(pixIR + 1 + (mg_pvsVar->vs_iValue*fUnitWidth), pixJ + 2, fUnitWidth, pixJSize - 9, col);
|
||||
}
|
||||
// move text printout to the right of slider
|
||||
pixIR += box.Size()(1)*0.15f;
|
||||
}
|
||||
}
|
||||
// write right text
|
||||
pdp->PutText(strText, pixIR, pixJ, col);
|
||||
}
|
||||
// draw filled part of slider
|
||||
if (mg_pvsVar->vs_iSlider == 1) {
|
||||
// fill slider
|
||||
FLOAT fFactor = (FLOAT)(mg_pvsVar->vs_iValue + 1) / mg_pvsVar->vs_ctValues;
|
||||
pdp->Fill(pixIR + 1, pixJ + 2, (pixISize - 6)*fFactor, pixJSize - 9, col);
|
||||
} else {
|
||||
// ratio slider
|
||||
ASSERT(mg_pvsVar->vs_iSlider == 2);
|
||||
FLOAT fUnitWidth = (FLOAT)(pixISize - 5) / mg_pvsVar->vs_ctValues;
|
||||
pdp->Fill(pixIR + 1 + (mg_pvsVar->vs_iValue*fUnitWidth), pixJ + 2, fUnitWidth, pixJSize - 9, col);
|
||||
}
|
||||
// move text printout to the right of slider
|
||||
pixIR += box.Size()(1)*0.15f;
|
||||
}
|
||||
}
|
||||
// write right text
|
||||
pdp->PutText(strText, pixIR, pixJ, col);
|
||||
}
|
||||
}
|
|
@ -29,69 +29,69 @@ extern CMenuGadget *_pmgLastActivatedGadget = NULL;
|
|||
|
||||
CMenuGadget::CMenuGadget(void)
|
||||
{
|
||||
mg_pmgLeft = NULL;
|
||||
mg_pmgRight = NULL;
|
||||
mg_pmgUp = NULL;
|
||||
mg_pmgDown = NULL;
|
||||
mg_pmgLeft = NULL;
|
||||
mg_pmgRight = NULL;
|
||||
mg_pmgUp = NULL;
|
||||
mg_pmgDown = NULL;
|
||||
|
||||
mg_bVisible = TRUE;
|
||||
mg_bEnabled = TRUE;
|
||||
mg_bLabel = FALSE;
|
||||
mg_bFocused = FALSE;
|
||||
mg_iInList = -1; // not in list
|
||||
mg_bVisible = TRUE;
|
||||
mg_bEnabled = TRUE;
|
||||
mg_bLabel = FALSE;
|
||||
mg_bFocused = FALSE;
|
||||
mg_iInList = -1; // not in list
|
||||
}
|
||||
|
||||
void CMenuGadget::OnActivate(void)
|
||||
{
|
||||
NOTHING;
|
||||
NOTHING;
|
||||
}
|
||||
|
||||
// return TRUE if handled
|
||||
BOOL CMenuGadget::OnKeyDown(int iVKey)
|
||||
{
|
||||
// if return pressed
|
||||
if (iVKey == VK_RETURN || iVKey == VK_LBUTTON) {
|
||||
// activate
|
||||
OnActivate();
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
// key is not handled
|
||||
return FALSE;
|
||||
// if return pressed
|
||||
if (iVKey == VK_RETURN || iVKey == VK_LBUTTON) {
|
||||
// activate
|
||||
OnActivate();
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
// key is not handled
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL CMenuGadget::OnChar(MSG msg)
|
||||
{
|
||||
// key is not handled
|
||||
return FALSE;
|
||||
// key is not handled
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
void CMenuGadget::OnSetFocus(void)
|
||||
{
|
||||
mg_bFocused = TRUE;
|
||||
if (!IsSeparator())
|
||||
{
|
||||
PlayMenuSound(_psdSelect);
|
||||
IFeel_PlayEffect("Menu_select");
|
||||
}
|
||||
mg_bFocused = TRUE;
|
||||
if (!IsSeparator())
|
||||
{
|
||||
PlayMenuSound(_psdSelect);
|
||||
IFeel_PlayEffect("Menu_select");
|
||||
}
|
||||
}
|
||||
|
||||
void CMenuGadget::OnKillFocus(void)
|
||||
{
|
||||
mg_bFocused = FALSE;
|
||||
mg_bFocused = FALSE;
|
||||
}
|
||||
|
||||
void CMenuGadget::Appear(void)
|
||||
{
|
||||
mg_bVisible = TRUE;
|
||||
mg_bVisible = TRUE;
|
||||
}
|
||||
|
||||
void CMenuGadget::Disappear(void)
|
||||
{
|
||||
mg_bVisible = FALSE;
|
||||
mg_bFocused = FALSE;
|
||||
mg_bVisible = FALSE;
|
||||
mg_bFocused = FALSE;
|
||||
}
|
||||
|
||||
void CMenuGadget::Think(void)
|
||||
|
@ -105,30 +105,30 @@ void CMenuGadget::OnMouseOver(PIX pixI, PIX pixJ)
|
|||
// get current color for the gadget
|
||||
COLOR CMenuGadget::GetCurrentColor(void)
|
||||
{
|
||||
// use normal colors
|
||||
COLOR colUnselected = LCDGetColor(C_GREEN, "unselected");
|
||||
COLOR colSelected = LCDGetColor(C_WHITE, "selected");
|
||||
// if disabled
|
||||
if (!mg_bEnabled) {
|
||||
// use a bit darker colors
|
||||
colUnselected = LCDGetColor(C_dGREEN, "disabled unselected");
|
||||
colSelected = LCDGetColor(C_GRAY, "disabled selected");
|
||||
// if label
|
||||
if (mg_bLabel) {
|
||||
// use white
|
||||
colUnselected = colSelected = LCDGetColor(C_WHITE, "label");
|
||||
}
|
||||
}
|
||||
// use unselected color
|
||||
COLOR colRet = colUnselected;
|
||||
// if selected
|
||||
if (mg_bFocused) {
|
||||
// oscilate towards selected color
|
||||
FLOAT tmNow = _pTimer->GetHighPrecisionTimer().GetSeconds();
|
||||
colRet = LerpColor((colUnselected >> 1) & 0x7F7F7F7F, colSelected, sin(tmNow*10.0f)*0.5f + 0.5f);
|
||||
}
|
||||
// use normal colors
|
||||
COLOR colUnselected = LCDGetColor(C_GREEN, "unselected");
|
||||
COLOR colSelected = LCDGetColor(C_WHITE, "selected");
|
||||
// if disabled
|
||||
if (!mg_bEnabled) {
|
||||
// use a bit darker colors
|
||||
colUnselected = LCDGetColor(C_dGREEN, "disabled unselected");
|
||||
colSelected = LCDGetColor(C_GRAY, "disabled selected");
|
||||
// if label
|
||||
if (mg_bLabel) {
|
||||
// use white
|
||||
colUnselected = colSelected = LCDGetColor(C_WHITE, "label");
|
||||
}
|
||||
}
|
||||
// use unselected color
|
||||
COLOR colRet = colUnselected;
|
||||
// if selected
|
||||
if (mg_bFocused) {
|
||||
// oscilate towards selected color
|
||||
FLOAT tmNow = _pTimer->GetHighPrecisionTimer().GetSeconds();
|
||||
colRet = LerpColor((colUnselected >> 1) & 0x7F7F7F7F, colSelected, sin(tmNow*10.0f)*0.5f + 0.5f);
|
||||
}
|
||||
|
||||
return colRet | CT_OPAQUE;
|
||||
return colRet | CT_OPAQUE;
|
||||
}
|
||||
|
||||
void CMenuGadget::Render(CDrawPort *pdp)
|
||||
|
|
|
@ -20,16 +20,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
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;
|
||||
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)
|
||||
|
@ -42,15 +42,15 @@ void CGameMenu::Destroy(void)
|
|||
|
||||
void CGameMenu::FillListItems(void)
|
||||
{
|
||||
ASSERT(FALSE); // must be implemented to scroll up/down
|
||||
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;
|
||||
}
|
||||
// for each menu gadget in menu
|
||||
FOREACHINLIST(CMenuGadget, mg_lnNode, gm_lhGadgets, itmg) {
|
||||
itmg->mg_bFocused = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void CGameMenu::Think(void)
|
||||
|
@ -63,288 +63,288 @@ void CGameMenu::Think(void)
|
|||
// +-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;
|
||||
}
|
||||
// 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));
|
||||
}
|
||||
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();
|
||||
// set new names
|
||||
FillListItems();
|
||||
|
||||
// if scroling with wheel
|
||||
if (iDir == +4 || iDir == -4) {
|
||||
// no focus changing
|
||||
return;
|
||||
}
|
||||
// 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();
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
// 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 none focused
|
||||
if (pmgActive == NULL) {
|
||||
// do nothing
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// if active gadget handles it
|
||||
if (pmgActive->OnChar(msg)) {
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
// if active gadget handles it
|
||||
if (pmgActive->OnChar(msg)) {
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// key is not handled
|
||||
return FALSE;
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
// 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 none focused
|
||||
if (pmgActive == NULL) {
|
||||
// do nothing
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// if active gadget handles it
|
||||
if (pmgActive->OnKeyDown(iVKey)) {
|
||||
// key is handled
|
||||
return TRUE;
|
||||
}
|
||||
// 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;
|
||||
// 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 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;
|
||||
}
|
||||
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;
|
||||
// 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();
|
||||
}
|
||||
// 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));
|
||||
// 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();
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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();
|
||||
}
|
||||
// for each menu gadget in menu
|
||||
FOREACHINLIST(CMenuGadget, mg_lnNode, gm_lhGadgets, itmg)
|
||||
{
|
||||
// call disappear
|
||||
itmg->Disappear();
|
||||
}
|
||||
}
|
|
@ -23,55 +23,55 @@ extern void RefreshSoundFormat(void);
|
|||
|
||||
void CAudioOptionsMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize Audio options menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("AUDIO");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// intialize Audio options menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("AUDIO");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
TRIGGER_MG(gm_mgAudioAutoTrigger, 0,
|
||||
gm_mgApply, gm_mgFrequencyTrigger, TRANS("AUTO-ADJUST"), astrNoYes);
|
||||
gm_mgAudioAutoTrigger.mg_strTip = TRANS("adjust quality to fit your system");
|
||||
TRIGGER_MG(gm_mgAudioAutoTrigger, 0,
|
||||
gm_mgApply, gm_mgFrequencyTrigger, TRANS("AUTO-ADJUST"), astrNoYes);
|
||||
gm_mgAudioAutoTrigger.mg_strTip = TRANS("adjust quality to fit your system");
|
||||
|
||||
TRIGGER_MG(gm_mgFrequencyTrigger, 1,
|
||||
gm_mgAudioAutoTrigger, gm_mgAudioAPITrigger, TRANS("FREQUENCY"), astrFrequencyRadioTexts);
|
||||
gm_mgFrequencyTrigger.mg_strTip = TRANS("select sound quality or turn sound off");
|
||||
gm_mgFrequencyTrigger.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgFrequencyTrigger, 1,
|
||||
gm_mgAudioAutoTrigger, gm_mgAudioAPITrigger, TRANS("FREQUENCY"), astrFrequencyRadioTexts);
|
||||
gm_mgFrequencyTrigger.mg_strTip = TRANS("select sound quality or turn sound off");
|
||||
gm_mgFrequencyTrigger.mg_pOnTriggerChange = NULL;
|
||||
|
||||
TRIGGER_MG(gm_mgAudioAPITrigger, 2,
|
||||
gm_mgFrequencyTrigger, gm_mgWaveVolume, TRANS("SOUND SYSTEM"), astrSoundAPIRadioTexts);
|
||||
gm_mgAudioAPITrigger.mg_strTip = TRANS("choose sound system (API) to use");
|
||||
gm_mgAudioAPITrigger.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgAudioAPITrigger, 2,
|
||||
gm_mgFrequencyTrigger, gm_mgWaveVolume, TRANS("SOUND SYSTEM"), astrSoundAPIRadioTexts);
|
||||
gm_mgAudioAPITrigger.mg_strTip = TRANS("choose sound system (API) to use");
|
||||
gm_mgAudioAPITrigger.mg_pOnTriggerChange = NULL;
|
||||
|
||||
gm_mgWaveVolume.mg_boxOnScreen = BoxMediumRow(3);
|
||||
gm_mgWaveVolume.mg_strText = TRANS("SOUND EFFECTS VOLUME");
|
||||
gm_mgWaveVolume.mg_strTip = TRANS("adjust volume of in-game sound effects");
|
||||
gm_mgWaveVolume.mg_pmgUp = &gm_mgAudioAPITrigger;
|
||||
gm_mgWaveVolume.mg_pmgDown = &gm_mgMPEGVolume;
|
||||
gm_mgWaveVolume.mg_pOnSliderChange = NULL;
|
||||
gm_mgWaveVolume.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgWaveVolume.mg_lnNode);
|
||||
gm_mgWaveVolume.mg_boxOnScreen = BoxMediumRow(3);
|
||||
gm_mgWaveVolume.mg_strText = TRANS("SOUND EFFECTS VOLUME");
|
||||
gm_mgWaveVolume.mg_strTip = TRANS("adjust volume of in-game sound effects");
|
||||
gm_mgWaveVolume.mg_pmgUp = &gm_mgAudioAPITrigger;
|
||||
gm_mgWaveVolume.mg_pmgDown = &gm_mgMPEGVolume;
|
||||
gm_mgWaveVolume.mg_pOnSliderChange = NULL;
|
||||
gm_mgWaveVolume.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgWaveVolume.mg_lnNode);
|
||||
|
||||
gm_mgMPEGVolume.mg_boxOnScreen = BoxMediumRow(4);
|
||||
gm_mgMPEGVolume.mg_strText = TRANS("MUSIC VOLUME");
|
||||
gm_mgMPEGVolume.mg_strTip = TRANS("adjust volume of in-game music");
|
||||
gm_mgMPEGVolume.mg_pmgUp = &gm_mgWaveVolume;
|
||||
gm_mgMPEGVolume.mg_pmgDown = &gm_mgApply;
|
||||
gm_mgMPEGVolume.mg_pOnSliderChange = NULL;
|
||||
gm_mgMPEGVolume.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgMPEGVolume.mg_lnNode);
|
||||
gm_mgMPEGVolume.mg_boxOnScreen = BoxMediumRow(4);
|
||||
gm_mgMPEGVolume.mg_strText = TRANS("MUSIC VOLUME");
|
||||
gm_mgMPEGVolume.mg_strTip = TRANS("adjust volume of in-game music");
|
||||
gm_mgMPEGVolume.mg_pmgUp = &gm_mgWaveVolume;
|
||||
gm_mgMPEGVolume.mg_pmgDown = &gm_mgApply;
|
||||
gm_mgMPEGVolume.mg_pOnSliderChange = NULL;
|
||||
gm_mgMPEGVolume.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgMPEGVolume.mg_lnNode);
|
||||
|
||||
gm_mgApply.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgApply.mg_boxOnScreen = BoxBigRow(4);
|
||||
gm_mgApply.mg_strText = TRANS("APPLY");
|
||||
gm_mgApply.mg_strTip = TRANS("activate selected options");
|
||||
gm_lhGadgets.AddTail(gm_mgApply.mg_lnNode);
|
||||
gm_mgApply.mg_pmgUp = &gm_mgMPEGVolume;
|
||||
gm_mgApply.mg_pmgDown = &gm_mgAudioAutoTrigger;
|
||||
gm_mgApply.mg_pActivatedFunction = NULL;
|
||||
gm_mgApply.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgApply.mg_boxOnScreen = BoxBigRow(4);
|
||||
gm_mgApply.mg_strText = TRANS("APPLY");
|
||||
gm_mgApply.mg_strTip = TRANS("activate selected options");
|
||||
gm_lhGadgets.AddTail(gm_mgApply.mg_lnNode);
|
||||
gm_mgApply.mg_pmgUp = &gm_mgMPEGVolume;
|
||||
gm_mgApply.mg_pmgDown = &gm_mgAudioAutoTrigger;
|
||||
gm_mgApply.mg_pActivatedFunction = NULL;
|
||||
}
|
||||
|
||||
void CAudioOptionsMenu::StartMenu(void)
|
||||
{
|
||||
RefreshSoundFormat();
|
||||
CGameMenu::StartMenu();
|
||||
RefreshSoundFormat();
|
||||
CGameMenu::StartMenu();
|
||||
}
|
|
@ -19,64 +19,64 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CConfirmMenu::Initialize_t(void)
|
||||
{
|
||||
gm_bPopup = TRUE;
|
||||
gm_bPopup = TRUE;
|
||||
|
||||
gm_mgConfirmLabel.mg_strText = "";
|
||||
gm_lhGadgets.AddTail(gm_mgConfirmLabel.mg_lnNode);
|
||||
gm_mgConfirmLabel.mg_boxOnScreen = BoxPopupLabel();
|
||||
gm_mgConfirmLabel.mg_iCenterI = 0;
|
||||
gm_mgConfirmLabel.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgConfirmLabel.mg_strText = "";
|
||||
gm_lhGadgets.AddTail(gm_mgConfirmLabel.mg_lnNode);
|
||||
gm_mgConfirmLabel.mg_boxOnScreen = BoxPopupLabel();
|
||||
gm_mgConfirmLabel.mg_iCenterI = 0;
|
||||
gm_mgConfirmLabel.mg_bfsFontSize = BFS_LARGE;
|
||||
|
||||
gm_mgConfirmYes.mg_strText = TRANS("YES");
|
||||
gm_lhGadgets.AddTail(gm_mgConfirmYes.mg_lnNode);
|
||||
gm_mgConfirmYes.mg_boxOnScreen = BoxPopupYesLarge();
|
||||
gm_mgConfirmYes.mg_pActivatedFunction = NULL;
|
||||
gm_mgConfirmYes.mg_pmgLeft =
|
||||
gm_mgConfirmYes.mg_pmgRight = &gm_mgConfirmNo;
|
||||
gm_mgConfirmYes.mg_iCenterI = 1;
|
||||
gm_mgConfirmYes.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgConfirmYes.mg_strText = TRANS("YES");
|
||||
gm_lhGadgets.AddTail(gm_mgConfirmYes.mg_lnNode);
|
||||
gm_mgConfirmYes.mg_boxOnScreen = BoxPopupYesLarge();
|
||||
gm_mgConfirmYes.mg_pActivatedFunction = NULL;
|
||||
gm_mgConfirmYes.mg_pmgLeft =
|
||||
gm_mgConfirmYes.mg_pmgRight = &gm_mgConfirmNo;
|
||||
gm_mgConfirmYes.mg_iCenterI = 1;
|
||||
gm_mgConfirmYes.mg_bfsFontSize = BFS_LARGE;
|
||||
|
||||
gm_mgConfirmNo.mg_strText = TRANS("NO");
|
||||
gm_lhGadgets.AddTail(gm_mgConfirmNo.mg_lnNode);
|
||||
gm_mgConfirmNo.mg_boxOnScreen = BoxPopupNoLarge();
|
||||
gm_mgConfirmNo.mg_pActivatedFunction = NULL;
|
||||
gm_mgConfirmNo.mg_pmgLeft =
|
||||
gm_mgConfirmNo.mg_pmgRight = &gm_mgConfirmYes;
|
||||
gm_mgConfirmNo.mg_iCenterI = -1;
|
||||
gm_mgConfirmNo.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgConfirmNo.mg_strText = TRANS("NO");
|
||||
gm_lhGadgets.AddTail(gm_mgConfirmNo.mg_lnNode);
|
||||
gm_mgConfirmNo.mg_boxOnScreen = BoxPopupNoLarge();
|
||||
gm_mgConfirmNo.mg_pActivatedFunction = NULL;
|
||||
gm_mgConfirmNo.mg_pmgLeft =
|
||||
gm_mgConfirmNo.mg_pmgRight = &gm_mgConfirmYes;
|
||||
gm_mgConfirmNo.mg_iCenterI = -1;
|
||||
gm_mgConfirmNo.mg_bfsFontSize = BFS_LARGE;
|
||||
|
||||
_pConfimedYes = NULL;
|
||||
_pConfimedNo = NULL;
|
||||
_pConfimedYes = NULL;
|
||||
_pConfimedNo = NULL;
|
||||
}
|
||||
|
||||
void CConfirmMenu::BeLarge(void)
|
||||
{
|
||||
gm_mgConfirmLabel.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgConfirmYes.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgConfirmNo.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgConfirmLabel.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgConfirmYes.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgConfirmNo.mg_bfsFontSize = BFS_LARGE;
|
||||
|
||||
gm_mgConfirmLabel.mg_iCenterI = 0;
|
||||
gm_mgConfirmYes.mg_boxOnScreen = BoxPopupYesLarge();
|
||||
gm_mgConfirmNo.mg_boxOnScreen = BoxPopupNoLarge();
|
||||
gm_mgConfirmLabel.mg_iCenterI = 0;
|
||||
gm_mgConfirmYes.mg_boxOnScreen = BoxPopupYesLarge();
|
||||
gm_mgConfirmNo.mg_boxOnScreen = BoxPopupNoLarge();
|
||||
}
|
||||
|
||||
void CConfirmMenu::BeSmall(void)
|
||||
{
|
||||
gm_mgConfirmLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgConfirmYes.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgConfirmNo.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgConfirmLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgConfirmYes.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgConfirmNo.mg_bfsFontSize = BFS_MEDIUM;
|
||||
|
||||
gm_mgConfirmLabel.mg_iCenterI = -1;
|
||||
gm_mgConfirmYes.mg_boxOnScreen = BoxPopupYesSmall();
|
||||
gm_mgConfirmNo.mg_boxOnScreen = BoxPopupNoSmall();
|
||||
gm_mgConfirmLabel.mg_iCenterI = -1;
|
||||
gm_mgConfirmYes.mg_boxOnScreen = BoxPopupYesSmall();
|
||||
gm_mgConfirmNo.mg_boxOnScreen = BoxPopupNoSmall();
|
||||
}
|
||||
|
||||
// return TRUE if handled
|
||||
BOOL CConfirmMenu::OnKeyDown(int iVKey)
|
||||
{
|
||||
if ((iVKey == VK_ESCAPE || iVKey == VK_RBUTTON) && gm_mgConfirmNo.mg_pActivatedFunction != NULL) {
|
||||
gm_mgConfirmNo.OnActivate();
|
||||
return TRUE;
|
||||
}
|
||||
return CGameMenu::OnKeyDown(iVKey);
|
||||
if ((iVKey == VK_ESCAPE || iVKey == VK_RBUTTON) && gm_mgConfirmNo.mg_pActivatedFunction != NULL) {
|
||||
gm_mgConfirmNo.OnActivate();
|
||||
return TRUE;
|
||||
}
|
||||
return CGameMenu::OnKeyDown(iVKey);
|
||||
}
|
|
@ -23,136 +23,136 @@ extern CTFileName _fnmControlsToCustomize;
|
|||
|
||||
void CControlsMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize player and controls menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("CONTROLS");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// intialize player and controls menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("CONTROLS");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgNameLabel.mg_strText = "";
|
||||
gm_mgNameLabel.mg_boxOnScreen = BoxMediumRow(0.0);
|
||||
gm_mgNameLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNameLabel.mg_iCenterI = -1;
|
||||
gm_mgNameLabel.mg_bEnabled = FALSE;
|
||||
gm_mgNameLabel.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgNameLabel.mg_lnNode);
|
||||
gm_mgNameLabel.mg_strText = "";
|
||||
gm_mgNameLabel.mg_boxOnScreen = BoxMediumRow(0.0);
|
||||
gm_mgNameLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNameLabel.mg_iCenterI = -1;
|
||||
gm_mgNameLabel.mg_bEnabled = FALSE;
|
||||
gm_mgNameLabel.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgNameLabel.mg_lnNode);
|
||||
|
||||
gm_mgButtons.mg_strText = TRANS("CUSTOMIZE BUTTONS");
|
||||
gm_mgButtons.mg_boxOnScreen = BoxMediumRow(2.0);
|
||||
gm_mgButtons.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgButtons.mg_iCenterI = 0;
|
||||
gm_lhGadgets.AddTail(gm_mgButtons.mg_lnNode);
|
||||
gm_mgButtons.mg_pmgUp = &gm_mgPredefined;
|
||||
gm_mgButtons.mg_pmgDown = &gm_mgAdvanced;
|
||||
gm_mgButtons.mg_pActivatedFunction = NULL;
|
||||
gm_mgButtons.mg_strTip = TRANS("customize buttons in current controls");
|
||||
gm_mgButtons.mg_strText = TRANS("CUSTOMIZE BUTTONS");
|
||||
gm_mgButtons.mg_boxOnScreen = BoxMediumRow(2.0);
|
||||
gm_mgButtons.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgButtons.mg_iCenterI = 0;
|
||||
gm_lhGadgets.AddTail(gm_mgButtons.mg_lnNode);
|
||||
gm_mgButtons.mg_pmgUp = &gm_mgPredefined;
|
||||
gm_mgButtons.mg_pmgDown = &gm_mgAdvanced;
|
||||
gm_mgButtons.mg_pActivatedFunction = NULL;
|
||||
gm_mgButtons.mg_strTip = TRANS("customize buttons in current controls");
|
||||
|
||||
gm_mgAdvanced.mg_strText = TRANS("ADVANCED JOYSTICK SETUP");
|
||||
gm_mgAdvanced.mg_iCenterI = 0;
|
||||
gm_mgAdvanced.mg_boxOnScreen = BoxMediumRow(3);
|
||||
gm_mgAdvanced.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_lhGadgets.AddTail(gm_mgAdvanced.mg_lnNode);
|
||||
gm_mgAdvanced.mg_pmgUp = &gm_mgButtons;
|
||||
gm_mgAdvanced.mg_pmgDown = &gm_mgSensitivity;
|
||||
gm_mgAdvanced.mg_pActivatedFunction = NULL;
|
||||
gm_mgAdvanced.mg_strTip = TRANS("adjust advanced settings for joystick axis");
|
||||
gm_mgAdvanced.mg_strText = TRANS("ADVANCED JOYSTICK SETUP");
|
||||
gm_mgAdvanced.mg_iCenterI = 0;
|
||||
gm_mgAdvanced.mg_boxOnScreen = BoxMediumRow(3);
|
||||
gm_mgAdvanced.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_lhGadgets.AddTail(gm_mgAdvanced.mg_lnNode);
|
||||
gm_mgAdvanced.mg_pmgUp = &gm_mgButtons;
|
||||
gm_mgAdvanced.mg_pmgDown = &gm_mgSensitivity;
|
||||
gm_mgAdvanced.mg_pActivatedFunction = NULL;
|
||||
gm_mgAdvanced.mg_strTip = TRANS("adjust advanced settings for joystick axis");
|
||||
|
||||
gm_mgSensitivity.mg_boxOnScreen = BoxMediumRow(4.5);
|
||||
gm_mgSensitivity.mg_strText = TRANS("SENSITIVITY");
|
||||
gm_mgSensitivity.mg_pmgUp = &gm_mgAdvanced;
|
||||
gm_mgSensitivity.mg_pmgDown = &gm_mgInvertTrigger;
|
||||
gm_mgSensitivity.mg_strTip = TRANS("sensitivity for all axis in this control set");
|
||||
gm_lhGadgets.AddTail(gm_mgSensitivity.mg_lnNode);
|
||||
gm_mgSensitivity.mg_boxOnScreen = BoxMediumRow(4.5);
|
||||
gm_mgSensitivity.mg_strText = TRANS("SENSITIVITY");
|
||||
gm_mgSensitivity.mg_pmgUp = &gm_mgAdvanced;
|
||||
gm_mgSensitivity.mg_pmgDown = &gm_mgInvertTrigger;
|
||||
gm_mgSensitivity.mg_strTip = TRANS("sensitivity for all axis in this control set");
|
||||
gm_lhGadgets.AddTail(gm_mgSensitivity.mg_lnNode);
|
||||
|
||||
TRIGGER_MG(gm_mgInvertTrigger, 5.5, gm_mgSensitivity, gm_mgSmoothTrigger,
|
||||
TRANS("INVERT LOOK"), astrNoYes);
|
||||
gm_mgInvertTrigger.mg_strTip = TRANS("invert up/down looking");
|
||||
TRIGGER_MG(gm_mgSmoothTrigger, 6.5, gm_mgInvertTrigger, gm_mgAccelTrigger,
|
||||
TRANS("SMOOTH AXIS"), astrNoYes);
|
||||
gm_mgSmoothTrigger.mg_strTip = TRANS("smooth mouse/joystick movements");
|
||||
TRIGGER_MG(gm_mgAccelTrigger, 7.5, gm_mgSmoothTrigger, gm_mgIFeelTrigger,
|
||||
TRANS("MOUSE ACCELERATION"), astrNoYes);
|
||||
gm_mgAccelTrigger.mg_strTip = TRANS("allow mouse acceleration");
|
||||
TRIGGER_MG(gm_mgIFeelTrigger, 8.5, gm_mgAccelTrigger, gm_mgPredefined,
|
||||
TRANS("ENABLE IFEEL"), astrNoYes);
|
||||
gm_mgIFeelTrigger.mg_strTip = TRANS("enable support for iFeel tactile feedback mouse");
|
||||
TRIGGER_MG(gm_mgInvertTrigger, 5.5, gm_mgSensitivity, gm_mgSmoothTrigger,
|
||||
TRANS("INVERT LOOK"), astrNoYes);
|
||||
gm_mgInvertTrigger.mg_strTip = TRANS("invert up/down looking");
|
||||
TRIGGER_MG(gm_mgSmoothTrigger, 6.5, gm_mgInvertTrigger, gm_mgAccelTrigger,
|
||||
TRANS("SMOOTH AXIS"), astrNoYes);
|
||||
gm_mgSmoothTrigger.mg_strTip = TRANS("smooth mouse/joystick movements");
|
||||
TRIGGER_MG(gm_mgAccelTrigger, 7.5, gm_mgSmoothTrigger, gm_mgIFeelTrigger,
|
||||
TRANS("MOUSE ACCELERATION"), astrNoYes);
|
||||
gm_mgAccelTrigger.mg_strTip = TRANS("allow mouse acceleration");
|
||||
TRIGGER_MG(gm_mgIFeelTrigger, 8.5, gm_mgAccelTrigger, gm_mgPredefined,
|
||||
TRANS("ENABLE IFEEL"), astrNoYes);
|
||||
gm_mgIFeelTrigger.mg_strTip = TRANS("enable support for iFeel tactile feedback mouse");
|
||||
|
||||
gm_mgPredefined.mg_strText = TRANS("LOAD PREDEFINED SETTINGS");
|
||||
gm_mgPredefined.mg_iCenterI = 0;
|
||||
gm_mgPredefined.mg_boxOnScreen = BoxMediumRow(10);
|
||||
gm_mgPredefined.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_lhGadgets.AddTail(gm_mgPredefined.mg_lnNode);
|
||||
gm_mgPredefined.mg_pmgUp = &gm_mgIFeelTrigger;
|
||||
gm_mgPredefined.mg_pmgDown = &gm_mgButtons;
|
||||
gm_mgPredefined.mg_pActivatedFunction = NULL;
|
||||
gm_mgPredefined.mg_strTip = TRANS("load one of several predefined control settings");
|
||||
gm_mgPredefined.mg_strText = TRANS("LOAD PREDEFINED SETTINGS");
|
||||
gm_mgPredefined.mg_iCenterI = 0;
|
||||
gm_mgPredefined.mg_boxOnScreen = BoxMediumRow(10);
|
||||
gm_mgPredefined.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_lhGadgets.AddTail(gm_mgPredefined.mg_lnNode);
|
||||
gm_mgPredefined.mg_pmgUp = &gm_mgIFeelTrigger;
|
||||
gm_mgPredefined.mg_pmgDown = &gm_mgButtons;
|
||||
gm_mgPredefined.mg_pActivatedFunction = NULL;
|
||||
gm_mgPredefined.mg_strTip = TRANS("load one of several predefined control settings");
|
||||
}
|
||||
|
||||
void CControlsMenu::StartMenu(void)
|
||||
{
|
||||
gm_pmgSelectedByDefault = &gm_mgButtons;
|
||||
INDEX iPlayer = _pGame->gm_iSinglePlayer;
|
||||
if (_iLocalPlayer >= 0 && _iLocalPlayer<4) {
|
||||
iPlayer = _pGame->gm_aiMenuLocalPlayers[_iLocalPlayer];
|
||||
}
|
||||
_fnmControlsToCustomize.PrintF("Controls\\Controls%d.ctl", iPlayer);
|
||||
gm_pmgSelectedByDefault = &gm_mgButtons;
|
||||
INDEX iPlayer = _pGame->gm_iSinglePlayer;
|
||||
if (_iLocalPlayer >= 0 && _iLocalPlayer<4) {
|
||||
iPlayer = _pGame->gm_aiMenuLocalPlayers[_iLocalPlayer];
|
||||
}
|
||||
_fnmControlsToCustomize.PrintF("Controls\\Controls%d.ctl", iPlayer);
|
||||
|
||||
ControlsMenuOn();
|
||||
ControlsMenuOn();
|
||||
|
||||
gm_mgNameLabel.mg_strText.PrintF(TRANS("CONTROLS FOR: %s"), _pGame->gm_apcPlayers[iPlayer].GetNameForPrinting());
|
||||
gm_mgNameLabel.mg_strText.PrintF(TRANS("CONTROLS FOR: %s"), _pGame->gm_apcPlayers[iPlayer].GetNameForPrinting());
|
||||
|
||||
ObtainActionSettings();
|
||||
CGameMenu::StartMenu();
|
||||
ObtainActionSettings();
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void CControlsMenu::EndMenu(void)
|
||||
{
|
||||
ApplyActionSettings();
|
||||
ApplyActionSettings();
|
||||
|
||||
ControlsMenuOff();
|
||||
ControlsMenuOff();
|
||||
|
||||
CGameMenu::EndMenu();
|
||||
CGameMenu::EndMenu();
|
||||
}
|
||||
|
||||
void CControlsMenu::ObtainActionSettings(void)
|
||||
{
|
||||
CControls &ctrls = _pGame->gm_ctrlControlsExtra;
|
||||
CControls &ctrls = _pGame->gm_ctrlControlsExtra;
|
||||
|
||||
gm_mgSensitivity.mg_iMinPos = 0;
|
||||
gm_mgSensitivity.mg_iMaxPos = 50;
|
||||
gm_mgSensitivity.mg_iCurPos = ctrls.ctrl_fSensitivity / 2;
|
||||
gm_mgSensitivity.ApplyCurrentPosition();
|
||||
gm_mgSensitivity.mg_iMinPos = 0;
|
||||
gm_mgSensitivity.mg_iMaxPos = 50;
|
||||
gm_mgSensitivity.mg_iCurPos = ctrls.ctrl_fSensitivity / 2;
|
||||
gm_mgSensitivity.ApplyCurrentPosition();
|
||||
|
||||
gm_mgInvertTrigger.mg_iSelected = ctrls.ctrl_bInvertLook ? 1 : 0;
|
||||
gm_mgSmoothTrigger.mg_iSelected = ctrls.ctrl_bSmoothAxes ? 1 : 0;
|
||||
gm_mgAccelTrigger.mg_iSelected = _pShell->GetINDEX("inp_bAllowMouseAcceleration") ? 1 : 0;
|
||||
gm_mgIFeelTrigger.mg_bEnabled = _pShell->GetINDEX("sys_bIFeelEnabled") ? 1 : 0;
|
||||
gm_mgIFeelTrigger.mg_iSelected = _pShell->GetFLOAT("inp_fIFeelGain")>0 ? 1 : 0;
|
||||
gm_mgInvertTrigger.mg_iSelected = ctrls.ctrl_bInvertLook ? 1 : 0;
|
||||
gm_mgSmoothTrigger.mg_iSelected = ctrls.ctrl_bSmoothAxes ? 1 : 0;
|
||||
gm_mgAccelTrigger.mg_iSelected = _pShell->GetINDEX("inp_bAllowMouseAcceleration") ? 1 : 0;
|
||||
gm_mgIFeelTrigger.mg_bEnabled = _pShell->GetINDEX("sys_bIFeelEnabled") ? 1 : 0;
|
||||
gm_mgIFeelTrigger.mg_iSelected = _pShell->GetFLOAT("inp_fIFeelGain")>0 ? 1 : 0;
|
||||
|
||||
gm_mgInvertTrigger.ApplyCurrentSelection();
|
||||
gm_mgSmoothTrigger.ApplyCurrentSelection();
|
||||
gm_mgAccelTrigger.ApplyCurrentSelection();
|
||||
gm_mgIFeelTrigger.ApplyCurrentSelection();
|
||||
gm_mgInvertTrigger.ApplyCurrentSelection();
|
||||
gm_mgSmoothTrigger.ApplyCurrentSelection();
|
||||
gm_mgAccelTrigger.ApplyCurrentSelection();
|
||||
gm_mgIFeelTrigger.ApplyCurrentSelection();
|
||||
}
|
||||
|
||||
void CControlsMenu::ApplyActionSettings(void)
|
||||
{
|
||||
CControls &ctrls = _pGame->gm_ctrlControlsExtra;
|
||||
CControls &ctrls = _pGame->gm_ctrlControlsExtra;
|
||||
|
||||
FLOAT fSensitivity =
|
||||
FLOAT(gm_mgSensitivity.mg_iCurPos - gm_mgSensitivity.mg_iMinPos) /
|
||||
FLOAT(gm_mgSensitivity.mg_iMaxPos - gm_mgSensitivity.mg_iMinPos)*100.0f;
|
||||
FLOAT fSensitivity =
|
||||
FLOAT(gm_mgSensitivity.mg_iCurPos - gm_mgSensitivity.mg_iMinPos) /
|
||||
FLOAT(gm_mgSensitivity.mg_iMaxPos - gm_mgSensitivity.mg_iMinPos)*100.0f;
|
||||
|
||||
BOOL bInvert = gm_mgInvertTrigger.mg_iSelected != 0;
|
||||
BOOL bSmooth = gm_mgSmoothTrigger.mg_iSelected != 0;
|
||||
BOOL bAccel = gm_mgAccelTrigger.mg_iSelected != 0;
|
||||
BOOL bIFeel = gm_mgIFeelTrigger.mg_iSelected != 0;
|
||||
BOOL bInvert = gm_mgInvertTrigger.mg_iSelected != 0;
|
||||
BOOL bSmooth = gm_mgSmoothTrigger.mg_iSelected != 0;
|
||||
BOOL bAccel = gm_mgAccelTrigger.mg_iSelected != 0;
|
||||
BOOL bIFeel = gm_mgIFeelTrigger.mg_iSelected != 0;
|
||||
|
||||
if (INDEX(ctrls.ctrl_fSensitivity) != INDEX(fSensitivity)) {
|
||||
ctrls.ctrl_fSensitivity = fSensitivity;
|
||||
}
|
||||
ctrls.ctrl_bInvertLook = bInvert;
|
||||
ctrls.ctrl_bSmoothAxes = bSmooth;
|
||||
_pShell->SetINDEX("inp_bAllowMouseAcceleration", bAccel);
|
||||
_pShell->SetFLOAT("inp_fIFeelGain", bIFeel ? 1.0f : 0.0f);
|
||||
ctrls.CalculateInfluencesForAllAxis();
|
||||
if (INDEX(ctrls.ctrl_fSensitivity) != INDEX(fSensitivity)) {
|
||||
ctrls.ctrl_fSensitivity = fSensitivity;
|
||||
}
|
||||
ctrls.ctrl_bInvertLook = bInvert;
|
||||
ctrls.ctrl_bSmoothAxes = bSmooth;
|
||||
_pShell->SetINDEX("inp_bAllowMouseAcceleration", bAccel);
|
||||
_pShell->SetFLOAT("inp_fIFeelGain", bIFeel ? 1.0f : 0.0f);
|
||||
ctrls.CalculateInfluencesForAllAxis();
|
||||
}
|
|
@ -21,135 +21,135 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
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);
|
||||
// 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_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");
|
||||
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_astrTexts = new CTString[AXIS_ACTIONS_CT];
|
||||
gm_mgActionTrigger.mg_ctTexts = AXIS_ACTIONS_CT;
|
||||
|
||||
gm_mgActionTrigger.mg_pPreTriggerChange = NULL;
|
||||
gm_mgActionTrigger.mg_pOnTriggerChange = NULL;
|
||||
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;
|
||||
// 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);
|
||||
}
|
||||
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_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");
|
||||
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");
|
||||
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;
|
||||
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;
|
||||
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_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_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_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_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();
|
||||
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;
|
||||
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;
|
||||
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();
|
||||
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();
|
||||
ControlsMenuOff();
|
||||
}
|
||||
|
||||
void CCustomizeAxisMenu::StartMenu(void)
|
||||
{
|
||||
ObtainActionSettings();
|
||||
ObtainActionSettings();
|
||||
|
||||
CGameMenu::StartMenu();
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void CCustomizeAxisMenu::EndMenu(void)
|
||||
{
|
||||
ApplyActionSettings();
|
||||
CGameMenu::EndMenu();
|
||||
ApplyActionSettings();
|
||||
CGameMenu::EndMenu();
|
||||
}
|
|
@ -21,91 +21,91 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
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;
|
||||
}
|
||||
// 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++;
|
||||
}
|
||||
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;
|
||||
// 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);
|
||||
// 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];
|
||||
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];
|
||||
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];
|
||||
}
|
||||
|
||||
void CCustomizeKeyboardMenu::StartMenu(void)
|
||||
{
|
||||
ControlsMenuOn();
|
||||
gm_iListOffset = 0;
|
||||
gm_ctListTotal = _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count();
|
||||
gm_iListWantedItem = 0;
|
||||
CGameMenu::StartMenu();
|
||||
ControlsMenuOn();
|
||||
gm_iListOffset = 0;
|
||||
gm_ctListTotal = _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count();
|
||||
gm_iListWantedItem = 0;
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void CCustomizeKeyboardMenu::EndMenu(void)
|
||||
{
|
||||
ControlsMenuOff();
|
||||
CGameMenu::EndMenu();
|
||||
ControlsMenuOff();
|
||||
CGameMenu::EndMenu();
|
||||
}
|
|
@ -20,11 +20,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CDisabledMenu::Initialize_t(void)
|
||||
{
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgButton.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgButton.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
gm_lhGadgets.AddTail(gm_mgButton.mg_lnNode);
|
||||
gm_mgButton.mg_pActivatedFunction = NULL;
|
||||
gm_mgButton.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgButton.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
gm_lhGadgets.AddTail(gm_mgButton.mg_lnNode);
|
||||
gm_mgButton.mg_pActivatedFunction = NULL;
|
||||
}
|
|
@ -20,16 +20,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
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_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);
|
||||
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();
|
||||
gm_pgmParentMenu = pgmCurrentMenu;
|
||||
CGameMenu::StartMenu();
|
||||
}
|
|
@ -20,154 +20,154 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CInGameMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize main menu
|
||||
gm_mgTitle.mg_strText = TRANS("GAME");
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// intialize main menu
|
||||
gm_mgTitle.mg_strText = TRANS("GAME");
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgLabel1.mg_strText = "";
|
||||
gm_mgLabel1.mg_boxOnScreen = BoxMediumRow(-2.0);
|
||||
gm_mgLabel1.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgLabel1.mg_iCenterI = -1;
|
||||
gm_mgLabel1.mg_bEnabled = FALSE;
|
||||
gm_mgLabel1.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgLabel1.mg_lnNode);
|
||||
gm_mgLabel1.mg_strText = "";
|
||||
gm_mgLabel1.mg_boxOnScreen = BoxMediumRow(-2.0);
|
||||
gm_mgLabel1.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgLabel1.mg_iCenterI = -1;
|
||||
gm_mgLabel1.mg_bEnabled = FALSE;
|
||||
gm_mgLabel1.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgLabel1.mg_lnNode);
|
||||
|
||||
gm_mgLabel2.mg_strText = "";
|
||||
gm_mgLabel2.mg_boxOnScreen = BoxMediumRow(-1.0);
|
||||
gm_mgLabel2.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgLabel2.mg_iCenterI = -1;
|
||||
gm_mgLabel2.mg_bEnabled = FALSE;
|
||||
gm_mgLabel2.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgLabel2.mg_lnNode);
|
||||
gm_mgLabel2.mg_strText = "";
|
||||
gm_mgLabel2.mg_boxOnScreen = BoxMediumRow(-1.0);
|
||||
gm_mgLabel2.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgLabel2.mg_iCenterI = -1;
|
||||
gm_mgLabel2.mg_bEnabled = FALSE;
|
||||
gm_mgLabel2.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgLabel2.mg_lnNode);
|
||||
|
||||
gm_mgQuickLoad.mg_strText = TRANS("QUICK LOAD");
|
||||
gm_mgQuickLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuickLoad.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
gm_mgQuickLoad.mg_strTip = TRANS("load a quick-saved game (F9)");
|
||||
gm_lhGadgets.AddTail(gm_mgQuickLoad.mg_lnNode);
|
||||
gm_mgQuickLoad.mg_pmgUp = &gm_mgQuit;
|
||||
gm_mgQuickLoad.mg_pmgDown = &gm_mgQuickSave;
|
||||
gm_mgQuickLoad.mg_pActivatedFunction = NULL;
|
||||
gm_mgQuickLoad.mg_strText = TRANS("QUICK LOAD");
|
||||
gm_mgQuickLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuickLoad.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
gm_mgQuickLoad.mg_strTip = TRANS("load a quick-saved game (F9)");
|
||||
gm_lhGadgets.AddTail(gm_mgQuickLoad.mg_lnNode);
|
||||
gm_mgQuickLoad.mg_pmgUp = &gm_mgQuit;
|
||||
gm_mgQuickLoad.mg_pmgDown = &gm_mgQuickSave;
|
||||
gm_mgQuickLoad.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgQuickSave.mg_strText = TRANS("QUICK SAVE");
|
||||
gm_mgQuickSave.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuickSave.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgQuickSave.mg_strTip = TRANS("quick-save current game (F6)");
|
||||
gm_lhGadgets.AddTail(gm_mgQuickSave.mg_lnNode);
|
||||
gm_mgQuickSave.mg_pmgUp = &gm_mgQuickLoad;
|
||||
gm_mgQuickSave.mg_pmgDown = &gm_mgLoad;
|
||||
gm_mgQuickSave.mg_pActivatedFunction = NULL;
|
||||
gm_mgQuickSave.mg_strText = TRANS("QUICK SAVE");
|
||||
gm_mgQuickSave.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuickSave.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgQuickSave.mg_strTip = TRANS("quick-save current game (F6)");
|
||||
gm_lhGadgets.AddTail(gm_mgQuickSave.mg_lnNode);
|
||||
gm_mgQuickSave.mg_pmgUp = &gm_mgQuickLoad;
|
||||
gm_mgQuickSave.mg_pmgDown = &gm_mgLoad;
|
||||
gm_mgQuickSave.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgLoad.mg_strText = TRANS("LOAD");
|
||||
gm_mgLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgLoad.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgLoad.mg_strTip = TRANS("load a saved game");
|
||||
gm_lhGadgets.AddTail(gm_mgLoad.mg_lnNode);
|
||||
gm_mgLoad.mg_pmgUp = &gm_mgQuickSave;
|
||||
gm_mgLoad.mg_pmgDown = &gm_mgSave;
|
||||
gm_mgLoad.mg_pActivatedFunction = NULL;
|
||||
gm_mgLoad.mg_strText = TRANS("LOAD");
|
||||
gm_mgLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgLoad.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgLoad.mg_strTip = TRANS("load a saved game");
|
||||
gm_lhGadgets.AddTail(gm_mgLoad.mg_lnNode);
|
||||
gm_mgLoad.mg_pmgUp = &gm_mgQuickSave;
|
||||
gm_mgLoad.mg_pmgDown = &gm_mgSave;
|
||||
gm_mgLoad.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgSave.mg_strText = TRANS("SAVE");
|
||||
gm_mgSave.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgSave.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgSave.mg_strTip = TRANS("save current game (each player has own slots!)");
|
||||
gm_lhGadgets.AddTail(gm_mgSave.mg_lnNode);
|
||||
gm_mgSave.mg_pmgUp = &gm_mgLoad;
|
||||
gm_mgSave.mg_pmgDown = &gm_mgDemoRec;
|
||||
gm_mgSave.mg_pActivatedFunction = NULL;
|
||||
gm_mgSave.mg_strText = TRANS("SAVE");
|
||||
gm_mgSave.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgSave.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgSave.mg_strTip = TRANS("save current game (each player has own slots!)");
|
||||
gm_lhGadgets.AddTail(gm_mgSave.mg_lnNode);
|
||||
gm_mgSave.mg_pmgUp = &gm_mgLoad;
|
||||
gm_mgSave.mg_pmgDown = &gm_mgDemoRec;
|
||||
gm_mgSave.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgDemoRec.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgDemoRec.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgDemoRec.mg_pmgUp = &gm_mgSave;
|
||||
gm_mgDemoRec.mg_pmgDown = &gm_mgHighScore;
|
||||
gm_mgDemoRec.mg_strText = "Text not set";
|
||||
gm_lhGadgets.AddTail(gm_mgDemoRec.mg_lnNode);
|
||||
gm_mgDemoRec.mg_pActivatedFunction = NULL;
|
||||
gm_mgDemoRec.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgDemoRec.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgDemoRec.mg_pmgUp = &gm_mgSave;
|
||||
gm_mgDemoRec.mg_pmgDown = &gm_mgHighScore;
|
||||
gm_mgDemoRec.mg_strText = "Text not set";
|
||||
gm_lhGadgets.AddTail(gm_mgDemoRec.mg_lnNode);
|
||||
gm_mgDemoRec.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgHighScore.mg_strText = TRANS("HIGH SCORES");
|
||||
gm_mgHighScore.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgHighScore.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgHighScore.mg_strTip = TRANS("view list of top ten best scores");
|
||||
gm_lhGadgets.AddTail(gm_mgHighScore.mg_lnNode);
|
||||
gm_mgHighScore.mg_pmgUp = &gm_mgDemoRec;
|
||||
gm_mgHighScore.mg_pmgDown = &gm_mgOptions;
|
||||
gm_mgHighScore.mg_pActivatedFunction = NULL;
|
||||
gm_mgHighScore.mg_strText = TRANS("HIGH SCORES");
|
||||
gm_mgHighScore.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgHighScore.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgHighScore.mg_strTip = TRANS("view list of top ten best scores");
|
||||
gm_lhGadgets.AddTail(gm_mgHighScore.mg_lnNode);
|
||||
gm_mgHighScore.mg_pmgUp = &gm_mgDemoRec;
|
||||
gm_mgHighScore.mg_pmgDown = &gm_mgOptions;
|
||||
gm_mgHighScore.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgOptions.mg_strText = TRANS("OPTIONS");
|
||||
gm_mgOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgOptions.mg_boxOnScreen = BoxBigRow(6.0f);
|
||||
gm_mgOptions.mg_strTip = TRANS("adjust video, audio and input options");
|
||||
gm_lhGadgets.AddTail(gm_mgOptions.mg_lnNode);
|
||||
gm_mgOptions.mg_pmgUp = &gm_mgHighScore;
|
||||
gm_mgOptions.mg_pmgDown = &gm_mgStop;
|
||||
gm_mgOptions.mg_pActivatedFunction = NULL;
|
||||
gm_mgOptions.mg_strText = TRANS("OPTIONS");
|
||||
gm_mgOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgOptions.mg_boxOnScreen = BoxBigRow(6.0f);
|
||||
gm_mgOptions.mg_strTip = TRANS("adjust video, audio and input options");
|
||||
gm_lhGadgets.AddTail(gm_mgOptions.mg_lnNode);
|
||||
gm_mgOptions.mg_pmgUp = &gm_mgHighScore;
|
||||
gm_mgOptions.mg_pmgDown = &gm_mgStop;
|
||||
gm_mgOptions.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgStop.mg_strText = TRANS("STOP GAME");
|
||||
gm_mgStop.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgStop.mg_boxOnScreen = BoxBigRow(7.0f);
|
||||
gm_mgStop.mg_strTip = TRANS("stop currently running game");
|
||||
gm_lhGadgets.AddTail(gm_mgStop.mg_lnNode);
|
||||
gm_mgStop.mg_pmgUp = &gm_mgOptions;
|
||||
gm_mgStop.mg_pmgDown = &gm_mgQuit;
|
||||
gm_mgStop.mg_pActivatedFunction = NULL;
|
||||
gm_mgStop.mg_strText = TRANS("STOP GAME");
|
||||
gm_mgStop.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgStop.mg_boxOnScreen = BoxBigRow(7.0f);
|
||||
gm_mgStop.mg_strTip = TRANS("stop currently running game");
|
||||
gm_lhGadgets.AddTail(gm_mgStop.mg_lnNode);
|
||||
gm_mgStop.mg_pmgUp = &gm_mgOptions;
|
||||
gm_mgStop.mg_pmgDown = &gm_mgQuit;
|
||||
gm_mgStop.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgQuit.mg_strText = TRANS("QUIT");
|
||||
gm_mgQuit.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuit.mg_boxOnScreen = BoxBigRow(8.0f);
|
||||
gm_mgQuit.mg_strTip = TRANS("exit game immediately");
|
||||
gm_lhGadgets.AddTail(gm_mgQuit.mg_lnNode);
|
||||
gm_mgQuit.mg_pmgUp = &gm_mgStop;
|
||||
gm_mgQuit.mg_pmgDown = &gm_mgQuickLoad;
|
||||
gm_mgQuit.mg_pActivatedFunction = NULL;
|
||||
gm_mgQuit.mg_strText = TRANS("QUIT");
|
||||
gm_mgQuit.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuit.mg_boxOnScreen = BoxBigRow(8.0f);
|
||||
gm_mgQuit.mg_strTip = TRANS("exit game immediately");
|
||||
gm_lhGadgets.AddTail(gm_mgQuit.mg_lnNode);
|
||||
gm_mgQuit.mg_pmgUp = &gm_mgStop;
|
||||
gm_mgQuit.mg_pmgDown = &gm_mgQuickLoad;
|
||||
gm_mgQuit.mg_pActivatedFunction = NULL;
|
||||
}
|
||||
|
||||
void CInGameMenu::StartMenu(void)
|
||||
{
|
||||
gm_mgQuickLoad.mg_bEnabled = _pNetwork->IsServer();
|
||||
gm_mgQuickSave.mg_bEnabled = _pNetwork->IsServer();
|
||||
gm_mgLoad.mg_bEnabled = _pNetwork->IsServer();
|
||||
gm_mgSave.mg_bEnabled = _pNetwork->IsServer();
|
||||
gm_mgDemoRec.mg_bEnabled = TRUE;//_pNetwork->IsServer();
|
||||
extern void SetDemoStartStopRecText();
|
||||
SetDemoStartStopRecText();
|
||||
gm_mgQuickLoad.mg_bEnabled = _pNetwork->IsServer();
|
||||
gm_mgQuickSave.mg_bEnabled = _pNetwork->IsServer();
|
||||
gm_mgLoad.mg_bEnabled = _pNetwork->IsServer();
|
||||
gm_mgSave.mg_bEnabled = _pNetwork->IsServer();
|
||||
gm_mgDemoRec.mg_bEnabled = TRUE;//_pNetwork->IsServer();
|
||||
extern void SetDemoStartStopRecText();
|
||||
SetDemoStartStopRecText();
|
||||
|
||||
|
||||
if (_gmRunningGameMode == GM_SINGLE_PLAYER) {
|
||||
CPlayerCharacter &pc = _pGame->gm_apcPlayers[_pGame->gm_iSinglePlayer];
|
||||
gm_mgLabel1.mg_strText.PrintF(TRANS("Player: %s"), pc.GetNameForPrinting());
|
||||
gm_mgLabel2.mg_strText = "";
|
||||
if (_gmRunningGameMode == GM_SINGLE_PLAYER) {
|
||||
CPlayerCharacter &pc = _pGame->gm_apcPlayers[_pGame->gm_iSinglePlayer];
|
||||
gm_mgLabel1.mg_strText.PrintF(TRANS("Player: %s"), pc.GetNameForPrinting());
|
||||
gm_mgLabel2.mg_strText = "";
|
||||
|
||||
} else {
|
||||
if (_pNetwork->IsServer()) {
|
||||
} else {
|
||||
if (_pNetwork->IsServer()) {
|
||||
|
||||
CTString strHost, strAddress;
|
||||
CTString strHostName;
|
||||
_pNetwork->GetHostName(strHost, strAddress);
|
||||
if (strHost == "") {
|
||||
strHostName = TRANS("<not started yet>");
|
||||
}
|
||||
else {
|
||||
strHostName = strHost + " (" + strAddress + ")";
|
||||
}
|
||||
CTString strHost, strAddress;
|
||||
CTString strHostName;
|
||||
_pNetwork->GetHostName(strHost, strAddress);
|
||||
if (strHost == "") {
|
||||
strHostName = TRANS("<not started yet>");
|
||||
}
|
||||
else {
|
||||
strHostName = strHost + " (" + strAddress + ")";
|
||||
}
|
||||
|
||||
gm_mgLabel1.mg_strText = TRANS("Address: ") + strHostName;
|
||||
gm_mgLabel2.mg_strText = "";
|
||||
gm_mgLabel1.mg_strText = TRANS("Address: ") + strHostName;
|
||||
gm_mgLabel2.mg_strText = "";
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
CTString strConfig;
|
||||
strConfig = TRANS("<not adjusted>");
|
||||
extern CTString sam_strNetworkSettings;
|
||||
if (sam_strNetworkSettings != "") {
|
||||
LoadStringVar(CTFileName(sam_strNetworkSettings).NoExt() + ".des", strConfig);
|
||||
strConfig.OnlyFirstLine();
|
||||
}
|
||||
CTString strConfig;
|
||||
strConfig = TRANS("<not adjusted>");
|
||||
extern CTString sam_strNetworkSettings;
|
||||
if (sam_strNetworkSettings != "") {
|
||||
LoadStringVar(CTFileName(sam_strNetworkSettings).NoExt() + ".des", strConfig);
|
||||
strConfig.OnlyFirstLine();
|
||||
}
|
||||
|
||||
gm_mgLabel1.mg_strText = TRANS("Connected to: ") + _pGame->gam_strJoinAddress;
|
||||
gm_mgLabel2.mg_strText = TRANS("Connection: ") + strConfig;
|
||||
}
|
||||
}
|
||||
gm_mgLabel1.mg_strText = TRANS("Connected to: ") + _pGame->gam_strJoinAddress;
|
||||
gm_mgLabel2.mg_strText = TRANS("Connection: ") + strConfig;
|
||||
}
|
||||
}
|
||||
|
||||
CGameMenu::StartMenu();
|
||||
CGameMenu::StartMenu();
|
||||
}
|
|
@ -21,91 +21,91 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CLevelsMenu::Initialize_t(void)
|
||||
{
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("CHOOSE LEVEL");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("CHOOSE LEVEL");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
for (INDEX iLabel = 0; iLabel<LEVELS_ON_SCREEN; iLabel++)
|
||||
{
|
||||
INDEX iPrev = (LEVELS_ON_SCREEN + iLabel - 1) % LEVELS_ON_SCREEN;
|
||||
INDEX iNext = (iLabel + 1) % LEVELS_ON_SCREEN;
|
||||
// initialize label gadgets
|
||||
gm_mgManualLevel[iLabel].mg_pmgUp = &gm_mgManualLevel[iPrev];
|
||||
gm_mgManualLevel[iLabel].mg_pmgDown = &gm_mgManualLevel[iNext];
|
||||
gm_mgManualLevel[iLabel].mg_boxOnScreen = BoxMediumRow(iLabel);
|
||||
gm_mgManualLevel[iLabel].mg_pActivatedFunction = NULL; // never called!
|
||||
gm_lhGadgets.AddTail(gm_mgManualLevel[iLabel].mg_lnNode);
|
||||
}
|
||||
for (INDEX iLabel = 0; iLabel<LEVELS_ON_SCREEN; iLabel++)
|
||||
{
|
||||
INDEX iPrev = (LEVELS_ON_SCREEN + iLabel - 1) % LEVELS_ON_SCREEN;
|
||||
INDEX iNext = (iLabel + 1) % LEVELS_ON_SCREEN;
|
||||
// initialize label gadgets
|
||||
gm_mgManualLevel[iLabel].mg_pmgUp = &gm_mgManualLevel[iPrev];
|
||||
gm_mgManualLevel[iLabel].mg_pmgDown = &gm_mgManualLevel[iNext];
|
||||
gm_mgManualLevel[iLabel].mg_boxOnScreen = BoxMediumRow(iLabel);
|
||||
gm_mgManualLevel[iLabel].mg_pActivatedFunction = NULL; // never called!
|
||||
gm_lhGadgets.AddTail(gm_mgManualLevel[iLabel].mg_lnNode);
|
||||
}
|
||||
|
||||
gm_lhGadgets.AddTail(gm_mgArrowUp.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgArrowDn.mg_lnNode);
|
||||
gm_mgArrowUp.mg_adDirection = AD_UP;
|
||||
gm_mgArrowDn.mg_adDirection = AD_DOWN;
|
||||
gm_mgArrowUp.mg_boxOnScreen = BoxArrow(AD_UP);
|
||||
gm_mgArrowDn.mg_boxOnScreen = BoxArrow(AD_DOWN);
|
||||
gm_mgArrowUp.mg_pmgRight = gm_mgArrowUp.mg_pmgDown =
|
||||
&gm_mgManualLevel[0];
|
||||
gm_mgArrowDn.mg_pmgRight = gm_mgArrowDn.mg_pmgUp =
|
||||
&gm_mgManualLevel[LEVELS_ON_SCREEN - 1];
|
||||
gm_lhGadgets.AddTail(gm_mgArrowUp.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgArrowDn.mg_lnNode);
|
||||
gm_mgArrowUp.mg_adDirection = AD_UP;
|
||||
gm_mgArrowDn.mg_adDirection = AD_DOWN;
|
||||
gm_mgArrowUp.mg_boxOnScreen = BoxArrow(AD_UP);
|
||||
gm_mgArrowDn.mg_boxOnScreen = BoxArrow(AD_DOWN);
|
||||
gm_mgArrowUp.mg_pmgRight = gm_mgArrowUp.mg_pmgDown =
|
||||
&gm_mgManualLevel[0];
|
||||
gm_mgArrowDn.mg_pmgRight = gm_mgArrowDn.mg_pmgUp =
|
||||
&gm_mgManualLevel[LEVELS_ON_SCREEN - 1];
|
||||
|
||||
gm_ctListVisible = LEVELS_ON_SCREEN;
|
||||
gm_pmgArrowUp = &gm_mgArrowUp;
|
||||
gm_pmgArrowDn = &gm_mgArrowDn;
|
||||
gm_pmgListTop = &gm_mgManualLevel[0];
|
||||
gm_pmgListBottom = &gm_mgManualLevel[LEVELS_ON_SCREEN - 1];
|
||||
gm_ctListVisible = LEVELS_ON_SCREEN;
|
||||
gm_pmgArrowUp = &gm_mgArrowUp;
|
||||
gm_pmgArrowDn = &gm_mgArrowDn;
|
||||
gm_pmgListTop = &gm_mgManualLevel[0];
|
||||
gm_pmgListBottom = &gm_mgManualLevel[LEVELS_ON_SCREEN - 1];
|
||||
}
|
||||
|
||||
void CLevelsMenu::FillListItems(void)
|
||||
{
|
||||
// disable all items first
|
||||
for (INDEX i = 0; i<LEVELS_ON_SCREEN; i++) {
|
||||
gm_mgManualLevel[i].mg_bEnabled = FALSE;
|
||||
gm_mgManualLevel[i].mg_strText = TRANS("<empty>");
|
||||
gm_mgManualLevel[i].mg_iInList = -2;
|
||||
}
|
||||
// disable all items first
|
||||
for (INDEX i = 0; i<LEVELS_ON_SCREEN; i++) {
|
||||
gm_mgManualLevel[i].mg_bEnabled = FALSE;
|
||||
gm_mgManualLevel[i].mg_strText = TRANS("<empty>");
|
||||
gm_mgManualLevel[i].mg_iInList = -2;
|
||||
}
|
||||
|
||||
BOOL bHasFirst = FALSE;
|
||||
BOOL bHasLast = FALSE;
|
||||
INDEX ctLabels = _lhFilteredLevels.Count();
|
||||
INDEX iLabel = 0;
|
||||
FOREACHINLIST(CLevelInfo, li_lnNode, _lhFilteredLevels, itli) {
|
||||
CLevelInfo &li = *itli;
|
||||
INDEX iInMenu = iLabel - gm_iListOffset;
|
||||
if ((iLabel >= gm_iListOffset) &&
|
||||
(iLabel<(gm_iListOffset + LEVELS_ON_SCREEN)))
|
||||
{
|
||||
bHasFirst |= (iLabel == 0);
|
||||
bHasLast |= (iLabel == ctLabels - 1);
|
||||
gm_mgManualLevel[iInMenu].mg_strText = li.li_strName;
|
||||
gm_mgManualLevel[iInMenu].mg_fnmLevel = li.li_fnLevel;
|
||||
gm_mgManualLevel[iInMenu].mg_bEnabled = TRUE;
|
||||
gm_mgManualLevel[iInMenu].mg_iInList = iLabel;
|
||||
}
|
||||
iLabel++;
|
||||
}
|
||||
BOOL bHasFirst = FALSE;
|
||||
BOOL bHasLast = FALSE;
|
||||
INDEX ctLabels = _lhFilteredLevels.Count();
|
||||
INDEX iLabel = 0;
|
||||
FOREACHINLIST(CLevelInfo, li_lnNode, _lhFilteredLevels, itli) {
|
||||
CLevelInfo &li = *itli;
|
||||
INDEX iInMenu = iLabel - gm_iListOffset;
|
||||
if ((iLabel >= gm_iListOffset) &&
|
||||
(iLabel<(gm_iListOffset + LEVELS_ON_SCREEN)))
|
||||
{
|
||||
bHasFirst |= (iLabel == 0);
|
||||
bHasLast |= (iLabel == ctLabels - 1);
|
||||
gm_mgManualLevel[iInMenu].mg_strText = li.li_strName;
|
||||
gm_mgManualLevel[iInMenu].mg_fnmLevel = li.li_fnLevel;
|
||||
gm_mgManualLevel[iInMenu].mg_bEnabled = TRUE;
|
||||
gm_mgManualLevel[iInMenu].mg_iInList = iLabel;
|
||||
}
|
||||
iLabel++;
|
||||
}
|
||||
|
||||
// enable/disable up/down arrows
|
||||
gm_mgArrowUp.mg_bEnabled = !bHasFirst && ctLabels>0;
|
||||
gm_mgArrowDn.mg_bEnabled = !bHasLast && ctLabels>0;
|
||||
// enable/disable up/down arrows
|
||||
gm_mgArrowUp.mg_bEnabled = !bHasFirst && ctLabels>0;
|
||||
gm_mgArrowDn.mg_bEnabled = !bHasLast && ctLabels>0;
|
||||
}
|
||||
|
||||
void CLevelsMenu::StartMenu(void)
|
||||
{
|
||||
// set default parameters for the list
|
||||
gm_iListOffset = 0;
|
||||
gm_ctListTotal = _lhFilteredLevels.Count();
|
||||
gm_iListWantedItem = 0;
|
||||
// for each level
|
||||
INDEX i = 0;
|
||||
FOREACHINLIST(CLevelInfo, li_lnNode, _lhFilteredLevels, itlid) {
|
||||
CLevelInfo &lid = *itlid;
|
||||
// if it is the chosen one
|
||||
if (lid.li_fnLevel == _pGame->gam_strCustomLevel) {
|
||||
// demand focus on it
|
||||
gm_iListWantedItem = i;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
CGameMenu::StartMenu();
|
||||
// set default parameters for the list
|
||||
gm_iListOffset = 0;
|
||||
gm_ctListTotal = _lhFilteredLevels.Count();
|
||||
gm_iListWantedItem = 0;
|
||||
// for each level
|
||||
INDEX i = 0;
|
||||
FOREACHINLIST(CLevelInfo, li_lnNode, _lhFilteredLevels, itlid) {
|
||||
CLevelInfo &lid = *itlid;
|
||||
// if it is the chosen one
|
||||
if (lid.li_fnLevel == _pGame->gam_strCustomLevel) {
|
||||
// demand focus on it
|
||||
gm_iListWantedItem = i;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
CGameMenu::StartMenu();
|
||||
}
|
|
@ -21,215 +21,215 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CLoadSaveMenu::Initialize_t(void)
|
||||
{
|
||||
gm_pgmNextMenu = NULL;
|
||||
gm_pgmNextMenu = NULL;
|
||||
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgNotes.mg_boxOnScreen = BoxMediumRow(10.0);
|
||||
gm_mgNotes.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNotes.mg_iCenterI = -1;
|
||||
gm_mgNotes.mg_bEnabled = FALSE;
|
||||
gm_mgNotes.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgNotes.mg_lnNode);
|
||||
gm_mgNotes.mg_boxOnScreen = BoxMediumRow(10.0);
|
||||
gm_mgNotes.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNotes.mg_iCenterI = -1;
|
||||
gm_mgNotes.mg_bEnabled = FALSE;
|
||||
gm_mgNotes.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgNotes.mg_lnNode);
|
||||
|
||||
for (INDEX iLabel = 0; iLabel<SAVELOAD_BUTTONS_CT; iLabel++)
|
||||
{
|
||||
INDEX iPrev = (SAVELOAD_BUTTONS_CT + iLabel - 1) % SAVELOAD_BUTTONS_CT;
|
||||
INDEX iNext = (iLabel + 1) % SAVELOAD_BUTTONS_CT;
|
||||
// initialize label gadgets
|
||||
gm_amgButton[iLabel].mg_pmgUp = &gm_amgButton[iPrev];
|
||||
gm_amgButton[iLabel].mg_pmgDown = &gm_amgButton[iNext];
|
||||
gm_amgButton[iLabel].mg_boxOnScreen = BoxSaveLoad(iLabel);
|
||||
gm_amgButton[iLabel].mg_pActivatedFunction = NULL; // never called!
|
||||
gm_amgButton[iLabel].mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_amgButton[iLabel].mg_lnNode);
|
||||
}
|
||||
for (INDEX iLabel = 0; iLabel<SAVELOAD_BUTTONS_CT; iLabel++)
|
||||
{
|
||||
INDEX iPrev = (SAVELOAD_BUTTONS_CT + iLabel - 1) % SAVELOAD_BUTTONS_CT;
|
||||
INDEX iNext = (iLabel + 1) % SAVELOAD_BUTTONS_CT;
|
||||
// initialize label gadgets
|
||||
gm_amgButton[iLabel].mg_pmgUp = &gm_amgButton[iPrev];
|
||||
gm_amgButton[iLabel].mg_pmgDown = &gm_amgButton[iNext];
|
||||
gm_amgButton[iLabel].mg_boxOnScreen = BoxSaveLoad(iLabel);
|
||||
gm_amgButton[iLabel].mg_pActivatedFunction = NULL; // never called!
|
||||
gm_amgButton[iLabel].mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_amgButton[iLabel].mg_lnNode);
|
||||
}
|
||||
|
||||
gm_lhGadgets.AddTail(gm_mgArrowUp.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgArrowDn.mg_lnNode);
|
||||
gm_mgArrowUp.mg_adDirection = AD_UP;
|
||||
gm_mgArrowDn.mg_adDirection = AD_DOWN;
|
||||
gm_mgArrowUp.mg_boxOnScreen = BoxArrow(AD_UP);
|
||||
gm_mgArrowDn.mg_boxOnScreen = BoxArrow(AD_DOWN);
|
||||
gm_mgArrowUp.mg_pmgRight = gm_mgArrowUp.mg_pmgDown = &gm_amgButton[0];
|
||||
gm_mgArrowDn.mg_pmgRight = gm_mgArrowDn.mg_pmgUp = &gm_amgButton[SAVELOAD_BUTTONS_CT - 1];
|
||||
gm_lhGadgets.AddTail(gm_mgArrowUp.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgArrowDn.mg_lnNode);
|
||||
gm_mgArrowUp.mg_adDirection = AD_UP;
|
||||
gm_mgArrowDn.mg_adDirection = AD_DOWN;
|
||||
gm_mgArrowUp.mg_boxOnScreen = BoxArrow(AD_UP);
|
||||
gm_mgArrowDn.mg_boxOnScreen = BoxArrow(AD_DOWN);
|
||||
gm_mgArrowUp.mg_pmgRight = gm_mgArrowUp.mg_pmgDown = &gm_amgButton[0];
|
||||
gm_mgArrowDn.mg_pmgRight = gm_mgArrowDn.mg_pmgUp = &gm_amgButton[SAVELOAD_BUTTONS_CT - 1];
|
||||
|
||||
gm_ctListVisible = SAVELOAD_BUTTONS_CT;
|
||||
gm_pmgArrowUp = &gm_mgArrowUp;
|
||||
gm_pmgArrowDn = &gm_mgArrowDn;
|
||||
gm_pmgListTop = &gm_amgButton[0];
|
||||
gm_pmgListBottom = &gm_amgButton[SAVELOAD_BUTTONS_CT - 1];
|
||||
gm_ctListVisible = SAVELOAD_BUTTONS_CT;
|
||||
gm_pmgArrowUp = &gm_mgArrowUp;
|
||||
gm_pmgArrowDn = &gm_mgArrowDn;
|
||||
gm_pmgListTop = &gm_amgButton[0];
|
||||
gm_pmgListBottom = &gm_amgButton[SAVELOAD_BUTTONS_CT - 1];
|
||||
}
|
||||
|
||||
void CLoadSaveMenu::StartMenu(void)
|
||||
{
|
||||
gm_bNoEscape = FALSE;
|
||||
gm_bNoEscape = FALSE;
|
||||
|
||||
// delete all file infos
|
||||
FORDELETELIST(CFileInfo, fi_lnNode, gm_lhFileInfos, itfi) {
|
||||
delete &itfi.Current();
|
||||
}
|
||||
// delete all file infos
|
||||
FORDELETELIST(CFileInfo, fi_lnNode, gm_lhFileInfos, itfi) {
|
||||
delete &itfi.Current();
|
||||
}
|
||||
|
||||
// list the directory
|
||||
CDynamicStackArray<CTFileName> afnmDir;
|
||||
MakeDirList(afnmDir, gm_fnmDirectory, "", 0);
|
||||
gm_iLastFile = -1;
|
||||
// list the directory
|
||||
CDynamicStackArray<CTFileName> afnmDir;
|
||||
MakeDirList(afnmDir, gm_fnmDirectory, "", 0);
|
||||
gm_iLastFile = -1;
|
||||
|
||||
// for each file in the directory
|
||||
for (INDEX i = 0; i<afnmDir.Count(); i++) {
|
||||
CTFileName fnm = afnmDir[i];
|
||||
// for each file in the directory
|
||||
for (INDEX i = 0; i<afnmDir.Count(); i++) {
|
||||
CTFileName fnm = afnmDir[i];
|
||||
|
||||
// if it can be parsed
|
||||
CTString strName;
|
||||
if (ParseFile(fnm, strName)) {
|
||||
// create new info for that file
|
||||
CFileInfo *pfi = new CFileInfo;
|
||||
pfi->fi_fnFile = fnm;
|
||||
pfi->fi_strName = strName;
|
||||
// add it to list
|
||||
gm_lhFileInfos.AddTail(pfi->fi_lnNode);
|
||||
}
|
||||
}
|
||||
// if it can be parsed
|
||||
CTString strName;
|
||||
if (ParseFile(fnm, strName)) {
|
||||
// create new info for that file
|
||||
CFileInfo *pfi = new CFileInfo;
|
||||
pfi->fi_fnFile = fnm;
|
||||
pfi->fi_strName = strName;
|
||||
// add it to list
|
||||
gm_lhFileInfos.AddTail(pfi->fi_lnNode);
|
||||
}
|
||||
}
|
||||
|
||||
// sort if needed
|
||||
switch (gm_iSortType) {
|
||||
default: ASSERT(FALSE);
|
||||
case LSSORT_NONE: break;
|
||||
case LSSORT_NAMEUP:
|
||||
gm_lhFileInfos.Sort(qsort_CompareFileInfos_NameUp, offsetof(CFileInfo, fi_lnNode));
|
||||
break;
|
||||
case LSSORT_NAMEDN:
|
||||
gm_lhFileInfos.Sort(qsort_CompareFileInfos_NameDn, offsetof(CFileInfo, fi_lnNode));
|
||||
break;
|
||||
case LSSORT_FILEUP:
|
||||
gm_lhFileInfos.Sort(qsort_CompareFileInfos_FileUp, offsetof(CFileInfo, fi_lnNode));
|
||||
break;
|
||||
case LSSORT_FILEDN:
|
||||
gm_lhFileInfos.Sort(qsort_CompareFileInfos_FileDn, offsetof(CFileInfo, fi_lnNode));
|
||||
break;
|
||||
}
|
||||
// sort if needed
|
||||
switch (gm_iSortType) {
|
||||
default: ASSERT(FALSE);
|
||||
case LSSORT_NONE: break;
|
||||
case LSSORT_NAMEUP:
|
||||
gm_lhFileInfos.Sort(qsort_CompareFileInfos_NameUp, offsetof(CFileInfo, fi_lnNode));
|
||||
break;
|
||||
case LSSORT_NAMEDN:
|
||||
gm_lhFileInfos.Sort(qsort_CompareFileInfos_NameDn, offsetof(CFileInfo, fi_lnNode));
|
||||
break;
|
||||
case LSSORT_FILEUP:
|
||||
gm_lhFileInfos.Sort(qsort_CompareFileInfos_FileUp, offsetof(CFileInfo, fi_lnNode));
|
||||
break;
|
||||
case LSSORT_FILEDN:
|
||||
gm_lhFileInfos.Sort(qsort_CompareFileInfos_FileDn, offsetof(CFileInfo, fi_lnNode));
|
||||
break;
|
||||
}
|
||||
|
||||
// if saving
|
||||
if (gm_bSave) {
|
||||
// add one info as empty slot
|
||||
CFileInfo *pfi = new CFileInfo;
|
||||
CTString strNumber;
|
||||
strNumber.PrintF("%04d", gm_iLastFile + 1);
|
||||
pfi->fi_fnFile = gm_fnmDirectory + gm_fnmBaseName + strNumber + gm_fnmExt;
|
||||
pfi->fi_strName = EMPTYSLOTSTRING;
|
||||
// add it to beginning
|
||||
gm_lhFileInfos.AddHead(pfi->fi_lnNode);
|
||||
}
|
||||
// if saving
|
||||
if (gm_bSave) {
|
||||
// add one info as empty slot
|
||||
CFileInfo *pfi = new CFileInfo;
|
||||
CTString strNumber;
|
||||
strNumber.PrintF("%04d", gm_iLastFile + 1);
|
||||
pfi->fi_fnFile = gm_fnmDirectory + gm_fnmBaseName + strNumber + gm_fnmExt;
|
||||
pfi->fi_strName = EMPTYSLOTSTRING;
|
||||
// add it to beginning
|
||||
gm_lhFileInfos.AddHead(pfi->fi_lnNode);
|
||||
}
|
||||
|
||||
// set default parameters for the list
|
||||
gm_iListOffset = 0;
|
||||
gm_ctListTotal = gm_lhFileInfos.Count();
|
||||
// set default parameters for the list
|
||||
gm_iListOffset = 0;
|
||||
gm_ctListTotal = gm_lhFileInfos.Count();
|
||||
|
||||
// find which one should be selected
|
||||
gm_iListWantedItem = 0;
|
||||
if (gm_fnmSelected != "") {
|
||||
INDEX i = 0;
|
||||
FOREACHINLIST(CFileInfo, fi_lnNode, gm_lhFileInfos, itfi) {
|
||||
CFileInfo &fi = *itfi;
|
||||
if (fi.fi_fnFile == gm_fnmSelected) {
|
||||
gm_iListWantedItem = i;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
// find which one should be selected
|
||||
gm_iListWantedItem = 0;
|
||||
if (gm_fnmSelected != "") {
|
||||
INDEX i = 0;
|
||||
FOREACHINLIST(CFileInfo, fi_lnNode, gm_lhFileInfos, itfi) {
|
||||
CFileInfo &fi = *itfi;
|
||||
if (fi.fi_fnFile == gm_fnmSelected) {
|
||||
gm_iListWantedItem = i;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
CGameMenu::StartMenu();
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void CLoadSaveMenu::EndMenu(void)
|
||||
{
|
||||
// delete all file infos
|
||||
FORDELETELIST(CFileInfo, fi_lnNode, gm_lhFileInfos, itfi) {
|
||||
delete &itfi.Current();
|
||||
}
|
||||
gm_pgmNextMenu = NULL;
|
||||
CGameMenu::EndMenu();
|
||||
// delete all file infos
|
||||
FORDELETELIST(CFileInfo, fi_lnNode, gm_lhFileInfos, itfi) {
|
||||
delete &itfi.Current();
|
||||
}
|
||||
gm_pgmNextMenu = NULL;
|
||||
CGameMenu::EndMenu();
|
||||
}
|
||||
|
||||
void CLoadSaveMenu::FillListItems(void)
|
||||
{
|
||||
// disable all items first
|
||||
for (INDEX i = 0; i<SAVELOAD_BUTTONS_CT; i++) {
|
||||
gm_amgButton[i].mg_bEnabled = FALSE;
|
||||
gm_amgButton[i].mg_strText = TRANS("<empty>");
|
||||
gm_amgButton[i].mg_strTip = "";
|
||||
gm_amgButton[i].mg_iInList = -2;
|
||||
}
|
||||
// disable all items first
|
||||
for (INDEX i = 0; i<SAVELOAD_BUTTONS_CT; i++) {
|
||||
gm_amgButton[i].mg_bEnabled = FALSE;
|
||||
gm_amgButton[i].mg_strText = TRANS("<empty>");
|
||||
gm_amgButton[i].mg_strTip = "";
|
||||
gm_amgButton[i].mg_iInList = -2;
|
||||
}
|
||||
|
||||
BOOL bHasFirst = FALSE;
|
||||
BOOL bHasLast = FALSE;
|
||||
INDEX ctLabels = gm_lhFileInfos.Count();
|
||||
INDEX iLabel = 0;
|
||||
FOREACHINLIST(CFileInfo, fi_lnNode, gm_lhFileInfos, itfi) {
|
||||
CFileInfo &fi = *itfi;
|
||||
INDEX iInMenu = iLabel - gm_iListOffset;
|
||||
if ((iLabel >= gm_iListOffset) &&
|
||||
(iLabel<(gm_iListOffset + SAVELOAD_BUTTONS_CT)))
|
||||
{
|
||||
bHasFirst |= (iLabel == 0);
|
||||
bHasLast |= (iLabel == ctLabels - 1);
|
||||
gm_amgButton[iInMenu].mg_iInList = iLabel;
|
||||
gm_amgButton[iInMenu].mg_strDes = fi.fi_strName;
|
||||
gm_amgButton[iInMenu].mg_fnm = fi.fi_fnFile;
|
||||
gm_amgButton[iInMenu].mg_bEnabled = TRUE;
|
||||
gm_amgButton[iInMenu].RefreshText();
|
||||
if (gm_bSave) {
|
||||
if (!FileExistsForWriting(gm_amgButton[iInMenu].mg_fnm)) {
|
||||
gm_amgButton[iInMenu].mg_strTip = TRANS("Enter - save in new slot");
|
||||
}
|
||||
else {
|
||||
gm_amgButton[iInMenu].mg_strTip = TRANS("Enter - save here, F2 - rename, Del - delete");
|
||||
}
|
||||
}
|
||||
else if (gm_bManage) {
|
||||
gm_amgButton[iInMenu].mg_strTip = TRANS("Enter - load this, F2 - rename, Del - delete");
|
||||
}
|
||||
else {
|
||||
gm_amgButton[iInMenu].mg_strTip = TRANS("Enter - load this");
|
||||
}
|
||||
}
|
||||
iLabel++;
|
||||
}
|
||||
BOOL bHasFirst = FALSE;
|
||||
BOOL bHasLast = FALSE;
|
||||
INDEX ctLabels = gm_lhFileInfos.Count();
|
||||
INDEX iLabel = 0;
|
||||
FOREACHINLIST(CFileInfo, fi_lnNode, gm_lhFileInfos, itfi) {
|
||||
CFileInfo &fi = *itfi;
|
||||
INDEX iInMenu = iLabel - gm_iListOffset;
|
||||
if ((iLabel >= gm_iListOffset) &&
|
||||
(iLabel<(gm_iListOffset + SAVELOAD_BUTTONS_CT)))
|
||||
{
|
||||
bHasFirst |= (iLabel == 0);
|
||||
bHasLast |= (iLabel == ctLabels - 1);
|
||||
gm_amgButton[iInMenu].mg_iInList = iLabel;
|
||||
gm_amgButton[iInMenu].mg_strDes = fi.fi_strName;
|
||||
gm_amgButton[iInMenu].mg_fnm = fi.fi_fnFile;
|
||||
gm_amgButton[iInMenu].mg_bEnabled = TRUE;
|
||||
gm_amgButton[iInMenu].RefreshText();
|
||||
if (gm_bSave) {
|
||||
if (!FileExistsForWriting(gm_amgButton[iInMenu].mg_fnm)) {
|
||||
gm_amgButton[iInMenu].mg_strTip = TRANS("Enter - save in new slot");
|
||||
}
|
||||
else {
|
||||
gm_amgButton[iInMenu].mg_strTip = TRANS("Enter - save here, F2 - rename, Del - delete");
|
||||
}
|
||||
}
|
||||
else if (gm_bManage) {
|
||||
gm_amgButton[iInMenu].mg_strTip = TRANS("Enter - load this, F2 - rename, Del - delete");
|
||||
}
|
||||
else {
|
||||
gm_amgButton[iInMenu].mg_strTip = TRANS("Enter - load this");
|
||||
}
|
||||
}
|
||||
iLabel++;
|
||||
}
|
||||
|
||||
// enable/disable up/down arrows
|
||||
gm_mgArrowUp.mg_bEnabled = !bHasFirst && ctLabels>0;
|
||||
gm_mgArrowDn.mg_bEnabled = !bHasLast && ctLabels>0;
|
||||
// enable/disable up/down arrows
|
||||
gm_mgArrowUp.mg_bEnabled = !bHasFirst && ctLabels>0;
|
||||
gm_mgArrowDn.mg_bEnabled = !bHasLast && ctLabels>0;
|
||||
}
|
||||
|
||||
// called to get info of a file from directory, or to skip it
|
||||
BOOL CLoadSaveMenu::ParseFile(const CTFileName &fnm, CTString &strName)
|
||||
{
|
||||
if (fnm.FileExt() != gm_fnmExt) {
|
||||
return FALSE;
|
||||
}
|
||||
if (fnm.FileExt() != gm_fnmExt) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CTFileName fnSaveGameDescription = fnm.NoExt() + ".des";
|
||||
try {
|
||||
strName.Load_t(fnSaveGameDescription);
|
||||
} catch (char *strError) {
|
||||
(void)strError;
|
||||
strName = fnm.FileName();
|
||||
CTFileName fnSaveGameDescription = fnm.NoExt() + ".des";
|
||||
try {
|
||||
strName.Load_t(fnSaveGameDescription);
|
||||
} catch (char *strError) {
|
||||
(void)strError;
|
||||
strName = fnm.FileName();
|
||||
|
||||
if (fnm.FileExt() == ".ctl") {
|
||||
INDEX iCtl = -1;
|
||||
strName.ScanF("Controls%d", &iCtl);
|
||||
if (iCtl >= 0 && iCtl <= 7) {
|
||||
strName.PrintF(TRANS("From player: %s"), _pGame->gm_apcPlayers[iCtl].GetNameForPrinting());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fnm.FileExt() == ".ctl") {
|
||||
INDEX iCtl = -1;
|
||||
strName.ScanF("Controls%d", &iCtl);
|
||||
if (iCtl >= 0 && iCtl <= 7) {
|
||||
strName.PrintF(TRANS("From player: %s"), _pGame->gm_apcPlayers[iCtl].GetNameForPrinting());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INDEX iFile = -1;
|
||||
fnm.FileName().ScanF((const char*)(gm_fnmBaseName + "%d"), &iFile);
|
||||
INDEX iFile = -1;
|
||||
fnm.FileName().ScanF((const char*)(gm_fnmBaseName + "%d"), &iFile);
|
||||
|
||||
gm_iLastFile = Max(gm_iLastFile, iFile);
|
||||
gm_iLastFile = Max(gm_iLastFile, iFile);
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
|
@ -21,109 +21,109 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CMainMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize main menu
|
||||
/*
|
||||
gm_mgTitle.mg_strText = "SERIOUS SAM - BETA"; // nothing to see here, kazuya
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail( gm_mgTitle.mg_lnNode);
|
||||
*/
|
||||
// intialize main menu
|
||||
/*
|
||||
gm_mgTitle.mg_strText = "SERIOUS SAM - BETA"; // nothing to see here, kazuya
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail( gm_mgTitle.mg_lnNode);
|
||||
*/
|
||||
|
||||
extern CTString sam_strVersion;
|
||||
gm_mgVersionLabel.mg_strText = sam_strVersion;
|
||||
gm_mgVersionLabel.mg_boxOnScreen = BoxVersion();
|
||||
gm_mgVersionLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgVersionLabel.mg_iCenterI = +1;
|
||||
gm_mgVersionLabel.mg_bEnabled = FALSE;
|
||||
gm_mgVersionLabel.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgVersionLabel.mg_lnNode);
|
||||
extern CTString sam_strVersion;
|
||||
gm_mgVersionLabel.mg_strText = sam_strVersion;
|
||||
gm_mgVersionLabel.mg_boxOnScreen = BoxVersion();
|
||||
gm_mgVersionLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgVersionLabel.mg_iCenterI = +1;
|
||||
gm_mgVersionLabel.mg_bEnabled = FALSE;
|
||||
gm_mgVersionLabel.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgVersionLabel.mg_lnNode);
|
||||
|
||||
extern CTString sam_strModName;
|
||||
gm_mgModLabel.mg_strText = sam_strModName;
|
||||
gm_mgModLabel.mg_boxOnScreen = BoxMediumRow(-2.0f);
|
||||
gm_mgModLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgModLabel.mg_iCenterI = 0;
|
||||
gm_mgModLabel.mg_bEnabled = FALSE;
|
||||
gm_mgModLabel.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgModLabel.mg_lnNode);
|
||||
extern CTString sam_strModName;
|
||||
gm_mgModLabel.mg_strText = sam_strModName;
|
||||
gm_mgModLabel.mg_boxOnScreen = BoxMediumRow(-2.0f);
|
||||
gm_mgModLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgModLabel.mg_iCenterI = 0;
|
||||
gm_mgModLabel.mg_bEnabled = FALSE;
|
||||
gm_mgModLabel.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgModLabel.mg_lnNode);
|
||||
|
||||
gm_mgSingle.mg_strText = TRANS("SINGLE PLAYER");
|
||||
gm_mgSingle.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgSingle.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
gm_mgSingle.mg_strTip = TRANS("single player game menus");
|
||||
gm_lhGadgets.AddTail(gm_mgSingle.mg_lnNode);
|
||||
gm_mgSingle.mg_pmgUp = &gm_mgQuit;
|
||||
gm_mgSingle.mg_pmgDown = &gm_mgNetwork;
|
||||
gm_mgSingle.mg_pActivatedFunction = NULL;
|
||||
gm_mgSingle.mg_strText = TRANS("SINGLE PLAYER");
|
||||
gm_mgSingle.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgSingle.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
gm_mgSingle.mg_strTip = TRANS("single player game menus");
|
||||
gm_lhGadgets.AddTail(gm_mgSingle.mg_lnNode);
|
||||
gm_mgSingle.mg_pmgUp = &gm_mgQuit;
|
||||
gm_mgSingle.mg_pmgDown = &gm_mgNetwork;
|
||||
gm_mgSingle.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgNetwork.mg_strText = TRANS("NETWORK");
|
||||
gm_mgNetwork.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgNetwork.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgNetwork.mg_strTip = TRANS("LAN/iNet multiplayer menus");
|
||||
gm_lhGadgets.AddTail(gm_mgNetwork.mg_lnNode);
|
||||
gm_mgNetwork.mg_pmgUp = &gm_mgSingle;
|
||||
gm_mgNetwork.mg_pmgDown = &gm_mgSplitScreen;
|
||||
gm_mgNetwork.mg_pActivatedFunction = NULL;
|
||||
gm_mgNetwork.mg_strText = TRANS("NETWORK");
|
||||
gm_mgNetwork.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgNetwork.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgNetwork.mg_strTip = TRANS("LAN/iNet multiplayer menus");
|
||||
gm_lhGadgets.AddTail(gm_mgNetwork.mg_lnNode);
|
||||
gm_mgNetwork.mg_pmgUp = &gm_mgSingle;
|
||||
gm_mgNetwork.mg_pmgDown = &gm_mgSplitScreen;
|
||||
gm_mgNetwork.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgSplitScreen.mg_strText = TRANS("SPLIT SCREEN");
|
||||
gm_mgSplitScreen.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgSplitScreen.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgSplitScreen.mg_strTip = TRANS("play with multiple players on one computer");
|
||||
gm_lhGadgets.AddTail(gm_mgSplitScreen.mg_lnNode);
|
||||
gm_mgSplitScreen.mg_pmgUp = &gm_mgNetwork;
|
||||
gm_mgSplitScreen.mg_pmgDown = &gm_mgDemo;
|
||||
gm_mgSplitScreen.mg_pActivatedFunction = NULL;
|
||||
gm_mgSplitScreen.mg_strText = TRANS("SPLIT SCREEN");
|
||||
gm_mgSplitScreen.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgSplitScreen.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgSplitScreen.mg_strTip = TRANS("play with multiple players on one computer");
|
||||
gm_lhGadgets.AddTail(gm_mgSplitScreen.mg_lnNode);
|
||||
gm_mgSplitScreen.mg_pmgUp = &gm_mgNetwork;
|
||||
gm_mgSplitScreen.mg_pmgDown = &gm_mgDemo;
|
||||
gm_mgSplitScreen.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgDemo.mg_strText = TRANS("DEMO");
|
||||
gm_mgDemo.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgDemo.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgDemo.mg_strTip = TRANS("play a game demo");
|
||||
gm_lhGadgets.AddTail(gm_mgDemo.mg_lnNode);
|
||||
gm_mgDemo.mg_pmgUp = &gm_mgSplitScreen;
|
||||
gm_mgDemo.mg_pmgDown = &gm_mgMods;
|
||||
gm_mgDemo.mg_pActivatedFunction = NULL;
|
||||
gm_mgDemo.mg_strText = TRANS("DEMO");
|
||||
gm_mgDemo.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgDemo.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgDemo.mg_strTip = TRANS("play a game demo");
|
||||
gm_lhGadgets.AddTail(gm_mgDemo.mg_lnNode);
|
||||
gm_mgDemo.mg_pmgUp = &gm_mgSplitScreen;
|
||||
gm_mgDemo.mg_pmgDown = &gm_mgMods;
|
||||
gm_mgDemo.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgMods.mg_strText = TRANS("MODS");
|
||||
gm_mgMods.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgMods.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgMods.mg_strTip = TRANS("run one of installed game modifications");
|
||||
gm_lhGadgets.AddTail(gm_mgMods.mg_lnNode);
|
||||
gm_mgMods.mg_pmgUp = &gm_mgDemo;
|
||||
gm_mgMods.mg_pmgDown = &gm_mgHighScore;
|
||||
gm_mgMods.mg_pActivatedFunction = NULL;
|
||||
gm_mgMods.mg_strText = TRANS("MODS");
|
||||
gm_mgMods.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgMods.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgMods.mg_strTip = TRANS("run one of installed game modifications");
|
||||
gm_lhGadgets.AddTail(gm_mgMods.mg_lnNode);
|
||||
gm_mgMods.mg_pmgUp = &gm_mgDemo;
|
||||
gm_mgMods.mg_pmgDown = &gm_mgHighScore;
|
||||
gm_mgMods.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgHighScore.mg_strText = TRANS("HIGH SCORES");
|
||||
gm_mgHighScore.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgHighScore.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgHighScore.mg_strTip = TRANS("view list of top ten best scores");
|
||||
gm_lhGadgets.AddTail(gm_mgHighScore.mg_lnNode);
|
||||
gm_mgHighScore.mg_pmgUp = &gm_mgMods;
|
||||
gm_mgHighScore.mg_pmgDown = &gm_mgOptions;
|
||||
gm_mgHighScore.mg_pActivatedFunction = NULL;
|
||||
gm_mgHighScore.mg_strText = TRANS("HIGH SCORES");
|
||||
gm_mgHighScore.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgHighScore.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgHighScore.mg_strTip = TRANS("view list of top ten best scores");
|
||||
gm_lhGadgets.AddTail(gm_mgHighScore.mg_lnNode);
|
||||
gm_mgHighScore.mg_pmgUp = &gm_mgMods;
|
||||
gm_mgHighScore.mg_pmgDown = &gm_mgOptions;
|
||||
gm_mgHighScore.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgOptions.mg_strText = TRANS("OPTIONS");
|
||||
gm_mgOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgOptions.mg_boxOnScreen = BoxBigRow(6.0f);
|
||||
gm_mgOptions.mg_strTip = TRANS("adjust video, audio and input options");
|
||||
gm_lhGadgets.AddTail(gm_mgOptions.mg_lnNode);
|
||||
gm_mgOptions.mg_pmgUp = &gm_mgHighScore;
|
||||
gm_mgOptions.mg_pmgDown = &gm_mgQuit;
|
||||
gm_mgOptions.mg_pActivatedFunction = NULL;
|
||||
gm_mgOptions.mg_strText = TRANS("OPTIONS");
|
||||
gm_mgOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgOptions.mg_boxOnScreen = BoxBigRow(6.0f);
|
||||
gm_mgOptions.mg_strTip = TRANS("adjust video, audio and input options");
|
||||
gm_lhGadgets.AddTail(gm_mgOptions.mg_lnNode);
|
||||
gm_mgOptions.mg_pmgUp = &gm_mgHighScore;
|
||||
gm_mgOptions.mg_pmgDown = &gm_mgQuit;
|
||||
gm_mgOptions.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgQuit.mg_strText = TRANS("QUIT");
|
||||
gm_mgQuit.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuit.mg_boxOnScreen = BoxBigRow(7.0f);
|
||||
gm_mgQuit.mg_strTip = TRANS("exit game immediately");
|
||||
gm_lhGadgets.AddTail(gm_mgQuit.mg_lnNode);
|
||||
gm_mgQuit.mg_pmgUp = &gm_mgOptions;
|
||||
gm_mgQuit.mg_pmgDown = &gm_mgSingle;
|
||||
gm_mgQuit.mg_pActivatedFunction = NULL;
|
||||
gm_mgQuit.mg_strText = TRANS("QUIT");
|
||||
gm_mgQuit.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuit.mg_boxOnScreen = BoxBigRow(7.0f);
|
||||
gm_mgQuit.mg_strTip = TRANS("exit game immediately");
|
||||
gm_lhGadgets.AddTail(gm_mgQuit.mg_lnNode);
|
||||
gm_mgQuit.mg_pmgUp = &gm_mgOptions;
|
||||
gm_mgQuit.mg_pmgDown = &gm_mgSingle;
|
||||
gm_mgQuit.mg_pActivatedFunction = NULL;
|
||||
}
|
||||
|
||||
void CMainMenu::StartMenu(void)
|
||||
{
|
||||
gm_mgSingle.mg_bEnabled = IsMenuEnabled("Single Player");
|
||||
gm_mgNetwork.mg_bEnabled = IsMenuEnabled("Network");
|
||||
gm_mgSplitScreen.mg_bEnabled = IsMenuEnabled("Split Screen");
|
||||
gm_mgHighScore.mg_bEnabled = IsMenuEnabled("High Score");
|
||||
CGameMenu::StartMenu();
|
||||
gm_mgSingle.mg_bEnabled = IsMenuEnabled("Single Player");
|
||||
gm_mgNetwork.mg_bEnabled = IsMenuEnabled("Network");
|
||||
gm_mgSplitScreen.mg_bEnabled = IsMenuEnabled("Split Screen");
|
||||
gm_mgHighScore.mg_bEnabled = IsMenuEnabled("High Score");
|
||||
CGameMenu::StartMenu();
|
||||
}
|
|
@ -20,49 +20,49 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
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);
|
||||
// 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_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_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_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;
|
||||
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();
|
||||
CGameMenu::StartMenu();
|
||||
}
|
|
@ -21,35 +21,35 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CNetworkJoinMenu::Initialize_t(void)
|
||||
{
|
||||
// title
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("JOIN GAME");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// title
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("JOIN GAME");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgLAN.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgLAN.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgLAN.mg_pmgUp = &gm_mgOpen;
|
||||
gm_mgLAN.mg_pmgDown = &gm_mgNET;
|
||||
gm_mgLAN.mg_strText = TRANS("SEARCH LAN");
|
||||
gm_mgLAN.mg_strTip = TRANS("search local network for servers");
|
||||
gm_lhGadgets.AddTail(gm_mgLAN.mg_lnNode);
|
||||
gm_mgLAN.mg_pActivatedFunction = NULL;
|
||||
gm_mgLAN.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgLAN.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgLAN.mg_pmgUp = &gm_mgOpen;
|
||||
gm_mgLAN.mg_pmgDown = &gm_mgNET;
|
||||
gm_mgLAN.mg_strText = TRANS("SEARCH LAN");
|
||||
gm_mgLAN.mg_strTip = TRANS("search local network for servers");
|
||||
gm_lhGadgets.AddTail(gm_mgLAN.mg_lnNode);
|
||||
gm_mgLAN.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgNET.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgNET.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgNET.mg_pmgUp = &gm_mgLAN;
|
||||
gm_mgNET.mg_pmgDown = &gm_mgOpen;
|
||||
gm_mgNET.mg_strText = TRANS("SEARCH INTERNET");
|
||||
gm_mgNET.mg_strTip = TRANS("search internet for servers");
|
||||
gm_lhGadgets.AddTail(gm_mgNET.mg_lnNode);
|
||||
gm_mgNET.mg_pActivatedFunction = NULL;
|
||||
gm_mgNET.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgNET.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgNET.mg_pmgUp = &gm_mgLAN;
|
||||
gm_mgNET.mg_pmgDown = &gm_mgOpen;
|
||||
gm_mgNET.mg_strText = TRANS("SEARCH INTERNET");
|
||||
gm_mgNET.mg_strTip = TRANS("search internet for servers");
|
||||
gm_lhGadgets.AddTail(gm_mgNET.mg_lnNode);
|
||||
gm_mgNET.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgOpen.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgOpen.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgOpen.mg_pmgUp = &gm_mgNET;
|
||||
gm_mgOpen.mg_pmgDown = &gm_mgLAN;
|
||||
gm_mgOpen.mg_strText = TRANS("SPECIFY SERVER");
|
||||
gm_mgOpen.mg_strTip = TRANS("type in server address to connect to");
|
||||
gm_lhGadgets.AddTail(gm_mgOpen.mg_lnNode);
|
||||
gm_mgOpen.mg_pActivatedFunction = NULL;
|
||||
gm_mgOpen.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgOpen.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgOpen.mg_pmgUp = &gm_mgNET;
|
||||
gm_mgOpen.mg_pmgDown = &gm_mgLAN;
|
||||
gm_mgOpen.mg_strText = TRANS("SPECIFY SERVER");
|
||||
gm_mgOpen.mg_strTip = TRANS("type in server address to connect to");
|
||||
gm_lhGadgets.AddTail(gm_mgOpen.mg_lnNode);
|
||||
gm_mgOpen.mg_pActivatedFunction = NULL;
|
||||
}
|
|
@ -21,58 +21,58 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CNetworkOpenMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize network join menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("JOIN");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// intialize network join menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("JOIN");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgAddressLabel.mg_strText = TRANS("Address:");
|
||||
gm_mgAddressLabel.mg_boxOnScreen = BoxMediumLeft(1);
|
||||
gm_mgAddressLabel.mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_mgAddressLabel.mg_lnNode);
|
||||
gm_mgAddressLabel.mg_strText = TRANS("Address:");
|
||||
gm_mgAddressLabel.mg_boxOnScreen = BoxMediumLeft(1);
|
||||
gm_mgAddressLabel.mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_mgAddressLabel.mg_lnNode);
|
||||
|
||||
gm_mgAddress.mg_strText = _pGame->gam_strJoinAddress;
|
||||
gm_mgAddress.mg_ctMaxStringLen = 20;
|
||||
gm_mgAddress.mg_pstrToChange = &_pGame->gam_strJoinAddress;
|
||||
gm_mgAddress.mg_boxOnScreen = BoxMediumMiddle(1);
|
||||
gm_mgAddress.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgAddress.mg_iCenterI = -1;
|
||||
gm_mgAddress.mg_pmgUp = &gm_mgJoin;
|
||||
gm_mgAddress.mg_pmgDown = &gm_mgPort;
|
||||
gm_mgAddress.mg_strTip = TRANS("specify server address");
|
||||
gm_lhGadgets.AddTail(gm_mgAddress.mg_lnNode);
|
||||
gm_mgAddress.mg_strText = _pGame->gam_strJoinAddress;
|
||||
gm_mgAddress.mg_ctMaxStringLen = 20;
|
||||
gm_mgAddress.mg_pstrToChange = &_pGame->gam_strJoinAddress;
|
||||
gm_mgAddress.mg_boxOnScreen = BoxMediumMiddle(1);
|
||||
gm_mgAddress.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgAddress.mg_iCenterI = -1;
|
||||
gm_mgAddress.mg_pmgUp = &gm_mgJoin;
|
||||
gm_mgAddress.mg_pmgDown = &gm_mgPort;
|
||||
gm_mgAddress.mg_strTip = TRANS("specify server address");
|
||||
gm_lhGadgets.AddTail(gm_mgAddress.mg_lnNode);
|
||||
|
||||
gm_mgPortLabel.mg_strText = TRANS("Port:");
|
||||
gm_mgPortLabel.mg_boxOnScreen = BoxMediumLeft(2);
|
||||
gm_mgPortLabel.mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_mgPortLabel.mg_lnNode);
|
||||
gm_mgPortLabel.mg_strText = TRANS("Port:");
|
||||
gm_mgPortLabel.mg_boxOnScreen = BoxMediumLeft(2);
|
||||
gm_mgPortLabel.mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_mgPortLabel.mg_lnNode);
|
||||
|
||||
gm_mgPort.mg_strText = "";
|
||||
gm_mgPort.mg_ctMaxStringLen = 10;
|
||||
gm_mgPort.mg_pstrToChange = &gm_strPort;
|
||||
gm_mgPort.mg_boxOnScreen = BoxMediumMiddle(2);
|
||||
gm_mgPort.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgPort.mg_iCenterI = -1;
|
||||
gm_mgPort.mg_pmgUp = &gm_mgAddress;
|
||||
gm_mgPort.mg_pmgDown = &gm_mgJoin;
|
||||
gm_mgPort.mg_strTip = TRANS("specify server address");
|
||||
gm_lhGadgets.AddTail(gm_mgPort.mg_lnNode);
|
||||
gm_mgPort.mg_strText = "";
|
||||
gm_mgPort.mg_ctMaxStringLen = 10;
|
||||
gm_mgPort.mg_pstrToChange = &gm_strPort;
|
||||
gm_mgPort.mg_boxOnScreen = BoxMediumMiddle(2);
|
||||
gm_mgPort.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgPort.mg_iCenterI = -1;
|
||||
gm_mgPort.mg_pmgUp = &gm_mgAddress;
|
||||
gm_mgPort.mg_pmgDown = &gm_mgJoin;
|
||||
gm_mgPort.mg_strTip = TRANS("specify server address");
|
||||
gm_lhGadgets.AddTail(gm_mgPort.mg_lnNode);
|
||||
|
||||
gm_mgJoin.mg_boxOnScreen = BoxMediumMiddle(3);
|
||||
gm_mgJoin.mg_pmgUp = &gm_mgPort;
|
||||
gm_mgJoin.mg_pmgDown = &gm_mgAddress;
|
||||
gm_mgJoin.mg_strText = TRANS("Join");
|
||||
gm_lhGadgets.AddTail(gm_mgJoin.mg_lnNode);
|
||||
gm_mgJoin.mg_pActivatedFunction = NULL;
|
||||
gm_mgJoin.mg_boxOnScreen = BoxMediumMiddle(3);
|
||||
gm_mgJoin.mg_pmgUp = &gm_mgPort;
|
||||
gm_mgJoin.mg_pmgDown = &gm_mgAddress;
|
||||
gm_mgJoin.mg_strText = TRANS("Join");
|
||||
gm_lhGadgets.AddTail(gm_mgJoin.mg_lnNode);
|
||||
gm_mgJoin.mg_pActivatedFunction = NULL;
|
||||
}
|
||||
|
||||
void CNetworkOpenMenu::StartMenu(void)
|
||||
{
|
||||
gm_strPort = _pShell->GetValue("net_iPort");
|
||||
gm_mgPort.mg_strText = gm_strPort;
|
||||
gm_strPort = _pShell->GetValue("net_iPort");
|
||||
gm_mgPort.mg_strText = gm_strPort;
|
||||
}
|
||||
|
||||
void CNetworkOpenMenu::EndMenu(void)
|
||||
{
|
||||
_pShell->SetValue("net_iPort", gm_strPort);
|
||||
_pShell->SetValue("net_iPort", gm_strPort);
|
||||
}
|
|
@ -24,123 +24,123 @@ extern void UpdateNetworkLevel(INDEX iDummy);
|
|||
|
||||
void CNetworkStartMenu::Initialize_t(void)
|
||||
{
|
||||
// title
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("START SERVER");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// title
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("START SERVER");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
// session name edit box
|
||||
gm_mgSessionName.mg_strText = _pGame->gam_strSessionName;
|
||||
gm_mgSessionName.mg_strLabel = TRANS("Session name:");
|
||||
gm_mgSessionName.mg_ctMaxStringLen = 25;
|
||||
gm_mgSessionName.mg_pstrToChange = &_pGame->gam_strSessionName;
|
||||
gm_mgSessionName.mg_boxOnScreen = BoxMediumRow(1);
|
||||
gm_mgSessionName.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgSessionName.mg_iCenterI = -1;
|
||||
gm_mgSessionName.mg_pmgUp = &gm_mgStart;
|
||||
gm_mgSessionName.mg_pmgDown = &gm_mgGameType;
|
||||
gm_mgSessionName.mg_strTip = TRANS("name the session to start");
|
||||
gm_lhGadgets.AddTail(gm_mgSessionName.mg_lnNode);
|
||||
// session name edit box
|
||||
gm_mgSessionName.mg_strText = _pGame->gam_strSessionName;
|
||||
gm_mgSessionName.mg_strLabel = TRANS("Session name:");
|
||||
gm_mgSessionName.mg_ctMaxStringLen = 25;
|
||||
gm_mgSessionName.mg_pstrToChange = &_pGame->gam_strSessionName;
|
||||
gm_mgSessionName.mg_boxOnScreen = BoxMediumRow(1);
|
||||
gm_mgSessionName.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgSessionName.mg_iCenterI = -1;
|
||||
gm_mgSessionName.mg_pmgUp = &gm_mgStart;
|
||||
gm_mgSessionName.mg_pmgDown = &gm_mgGameType;
|
||||
gm_mgSessionName.mg_strTip = TRANS("name the session to start");
|
||||
gm_lhGadgets.AddTail(gm_mgSessionName.mg_lnNode);
|
||||
|
||||
// game type trigger
|
||||
TRIGGER_MG(gm_mgGameType, 2,
|
||||
gm_mgSessionName, gm_mgDifficulty, TRANS("Game type:"), astrGameTypeRadioTexts);
|
||||
gm_mgGameType.mg_ctTexts = ctGameTypeRadioTexts;
|
||||
gm_mgGameType.mg_strTip = TRANS("choose type of multiplayer game");
|
||||
gm_mgGameType.mg_pOnTriggerChange = &UpdateNetworkLevel;
|
||||
// game type trigger
|
||||
TRIGGER_MG(gm_mgGameType, 2,
|
||||
gm_mgSessionName, gm_mgDifficulty, TRANS("Game type:"), astrGameTypeRadioTexts);
|
||||
gm_mgGameType.mg_ctTexts = ctGameTypeRadioTexts;
|
||||
gm_mgGameType.mg_strTip = TRANS("choose type of multiplayer game");
|
||||
gm_mgGameType.mg_pOnTriggerChange = &UpdateNetworkLevel;
|
||||
|
||||
// difficulty trigger
|
||||
TRIGGER_MG(gm_mgDifficulty, 3,
|
||||
gm_mgGameType, gm_mgLevel, TRANS("Difficulty:"), astrDifficultyRadioTexts);
|
||||
gm_mgDifficulty.mg_strTip = TRANS("choose difficulty level");
|
||||
// difficulty trigger
|
||||
TRIGGER_MG(gm_mgDifficulty, 3,
|
||||
gm_mgGameType, gm_mgLevel, TRANS("Difficulty:"), astrDifficultyRadioTexts);
|
||||
gm_mgDifficulty.mg_strTip = TRANS("choose difficulty level");
|
||||
|
||||
// level name
|
||||
gm_mgLevel.mg_strText = "";
|
||||
gm_mgLevel.mg_strLabel = TRANS("Level:");
|
||||
gm_mgLevel.mg_boxOnScreen = BoxMediumRow(4);
|
||||
gm_mgLevel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgLevel.mg_iCenterI = -1;
|
||||
gm_mgLevel.mg_pmgUp = &gm_mgDifficulty;
|
||||
gm_mgLevel.mg_pmgDown = &gm_mgMaxPlayers;
|
||||
gm_mgLevel.mg_strTip = TRANS("choose the level to start");
|
||||
gm_mgLevel.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgLevel.mg_lnNode);
|
||||
// level name
|
||||
gm_mgLevel.mg_strText = "";
|
||||
gm_mgLevel.mg_strLabel = TRANS("Level:");
|
||||
gm_mgLevel.mg_boxOnScreen = BoxMediumRow(4);
|
||||
gm_mgLevel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgLevel.mg_iCenterI = -1;
|
||||
gm_mgLevel.mg_pmgUp = &gm_mgDifficulty;
|
||||
gm_mgLevel.mg_pmgDown = &gm_mgMaxPlayers;
|
||||
gm_mgLevel.mg_strTip = TRANS("choose the level to start");
|
||||
gm_mgLevel.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgLevel.mg_lnNode);
|
||||
|
||||
// max players trigger
|
||||
TRIGGER_MG(gm_mgMaxPlayers, 5,
|
||||
gm_mgLevel, gm_mgWaitAllPlayers, TRANS("Max players:"), astrMaxPlayersRadioTexts);
|
||||
gm_mgMaxPlayers.mg_strTip = TRANS("choose maximum allowed number of players");
|
||||
// max players trigger
|
||||
TRIGGER_MG(gm_mgMaxPlayers, 5,
|
||||
gm_mgLevel, gm_mgWaitAllPlayers, TRANS("Max players:"), astrMaxPlayersRadioTexts);
|
||||
gm_mgMaxPlayers.mg_strTip = TRANS("choose maximum allowed number of players");
|
||||
|
||||
// wait all players trigger
|
||||
TRIGGER_MG(gm_mgWaitAllPlayers, 6,
|
||||
gm_mgMaxPlayers, gm_mgVisible, TRANS("Wait for all players:"), astrNoYes);
|
||||
gm_mgWaitAllPlayers.mg_strTip = TRANS("if on, game won't start until all players have joined");
|
||||
// wait all players trigger
|
||||
TRIGGER_MG(gm_mgWaitAllPlayers, 6,
|
||||
gm_mgMaxPlayers, gm_mgVisible, TRANS("Wait for all players:"), astrNoYes);
|
||||
gm_mgWaitAllPlayers.mg_strTip = TRANS("if on, game won't start until all players have joined");
|
||||
|
||||
// server visible trigger
|
||||
TRIGGER_MG(gm_mgVisible, 7,
|
||||
gm_mgMaxPlayers, gm_mgGameOptions, TRANS("Server visible:"), astrNoYes);
|
||||
gm_mgVisible.mg_strTip = TRANS("invisible servers are not listed, cleints have to join manually");
|
||||
// server visible trigger
|
||||
TRIGGER_MG(gm_mgVisible, 7,
|
||||
gm_mgMaxPlayers, gm_mgGameOptions, TRANS("Server visible:"), astrNoYes);
|
||||
gm_mgVisible.mg_strTip = TRANS("invisible servers are not listed, cleints have to join manually");
|
||||
|
||||
// options button
|
||||
gm_mgGameOptions.mg_strText = TRANS("Game options");
|
||||
gm_mgGameOptions.mg_boxOnScreen = BoxMediumRow(8);
|
||||
gm_mgGameOptions.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgGameOptions.mg_iCenterI = 0;
|
||||
gm_mgGameOptions.mg_pmgUp = &gm_mgVisible;
|
||||
gm_mgGameOptions.mg_pmgDown = &gm_mgStart;
|
||||
gm_mgGameOptions.mg_strTip = TRANS("adjust game rules");
|
||||
gm_mgGameOptions.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgGameOptions.mg_lnNode);
|
||||
// options button
|
||||
gm_mgGameOptions.mg_strText = TRANS("Game options");
|
||||
gm_mgGameOptions.mg_boxOnScreen = BoxMediumRow(8);
|
||||
gm_mgGameOptions.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgGameOptions.mg_iCenterI = 0;
|
||||
gm_mgGameOptions.mg_pmgUp = &gm_mgVisible;
|
||||
gm_mgGameOptions.mg_pmgDown = &gm_mgStart;
|
||||
gm_mgGameOptions.mg_strTip = TRANS("adjust game rules");
|
||||
gm_mgGameOptions.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgGameOptions.mg_lnNode);
|
||||
|
||||
// start button
|
||||
gm_mgStart.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgStart.mg_boxOnScreen = BoxBigRow(7);
|
||||
gm_mgStart.mg_pmgUp = &gm_mgGameOptions;
|
||||
gm_mgStart.mg_pmgDown = &gm_mgSessionName;
|
||||
gm_mgStart.mg_strText = TRANS("START");
|
||||
gm_lhGadgets.AddTail(gm_mgStart.mg_lnNode);
|
||||
gm_mgStart.mg_pActivatedFunction = NULL;
|
||||
// start button
|
||||
gm_mgStart.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgStart.mg_boxOnScreen = BoxBigRow(7);
|
||||
gm_mgStart.mg_pmgUp = &gm_mgGameOptions;
|
||||
gm_mgStart.mg_pmgDown = &gm_mgSessionName;
|
||||
gm_mgStart.mg_strText = TRANS("START");
|
||||
gm_lhGadgets.AddTail(gm_mgStart.mg_lnNode);
|
||||
gm_mgStart.mg_pActivatedFunction = NULL;
|
||||
}
|
||||
|
||||
void CNetworkStartMenu::StartMenu(void)
|
||||
{
|
||||
extern INDEX sam_bMentalActivated;
|
||||
gm_mgDifficulty.mg_ctTexts = sam_bMentalActivated ? 6 : 5;
|
||||
extern INDEX sam_bMentalActivated;
|
||||
gm_mgDifficulty.mg_ctTexts = sam_bMentalActivated ? 6 : 5;
|
||||
|
||||
gm_mgGameType.mg_iSelected = Clamp(_pShell->GetINDEX("gam_iStartMode"), 0L, ctGameTypeRadioTexts - 1L);
|
||||
gm_mgGameType.ApplyCurrentSelection();
|
||||
gm_mgDifficulty.mg_iSelected = _pShell->GetINDEX("gam_iStartDifficulty") + 1;
|
||||
gm_mgDifficulty.ApplyCurrentSelection();
|
||||
gm_mgGameType.mg_iSelected = Clamp(_pShell->GetINDEX("gam_iStartMode"), 0L, ctGameTypeRadioTexts - 1L);
|
||||
gm_mgGameType.ApplyCurrentSelection();
|
||||
gm_mgDifficulty.mg_iSelected = _pShell->GetINDEX("gam_iStartDifficulty") + 1;
|
||||
gm_mgDifficulty.ApplyCurrentSelection();
|
||||
|
||||
_pShell->SetINDEX("gam_iStartMode", CSessionProperties::GM_COOPERATIVE);
|
||||
_pShell->SetINDEX("gam_iStartMode", CSessionProperties::GM_COOPERATIVE);
|
||||
|
||||
INDEX ctMaxPlayers = _pShell->GetINDEX("gam_ctMaxPlayers");
|
||||
if (ctMaxPlayers<2 || ctMaxPlayers>16) {
|
||||
ctMaxPlayers = 2;
|
||||
_pShell->SetINDEX("gam_ctMaxPlayers", ctMaxPlayers);
|
||||
}
|
||||
INDEX ctMaxPlayers = _pShell->GetINDEX("gam_ctMaxPlayers");
|
||||
if (ctMaxPlayers<2 || ctMaxPlayers>16) {
|
||||
ctMaxPlayers = 2;
|
||||
_pShell->SetINDEX("gam_ctMaxPlayers", ctMaxPlayers);
|
||||
}
|
||||
|
||||
gm_mgMaxPlayers.mg_iSelected = ctMaxPlayers - 2;
|
||||
gm_mgMaxPlayers.ApplyCurrentSelection();
|
||||
gm_mgMaxPlayers.mg_iSelected = ctMaxPlayers - 2;
|
||||
gm_mgMaxPlayers.ApplyCurrentSelection();
|
||||
|
||||
gm_mgWaitAllPlayers.mg_iSelected = Clamp(_pShell->GetINDEX("gam_bWaitAllPlayers"), 0L, 1L);
|
||||
gm_mgWaitAllPlayers.ApplyCurrentSelection();
|
||||
gm_mgWaitAllPlayers.mg_iSelected = Clamp(_pShell->GetINDEX("gam_bWaitAllPlayers"), 0L, 1L);
|
||||
gm_mgWaitAllPlayers.ApplyCurrentSelection();
|
||||
|
||||
gm_mgVisible.mg_iSelected = _pShell->GetINDEX("ser_bEnumeration");
|
||||
gm_mgVisible.ApplyCurrentSelection();
|
||||
gm_mgVisible.mg_iSelected = _pShell->GetINDEX("ser_bEnumeration");
|
||||
gm_mgVisible.ApplyCurrentSelection();
|
||||
|
||||
UpdateNetworkLevel(0);
|
||||
UpdateNetworkLevel(0);
|
||||
|
||||
CGameMenu::StartMenu();
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void CNetworkStartMenu::EndMenu(void)
|
||||
{
|
||||
_pShell->SetINDEX("gam_iStartDifficulty", gm_mgDifficulty.mg_iSelected - 1);
|
||||
_pShell->SetINDEX("gam_iStartMode", gm_mgGameType.mg_iSelected);
|
||||
_pShell->SetINDEX("gam_bWaitAllPlayers", gm_mgWaitAllPlayers.mg_iSelected);
|
||||
_pShell->SetINDEX("gam_ctMaxPlayers", gm_mgMaxPlayers.mg_iSelected + 2);
|
||||
_pShell->SetINDEX("ser_bEnumeration", gm_mgVisible.mg_iSelected);
|
||||
_pShell->SetINDEX("gam_iStartDifficulty", gm_mgDifficulty.mg_iSelected - 1);
|
||||
_pShell->SetINDEX("gam_iStartMode", gm_mgGameType.mg_iSelected);
|
||||
_pShell->SetINDEX("gam_bWaitAllPlayers", gm_mgWaitAllPlayers.mg_iSelected);
|
||||
_pShell->SetINDEX("gam_ctMaxPlayers", gm_mgMaxPlayers.mg_iSelected + 2);
|
||||
_pShell->SetINDEX("ser_bEnumeration", gm_mgVisible.mg_iSelected);
|
||||
|
||||
CGameMenu::EndMenu();
|
||||
CGameMenu::EndMenu();
|
||||
}
|
||||
|
|
|
@ -20,62 +20,62 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
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);
|
||||
// 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_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_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_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_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_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;
|
||||
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;
|
||||
}
|
|
@ -20,18 +20,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "GUI/Menus/MenuManager.h"
|
||||
|
||||
#define ADD_SELECT_PLAYER_MG( index, mg, mgprev, mgnext, me)\
|
||||
mg.mg_iIndex = index; \
|
||||
mg.mg_bfsFontSize = BFS_MEDIUM; \
|
||||
mg.mg_boxOnScreen = BoxNoUp(index); \
|
||||
mg.mg_bRectangle = TRUE; \
|
||||
mg.mg_pmgLeft = &mgprev; \
|
||||
mg.mg_pmgRight = &mgnext; \
|
||||
mg.mg_pmgUp = &gm_mgCustomizeControls; \
|
||||
mg.mg_pmgDown = &gm_mgNameField; \
|
||||
mg.mg_pActivatedFunction = &PPOnPlayerSelect; \
|
||||
mg.mg_strText = #index; \
|
||||
mg.mg_strTip = TRANS("select new currently active player"); \
|
||||
gm_lhGadgets.AddTail(mg.mg_lnNode);
|
||||
mg.mg_iIndex = index; \
|
||||
mg.mg_bfsFontSize = BFS_MEDIUM; \
|
||||
mg.mg_boxOnScreen = BoxNoUp(index); \
|
||||
mg.mg_bRectangle = TRUE; \
|
||||
mg.mg_pmgLeft = &mgprev; \
|
||||
mg.mg_pmgRight = &mgnext; \
|
||||
mg.mg_pmgUp = &gm_mgCustomizeControls; \
|
||||
mg.mg_pmgDown = &gm_mgNameField; \
|
||||
mg.mg_pActivatedFunction = &PPOnPlayerSelect; \
|
||||
mg.mg_strText = #index; \
|
||||
mg.mg_strTip = TRANS("select new currently active player"); \
|
||||
gm_lhGadgets.AddTail(mg.mg_lnNode);
|
||||
|
||||
extern BOOL _bPlayerMenuFromSinglePlayer;
|
||||
extern CTString _strLastPlayerAppearance;
|
||||
|
@ -40,267 +40,267 @@ extern void PPOnPlayerSelect(void);
|
|||
|
||||
void CPlayerProfileMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize player and controls menu
|
||||
_bPlayerMenuFromSinglePlayer = FALSE;
|
||||
gm_mgProfileTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgProfileTitle.mg_strText = TRANS("PLAYER PROFILE");
|
||||
gm_lhGadgets.AddTail(gm_mgProfileTitle.mg_lnNode);
|
||||
// intialize player and controls menu
|
||||
_bPlayerMenuFromSinglePlayer = FALSE;
|
||||
gm_mgProfileTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgProfileTitle.mg_strText = TRANS("PLAYER PROFILE");
|
||||
gm_lhGadgets.AddTail(gm_mgProfileTitle.mg_lnNode);
|
||||
|
||||
gm_mgNoLabel.mg_strText = TRANS("PROFILE:");
|
||||
gm_mgNoLabel.mg_boxOnScreen = BoxMediumLeft(0.0f);
|
||||
gm_mgNoLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNoLabel.mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_mgNoLabel.mg_lnNode);
|
||||
gm_mgNoLabel.mg_strText = TRANS("PROFILE:");
|
||||
gm_mgNoLabel.mg_boxOnScreen = BoxMediumLeft(0.0f);
|
||||
gm_mgNoLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNoLabel.mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_mgNoLabel.mg_lnNode);
|
||||
|
||||
ADD_SELECT_PLAYER_MG(0, gm_mgNumber[0], gm_mgNumber[7], gm_mgNumber[1], gm_mgNumber[0]);
|
||||
ADD_SELECT_PLAYER_MG(1, gm_mgNumber[1], gm_mgNumber[0], gm_mgNumber[2], gm_mgNumber[1]);
|
||||
ADD_SELECT_PLAYER_MG(2, gm_mgNumber[2], gm_mgNumber[1], gm_mgNumber[3], gm_mgNumber[2]);
|
||||
ADD_SELECT_PLAYER_MG(3, gm_mgNumber[3], gm_mgNumber[2], gm_mgNumber[4], gm_mgNumber[3]);
|
||||
ADD_SELECT_PLAYER_MG(4, gm_mgNumber[4], gm_mgNumber[3], gm_mgNumber[5], gm_mgNumber[4]);
|
||||
ADD_SELECT_PLAYER_MG(5, gm_mgNumber[5], gm_mgNumber[4], gm_mgNumber[6], gm_mgNumber[5]);
|
||||
ADD_SELECT_PLAYER_MG(6, gm_mgNumber[6], gm_mgNumber[5], gm_mgNumber[7], gm_mgNumber[6]);
|
||||
ADD_SELECT_PLAYER_MG(7, gm_mgNumber[7], gm_mgNumber[6], gm_mgNumber[0], gm_mgNumber[7]);
|
||||
gm_mgNumber[7].mg_pmgRight = &gm_mgModel;
|
||||
ADD_SELECT_PLAYER_MG(0, gm_mgNumber[0], gm_mgNumber[7], gm_mgNumber[1], gm_mgNumber[0]);
|
||||
ADD_SELECT_PLAYER_MG(1, gm_mgNumber[1], gm_mgNumber[0], gm_mgNumber[2], gm_mgNumber[1]);
|
||||
ADD_SELECT_PLAYER_MG(2, gm_mgNumber[2], gm_mgNumber[1], gm_mgNumber[3], gm_mgNumber[2]);
|
||||
ADD_SELECT_PLAYER_MG(3, gm_mgNumber[3], gm_mgNumber[2], gm_mgNumber[4], gm_mgNumber[3]);
|
||||
ADD_SELECT_PLAYER_MG(4, gm_mgNumber[4], gm_mgNumber[3], gm_mgNumber[5], gm_mgNumber[4]);
|
||||
ADD_SELECT_PLAYER_MG(5, gm_mgNumber[5], gm_mgNumber[4], gm_mgNumber[6], gm_mgNumber[5]);
|
||||
ADD_SELECT_PLAYER_MG(6, gm_mgNumber[6], gm_mgNumber[5], gm_mgNumber[7], gm_mgNumber[6]);
|
||||
ADD_SELECT_PLAYER_MG(7, gm_mgNumber[7], gm_mgNumber[6], gm_mgNumber[0], gm_mgNumber[7]);
|
||||
gm_mgNumber[7].mg_pmgRight = &gm_mgModel;
|
||||
|
||||
gm_mgNameLabel.mg_strText = TRANS("NAME:");
|
||||
gm_mgNameLabel.mg_boxOnScreen = BoxMediumLeft(1.25f);
|
||||
gm_mgNameLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNameLabel.mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_mgNameLabel.mg_lnNode);
|
||||
gm_mgNameLabel.mg_strText = TRANS("NAME:");
|
||||
gm_mgNameLabel.mg_boxOnScreen = BoxMediumLeft(1.25f);
|
||||
gm_mgNameLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNameLabel.mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_mgNameLabel.mg_lnNode);
|
||||
|
||||
// setup of player name button is done on start menu
|
||||
gm_mgNameField.mg_strText = "<???>";
|
||||
gm_mgNameField.mg_ctMaxStringLen = 25;
|
||||
gm_mgNameField.mg_boxOnScreen = BoxPlayerEdit(1.25);
|
||||
gm_mgNameField.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNameField.mg_iCenterI = -1;
|
||||
gm_mgNameField.mg_pmgUp = &gm_mgNumber[0];
|
||||
gm_mgNameField.mg_pmgDown = &gm_mgTeam;
|
||||
gm_mgNameField.mg_pmgRight = &gm_mgModel;
|
||||
gm_mgNameField.mg_strTip = TRANS("rename currently active player");
|
||||
gm_lhGadgets.AddTail(gm_mgNameField.mg_lnNode);
|
||||
// setup of player name button is done on start menu
|
||||
gm_mgNameField.mg_strText = "<???>";
|
||||
gm_mgNameField.mg_ctMaxStringLen = 25;
|
||||
gm_mgNameField.mg_boxOnScreen = BoxPlayerEdit(1.25);
|
||||
gm_mgNameField.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNameField.mg_iCenterI = -1;
|
||||
gm_mgNameField.mg_pmgUp = &gm_mgNumber[0];
|
||||
gm_mgNameField.mg_pmgDown = &gm_mgTeam;
|
||||
gm_mgNameField.mg_pmgRight = &gm_mgModel;
|
||||
gm_mgNameField.mg_strTip = TRANS("rename currently active player");
|
||||
gm_lhGadgets.AddTail(gm_mgNameField.mg_lnNode);
|
||||
|
||||
gm_mgTeamLabel.mg_strText = TRANS("TEAM:");
|
||||
gm_mgTeamLabel.mg_boxOnScreen = BoxMediumLeft(2.25f);
|
||||
gm_mgTeamLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgTeamLabel.mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_mgTeamLabel.mg_lnNode);
|
||||
gm_mgTeamLabel.mg_strText = TRANS("TEAM:");
|
||||
gm_mgTeamLabel.mg_boxOnScreen = BoxMediumLeft(2.25f);
|
||||
gm_mgTeamLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgTeamLabel.mg_iCenterI = -1;
|
||||
gm_lhGadgets.AddTail(gm_mgTeamLabel.mg_lnNode);
|
||||
|
||||
// setup of player name button is done on start menu
|
||||
gm_mgTeam.mg_strText = "<???>";
|
||||
gm_mgTeam.mg_ctMaxStringLen = 25;
|
||||
gm_mgTeam.mg_boxOnScreen = BoxPlayerEdit(2.25f);
|
||||
gm_mgTeam.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgTeam.mg_iCenterI = -1;
|
||||
gm_mgTeam.mg_pmgUp = gm_mgNameField.mg_pmgUp = &gm_mgNumber[0];
|
||||
// setup of player name button is done on start menu
|
||||
gm_mgTeam.mg_strText = "<???>";
|
||||
gm_mgTeam.mg_ctMaxStringLen = 25;
|
||||
gm_mgTeam.mg_boxOnScreen = BoxPlayerEdit(2.25f);
|
||||
gm_mgTeam.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgTeam.mg_iCenterI = -1;
|
||||
gm_mgTeam.mg_pmgUp = gm_mgNameField.mg_pmgUp = &gm_mgNumber[0];
|
||||
|
||||
gm_mgTeam.mg_pmgDown = &gm_mgCrosshair;
|
||||
gm_mgTeam.mg_pmgRight = &gm_mgModel;
|
||||
//gm_mgTeam.mg_strTip = TRANS("teamplay is disabled in this version");
|
||||
gm_mgTeam.mg_strTip = TRANS("enter team name, if playing in team");
|
||||
gm_lhGadgets.AddTail(gm_mgTeam.mg_lnNode);
|
||||
gm_mgTeam.mg_pmgDown = &gm_mgCrosshair;
|
||||
gm_mgTeam.mg_pmgRight = &gm_mgModel;
|
||||
//gm_mgTeam.mg_strTip = TRANS("teamplay is disabled in this version");
|
||||
gm_mgTeam.mg_strTip = TRANS("enter team name, if playing in team");
|
||||
gm_lhGadgets.AddTail(gm_mgTeam.mg_lnNode);
|
||||
|
||||
TRIGGER_MG(gm_mgCrosshair, 4.0, gm_mgTeam, gm_mgWeaponSelect, TRANS("CROSSHAIR"), astrCrosshair);
|
||||
gm_mgCrosshair.mg_bVisual = TRUE;
|
||||
gm_mgCrosshair.mg_boxOnScreen = BoxPlayerSwitch(5.0f);
|
||||
gm_mgCrosshair.mg_iCenterI = -1;
|
||||
gm_mgCrosshair.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgCrosshair, 4.0, gm_mgTeam, gm_mgWeaponSelect, TRANS("CROSSHAIR"), astrCrosshair);
|
||||
gm_mgCrosshair.mg_bVisual = TRUE;
|
||||
gm_mgCrosshair.mg_boxOnScreen = BoxPlayerSwitch(5.0f);
|
||||
gm_mgCrosshair.mg_iCenterI = -1;
|
||||
gm_mgCrosshair.mg_pOnTriggerChange = NULL;
|
||||
|
||||
TRIGGER_MG(gm_mgWeaponSelect, 4.0, gm_mgCrosshair, gm_mgWeaponHide, TRANS("AUTO SELECT WEAPON"), astrWeapon);
|
||||
gm_mgWeaponSelect.mg_boxOnScreen = BoxPlayerSwitch(6.0f);
|
||||
gm_mgWeaponSelect.mg_iCenterI = -1;
|
||||
gm_mgWeaponSelect.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgWeaponSelect, 4.0, gm_mgCrosshair, gm_mgWeaponHide, TRANS("AUTO SELECT WEAPON"), astrWeapon);
|
||||
gm_mgWeaponSelect.mg_boxOnScreen = BoxPlayerSwitch(6.0f);
|
||||
gm_mgWeaponSelect.mg_iCenterI = -1;
|
||||
gm_mgWeaponSelect.mg_pOnTriggerChange = NULL;
|
||||
|
||||
TRIGGER_MG(gm_mgWeaponHide, 4.0, gm_mgWeaponSelect, gm_mg3rdPerson, TRANS("HIDE WEAPON MODEL"), astrNoYes);
|
||||
gm_mgWeaponHide.mg_boxOnScreen = BoxPlayerSwitch(7.0f);
|
||||
gm_mgWeaponHide.mg_iCenterI = -1;
|
||||
gm_mgWeaponHide.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgWeaponHide, 4.0, gm_mgWeaponSelect, gm_mg3rdPerson, TRANS("HIDE WEAPON MODEL"), astrNoYes);
|
||||
gm_mgWeaponHide.mg_boxOnScreen = BoxPlayerSwitch(7.0f);
|
||||
gm_mgWeaponHide.mg_iCenterI = -1;
|
||||
gm_mgWeaponHide.mg_pOnTriggerChange = NULL;
|
||||
|
||||
TRIGGER_MG(gm_mg3rdPerson, 4.0, gm_mgWeaponHide, gm_mgQuotes, TRANS("PREFER 3RD PERSON VIEW"), astrNoYes);
|
||||
gm_mg3rdPerson.mg_boxOnScreen = BoxPlayerSwitch(8.0f);
|
||||
gm_mg3rdPerson.mg_iCenterI = -1;
|
||||
gm_mg3rdPerson.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mg3rdPerson, 4.0, gm_mgWeaponHide, gm_mgQuotes, TRANS("PREFER 3RD PERSON VIEW"), astrNoYes);
|
||||
gm_mg3rdPerson.mg_boxOnScreen = BoxPlayerSwitch(8.0f);
|
||||
gm_mg3rdPerson.mg_iCenterI = -1;
|
||||
gm_mg3rdPerson.mg_pOnTriggerChange = NULL;
|
||||
|
||||
TRIGGER_MG(gm_mgQuotes, 4.0, gm_mg3rdPerson, gm_mgAutoSave, TRANS("VOICE QUOTES"), astrNoYes);
|
||||
gm_mgQuotes.mg_boxOnScreen = BoxPlayerSwitch(9.0f);
|
||||
gm_mgQuotes.mg_iCenterI = -1;
|
||||
gm_mgQuotes.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgQuotes, 4.0, gm_mg3rdPerson, gm_mgAutoSave, TRANS("VOICE QUOTES"), astrNoYes);
|
||||
gm_mgQuotes.mg_boxOnScreen = BoxPlayerSwitch(9.0f);
|
||||
gm_mgQuotes.mg_iCenterI = -1;
|
||||
gm_mgQuotes.mg_pOnTriggerChange = NULL;
|
||||
|
||||
TRIGGER_MG(gm_mgAutoSave, 4.0, gm_mgQuotes, gm_mgCompDoubleClick, TRANS("AUTO SAVE"), astrNoYes);
|
||||
gm_mgAutoSave.mg_boxOnScreen = BoxPlayerSwitch(10.0f);
|
||||
gm_mgAutoSave.mg_iCenterI = -1;
|
||||
gm_mgAutoSave.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgAutoSave, 4.0, gm_mgQuotes, gm_mgCompDoubleClick, TRANS("AUTO SAVE"), astrNoYes);
|
||||
gm_mgAutoSave.mg_boxOnScreen = BoxPlayerSwitch(10.0f);
|
||||
gm_mgAutoSave.mg_iCenterI = -1;
|
||||
gm_mgAutoSave.mg_pOnTriggerChange = NULL;
|
||||
|
||||
TRIGGER_MG(gm_mgCompDoubleClick, 4.0, gm_mgAutoSave, gm_mgSharpTurning, TRANS("INVOKE COMPUTER"), astrComputerInvoke);
|
||||
gm_mgCompDoubleClick.mg_boxOnScreen = BoxPlayerSwitch(11.0f);
|
||||
gm_mgCompDoubleClick.mg_iCenterI = -1;
|
||||
gm_mgCompDoubleClick.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgCompDoubleClick, 4.0, gm_mgAutoSave, gm_mgSharpTurning, TRANS("INVOKE COMPUTER"), astrComputerInvoke);
|
||||
gm_mgCompDoubleClick.mg_boxOnScreen = BoxPlayerSwitch(11.0f);
|
||||
gm_mgCompDoubleClick.mg_iCenterI = -1;
|
||||
gm_mgCompDoubleClick.mg_pOnTriggerChange = NULL;
|
||||
|
||||
TRIGGER_MG(gm_mgSharpTurning, 4.0, gm_mgCompDoubleClick, gm_mgViewBobbing, TRANS("SHARP TURNING"), astrNoYes);
|
||||
gm_mgSharpTurning.mg_boxOnScreen = BoxPlayerSwitch(12.0f);
|
||||
gm_mgSharpTurning.mg_iCenterI = -1;
|
||||
gm_mgSharpTurning.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgSharpTurning, 4.0, gm_mgCompDoubleClick, gm_mgViewBobbing, TRANS("SHARP TURNING"), astrNoYes);
|
||||
gm_mgSharpTurning.mg_boxOnScreen = BoxPlayerSwitch(12.0f);
|
||||
gm_mgSharpTurning.mg_iCenterI = -1;
|
||||
gm_mgSharpTurning.mg_pOnTriggerChange = NULL;
|
||||
|
||||
TRIGGER_MG(gm_mgViewBobbing, 4.0, gm_mgSharpTurning, gm_mgCustomizeControls, TRANS("VIEW BOBBING"), astrNoYes);
|
||||
gm_mgViewBobbing.mg_boxOnScreen = BoxPlayerSwitch(13.0f);
|
||||
gm_mgViewBobbing.mg_iCenterI = -1;
|
||||
gm_mgViewBobbing.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgViewBobbing, 4.0, gm_mgSharpTurning, gm_mgCustomizeControls, TRANS("VIEW BOBBING"), astrNoYes);
|
||||
gm_mgViewBobbing.mg_boxOnScreen = BoxPlayerSwitch(13.0f);
|
||||
gm_mgViewBobbing.mg_iCenterI = -1;
|
||||
gm_mgViewBobbing.mg_pOnTriggerChange = NULL;
|
||||
|
||||
gm_mgCustomizeControls.mg_strText = TRANS("CUSTOMIZE CONTROLS");
|
||||
gm_mgCustomizeControls.mg_boxOnScreen = BoxMediumLeft(14.5f);
|
||||
gm_mgCustomizeControls.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgCustomizeControls.mg_iCenterI = -1;
|
||||
gm_mgCustomizeControls.mg_pmgUp = &gm_mgViewBobbing;
|
||||
gm_mgCustomizeControls.mg_pActivatedFunction = NULL;
|
||||
gm_mgCustomizeControls.mg_pmgDown = &gm_mgNumber[0];
|
||||
gm_mgCustomizeControls.mg_pmgRight = &gm_mgModel;
|
||||
gm_mgCustomizeControls.mg_strTip = TRANS("customize controls for this player");
|
||||
gm_lhGadgets.AddTail(gm_mgCustomizeControls.mg_lnNode);
|
||||
gm_mgCustomizeControls.mg_strText = TRANS("CUSTOMIZE CONTROLS");
|
||||
gm_mgCustomizeControls.mg_boxOnScreen = BoxMediumLeft(14.5f);
|
||||
gm_mgCustomizeControls.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgCustomizeControls.mg_iCenterI = -1;
|
||||
gm_mgCustomizeControls.mg_pmgUp = &gm_mgViewBobbing;
|
||||
gm_mgCustomizeControls.mg_pActivatedFunction = NULL;
|
||||
gm_mgCustomizeControls.mg_pmgDown = &gm_mgNumber[0];
|
||||
gm_mgCustomizeControls.mg_pmgRight = &gm_mgModel;
|
||||
gm_mgCustomizeControls.mg_strTip = TRANS("customize controls for this player");
|
||||
gm_lhGadgets.AddTail(gm_mgCustomizeControls.mg_lnNode);
|
||||
|
||||
gm_mgModel.mg_boxOnScreen = BoxPlayerModel();
|
||||
gm_mgModel.mg_pmgLeft = &gm_mgNameField;
|
||||
gm_mgModel.mg_pActivatedFunction = NULL;
|
||||
gm_mgModel.mg_pmgDown = &gm_mgNameField;
|
||||
gm_mgModel.mg_pmgLeft = &gm_mgNameField;
|
||||
gm_mgModel.mg_strTip = TRANS("change model for this player");
|
||||
gm_lhGadgets.AddTail(gm_mgModel.mg_lnNode);
|
||||
gm_mgModel.mg_boxOnScreen = BoxPlayerModel();
|
||||
gm_mgModel.mg_pmgLeft = &gm_mgNameField;
|
||||
gm_mgModel.mg_pActivatedFunction = NULL;
|
||||
gm_mgModel.mg_pmgDown = &gm_mgNameField;
|
||||
gm_mgModel.mg_pmgLeft = &gm_mgNameField;
|
||||
gm_mgModel.mg_strTip = TRANS("change model for this player");
|
||||
gm_lhGadgets.AddTail(gm_mgModel.mg_lnNode);
|
||||
}
|
||||
|
||||
INDEX CPlayerProfileMenu::ComboFromPlayer(INDEX iPlayer)
|
||||
{
|
||||
return iPlayer;
|
||||
return iPlayer;
|
||||
}
|
||||
|
||||
INDEX CPlayerProfileMenu::PlayerFromCombo(INDEX iCombo)
|
||||
{
|
||||
return iCombo;
|
||||
return iCombo;
|
||||
}
|
||||
|
||||
void CPlayerProfileMenu::SelectPlayer(INDEX iPlayer)
|
||||
{
|
||||
CPlayerCharacter &pc = _pGame->gm_apcPlayers[iPlayer];
|
||||
CPlayerCharacter &pc = _pGame->gm_apcPlayers[iPlayer];
|
||||
|
||||
for (INDEX iPl = 0; iPl<8; iPl++)
|
||||
{
|
||||
gm_mgNumber[iPl].mg_bHighlighted = FALSE;
|
||||
}
|
||||
for (INDEX iPl = 0; iPl<8; iPl++)
|
||||
{
|
||||
gm_mgNumber[iPl].mg_bHighlighted = FALSE;
|
||||
}
|
||||
|
||||
gm_mgNumber[iPlayer].mg_bHighlighted = TRUE;
|
||||
gm_mgNumber[iPlayer].mg_bHighlighted = TRUE;
|
||||
|
||||
iPlayer = Clamp(iPlayer, INDEX(0), INDEX(7));
|
||||
iPlayer = Clamp(iPlayer, INDEX(0), INDEX(7));
|
||||
|
||||
if (_iLocalPlayer >= 0 && _iLocalPlayer<4) {
|
||||
_pGame->gm_aiMenuLocalPlayers[_iLocalPlayer] = iPlayer;
|
||||
} else {
|
||||
_pGame->gm_iSinglePlayer = iPlayer;
|
||||
}
|
||||
gm_mgNameField.mg_pstrToChange = &pc.pc_strName;
|
||||
gm_mgNameField.SetText(*gm_mgNameField.mg_pstrToChange);
|
||||
gm_mgTeam.mg_pstrToChange = &pc.pc_strTeam;
|
||||
gm_mgTeam.SetText(*gm_mgTeam.mg_pstrToChange);
|
||||
if (_iLocalPlayer >= 0 && _iLocalPlayer<4) {
|
||||
_pGame->gm_aiMenuLocalPlayers[_iLocalPlayer] = iPlayer;
|
||||
} else {
|
||||
_pGame->gm_iSinglePlayer = iPlayer;
|
||||
}
|
||||
gm_mgNameField.mg_pstrToChange = &pc.pc_strName;
|
||||
gm_mgNameField.SetText(*gm_mgNameField.mg_pstrToChange);
|
||||
gm_mgTeam.mg_pstrToChange = &pc.pc_strTeam;
|
||||
gm_mgTeam.SetText(*gm_mgTeam.mg_pstrToChange);
|
||||
|
||||
CPlayerSettings *pps = (CPlayerSettings *)pc.pc_aubAppearance;
|
||||
CPlayerSettings *pps = (CPlayerSettings *)pc.pc_aubAppearance;
|
||||
|
||||
gm_mgCrosshair.mg_iSelected = pps->ps_iCrossHairType + 1;
|
||||
gm_mgCrosshair.ApplyCurrentSelection();
|
||||
gm_mgCrosshair.mg_iSelected = pps->ps_iCrossHairType + 1;
|
||||
gm_mgCrosshair.ApplyCurrentSelection();
|
||||
|
||||
gm_mgWeaponSelect.mg_iSelected = pps->ps_iWeaponAutoSelect;
|
||||
gm_mgWeaponSelect.ApplyCurrentSelection();
|
||||
gm_mgWeaponSelect.mg_iSelected = pps->ps_iWeaponAutoSelect;
|
||||
gm_mgWeaponSelect.ApplyCurrentSelection();
|
||||
|
||||
gm_mgWeaponHide.mg_iSelected = (pps->ps_ulFlags&PSF_HIDEWEAPON) ? 1 : 0;
|
||||
gm_mgWeaponHide.ApplyCurrentSelection();
|
||||
gm_mgWeaponHide.mg_iSelected = (pps->ps_ulFlags&PSF_HIDEWEAPON) ? 1 : 0;
|
||||
gm_mgWeaponHide.ApplyCurrentSelection();
|
||||
|
||||
gm_mg3rdPerson.mg_iSelected = (pps->ps_ulFlags&PSF_PREFER3RDPERSON) ? 1 : 0;
|
||||
gm_mg3rdPerson.ApplyCurrentSelection();
|
||||
gm_mg3rdPerson.mg_iSelected = (pps->ps_ulFlags&PSF_PREFER3RDPERSON) ? 1 : 0;
|
||||
gm_mg3rdPerson.ApplyCurrentSelection();
|
||||
|
||||
gm_mgQuotes.mg_iSelected = (pps->ps_ulFlags&PSF_NOQUOTES) ? 0 : 1;
|
||||
gm_mgQuotes.ApplyCurrentSelection();
|
||||
gm_mgQuotes.mg_iSelected = (pps->ps_ulFlags&PSF_NOQUOTES) ? 0 : 1;
|
||||
gm_mgQuotes.ApplyCurrentSelection();
|
||||
|
||||
gm_mgAutoSave.mg_iSelected = (pps->ps_ulFlags&PSF_AUTOSAVE) ? 1 : 0;
|
||||
gm_mgAutoSave.ApplyCurrentSelection();
|
||||
gm_mgAutoSave.mg_iSelected = (pps->ps_ulFlags&PSF_AUTOSAVE) ? 1 : 0;
|
||||
gm_mgAutoSave.ApplyCurrentSelection();
|
||||
|
||||
gm_mgCompDoubleClick.mg_iSelected = (pps->ps_ulFlags&PSF_COMPSINGLECLICK) ? 0 : 1;
|
||||
gm_mgCompDoubleClick.ApplyCurrentSelection();
|
||||
gm_mgCompDoubleClick.mg_iSelected = (pps->ps_ulFlags&PSF_COMPSINGLECLICK) ? 0 : 1;
|
||||
gm_mgCompDoubleClick.ApplyCurrentSelection();
|
||||
|
||||
gm_mgViewBobbing.mg_iSelected = (pps->ps_ulFlags&PSF_NOBOBBING) ? 0 : 1;
|
||||
gm_mgViewBobbing.ApplyCurrentSelection();
|
||||
gm_mgViewBobbing.mg_iSelected = (pps->ps_ulFlags&PSF_NOBOBBING) ? 0 : 1;
|
||||
gm_mgViewBobbing.ApplyCurrentSelection();
|
||||
|
||||
gm_mgSharpTurning.mg_iSelected = (pps->ps_ulFlags&PSF_SHARPTURNING) ? 1 : 0;
|
||||
gm_mgSharpTurning.ApplyCurrentSelection();
|
||||
gm_mgSharpTurning.mg_iSelected = (pps->ps_ulFlags&PSF_SHARPTURNING) ? 1 : 0;
|
||||
gm_mgSharpTurning.ApplyCurrentSelection();
|
||||
|
||||
// get function that will set player appearance
|
||||
CShellSymbol *pss = _pShell->GetSymbol("SetPlayerAppearance", /*bDeclaredOnly=*/ TRUE);
|
||||
// if none
|
||||
if (pss == NULL) {
|
||||
// no model
|
||||
gm_mgModel.mg_moModel.SetData(NULL);
|
||||
// if there is some
|
||||
} else {
|
||||
// set the model
|
||||
BOOL(*pFunc)(CModelObject *, CPlayerCharacter *, CTString &, BOOL) =
|
||||
(BOOL(*)(CModelObject *, CPlayerCharacter *, CTString &, BOOL))pss->ss_pvValue;
|
||||
CTString strName;
|
||||
BOOL bSet;
|
||||
if (_gmRunningGameMode != GM_SINGLE_PLAYER && !_bPlayerMenuFromSinglePlayer) {
|
||||
bSet = pFunc(&gm_mgModel.mg_moModel, &pc, strName, TRUE);
|
||||
gm_mgModel.mg_strTip = TRANS("change model for this player");
|
||||
gm_mgModel.mg_bEnabled = TRUE;
|
||||
}
|
||||
else {
|
||||
// cannot change player appearance in single player mode
|
||||
bSet = pFunc(&gm_mgModel.mg_moModel, NULL, strName, TRUE);
|
||||
gm_mgModel.mg_strTip = TRANS("cannot change model for single-player game");
|
||||
gm_mgModel.mg_bEnabled = FALSE;
|
||||
}
|
||||
// ignore gender flags, if any
|
||||
strName.RemovePrefix("#female#");
|
||||
strName.RemovePrefix("#male#");
|
||||
gm_mgModel.mg_plModel = CPlacement3D(FLOAT3D(0.1f, -1.0f, -3.5f), ANGLE3D(150, 0, 0));
|
||||
gm_mgModel.mg_strText = strName;
|
||||
CPlayerSettings *pps = (CPlayerSettings *)pc.pc_aubAppearance;
|
||||
_strLastPlayerAppearance = pps->GetModelFilename();
|
||||
try {
|
||||
gm_mgModel.mg_moFloor.SetData_t(CTFILENAME("Models\\Computer\\Floor.mdl"));
|
||||
gm_mgModel.mg_moFloor.mo_toTexture.SetData_t(CTFILENAME("Models\\Computer\\Floor.tex"));
|
||||
}
|
||||
catch (char *strError) {
|
||||
(void)strError;
|
||||
}
|
||||
}
|
||||
// get function that will set player appearance
|
||||
CShellSymbol *pss = _pShell->GetSymbol("SetPlayerAppearance", /*bDeclaredOnly=*/ TRUE);
|
||||
// if none
|
||||
if (pss == NULL) {
|
||||
// no model
|
||||
gm_mgModel.mg_moModel.SetData(NULL);
|
||||
// if there is some
|
||||
} else {
|
||||
// set the model
|
||||
BOOL(*pFunc)(CModelObject *, CPlayerCharacter *, CTString &, BOOL) =
|
||||
(BOOL(*)(CModelObject *, CPlayerCharacter *, CTString &, BOOL))pss->ss_pvValue;
|
||||
CTString strName;
|
||||
BOOL bSet;
|
||||
if (_gmRunningGameMode != GM_SINGLE_PLAYER && !_bPlayerMenuFromSinglePlayer) {
|
||||
bSet = pFunc(&gm_mgModel.mg_moModel, &pc, strName, TRUE);
|
||||
gm_mgModel.mg_strTip = TRANS("change model for this player");
|
||||
gm_mgModel.mg_bEnabled = TRUE;
|
||||
}
|
||||
else {
|
||||
// cannot change player appearance in single player mode
|
||||
bSet = pFunc(&gm_mgModel.mg_moModel, NULL, strName, TRUE);
|
||||
gm_mgModel.mg_strTip = TRANS("cannot change model for single-player game");
|
||||
gm_mgModel.mg_bEnabled = FALSE;
|
||||
}
|
||||
// ignore gender flags, if any
|
||||
strName.RemovePrefix("#female#");
|
||||
strName.RemovePrefix("#male#");
|
||||
gm_mgModel.mg_plModel = CPlacement3D(FLOAT3D(0.1f, -1.0f, -3.5f), ANGLE3D(150, 0, 0));
|
||||
gm_mgModel.mg_strText = strName;
|
||||
CPlayerSettings *pps = (CPlayerSettings *)pc.pc_aubAppearance;
|
||||
_strLastPlayerAppearance = pps->GetModelFilename();
|
||||
try {
|
||||
gm_mgModel.mg_moFloor.SetData_t(CTFILENAME("Models\\Computer\\Floor.mdl"));
|
||||
gm_mgModel.mg_moFloor.mo_toTexture.SetData_t(CTFILENAME("Models\\Computer\\Floor.tex"));
|
||||
}
|
||||
catch (char *strError) {
|
||||
(void)strError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CPlayerProfileMenu::StartMenu(void)
|
||||
{
|
||||
_pGUIM->gmPlayerProfile.gm_pmgSelectedByDefault = &gm_mgNameField;
|
||||
_pGUIM->gmPlayerProfile.gm_pmgSelectedByDefault = &gm_mgNameField;
|
||||
|
||||
if (_gmRunningGameMode == GM_NONE || _gmRunningGameMode == GM_DEMO) {
|
||||
for (INDEX i = 0; i<8; i++) {
|
||||
gm_mgNumber[i].mg_bEnabled = TRUE;
|
||||
}
|
||||
} else {
|
||||
for (INDEX i = 0; i<8; i++) {
|
||||
gm_mgNumber[i].mg_bEnabled = FALSE;
|
||||
}
|
||||
INDEX iFirstEnabled = 0;
|
||||
{for (INDEX ilp = 0; ilp<4; ilp++) {
|
||||
CLocalPlayer &lp = _pGame->gm_lpLocalPlayers[ilp];
|
||||
if (lp.lp_bActive) {
|
||||
gm_mgNumber[lp.lp_iPlayer].mg_bEnabled = TRUE;
|
||||
if (iFirstEnabled == 0) {
|
||||
iFirstEnabled = lp.lp_iPlayer;
|
||||
}
|
||||
}
|
||||
}}
|
||||
// backup to first player in case current player is disabled
|
||||
if (!gm_mgNumber[*gm_piCurrentPlayer].mg_bEnabled) *gm_piCurrentPlayer = iFirstEnabled;
|
||||
}
|
||||
// done
|
||||
SelectPlayer(*gm_piCurrentPlayer);
|
||||
CGameMenu::StartMenu();
|
||||
if (_gmRunningGameMode == GM_NONE || _gmRunningGameMode == GM_DEMO) {
|
||||
for (INDEX i = 0; i<8; i++) {
|
||||
gm_mgNumber[i].mg_bEnabled = TRUE;
|
||||
}
|
||||
} else {
|
||||
for (INDEX i = 0; i<8; i++) {
|
||||
gm_mgNumber[i].mg_bEnabled = FALSE;
|
||||
}
|
||||
INDEX iFirstEnabled = 0;
|
||||
{for (INDEX ilp = 0; ilp<4; ilp++) {
|
||||
CLocalPlayer &lp = _pGame->gm_lpLocalPlayers[ilp];
|
||||
if (lp.lp_bActive) {
|
||||
gm_mgNumber[lp.lp_iPlayer].mg_bEnabled = TRUE;
|
||||
if (iFirstEnabled == 0) {
|
||||
iFirstEnabled = lp.lp_iPlayer;
|
||||
}
|
||||
}
|
||||
}}
|
||||
// backup to first player in case current player is disabled
|
||||
if (!gm_mgNumber[*gm_piCurrentPlayer].mg_bEnabled) *gm_piCurrentPlayer = iFirstEnabled;
|
||||
}
|
||||
// done
|
||||
SelectPlayer(*gm_piCurrentPlayer);
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void CPlayerProfileMenu::EndMenu(void)
|
||||
{
|
||||
_pGame->SavePlayersAndControls();
|
||||
CGameMenu::EndMenu();
|
||||
_pGame->SavePlayersAndControls();
|
||||
CGameMenu::EndMenu();
|
||||
}
|
|
@ -19,13 +19,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "MSelectPlayers.h"
|
||||
|
||||
#define ADD_GADGET( gd, box, up, dn, lf, rt, txt) \
|
||||
gd.mg_boxOnScreen = box; \
|
||||
gd.mg_pmgUp = up; \
|
||||
gd.mg_pmgDown = dn; \
|
||||
gd.mg_pmgLeft = lf; \
|
||||
gd.mg_pmgRight = rt; \
|
||||
gd.mg_strText = txt; \
|
||||
gm_lhGadgets.AddTail(gd.mg_lnNode);
|
||||
gd.mg_boxOnScreen = box; \
|
||||
gd.mg_pmgUp = up; \
|
||||
gd.mg_pmgDown = dn; \
|
||||
gd.mg_pmgLeft = lf; \
|
||||
gd.mg_pmgRight = rt; \
|
||||
gd.mg_strText = txt; \
|
||||
gm_lhGadgets.AddTail(gd.mg_lnNode);
|
||||
|
||||
extern CTString astrNoYes[2];
|
||||
extern CTString astrSplitScreenRadioTexts[4];
|
||||
|
@ -34,84 +34,84 @@ extern void SelectPlayersApplyMenu(void);
|
|||
|
||||
void CSelectPlayersMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize split screen menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("SELECT PLAYERS");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// intialize split screen menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("SELECT PLAYERS");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
TRIGGER_MG(gm_mgDedicated, 0, gm_mgStart, gm_mgObserver, TRANS("Dedicated:"), astrNoYes);
|
||||
gm_mgDedicated.mg_strTip = TRANS("select to start dedicated server");
|
||||
gm_mgDedicated.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgDedicated, 0, gm_mgStart, gm_mgObserver, TRANS("Dedicated:"), astrNoYes);
|
||||
gm_mgDedicated.mg_strTip = TRANS("select to start dedicated server");
|
||||
gm_mgDedicated.mg_pOnTriggerChange = NULL;
|
||||
|
||||
TRIGGER_MG(gm_mgObserver, 1, gm_mgDedicated, gm_mgSplitScreenCfg, TRANS("Observer:"), astrNoYes);
|
||||
gm_mgObserver.mg_strTip = TRANS("select to join in for observing, not for playing");
|
||||
gm_mgObserver.mg_pOnTriggerChange = NULL;
|
||||
TRIGGER_MG(gm_mgObserver, 1, gm_mgDedicated, gm_mgSplitScreenCfg, TRANS("Observer:"), astrNoYes);
|
||||
gm_mgObserver.mg_strTip = TRANS("select to join in for observing, not for playing");
|
||||
gm_mgObserver.mg_pOnTriggerChange = NULL;
|
||||
|
||||
// split screen config trigger
|
||||
TRIGGER_MG(gm_mgSplitScreenCfg, 2, gm_mgObserver, gm_mgPlayer0Change, TRANS("Number of players:"), astrSplitScreenRadioTexts);
|
||||
gm_mgSplitScreenCfg.mg_strTip = TRANS("choose more than one player to play in split screen");
|
||||
gm_mgSplitScreenCfg.mg_pOnTriggerChange = NULL;
|
||||
// split screen config trigger
|
||||
TRIGGER_MG(gm_mgSplitScreenCfg, 2, gm_mgObserver, gm_mgPlayer0Change, TRANS("Number of players:"), astrSplitScreenRadioTexts);
|
||||
gm_mgSplitScreenCfg.mg_strTip = TRANS("choose more than one player to play in split screen");
|
||||
gm_mgSplitScreenCfg.mg_pOnTriggerChange = NULL;
|
||||
|
||||
gm_mgPlayer0Change.mg_iCenterI = -1;
|
||||
gm_mgPlayer1Change.mg_iCenterI = -1;
|
||||
gm_mgPlayer2Change.mg_iCenterI = -1;
|
||||
gm_mgPlayer3Change.mg_iCenterI = -1;
|
||||
gm_mgPlayer0Change.mg_boxOnScreen = BoxMediumMiddle(4);
|
||||
gm_mgPlayer1Change.mg_boxOnScreen = BoxMediumMiddle(5);
|
||||
gm_mgPlayer2Change.mg_boxOnScreen = BoxMediumMiddle(6);
|
||||
gm_mgPlayer3Change.mg_boxOnScreen = BoxMediumMiddle(7);
|
||||
gm_mgPlayer0Change.mg_strTip =
|
||||
gm_mgPlayer1Change.mg_strTip =
|
||||
gm_mgPlayer2Change.mg_strTip =
|
||||
gm_mgPlayer3Change.mg_strTip = TRANS("select profile for this player");
|
||||
gm_lhGadgets.AddTail(gm_mgPlayer0Change.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgPlayer1Change.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgPlayer2Change.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgPlayer3Change.mg_lnNode);
|
||||
gm_mgPlayer0Change.mg_iCenterI = -1;
|
||||
gm_mgPlayer1Change.mg_iCenterI = -1;
|
||||
gm_mgPlayer2Change.mg_iCenterI = -1;
|
||||
gm_mgPlayer3Change.mg_iCenterI = -1;
|
||||
gm_mgPlayer0Change.mg_boxOnScreen = BoxMediumMiddle(4);
|
||||
gm_mgPlayer1Change.mg_boxOnScreen = BoxMediumMiddle(5);
|
||||
gm_mgPlayer2Change.mg_boxOnScreen = BoxMediumMiddle(6);
|
||||
gm_mgPlayer3Change.mg_boxOnScreen = BoxMediumMiddle(7);
|
||||
gm_mgPlayer0Change.mg_strTip =
|
||||
gm_mgPlayer1Change.mg_strTip =
|
||||
gm_mgPlayer2Change.mg_strTip =
|
||||
gm_mgPlayer3Change.mg_strTip = TRANS("select profile for this player");
|
||||
gm_lhGadgets.AddTail(gm_mgPlayer0Change.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgPlayer1Change.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgPlayer2Change.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgPlayer3Change.mg_lnNode);
|
||||
|
||||
gm_mgNotes.mg_boxOnScreen = BoxMediumRow(9.0);
|
||||
gm_mgNotes.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNotes.mg_iCenterI = -1;
|
||||
gm_mgNotes.mg_bEnabled = FALSE;
|
||||
gm_mgNotes.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgNotes.mg_lnNode);
|
||||
gm_mgNotes.mg_strText = "";
|
||||
gm_mgNotes.mg_boxOnScreen = BoxMediumRow(9.0);
|
||||
gm_mgNotes.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgNotes.mg_iCenterI = -1;
|
||||
gm_mgNotes.mg_bEnabled = FALSE;
|
||||
gm_mgNotes.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgNotes.mg_lnNode);
|
||||
gm_mgNotes.mg_strText = "";
|
||||
|
||||
/* // options button
|
||||
mgSplitOptions.mg_strText = TRANS("Game options");
|
||||
mgSplitOptions.mg_boxOnScreen = BoxMediumRow(3);
|
||||
mgSplitOptions.mg_bfsFontSize = BFS_MEDIUM;
|
||||
mgSplitOptions.mg_iCenterI = 0;
|
||||
mgSplitOptions.mg_pmgUp = &mgSplitLevel;
|
||||
mgSplitOptions.mg_pmgDown = &mgSplitStartStart;
|
||||
mgSplitOptions.mg_strTip = TRANS("adjust game rules");
|
||||
mgSplitOptions.mg_pActivatedFunction = &StartGameOptionsFromSplitScreen;
|
||||
gm_lhGadgets.AddTail( mgSplitOptions.mg_lnNode);*/
|
||||
/* // options button
|
||||
mgSplitOptions.mg_strText = TRANS("Game options");
|
||||
mgSplitOptions.mg_boxOnScreen = BoxMediumRow(3);
|
||||
mgSplitOptions.mg_bfsFontSize = BFS_MEDIUM;
|
||||
mgSplitOptions.mg_iCenterI = 0;
|
||||
mgSplitOptions.mg_pmgUp = &mgSplitLevel;
|
||||
mgSplitOptions.mg_pmgDown = &mgSplitStartStart;
|
||||
mgSplitOptions.mg_strTip = TRANS("adjust game rules");
|
||||
mgSplitOptions.mg_pActivatedFunction = &StartGameOptionsFromSplitScreen;
|
||||
gm_lhGadgets.AddTail( mgSplitOptions.mg_lnNode);*/
|
||||
|
||||
/* // start button
|
||||
mgSplitStartStart.mg_bfsFontSize = BFS_LARGE;
|
||||
mgSplitStartStart.mg_boxOnScreen = BoxBigRow(4);
|
||||
mgSplitStartStart.mg_pmgUp = &mgSplitOptions;
|
||||
mgSplitStartStart.mg_pmgDown = &mgSplitGameType;
|
||||
mgSplitStartStart.mg_strText = TRANS("START");
|
||||
gm_lhGadgets.AddTail( mgSplitStartStart.mg_lnNode);
|
||||
mgSplitStartStart.mg_pActivatedFunction = &StartSelectPlayersMenuFromSplit;
|
||||
*/
|
||||
/* // start button
|
||||
mgSplitStartStart.mg_bfsFontSize = BFS_LARGE;
|
||||
mgSplitStartStart.mg_boxOnScreen = BoxBigRow(4);
|
||||
mgSplitStartStart.mg_pmgUp = &mgSplitOptions;
|
||||
mgSplitStartStart.mg_pmgDown = &mgSplitGameType;
|
||||
mgSplitStartStart.mg_strText = TRANS("START");
|
||||
gm_lhGadgets.AddTail( mgSplitStartStart.mg_lnNode);
|
||||
mgSplitStartStart.mg_pActivatedFunction = &StartSelectPlayersMenuFromSplit;
|
||||
*/
|
||||
|
||||
ADD_GADGET(gm_mgStart, BoxMediumRow(11), &gm_mgSplitScreenCfg, &gm_mgPlayer0Change, NULL, NULL, TRANS("START"));
|
||||
gm_mgStart.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgStart.mg_iCenterI = 0;
|
||||
ADD_GADGET(gm_mgStart, BoxMediumRow(11), &gm_mgSplitScreenCfg, &gm_mgPlayer0Change, NULL, NULL, TRANS("START"));
|
||||
gm_mgStart.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgStart.mg_iCenterI = 0;
|
||||
}
|
||||
|
||||
void CSelectPlayersMenu::StartMenu(void)
|
||||
{
|
||||
CGameMenu::StartMenu();
|
||||
SelectPlayersFillMenu();
|
||||
SelectPlayersApplyMenu();
|
||||
CGameMenu::StartMenu();
|
||||
SelectPlayersFillMenu();
|
||||
SelectPlayersApplyMenu();
|
||||
}
|
||||
|
||||
void CSelectPlayersMenu::EndMenu(void)
|
||||
{
|
||||
SelectPlayersApplyMenu();
|
||||
CGameMenu::EndMenu();
|
||||
SelectPlayersApplyMenu();
|
||||
CGameMenu::EndMenu();
|
||||
}
|
|
@ -23,87 +23,87 @@ CMGEdit mgServerFilter[7];
|
|||
|
||||
void CServersMenu::Initialize_t(void)
|
||||
{
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("CHOOSE SERVER");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("CHOOSE SERVER");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgList.mg_boxOnScreen = FLOATaabbox2D(FLOAT2D(0, 0), FLOAT2D(1, 1));
|
||||
gm_mgList.mg_pmgLeft = &gm_mgList; // make sure it can get focus
|
||||
gm_mgList.mg_bEnabled = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgList.mg_lnNode);
|
||||
gm_mgList.mg_boxOnScreen = FLOATaabbox2D(FLOAT2D(0, 0), FLOAT2D(1, 1));
|
||||
gm_mgList.mg_pmgLeft = &gm_mgList; // make sure it can get focus
|
||||
gm_mgList.mg_bEnabled = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgList.mg_lnNode);
|
||||
|
||||
ASSERT(ARRAYCOUNT(mgServerColumn) == ARRAYCOUNT(mgServerFilter));
|
||||
for (INDEX i = 0; i<ARRAYCOUNT(mgServerFilter); i++) {
|
||||
mgServerColumn[i].mg_strText = "";
|
||||
mgServerColumn[i].mg_boxOnScreen = BoxPlayerEdit(5.0);
|
||||
mgServerColumn[i].mg_bfsFontSize = BFS_SMALL;
|
||||
mgServerColumn[i].mg_iCenterI = -1;
|
||||
mgServerColumn[i].mg_pmgUp = &gm_mgList;
|
||||
mgServerColumn[i].mg_pmgDown = &mgServerFilter[i];
|
||||
gm_lhGadgets.AddTail(mgServerColumn[i].mg_lnNode);
|
||||
ASSERT(ARRAYCOUNT(mgServerColumn) == ARRAYCOUNT(mgServerFilter));
|
||||
for (INDEX i = 0; i<ARRAYCOUNT(mgServerFilter); i++) {
|
||||
mgServerColumn[i].mg_strText = "";
|
||||
mgServerColumn[i].mg_boxOnScreen = BoxPlayerEdit(5.0);
|
||||
mgServerColumn[i].mg_bfsFontSize = BFS_SMALL;
|
||||
mgServerColumn[i].mg_iCenterI = -1;
|
||||
mgServerColumn[i].mg_pmgUp = &gm_mgList;
|
||||
mgServerColumn[i].mg_pmgDown = &mgServerFilter[i];
|
||||
gm_lhGadgets.AddTail(mgServerColumn[i].mg_lnNode);
|
||||
|
||||
mgServerFilter[i].mg_ctMaxStringLen = 25;
|
||||
mgServerFilter[i].mg_boxOnScreen = BoxPlayerEdit(5.0);
|
||||
mgServerFilter[i].mg_bfsFontSize = BFS_SMALL;
|
||||
mgServerFilter[i].mg_iCenterI = -1;
|
||||
mgServerFilter[i].mg_pmgUp = &mgServerColumn[i];
|
||||
mgServerFilter[i].mg_pmgDown = &gm_mgList;
|
||||
gm_lhGadgets.AddTail(mgServerFilter[i].mg_lnNode);
|
||||
mgServerFilter[i].mg_pstrToChange = &_strServerFilter[i];
|
||||
mgServerFilter[i].SetText(*mgServerFilter[i].mg_pstrToChange);
|
||||
}
|
||||
mgServerFilter[i].mg_ctMaxStringLen = 25;
|
||||
mgServerFilter[i].mg_boxOnScreen = BoxPlayerEdit(5.0);
|
||||
mgServerFilter[i].mg_bfsFontSize = BFS_SMALL;
|
||||
mgServerFilter[i].mg_iCenterI = -1;
|
||||
mgServerFilter[i].mg_pmgUp = &mgServerColumn[i];
|
||||
mgServerFilter[i].mg_pmgDown = &gm_mgList;
|
||||
gm_lhGadgets.AddTail(mgServerFilter[i].mg_lnNode);
|
||||
mgServerFilter[i].mg_pstrToChange = &_strServerFilter[i];
|
||||
mgServerFilter[i].SetText(*mgServerFilter[i].mg_pstrToChange);
|
||||
}
|
||||
|
||||
gm_mgRefresh.mg_strText = TRANS("REFRESH");
|
||||
gm_mgRefresh.mg_boxOnScreen = BoxLeftColumn(15.0);
|
||||
gm_mgRefresh.mg_bfsFontSize = BFS_SMALL;
|
||||
gm_mgRefresh.mg_iCenterI = -1;
|
||||
gm_mgRefresh.mg_pmgDown = &gm_mgList;
|
||||
gm_mgRefresh.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgRefresh.mg_lnNode);
|
||||
gm_mgRefresh.mg_strText = TRANS("REFRESH");
|
||||
gm_mgRefresh.mg_boxOnScreen = BoxLeftColumn(15.0);
|
||||
gm_mgRefresh.mg_bfsFontSize = BFS_SMALL;
|
||||
gm_mgRefresh.mg_iCenterI = -1;
|
||||
gm_mgRefresh.mg_pmgDown = &gm_mgList;
|
||||
gm_mgRefresh.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgRefresh.mg_lnNode);
|
||||
|
||||
CTString astrColumns[7];
|
||||
mgServerColumn[0].mg_strText = TRANS("Server");
|
||||
mgServerColumn[1].mg_strText = TRANS("Map");
|
||||
mgServerColumn[2].mg_strText = TRANS("Ping");
|
||||
mgServerColumn[3].mg_strText = TRANS("Players");
|
||||
mgServerColumn[4].mg_strText = TRANS("Game");
|
||||
mgServerColumn[5].mg_strText = TRANS("Mod");
|
||||
mgServerColumn[6].mg_strText = TRANS("Ver");
|
||||
mgServerColumn[0].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[1].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[2].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[3].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[4].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[5].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[6].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[0].mg_strTip = TRANS("sort by server");
|
||||
mgServerColumn[1].mg_strTip = TRANS("sort by map");
|
||||
mgServerColumn[2].mg_strTip = TRANS("sort by ping");
|
||||
mgServerColumn[3].mg_strTip = TRANS("sort by players");
|
||||
mgServerColumn[4].mg_strTip = TRANS("sort by game");
|
||||
mgServerColumn[5].mg_strTip = TRANS("sort by mod");
|
||||
mgServerColumn[6].mg_strTip = TRANS("sort by version");
|
||||
mgServerFilter[0].mg_strTip = TRANS("filter by server");
|
||||
mgServerFilter[1].mg_strTip = TRANS("filter by map");
|
||||
mgServerFilter[2].mg_strTip = TRANS("filter by ping (ie. <200)");
|
||||
mgServerFilter[3].mg_strTip = TRANS("filter by players (ie. >=2)");
|
||||
mgServerFilter[4].mg_strTip = TRANS("filter by game (ie. coop)");
|
||||
mgServerFilter[5].mg_strTip = TRANS("filter by mod");
|
||||
mgServerFilter[6].mg_strTip = TRANS("filter by version");
|
||||
CTString astrColumns[7];
|
||||
mgServerColumn[0].mg_strText = TRANS("Server");
|
||||
mgServerColumn[1].mg_strText = TRANS("Map");
|
||||
mgServerColumn[2].mg_strText = TRANS("Ping");
|
||||
mgServerColumn[3].mg_strText = TRANS("Players");
|
||||
mgServerColumn[4].mg_strText = TRANS("Game");
|
||||
mgServerColumn[5].mg_strText = TRANS("Mod");
|
||||
mgServerColumn[6].mg_strText = TRANS("Ver");
|
||||
mgServerColumn[0].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[1].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[2].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[3].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[4].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[5].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[6].mg_pActivatedFunction = NULL;
|
||||
mgServerColumn[0].mg_strTip = TRANS("sort by server");
|
||||
mgServerColumn[1].mg_strTip = TRANS("sort by map");
|
||||
mgServerColumn[2].mg_strTip = TRANS("sort by ping");
|
||||
mgServerColumn[3].mg_strTip = TRANS("sort by players");
|
||||
mgServerColumn[4].mg_strTip = TRANS("sort by game");
|
||||
mgServerColumn[5].mg_strTip = TRANS("sort by mod");
|
||||
mgServerColumn[6].mg_strTip = TRANS("sort by version");
|
||||
mgServerFilter[0].mg_strTip = TRANS("filter by server");
|
||||
mgServerFilter[1].mg_strTip = TRANS("filter by map");
|
||||
mgServerFilter[2].mg_strTip = TRANS("filter by ping (ie. <200)");
|
||||
mgServerFilter[3].mg_strTip = TRANS("filter by players (ie. >=2)");
|
||||
mgServerFilter[4].mg_strTip = TRANS("filter by game (ie. coop)");
|
||||
mgServerFilter[5].mg_strTip = TRANS("filter by mod");
|
||||
mgServerFilter[6].mg_strTip = TRANS("filter by version");
|
||||
}
|
||||
|
||||
void CServersMenu::StartMenu(void)
|
||||
{
|
||||
extern void RefreshServerList(void);
|
||||
RefreshServerList();
|
||||
extern void RefreshServerList(void);
|
||||
RefreshServerList();
|
||||
|
||||
CGameMenu::StartMenu();
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void CServersMenu::Think(void)
|
||||
{
|
||||
if (!_pNetwork->ga_bEnumerationChange) {
|
||||
return;
|
||||
}
|
||||
_pNetwork->ga_bEnumerationChange = FALSE;
|
||||
if (!_pNetwork->ga_bEnumerationChange) {
|
||||
return;
|
||||
}
|
||||
_pNetwork->ga_bEnumerationChange = FALSE;
|
||||
}
|
||||
|
|
|
@ -21,135 +21,135 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CSinglePlayerMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize single player menu
|
||||
gm_mgTitle.mg_strText = TRANS("SINGLE PLAYER");
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// intialize single player menu
|
||||
gm_mgTitle.mg_strText = TRANS("SINGLE PLAYER");
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgPlayerLabel.mg_boxOnScreen = BoxBigRow(-1.0f);
|
||||
gm_mgPlayerLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgPlayerLabel.mg_iCenterI = -1;
|
||||
gm_mgPlayerLabel.mg_bEnabled = FALSE;
|
||||
gm_mgPlayerLabel.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgPlayerLabel.mg_lnNode);
|
||||
gm_mgPlayerLabel.mg_boxOnScreen = BoxBigRow(-1.0f);
|
||||
gm_mgPlayerLabel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgPlayerLabel.mg_iCenterI = -1;
|
||||
gm_mgPlayerLabel.mg_bEnabled = FALSE;
|
||||
gm_mgPlayerLabel.mg_bLabel = TRUE;
|
||||
gm_lhGadgets.AddTail(gm_mgPlayerLabel.mg_lnNode);
|
||||
|
||||
gm_mgNewGame.mg_strText = TRANS("NEW GAME");
|
||||
gm_mgNewGame.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgNewGame.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
gm_mgNewGame.mg_strTip = TRANS("start new game with current player");
|
||||
gm_lhGadgets.AddTail(gm_mgNewGame.mg_lnNode);
|
||||
gm_mgNewGame.mg_pmgUp = &gm_mgOptions;
|
||||
gm_mgNewGame.mg_pmgDown = &gm_mgCustom;
|
||||
gm_mgNewGame.mg_pActivatedFunction = NULL;
|
||||
gm_mgNewGame.mg_strText = TRANS("NEW GAME");
|
||||
gm_mgNewGame.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgNewGame.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
gm_mgNewGame.mg_strTip = TRANS("start new game with current player");
|
||||
gm_lhGadgets.AddTail(gm_mgNewGame.mg_lnNode);
|
||||
gm_mgNewGame.mg_pmgUp = &gm_mgOptions;
|
||||
gm_mgNewGame.mg_pmgDown = &gm_mgCustom;
|
||||
gm_mgNewGame.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgCustom.mg_strText = TRANS("CUSTOM LEVEL");
|
||||
gm_mgCustom.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgCustom.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgCustom.mg_strTip = TRANS("start new game on a custom level");
|
||||
gm_lhGadgets.AddTail(gm_mgCustom.mg_lnNode);
|
||||
gm_mgCustom.mg_pmgUp = &gm_mgNewGame;
|
||||
gm_mgCustom.mg_pmgDown = &gm_mgQuickLoad;
|
||||
gm_mgCustom.mg_pActivatedFunction = NULL;
|
||||
gm_mgCustom.mg_strText = TRANS("CUSTOM LEVEL");
|
||||
gm_mgCustom.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgCustom.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgCustom.mg_strTip = TRANS("start new game on a custom level");
|
||||
gm_lhGadgets.AddTail(gm_mgCustom.mg_lnNode);
|
||||
gm_mgCustom.mg_pmgUp = &gm_mgNewGame;
|
||||
gm_mgCustom.mg_pmgDown = &gm_mgQuickLoad;
|
||||
gm_mgCustom.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgQuickLoad.mg_strText = TRANS("QUICK LOAD");
|
||||
gm_mgQuickLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuickLoad.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgQuickLoad.mg_strTip = TRANS("load a quick-saved game (F9)");
|
||||
gm_lhGadgets.AddTail(gm_mgQuickLoad.mg_lnNode);
|
||||
gm_mgQuickLoad.mg_pmgUp = &gm_mgCustom;
|
||||
gm_mgQuickLoad.mg_pmgDown = &gm_mgLoad;
|
||||
gm_mgQuickLoad.mg_pActivatedFunction = NULL;
|
||||
gm_mgQuickLoad.mg_strText = TRANS("QUICK LOAD");
|
||||
gm_mgQuickLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuickLoad.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgQuickLoad.mg_strTip = TRANS("load a quick-saved game (F9)");
|
||||
gm_lhGadgets.AddTail(gm_mgQuickLoad.mg_lnNode);
|
||||
gm_mgQuickLoad.mg_pmgUp = &gm_mgCustom;
|
||||
gm_mgQuickLoad.mg_pmgDown = &gm_mgLoad;
|
||||
gm_mgQuickLoad.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgLoad.mg_strText = TRANS("LOAD");
|
||||
gm_mgLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgLoad.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgLoad.mg_strTip = TRANS("load a saved game of current player");
|
||||
gm_lhGadgets.AddTail(gm_mgLoad.mg_lnNode);
|
||||
gm_mgLoad.mg_pmgUp = &gm_mgQuickLoad;
|
||||
gm_mgLoad.mg_pmgDown = &gm_mgTraining;
|
||||
gm_mgLoad.mg_pActivatedFunction = NULL;
|
||||
gm_mgLoad.mg_strText = TRANS("LOAD");
|
||||
gm_mgLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgLoad.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgLoad.mg_strTip = TRANS("load a saved game of current player");
|
||||
gm_lhGadgets.AddTail(gm_mgLoad.mg_lnNode);
|
||||
gm_mgLoad.mg_pmgUp = &gm_mgQuickLoad;
|
||||
gm_mgLoad.mg_pmgDown = &gm_mgTraining;
|
||||
gm_mgLoad.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgTraining.mg_strText = TRANS("TRAINING");
|
||||
gm_mgTraining.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgTraining.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgTraining.mg_strTip = TRANS("start training level - KarnakDemo");
|
||||
gm_lhGadgets.AddTail(gm_mgTraining.mg_lnNode);
|
||||
gm_mgTraining.mg_pmgUp = &gm_mgLoad;
|
||||
gm_mgTraining.mg_pmgDown = &gm_mgTechTest;
|
||||
gm_mgTraining.mg_pActivatedFunction = NULL;
|
||||
gm_mgTraining.mg_strText = TRANS("TRAINING");
|
||||
gm_mgTraining.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgTraining.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgTraining.mg_strTip = TRANS("start training level - KarnakDemo");
|
||||
gm_lhGadgets.AddTail(gm_mgTraining.mg_lnNode);
|
||||
gm_mgTraining.mg_pmgUp = &gm_mgLoad;
|
||||
gm_mgTraining.mg_pmgDown = &gm_mgTechTest;
|
||||
gm_mgTraining.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgTechTest.mg_strText = TRANS("TECHNOLOGY TEST");
|
||||
gm_mgTechTest.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgTechTest.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgTechTest.mg_strTip = TRANS("start technology testing level");
|
||||
gm_lhGadgets.AddTail(gm_mgTechTest.mg_lnNode);
|
||||
gm_mgTechTest.mg_pmgUp = &gm_mgTraining;
|
||||
gm_mgTechTest.mg_pmgDown = &gm_mgPlayersAndControls;
|
||||
gm_mgTechTest.mg_pActivatedFunction = NULL;
|
||||
gm_mgTechTest.mg_strText = TRANS("TECHNOLOGY TEST");
|
||||
gm_mgTechTest.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgTechTest.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgTechTest.mg_strTip = TRANS("start technology testing level");
|
||||
gm_lhGadgets.AddTail(gm_mgTechTest.mg_lnNode);
|
||||
gm_mgTechTest.mg_pmgUp = &gm_mgTraining;
|
||||
gm_mgTechTest.mg_pmgDown = &gm_mgPlayersAndControls;
|
||||
gm_mgTechTest.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgPlayersAndControls.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgPlayersAndControls.mg_boxOnScreen = BoxBigRow(6.0f);
|
||||
gm_mgPlayersAndControls.mg_pmgUp = &gm_mgTechTest;
|
||||
gm_mgPlayersAndControls.mg_pmgDown = &gm_mgOptions;
|
||||
gm_mgPlayersAndControls.mg_strText = TRANS("PLAYERS AND CONTROLS");
|
||||
gm_mgPlayersAndControls.mg_strTip = TRANS("change currently active player or adjust controls");
|
||||
gm_lhGadgets.AddTail(gm_mgPlayersAndControls.mg_lnNode);
|
||||
gm_mgPlayersAndControls.mg_pActivatedFunction = NULL;
|
||||
gm_mgPlayersAndControls.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgPlayersAndControls.mg_boxOnScreen = BoxBigRow(6.0f);
|
||||
gm_mgPlayersAndControls.mg_pmgUp = &gm_mgTechTest;
|
||||
gm_mgPlayersAndControls.mg_pmgDown = &gm_mgOptions;
|
||||
gm_mgPlayersAndControls.mg_strText = TRANS("PLAYERS AND CONTROLS");
|
||||
gm_mgPlayersAndControls.mg_strTip = TRANS("change currently active player or adjust controls");
|
||||
gm_lhGadgets.AddTail(gm_mgPlayersAndControls.mg_lnNode);
|
||||
gm_mgPlayersAndControls.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgOptions.mg_strText = TRANS("GAME OPTIONS");
|
||||
gm_mgOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgOptions.mg_boxOnScreen = BoxBigRow(7.0f);
|
||||
gm_mgOptions.mg_strTip = TRANS("adjust miscellaneous game options");
|
||||
gm_lhGadgets.AddTail(gm_mgOptions.mg_lnNode);
|
||||
gm_mgOptions.mg_pmgUp = &gm_mgPlayersAndControls;
|
||||
gm_mgOptions.mg_pmgDown = &gm_mgNewGame;
|
||||
gm_mgOptions.mg_pActivatedFunction = NULL;
|
||||
gm_mgOptions.mg_strText = TRANS("GAME OPTIONS");
|
||||
gm_mgOptions.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgOptions.mg_boxOnScreen = BoxBigRow(7.0f);
|
||||
gm_mgOptions.mg_strTip = TRANS("adjust miscellaneous game options");
|
||||
gm_lhGadgets.AddTail(gm_mgOptions.mg_lnNode);
|
||||
gm_mgOptions.mg_pmgUp = &gm_mgPlayersAndControls;
|
||||
gm_mgOptions.mg_pmgDown = &gm_mgNewGame;
|
||||
gm_mgOptions.mg_pActivatedFunction = NULL;
|
||||
}
|
||||
|
||||
void CSinglePlayerMenu::StartMenu(void)
|
||||
{
|
||||
gm_mgTraining.mg_bEnabled = IsMenuEnabled("Training");
|
||||
gm_mgTechTest.mg_bEnabled = IsMenuEnabled("Technology Test");
|
||||
gm_mgTraining.mg_bEnabled = IsMenuEnabled("Training");
|
||||
gm_mgTechTest.mg_bEnabled = IsMenuEnabled("Technology Test");
|
||||
|
||||
if (gm_mgTraining.mg_bEnabled) {
|
||||
if (!gm_mgTraining.mg_lnNode.IsLinked()) {
|
||||
gm_lhGadgets.AddTail(gm_mgTraining.mg_lnNode);
|
||||
}
|
||||
if (gm_mgTraining.mg_bEnabled) {
|
||||
if (!gm_mgTraining.mg_lnNode.IsLinked()) {
|
||||
gm_lhGadgets.AddTail(gm_mgTraining.mg_lnNode);
|
||||
}
|
||||
|
||||
gm_mgLoad.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgLoad.mg_pmgUp = &gm_mgQuickLoad;
|
||||
gm_mgLoad.mg_pmgDown = &gm_mgTraining;
|
||||
gm_mgLoad.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgLoad.mg_pmgUp = &gm_mgQuickLoad;
|
||||
gm_mgLoad.mg_pmgDown = &gm_mgTraining;
|
||||
|
||||
gm_mgTraining.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgTraining.mg_pmgUp = &gm_mgLoad;
|
||||
gm_mgTraining.mg_pmgDown = &gm_mgTechTest;
|
||||
gm_mgTraining.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgTraining.mg_pmgUp = &gm_mgLoad;
|
||||
gm_mgTraining.mg_pmgDown = &gm_mgTechTest;
|
||||
|
||||
gm_mgTechTest.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgTechTest.mg_pmgUp = &gm_mgTraining;
|
||||
gm_mgTechTest.mg_pmgDown = &gm_mgPlayersAndControls;
|
||||
gm_mgTechTest.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgTechTest.mg_pmgUp = &gm_mgTraining;
|
||||
gm_mgTechTest.mg_pmgDown = &gm_mgPlayersAndControls;
|
||||
|
||||
gm_mgPlayersAndControls.mg_boxOnScreen = BoxBigRow(6.0f);
|
||||
gm_mgOptions.mg_boxOnScreen = BoxBigRow(7.0f);
|
||||
gm_mgPlayersAndControls.mg_boxOnScreen = BoxBigRow(6.0f);
|
||||
gm_mgOptions.mg_boxOnScreen = BoxBigRow(7.0f);
|
||||
|
||||
} else {
|
||||
if (gm_mgTraining.mg_lnNode.IsLinked()) {
|
||||
gm_mgTraining.mg_lnNode.Remove();
|
||||
}
|
||||
} else {
|
||||
if (gm_mgTraining.mg_lnNode.IsLinked()) {
|
||||
gm_mgTraining.mg_lnNode.Remove();
|
||||
}
|
||||
|
||||
gm_mgLoad.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgLoad.mg_pmgUp = &gm_mgQuickLoad;
|
||||
gm_mgLoad.mg_pmgDown = &gm_mgTechTest;
|
||||
gm_mgLoad.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgLoad.mg_pmgUp = &gm_mgQuickLoad;
|
||||
gm_mgLoad.mg_pmgDown = &gm_mgTechTest;
|
||||
|
||||
gm_mgTechTest.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgTechTest.mg_pmgUp = &gm_mgLoad;
|
||||
gm_mgTechTest.mg_pmgDown = &gm_mgPlayersAndControls;
|
||||
gm_mgTechTest.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgTechTest.mg_pmgUp = &gm_mgLoad;
|
||||
gm_mgTechTest.mg_pmgDown = &gm_mgPlayersAndControls;
|
||||
|
||||
gm_mgPlayersAndControls.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgOptions.mg_boxOnScreen = BoxBigRow(6.0f);
|
||||
}
|
||||
gm_mgPlayersAndControls.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgOptions.mg_boxOnScreen = BoxBigRow(6.0f);
|
||||
}
|
||||
|
||||
CGameMenu::StartMenu();
|
||||
CGameMenu::StartMenu();
|
||||
|
||||
CPlayerCharacter &pc = _pGame->gm_apcPlayers[_pGame->gm_iSinglePlayer];
|
||||
gm_mgPlayerLabel.mg_strText.PrintF(TRANS("Player: %s\n"), pc.GetNameForPrinting());
|
||||
CPlayerCharacter &pc = _pGame->gm_apcPlayers[_pGame->gm_iSinglePlayer];
|
||||
gm_mgPlayerLabel.mg_strText.PrintF(TRANS("Player: %s\n"), pc.GetNameForPrinting());
|
||||
}
|
||||
|
|
|
@ -21,79 +21,79 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CSinglePlayerNewMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize single player new menu
|
||||
gm_mgTitle.mg_strText = TRANS("NEW GAME");
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// intialize single player new menu
|
||||
gm_mgTitle.mg_strText = TRANS("NEW GAME");
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgTourist.mg_strText = TRANS("TOURIST");
|
||||
gm_mgTourist.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgTourist.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
gm_mgTourist.mg_strTip = TRANS("for non-FPS players");
|
||||
gm_lhGadgets.AddTail(gm_mgTourist.mg_lnNode);
|
||||
gm_mgTourist.mg_pmgUp = &gm_mgSerious;
|
||||
gm_mgTourist.mg_pmgDown = &gm_mgEasy;
|
||||
gm_mgTourist.mg_pActivatedFunction = NULL;
|
||||
gm_mgTourist.mg_strText = TRANS("TOURIST");
|
||||
gm_mgTourist.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgTourist.mg_boxOnScreen = BoxBigRow(0.0f);
|
||||
gm_mgTourist.mg_strTip = TRANS("for non-FPS players");
|
||||
gm_lhGadgets.AddTail(gm_mgTourist.mg_lnNode);
|
||||
gm_mgTourist.mg_pmgUp = &gm_mgSerious;
|
||||
gm_mgTourist.mg_pmgDown = &gm_mgEasy;
|
||||
gm_mgTourist.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgEasy.mg_strText = TRANS("EASY");
|
||||
gm_mgEasy.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgEasy.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgEasy.mg_strTip = TRANS("for unexperienced FPS players");
|
||||
gm_lhGadgets.AddTail(gm_mgEasy.mg_lnNode);
|
||||
gm_mgEasy.mg_pmgUp = &gm_mgTourist;
|
||||
gm_mgEasy.mg_pmgDown = &gm_mgMedium;
|
||||
gm_mgEasy.mg_pActivatedFunction = NULL;
|
||||
gm_mgEasy.mg_strText = TRANS("EASY");
|
||||
gm_mgEasy.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgEasy.mg_boxOnScreen = BoxBigRow(1.0f);
|
||||
gm_mgEasy.mg_strTip = TRANS("for unexperienced FPS players");
|
||||
gm_lhGadgets.AddTail(gm_mgEasy.mg_lnNode);
|
||||
gm_mgEasy.mg_pmgUp = &gm_mgTourist;
|
||||
gm_mgEasy.mg_pmgDown = &gm_mgMedium;
|
||||
gm_mgEasy.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgMedium.mg_strText = TRANS("NORMAL");
|
||||
gm_mgMedium.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgMedium.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgMedium.mg_strTip = TRANS("for experienced FPS players");
|
||||
gm_lhGadgets.AddTail(gm_mgMedium.mg_lnNode);
|
||||
gm_mgMedium.mg_pmgUp = &gm_mgEasy;
|
||||
gm_mgMedium.mg_pmgDown = &gm_mgHard;
|
||||
gm_mgMedium.mg_pActivatedFunction = NULL;
|
||||
gm_mgMedium.mg_strText = TRANS("NORMAL");
|
||||
gm_mgMedium.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgMedium.mg_boxOnScreen = BoxBigRow(2.0f);
|
||||
gm_mgMedium.mg_strTip = TRANS("for experienced FPS players");
|
||||
gm_lhGadgets.AddTail(gm_mgMedium.mg_lnNode);
|
||||
gm_mgMedium.mg_pmgUp = &gm_mgEasy;
|
||||
gm_mgMedium.mg_pmgDown = &gm_mgHard;
|
||||
gm_mgMedium.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgHard.mg_strText = TRANS("HARD");
|
||||
gm_mgHard.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgHard.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgHard.mg_strTip = TRANS("for experienced Serious Sam players");
|
||||
gm_lhGadgets.AddTail(gm_mgHard.mg_lnNode);
|
||||
gm_mgHard.mg_pmgUp = &gm_mgMedium;
|
||||
gm_mgHard.mg_pmgDown = &gm_mgSerious;
|
||||
gm_mgHard.mg_pActivatedFunction = NULL;
|
||||
gm_mgHard.mg_strText = TRANS("HARD");
|
||||
gm_mgHard.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgHard.mg_boxOnScreen = BoxBigRow(3.0f);
|
||||
gm_mgHard.mg_strTip = TRANS("for experienced Serious Sam players");
|
||||
gm_lhGadgets.AddTail(gm_mgHard.mg_lnNode);
|
||||
gm_mgHard.mg_pmgUp = &gm_mgMedium;
|
||||
gm_mgHard.mg_pmgDown = &gm_mgSerious;
|
||||
gm_mgHard.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgSerious.mg_strText = TRANS("SERIOUS");
|
||||
gm_mgSerious.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgSerious.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgSerious.mg_strTip = TRANS("are you serious?");
|
||||
gm_lhGadgets.AddTail(gm_mgSerious.mg_lnNode);
|
||||
gm_mgSerious.mg_pmgUp = &gm_mgHard;
|
||||
gm_mgSerious.mg_pmgDown = &gm_mgTourist;
|
||||
gm_mgSerious.mg_pActivatedFunction = NULL;
|
||||
gm_mgSerious.mg_strText = TRANS("SERIOUS");
|
||||
gm_mgSerious.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgSerious.mg_boxOnScreen = BoxBigRow(4.0f);
|
||||
gm_mgSerious.mg_strTip = TRANS("are you serious?");
|
||||
gm_lhGadgets.AddTail(gm_mgSerious.mg_lnNode);
|
||||
gm_mgSerious.mg_pmgUp = &gm_mgHard;
|
||||
gm_mgSerious.mg_pmgDown = &gm_mgTourist;
|
||||
gm_mgSerious.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgMental.mg_strText = TRANS("MENTAL");
|
||||
gm_mgMental.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgMental.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgMental.mg_strTip = TRANS("you are not serious!");
|
||||
gm_lhGadgets.AddTail(gm_mgMental.mg_lnNode);
|
||||
gm_mgMental.mg_pmgUp = &gm_mgSerious;
|
||||
gm_mgMental.mg_pmgDown = &gm_mgTourist;
|
||||
gm_mgMental.mg_pActivatedFunction = NULL;
|
||||
gm_mgMental.mg_bMental = TRUE;
|
||||
gm_mgMental.mg_strText = TRANS("MENTAL");
|
||||
gm_mgMental.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgMental.mg_boxOnScreen = BoxBigRow(5.0f);
|
||||
gm_mgMental.mg_strTip = TRANS("you are not serious!");
|
||||
gm_lhGadgets.AddTail(gm_mgMental.mg_lnNode);
|
||||
gm_mgMental.mg_pmgUp = &gm_mgSerious;
|
||||
gm_mgMental.mg_pmgDown = &gm_mgTourist;
|
||||
gm_mgMental.mg_pActivatedFunction = NULL;
|
||||
gm_mgMental.mg_bMental = TRUE;
|
||||
|
||||
|
||||
}
|
||||
void CSinglePlayerNewMenu::StartMenu(void)
|
||||
{
|
||||
CGameMenu::StartMenu();
|
||||
extern INDEX sam_bMentalActivated;
|
||||
if (sam_bMentalActivated) {
|
||||
gm_mgMental.Appear();
|
||||
gm_mgSerious.mg_pmgDown = &gm_mgMental;
|
||||
gm_mgTourist.mg_pmgUp = &gm_mgMental;
|
||||
} else {
|
||||
gm_mgMental.Disappear();
|
||||
gm_mgSerious.mg_pmgDown = &gm_mgTourist;
|
||||
gm_mgTourist.mg_pmgUp = &gm_mgSerious;
|
||||
}
|
||||
CGameMenu::StartMenu();
|
||||
extern INDEX sam_bMentalActivated;
|
||||
if (sam_bMentalActivated) {
|
||||
gm_mgMental.Appear();
|
||||
gm_mgSerious.mg_pmgDown = &gm_mgMental;
|
||||
gm_mgTourist.mg_pmgUp = &gm_mgMental;
|
||||
} else {
|
||||
gm_mgMental.Disappear();
|
||||
gm_mgSerious.mg_pmgDown = &gm_mgTourist;
|
||||
gm_mgTourist.mg_pmgUp = &gm_mgSerious;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,40 +20,40 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
void CSplitScreenMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize split screen menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("SPLIT SCREEN");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// intialize split screen menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("SPLIT SCREEN");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
gm_mgStart.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgStart.mg_boxOnScreen = BoxBigRow(0);
|
||||
gm_mgStart.mg_pmgUp = &gm_mgLoad;
|
||||
gm_mgStart.mg_pmgDown = &gm_mgQuickLoad;
|
||||
gm_mgStart.mg_strText = TRANS("NEW GAME");
|
||||
gm_mgStart.mg_strTip = TRANS("start new split-screen game");
|
||||
gm_lhGadgets.AddTail(gm_mgStart.mg_lnNode);
|
||||
gm_mgStart.mg_pActivatedFunction = NULL;
|
||||
gm_mgStart.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgStart.mg_boxOnScreen = BoxBigRow(0);
|
||||
gm_mgStart.mg_pmgUp = &gm_mgLoad;
|
||||
gm_mgStart.mg_pmgDown = &gm_mgQuickLoad;
|
||||
gm_mgStart.mg_strText = TRANS("NEW GAME");
|
||||
gm_mgStart.mg_strTip = TRANS("start new split-screen game");
|
||||
gm_lhGadgets.AddTail(gm_mgStart.mg_lnNode);
|
||||
gm_mgStart.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgQuickLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuickLoad.mg_boxOnScreen = BoxBigRow(1);
|
||||
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_mgQuickLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgQuickLoad.mg_boxOnScreen = BoxBigRow(1);
|
||||
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(2);
|
||||
gm_mgLoad.mg_pmgUp = &gm_mgQuickLoad;
|
||||
gm_mgLoad.mg_pmgDown = &gm_mgStart;
|
||||
gm_mgLoad.mg_strText = TRANS("LOAD");
|
||||
gm_mgLoad.mg_strTip = TRANS("load a saved split-screen game");
|
||||
gm_lhGadgets.AddTail(gm_mgLoad.mg_lnNode);
|
||||
gm_mgLoad.mg_pActivatedFunction = NULL;
|
||||
gm_mgLoad.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgLoad.mg_boxOnScreen = BoxBigRow(2);
|
||||
gm_mgLoad.mg_pmgUp = &gm_mgQuickLoad;
|
||||
gm_mgLoad.mg_pmgDown = &gm_mgStart;
|
||||
gm_mgLoad.mg_strText = TRANS("LOAD");
|
||||
gm_mgLoad.mg_strTip = TRANS("load a saved split-screen game");
|
||||
gm_lhGadgets.AddTail(gm_mgLoad.mg_lnNode);
|
||||
gm_mgLoad.mg_pActivatedFunction = NULL;
|
||||
}
|
||||
|
||||
void CSplitScreenMenu::StartMenu(void)
|
||||
{
|
||||
CGameMenu::StartMenu();
|
||||
CGameMenu::StartMenu();
|
||||
}
|
|
@ -24,77 +24,77 @@ extern void UpdateSplitLevel(INDEX iDummy);
|
|||
|
||||
void CSplitStartMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize split screen menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("START SPLIT SCREEN");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// intialize split screen menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("START SPLIT SCREEN");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
// game type trigger
|
||||
TRIGGER_MG(gm_mgGameType, 0,
|
||||
gm_mgStart, gm_mgDifficulty, TRANS("Game type:"), astrGameTypeRadioTexts);
|
||||
gm_mgGameType.mg_ctTexts = ctGameTypeRadioTexts;
|
||||
gm_mgGameType.mg_strTip = TRANS("choose type of multiplayer game");
|
||||
gm_mgGameType.mg_pOnTriggerChange = &UpdateSplitLevel;
|
||||
// game type trigger
|
||||
TRIGGER_MG(gm_mgGameType, 0,
|
||||
gm_mgStart, gm_mgDifficulty, TRANS("Game type:"), astrGameTypeRadioTexts);
|
||||
gm_mgGameType.mg_ctTexts = ctGameTypeRadioTexts;
|
||||
gm_mgGameType.mg_strTip = TRANS("choose type of multiplayer game");
|
||||
gm_mgGameType.mg_pOnTriggerChange = &UpdateSplitLevel;
|
||||
|
||||
// difficulty trigger
|
||||
TRIGGER_MG(gm_mgDifficulty, 1,
|
||||
gm_mgGameType, gm_mgLevel, TRANS("Difficulty:"), astrDifficultyRadioTexts);
|
||||
gm_mgDifficulty.mg_strTip = TRANS("choose difficulty level");
|
||||
// difficulty trigger
|
||||
TRIGGER_MG(gm_mgDifficulty, 1,
|
||||
gm_mgGameType, gm_mgLevel, TRANS("Difficulty:"), astrDifficultyRadioTexts);
|
||||
gm_mgDifficulty.mg_strTip = TRANS("choose difficulty level");
|
||||
|
||||
// level name
|
||||
gm_mgLevel.mg_strText = "";
|
||||
gm_mgLevel.mg_strLabel = TRANS("Level:");
|
||||
gm_mgLevel.mg_boxOnScreen = BoxMediumRow(2);
|
||||
gm_mgLevel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgLevel.mg_iCenterI = -1;
|
||||
gm_mgLevel.mg_pmgUp = &gm_mgDifficulty;
|
||||
gm_mgLevel.mg_pmgDown = &gm_mgOptions;
|
||||
gm_mgLevel.mg_strTip = TRANS("choose the level to start");
|
||||
gm_mgLevel.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgLevel.mg_lnNode);
|
||||
// level name
|
||||
gm_mgLevel.mg_strText = "";
|
||||
gm_mgLevel.mg_strLabel = TRANS("Level:");
|
||||
gm_mgLevel.mg_boxOnScreen = BoxMediumRow(2);
|
||||
gm_mgLevel.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgLevel.mg_iCenterI = -1;
|
||||
gm_mgLevel.mg_pmgUp = &gm_mgDifficulty;
|
||||
gm_mgLevel.mg_pmgDown = &gm_mgOptions;
|
||||
gm_mgLevel.mg_strTip = TRANS("choose the level to start");
|
||||
gm_mgLevel.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgLevel.mg_lnNode);
|
||||
|
||||
// options button
|
||||
gm_mgOptions.mg_strText = TRANS("Game options");
|
||||
gm_mgOptions.mg_boxOnScreen = BoxMediumRow(3);
|
||||
gm_mgOptions.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgOptions.mg_iCenterI = 0;
|
||||
gm_mgOptions.mg_pmgUp = &gm_mgLevel;
|
||||
gm_mgOptions.mg_pmgDown = &gm_mgStart;
|
||||
gm_mgOptions.mg_strTip = TRANS("adjust game rules");
|
||||
gm_mgOptions.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgOptions.mg_lnNode);
|
||||
// options button
|
||||
gm_mgOptions.mg_strText = TRANS("Game options");
|
||||
gm_mgOptions.mg_boxOnScreen = BoxMediumRow(3);
|
||||
gm_mgOptions.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgOptions.mg_iCenterI = 0;
|
||||
gm_mgOptions.mg_pmgUp = &gm_mgLevel;
|
||||
gm_mgOptions.mg_pmgDown = &gm_mgStart;
|
||||
gm_mgOptions.mg_strTip = TRANS("adjust game rules");
|
||||
gm_mgOptions.mg_pActivatedFunction = NULL;
|
||||
gm_lhGadgets.AddTail(gm_mgOptions.mg_lnNode);
|
||||
|
||||
// start button
|
||||
gm_mgStart.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgStart.mg_boxOnScreen = BoxBigRow(4);
|
||||
gm_mgStart.mg_pmgUp = &gm_mgOptions;
|
||||
gm_mgStart.mg_pmgDown = &gm_mgGameType;
|
||||
gm_mgStart.mg_strText = TRANS("START");
|
||||
gm_lhGadgets.AddTail(gm_mgStart.mg_lnNode);
|
||||
gm_mgStart.mg_pActivatedFunction = NULL;
|
||||
// start button
|
||||
gm_mgStart.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgStart.mg_boxOnScreen = BoxBigRow(4);
|
||||
gm_mgStart.mg_pmgUp = &gm_mgOptions;
|
||||
gm_mgStart.mg_pmgDown = &gm_mgGameType;
|
||||
gm_mgStart.mg_strText = TRANS("START");
|
||||
gm_lhGadgets.AddTail(gm_mgStart.mg_lnNode);
|
||||
gm_mgStart.mg_pActivatedFunction = NULL;
|
||||
}
|
||||
|
||||
void CSplitStartMenu::StartMenu(void)
|
||||
{
|
||||
extern INDEX sam_bMentalActivated;
|
||||
gm_mgDifficulty.mg_ctTexts = sam_bMentalActivated ? 6 : 5;
|
||||
extern INDEX sam_bMentalActivated;
|
||||
gm_mgDifficulty.mg_ctTexts = sam_bMentalActivated ? 6 : 5;
|
||||
|
||||
gm_mgGameType.mg_iSelected = Clamp(_pShell->GetINDEX("gam_iStartMode"), 0L, ctGameTypeRadioTexts - 1L);
|
||||
gm_mgGameType.ApplyCurrentSelection();
|
||||
gm_mgDifficulty.mg_iSelected = _pShell->GetINDEX("gam_iStartDifficulty") + 1;
|
||||
gm_mgDifficulty.ApplyCurrentSelection();
|
||||
gm_mgGameType.mg_iSelected = Clamp(_pShell->GetINDEX("gam_iStartMode"), 0L, ctGameTypeRadioTexts - 1L);
|
||||
gm_mgGameType.ApplyCurrentSelection();
|
||||
gm_mgDifficulty.mg_iSelected = _pShell->GetINDEX("gam_iStartDifficulty") + 1;
|
||||
gm_mgDifficulty.ApplyCurrentSelection();
|
||||
|
||||
// clamp maximum number of players to at least 4
|
||||
_pShell->SetINDEX("gam_ctMaxPlayers", ClampDn(_pShell->GetINDEX("gam_ctMaxPlayers"), 4L));
|
||||
// clamp maximum number of players to at least 4
|
||||
_pShell->SetINDEX("gam_ctMaxPlayers", ClampDn(_pShell->GetINDEX("gam_ctMaxPlayers"), 4L));
|
||||
|
||||
UpdateSplitLevel(0);
|
||||
CGameMenu::StartMenu();
|
||||
UpdateSplitLevel(0);
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void CSplitStartMenu::EndMenu(void)
|
||||
{
|
||||
_pShell->SetINDEX("gam_iStartDifficulty", gm_mgDifficulty.mg_iSelected - 1);
|
||||
_pShell->SetINDEX("gam_iStartMode", gm_mgGameType.mg_iSelected);
|
||||
_pShell->SetINDEX("gam_iStartDifficulty", gm_mgDifficulty.mg_iSelected - 1);
|
||||
_pShell->SetINDEX("gam_iStartMode", gm_mgGameType.mg_iSelected);
|
||||
|
||||
CGameMenu::EndMenu();
|
||||
CGameMenu::EndMenu();
|
||||
}
|
|
@ -23,111 +23,111 @@ extern BOOL _bVarChanged;
|
|||
|
||||
void CVarMenu::Initialize_t(void)
|
||||
{
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = "";
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = "";
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
for (INDEX iLabel = 0; iLabel<VARS_ON_SCREEN; iLabel++)
|
||||
{
|
||||
INDEX iPrev = (VARS_ON_SCREEN + iLabel - 1) % VARS_ON_SCREEN;
|
||||
INDEX iNext = (iLabel + 1) % VARS_ON_SCREEN;
|
||||
// initialize label gadgets
|
||||
gm_mgVar[iLabel].mg_pmgUp = &gm_mgVar[iPrev];
|
||||
gm_mgVar[iLabel].mg_pmgDown = &gm_mgVar[iNext];
|
||||
gm_mgVar[iLabel].mg_pmgLeft = &gm_mgApply;
|
||||
gm_mgVar[iLabel].mg_boxOnScreen = BoxMediumRow(iLabel);
|
||||
gm_mgVar[iLabel].mg_pActivatedFunction = NULL; // never called!
|
||||
gm_lhGadgets.AddTail(gm_mgVar[iLabel].mg_lnNode);
|
||||
}
|
||||
for (INDEX iLabel = 0; iLabel<VARS_ON_SCREEN; iLabel++)
|
||||
{
|
||||
INDEX iPrev = (VARS_ON_SCREEN + iLabel - 1) % VARS_ON_SCREEN;
|
||||
INDEX iNext = (iLabel + 1) % VARS_ON_SCREEN;
|
||||
// initialize label gadgets
|
||||
gm_mgVar[iLabel].mg_pmgUp = &gm_mgVar[iPrev];
|
||||
gm_mgVar[iLabel].mg_pmgDown = &gm_mgVar[iNext];
|
||||
gm_mgVar[iLabel].mg_pmgLeft = &gm_mgApply;
|
||||
gm_mgVar[iLabel].mg_boxOnScreen = BoxMediumRow(iLabel);
|
||||
gm_mgVar[iLabel].mg_pActivatedFunction = NULL; // never called!
|
||||
gm_lhGadgets.AddTail(gm_mgVar[iLabel].mg_lnNode);
|
||||
}
|
||||
|
||||
gm_mgApply.mg_boxOnScreen = BoxMediumRow(16.5f);
|
||||
gm_mgApply.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgApply.mg_iCenterI = 1;
|
||||
gm_mgApply.mg_pmgLeft =
|
||||
gm_mgApply.mg_pmgRight =
|
||||
gm_mgApply.mg_pmgUp =
|
||||
gm_mgApply.mg_pmgDown = &gm_mgVar[0];
|
||||
gm_mgApply.mg_strText = TRANS("APPLY");
|
||||
gm_mgApply.mg_strTip = TRANS("apply changes");
|
||||
gm_lhGadgets.AddTail(gm_mgApply.mg_lnNode);
|
||||
gm_mgApply.mg_pActivatedFunction = NULL;
|
||||
gm_mgApply.mg_boxOnScreen = BoxMediumRow(16.5f);
|
||||
gm_mgApply.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgApply.mg_iCenterI = 1;
|
||||
gm_mgApply.mg_pmgLeft =
|
||||
gm_mgApply.mg_pmgRight =
|
||||
gm_mgApply.mg_pmgUp =
|
||||
gm_mgApply.mg_pmgDown = &gm_mgVar[0];
|
||||
gm_mgApply.mg_strText = TRANS("APPLY");
|
||||
gm_mgApply.mg_strTip = TRANS("apply changes");
|
||||
gm_lhGadgets.AddTail(gm_mgApply.mg_lnNode);
|
||||
gm_mgApply.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_lhGadgets.AddTail(gm_mgArrowUp.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgArrowDn.mg_lnNode);
|
||||
gm_mgArrowUp.mg_adDirection = AD_UP;
|
||||
gm_mgArrowDn.mg_adDirection = AD_DOWN;
|
||||
gm_mgArrowUp.mg_boxOnScreen = BoxArrow(AD_UP);
|
||||
gm_mgArrowDn.mg_boxOnScreen = BoxArrow(AD_DOWN);
|
||||
gm_mgArrowUp.mg_pmgRight = gm_mgArrowUp.mg_pmgDown =
|
||||
&gm_mgVar[0];
|
||||
gm_mgArrowDn.mg_pmgRight = gm_mgArrowDn.mg_pmgUp =
|
||||
&gm_mgVar[VARS_ON_SCREEN - 1];
|
||||
gm_lhGadgets.AddTail(gm_mgArrowUp.mg_lnNode);
|
||||
gm_lhGadgets.AddTail(gm_mgArrowDn.mg_lnNode);
|
||||
gm_mgArrowUp.mg_adDirection = AD_UP;
|
||||
gm_mgArrowDn.mg_adDirection = AD_DOWN;
|
||||
gm_mgArrowUp.mg_boxOnScreen = BoxArrow(AD_UP);
|
||||
gm_mgArrowDn.mg_boxOnScreen = BoxArrow(AD_DOWN);
|
||||
gm_mgArrowUp.mg_pmgRight = gm_mgArrowUp.mg_pmgDown =
|
||||
&gm_mgVar[0];
|
||||
gm_mgArrowDn.mg_pmgRight = gm_mgArrowDn.mg_pmgUp =
|
||||
&gm_mgVar[VARS_ON_SCREEN - 1];
|
||||
|
||||
gm_ctListVisible = VARS_ON_SCREEN;
|
||||
gm_pmgArrowUp = &gm_mgArrowUp;
|
||||
gm_pmgArrowDn = &gm_mgArrowDn;
|
||||
gm_pmgListTop = &gm_mgVar[0];
|
||||
gm_pmgListBottom = &gm_mgVar[VARS_ON_SCREEN - 1];
|
||||
gm_ctListVisible = VARS_ON_SCREEN;
|
||||
gm_pmgArrowUp = &gm_mgArrowUp;
|
||||
gm_pmgArrowDn = &gm_mgArrowDn;
|
||||
gm_pmgListTop = &gm_mgVar[0];
|
||||
gm_pmgListBottom = &gm_mgVar[VARS_ON_SCREEN - 1];
|
||||
}
|
||||
|
||||
void CVarMenu::FillListItems(void)
|
||||
{
|
||||
// disable all items first
|
||||
for (INDEX i = 0; i<VARS_ON_SCREEN; i++) {
|
||||
gm_mgVar[i].mg_bEnabled = FALSE;
|
||||
gm_mgVar[i].mg_pvsVar = NULL;
|
||||
gm_mgVar[i].mg_iInList = -2;
|
||||
}
|
||||
BOOL bHasFirst = FALSE;
|
||||
BOOL bHasLast = FALSE;
|
||||
INDEX ctLabels = _lhVarSettings.Count();
|
||||
INDEX iLabel = 0;
|
||||
// disable all items first
|
||||
for (INDEX i = 0; i<VARS_ON_SCREEN; i++) {
|
||||
gm_mgVar[i].mg_bEnabled = FALSE;
|
||||
gm_mgVar[i].mg_pvsVar = NULL;
|
||||
gm_mgVar[i].mg_iInList = -2;
|
||||
}
|
||||
BOOL bHasFirst = FALSE;
|
||||
BOOL bHasLast = FALSE;
|
||||
INDEX ctLabels = _lhVarSettings.Count();
|
||||
INDEX iLabel = 0;
|
||||
|
||||
FOREACHINLIST(CVarSetting, vs_lnNode, _lhVarSettings, itvs) {
|
||||
CVarSetting &vs = *itvs;
|
||||
INDEX iInMenu = iLabel - gm_iListOffset;
|
||||
if ((iLabel >= gm_iListOffset) &&
|
||||
(iLabel<(gm_iListOffset + VARS_ON_SCREEN)))
|
||||
{
|
||||
bHasFirst |= (iLabel == 0);
|
||||
bHasLast |= (iLabel == ctLabels - 1);
|
||||
gm_mgVar[iInMenu].mg_pvsVar = &vs;
|
||||
gm_mgVar[iInMenu].mg_strTip = vs.vs_strTip;
|
||||
gm_mgVar[iInMenu].mg_bEnabled = gm_mgVar[iInMenu].IsEnabled();
|
||||
gm_mgVar[iInMenu].mg_iInList = iLabel;
|
||||
}
|
||||
iLabel++;
|
||||
}
|
||||
// enable/disable up/down arrows
|
||||
gm_mgArrowUp.mg_bEnabled = !bHasFirst && ctLabels>0;
|
||||
gm_mgArrowDn.mg_bEnabled = !bHasLast && ctLabels>0;
|
||||
FOREACHINLIST(CVarSetting, vs_lnNode, _lhVarSettings, itvs) {
|
||||
CVarSetting &vs = *itvs;
|
||||
INDEX iInMenu = iLabel - gm_iListOffset;
|
||||
if ((iLabel >= gm_iListOffset) &&
|
||||
(iLabel<(gm_iListOffset + VARS_ON_SCREEN)))
|
||||
{
|
||||
bHasFirst |= (iLabel == 0);
|
||||
bHasLast |= (iLabel == ctLabels - 1);
|
||||
gm_mgVar[iInMenu].mg_pvsVar = &vs;
|
||||
gm_mgVar[iInMenu].mg_strTip = vs.vs_strTip;
|
||||
gm_mgVar[iInMenu].mg_bEnabled = gm_mgVar[iInMenu].IsEnabled();
|
||||
gm_mgVar[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 CVarMenu::StartMenu(void)
|
||||
{
|
||||
LoadVarSettings(gm_fnmMenuCFG);
|
||||
// set default parameters for the list
|
||||
gm_iListOffset = 0;
|
||||
gm_ctListTotal = _lhVarSettings.Count();
|
||||
gm_iListWantedItem = 0;
|
||||
CGameMenu::StartMenu();
|
||||
LoadVarSettings(gm_fnmMenuCFG);
|
||||
// set default parameters for the list
|
||||
gm_iListOffset = 0;
|
||||
gm_ctListTotal = _lhVarSettings.Count();
|
||||
gm_iListWantedItem = 0;
|
||||
CGameMenu::StartMenu();
|
||||
}
|
||||
|
||||
void CVarMenu::EndMenu(void)
|
||||
{
|
||||
// disable all items first
|
||||
for (INDEX i = 0; i<VARS_ON_SCREEN; i++) {
|
||||
gm_mgVar[i].mg_bEnabled = FALSE;
|
||||
gm_mgVar[i].mg_pvsVar = NULL;
|
||||
gm_mgVar[i].mg_iInList = -2;
|
||||
}
|
||||
FlushVarSettings(FALSE);
|
||||
_bVarChanged = FALSE;
|
||||
// disable all items first
|
||||
for (INDEX i = 0; i<VARS_ON_SCREEN; i++) {
|
||||
gm_mgVar[i].mg_bEnabled = FALSE;
|
||||
gm_mgVar[i].mg_pvsVar = NULL;
|
||||
gm_mgVar[i].mg_iInList = -2;
|
||||
}
|
||||
FlushVarSettings(FALSE);
|
||||
_bVarChanged = FALSE;
|
||||
}
|
||||
|
||||
void CVarMenu::Think(void)
|
||||
{
|
||||
gm_mgApply.mg_bEnabled = _bVarChanged;
|
||||
extern void FixupBackButton(CGameMenu *pgm);
|
||||
FixupBackButton(this);
|
||||
gm_mgApply.mg_bEnabled = _bVarChanged;
|
||||
extern void FixupBackButton(CGameMenu *pgm);
|
||||
FixupBackButton(this);
|
||||
}
|
|
@ -24,61 +24,61 @@ extern void UpdateVideoOptionsButtons(INDEX iSelected);
|
|||
|
||||
void CVideoOptionsMenu::Initialize_t(void)
|
||||
{
|
||||
// intialize video options menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("VIDEO");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
// intialize video options menu
|
||||
gm_mgTitle.mg_boxOnScreen = BoxTitle();
|
||||
gm_mgTitle.mg_strText = TRANS("VIDEO");
|
||||
gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode);
|
||||
|
||||
TRIGGER_MG(gm_mgDisplayAPITrigger, 0,
|
||||
gm_mgApply, gm_mgDisplayAdaptersTrigger, TRANS("GRAPHICS API"), astrDisplayAPIRadioTexts);
|
||||
gm_mgDisplayAPITrigger.mg_strTip = TRANS("choose graphics API to be used");
|
||||
TRIGGER_MG(gm_mgDisplayAdaptersTrigger, 1,
|
||||
gm_mgDisplayAPITrigger, gm_mgDisplayPrefsTrigger, TRANS("DISPLAY ADAPTER"), astrNoYes);
|
||||
gm_mgDisplayAdaptersTrigger.mg_strTip = TRANS("choose display adapter to be used");
|
||||
TRIGGER_MG(gm_mgDisplayPrefsTrigger, 2,
|
||||
gm_mgDisplayAdaptersTrigger, gm_mgResolutionsTrigger, TRANS("PREFERENCES"), astrDisplayPrefsRadioTexts);
|
||||
gm_mgDisplayPrefsTrigger.mg_strTip = TRANS("balance between speed and rendering quality, depending on your system");
|
||||
TRIGGER_MG(gm_mgResolutionsTrigger, 3,
|
||||
gm_mgDisplayPrefsTrigger, gm_mgFullScreenTrigger, TRANS("RESOLUTION"), astrNoYes);
|
||||
gm_mgResolutionsTrigger.mg_strTip = TRANS("select video mode resolution");
|
||||
TRIGGER_MG(gm_mgFullScreenTrigger, 4,
|
||||
gm_mgResolutionsTrigger, gm_mgBitsPerPixelTrigger, TRANS("FULL SCREEN"), astrNoYes);
|
||||
gm_mgFullScreenTrigger.mg_strTip = TRANS("make game run in a window or in full screen");
|
||||
TRIGGER_MG(gm_mgBitsPerPixelTrigger, 5,
|
||||
gm_mgFullScreenTrigger, gm_mgVideoRendering, TRANS("BITS PER PIXEL"), astrBitsPerPixelRadioTexts);
|
||||
gm_mgBitsPerPixelTrigger.mg_strTip = TRANS("select number of colors used for display");
|
||||
TRIGGER_MG(gm_mgDisplayAPITrigger, 0,
|
||||
gm_mgApply, gm_mgDisplayAdaptersTrigger, TRANS("GRAPHICS API"), astrDisplayAPIRadioTexts);
|
||||
gm_mgDisplayAPITrigger.mg_strTip = TRANS("choose graphics API to be used");
|
||||
TRIGGER_MG(gm_mgDisplayAdaptersTrigger, 1,
|
||||
gm_mgDisplayAPITrigger, gm_mgDisplayPrefsTrigger, TRANS("DISPLAY ADAPTER"), astrNoYes);
|
||||
gm_mgDisplayAdaptersTrigger.mg_strTip = TRANS("choose display adapter to be used");
|
||||
TRIGGER_MG(gm_mgDisplayPrefsTrigger, 2,
|
||||
gm_mgDisplayAdaptersTrigger, gm_mgResolutionsTrigger, TRANS("PREFERENCES"), astrDisplayPrefsRadioTexts);
|
||||
gm_mgDisplayPrefsTrigger.mg_strTip = TRANS("balance between speed and rendering quality, depending on your system");
|
||||
TRIGGER_MG(gm_mgResolutionsTrigger, 3,
|
||||
gm_mgDisplayPrefsTrigger, gm_mgFullScreenTrigger, TRANS("RESOLUTION"), astrNoYes);
|
||||
gm_mgResolutionsTrigger.mg_strTip = TRANS("select video mode resolution");
|
||||
TRIGGER_MG(gm_mgFullScreenTrigger, 4,
|
||||
gm_mgResolutionsTrigger, gm_mgBitsPerPixelTrigger, TRANS("FULL SCREEN"), astrNoYes);
|
||||
gm_mgFullScreenTrigger.mg_strTip = TRANS("make game run in a window or in full screen");
|
||||
TRIGGER_MG(gm_mgBitsPerPixelTrigger, 5,
|
||||
gm_mgFullScreenTrigger, gm_mgVideoRendering, TRANS("BITS PER PIXEL"), astrBitsPerPixelRadioTexts);
|
||||
gm_mgBitsPerPixelTrigger.mg_strTip = TRANS("select number of colors used for display");
|
||||
|
||||
gm_mgDisplayPrefsTrigger.mg_pOnTriggerChange = NULL;
|
||||
gm_mgDisplayAPITrigger.mg_pOnTriggerChange = NULL;
|
||||
gm_mgDisplayAdaptersTrigger.mg_pOnTriggerChange = NULL;
|
||||
gm_mgFullScreenTrigger.mg_pOnTriggerChange = NULL;
|
||||
gm_mgResolutionsTrigger.mg_pOnTriggerChange = NULL;
|
||||
gm_mgBitsPerPixelTrigger.mg_pOnTriggerChange = NULL;
|
||||
gm_mgDisplayPrefsTrigger.mg_pOnTriggerChange = NULL;
|
||||
gm_mgDisplayAPITrigger.mg_pOnTriggerChange = NULL;
|
||||
gm_mgDisplayAdaptersTrigger.mg_pOnTriggerChange = NULL;
|
||||
gm_mgFullScreenTrigger.mg_pOnTriggerChange = NULL;
|
||||
gm_mgResolutionsTrigger.mg_pOnTriggerChange = NULL;
|
||||
gm_mgBitsPerPixelTrigger.mg_pOnTriggerChange = NULL;
|
||||
|
||||
gm_mgVideoRendering.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgVideoRendering.mg_boxOnScreen = BoxMediumRow(7.0f);
|
||||
gm_mgVideoRendering.mg_pmgUp = &gm_mgBitsPerPixelTrigger;
|
||||
gm_mgVideoRendering.mg_pmgDown = &gm_mgApply;
|
||||
gm_mgVideoRendering.mg_strText = TRANS("RENDERING OPTIONS");
|
||||
gm_mgVideoRendering.mg_strTip = TRANS("manually adjust rendering settings");
|
||||
gm_lhGadgets.AddTail(gm_mgVideoRendering.mg_lnNode);
|
||||
gm_mgVideoRendering.mg_pActivatedFunction = NULL;
|
||||
gm_mgVideoRendering.mg_bfsFontSize = BFS_MEDIUM;
|
||||
gm_mgVideoRendering.mg_boxOnScreen = BoxMediumRow(7.0f);
|
||||
gm_mgVideoRendering.mg_pmgUp = &gm_mgBitsPerPixelTrigger;
|
||||
gm_mgVideoRendering.mg_pmgDown = &gm_mgApply;
|
||||
gm_mgVideoRendering.mg_strText = TRANS("RENDERING OPTIONS");
|
||||
gm_mgVideoRendering.mg_strTip = TRANS("manually adjust rendering settings");
|
||||
gm_lhGadgets.AddTail(gm_mgVideoRendering.mg_lnNode);
|
||||
gm_mgVideoRendering.mg_pActivatedFunction = NULL;
|
||||
|
||||
gm_mgApply.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgApply.mg_boxOnScreen = BoxBigRow(5.5f);
|
||||
gm_mgApply.mg_pmgUp = &gm_mgVideoRendering;
|
||||
gm_mgApply.mg_pmgDown = &gm_mgDisplayAPITrigger;
|
||||
gm_mgApply.mg_strText = TRANS("APPLY");
|
||||
gm_mgApply.mg_strTip = TRANS("apply selected options");
|
||||
gm_lhGadgets.AddTail(gm_mgApply.mg_lnNode);
|
||||
gm_mgApply.mg_pActivatedFunction = NULL;
|
||||
gm_mgApply.mg_bfsFontSize = BFS_LARGE;
|
||||
gm_mgApply.mg_boxOnScreen = BoxBigRow(5.5f);
|
||||
gm_mgApply.mg_pmgUp = &gm_mgVideoRendering;
|
||||
gm_mgApply.mg_pmgDown = &gm_mgDisplayAPITrigger;
|
||||
gm_mgApply.mg_strText = TRANS("APPLY");
|
||||
gm_mgApply.mg_strTip = TRANS("apply selected options");
|
||||
gm_lhGadgets.AddTail(gm_mgApply.mg_lnNode);
|
||||
gm_mgApply.mg_pActivatedFunction = NULL;
|
||||
}
|
||||
|
||||
void CVideoOptionsMenu::StartMenu(void)
|
||||
{
|
||||
InitVideoOptionsButtons();
|
||||
InitVideoOptionsButtons();
|
||||
|
||||
CGameMenu::StartMenu();
|
||||
CGameMenu::StartMenu();
|
||||
|
||||
UpdateVideoOptionsButtons(-1);
|
||||
UpdateVideoOptionsButtons(-1);
|
||||
}
|
|
@ -162,9 +162,9 @@ void StartMenus(char *str)
|
|||
IFeel_StopEffect(NULL);
|
||||
if (pgmCurrentMenu == &_pGUIM->gmMainMenu || pgmCurrentMenu == &_pGUIM->gmInGameMenu) {
|
||||
if (_gmRunningGameMode==GM_NONE) {
|
||||
pgmCurrentMenu = &_pGUIM->gmMainMenu;
|
||||
pgmCurrentMenu = &_pGUIM->gmMainMenu;
|
||||
} else {
|
||||
pgmCurrentMenu = &_pGUIM->gmInGameMenu;
|
||||
pgmCurrentMenu = &_pGUIM->gmInGameMenu;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -180,29 +180,29 @@ void StartMenus(char *str)
|
|||
}
|
||||
if (CTString(str)=="load") {
|
||||
StartCurrentLoadMenu();
|
||||
_pGUIM->gmLoadSaveMenu.gm_pgmParentMenu = NULL;
|
||||
_pGUIM->gmLoadSaveMenu.gm_pgmParentMenu = NULL;
|
||||
}
|
||||
if (CTString(str)=="save") {
|
||||
StartCurrentSaveMenu();
|
||||
_pGUIM->gmLoadSaveMenu.gm_pgmParentMenu = NULL;
|
||||
FixupBackButton(&_pGUIM->gmLoadSaveMenu);
|
||||
_pGUIM->gmLoadSaveMenu.gm_pgmParentMenu = NULL;
|
||||
FixupBackButton(&_pGUIM->gmLoadSaveMenu);
|
||||
}
|
||||
if (CTString(str)=="controls") {
|
||||
void StartControlsMenuFromOptions(void);
|
||||
StartControlsMenuFromOptions();
|
||||
_pGUIM->gmControls.gm_pgmParentMenu = NULL;
|
||||
FixupBackButton(&_pGUIM->gmControls);
|
||||
_pGUIM->gmControls.gm_pgmParentMenu = NULL;
|
||||
FixupBackButton(&_pGUIM->gmControls);
|
||||
}
|
||||
if (CTString(str)=="join") {
|
||||
void StartSelectPlayersMenuFromOpen(void);
|
||||
StartSelectPlayersMenuFromOpen();
|
||||
_pGUIM->gmSelectPlayersMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
FixupBackButton(&_pGUIM->gmSelectPlayersMenu);
|
||||
_pGUIM->gmSelectPlayersMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
FixupBackButton(&_pGUIM->gmSelectPlayersMenu);
|
||||
}
|
||||
if (CTString(str)=="hiscore") {
|
||||
ChangeToMenu(&_pGUIM->gmHighScoreMenu);
|
||||
_pGUIM->gmHighScoreMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
FixupBackButton(&_pGUIM->gmHighScoreMenu);
|
||||
ChangeToMenu(&_pGUIM->gmHighScoreMenu);
|
||||
_pGUIM->gmHighScoreMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
FixupBackButton(&_pGUIM->gmHighScoreMenu);
|
||||
}
|
||||
bMenuActive = TRUE;
|
||||
bMenuRendering = TRUE;
|
||||
|
@ -218,9 +218,9 @@ void StopMenus( BOOL bGoToRoot /*=TRUE*/)
|
|||
bMenuActive = FALSE;
|
||||
if (bGoToRoot) {
|
||||
if (_gmRunningGameMode==GM_NONE) {
|
||||
pgmCurrentMenu = &_pGUIM->gmMainMenu;
|
||||
pgmCurrentMenu = &_pGUIM->gmMainMenu;
|
||||
} else {
|
||||
pgmCurrentMenu = &_pGUIM->gmInGameMenu;
|
||||
pgmCurrentMenu = &_pGUIM->gmInGameMenu;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -290,149 +290,149 @@ void InitializeMenus(void)
|
|||
InitGameTypes();
|
||||
|
||||
// ------------------- Initialize menus
|
||||
_pGUIM->gmConfirmMenu.Initialize_t();
|
||||
_pGUIM->gmConfirmMenu.gm_strName = "Confirm";
|
||||
_pGUIM->gmConfirmMenu.gm_pmgSelectedByDefault = &_pGUIM->gmConfirmMenu.gm_mgConfirmYes;
|
||||
_pGUIM->gmConfirmMenu.gm_pgmParentMenu = NULL;
|
||||
InitActionsForConfirmMenu();
|
||||
_pGUIM->gmConfirmMenu.Initialize_t();
|
||||
_pGUIM->gmConfirmMenu.gm_strName = "Confirm";
|
||||
_pGUIM->gmConfirmMenu.gm_pmgSelectedByDefault = &_pGUIM->gmConfirmMenu.gm_mgConfirmYes;
|
||||
_pGUIM->gmConfirmMenu.gm_pgmParentMenu = NULL;
|
||||
InitActionsForConfirmMenu();
|
||||
|
||||
_pGUIM->gmMainMenu.Initialize_t();
|
||||
_pGUIM->gmMainMenu.gm_strName = "Main";
|
||||
_pGUIM->gmMainMenu.gm_pmgSelectedByDefault = &_pGUIM->gmMainMenu.gm_mgSingle;
|
||||
_pGUIM->gmMainMenu.gm_pgmParentMenu = NULL;
|
||||
InitActionsForMainMenu();
|
||||
_pGUIM->gmMainMenu.Initialize_t();
|
||||
_pGUIM->gmMainMenu.gm_strName = "Main";
|
||||
_pGUIM->gmMainMenu.gm_pmgSelectedByDefault = &_pGUIM->gmMainMenu.gm_mgSingle;
|
||||
_pGUIM->gmMainMenu.gm_pgmParentMenu = NULL;
|
||||
InitActionsForMainMenu();
|
||||
|
||||
_pGUIM->gmInGameMenu.Initialize_t();
|
||||
_pGUIM->gmInGameMenu.gm_strName = "InGame";
|
||||
_pGUIM->gmInGameMenu.gm_pmgSelectedByDefault = &_pGUIM->gmInGameMenu.gm_mgQuickLoad;
|
||||
_pGUIM->gmInGameMenu.gm_pgmParentMenu = NULL;
|
||||
InitActionsForInGameMenu();
|
||||
_pGUIM->gmInGameMenu.Initialize_t();
|
||||
_pGUIM->gmInGameMenu.gm_strName = "InGame";
|
||||
_pGUIM->gmInGameMenu.gm_pmgSelectedByDefault = &_pGUIM->gmInGameMenu.gm_mgQuickLoad;
|
||||
_pGUIM->gmInGameMenu.gm_pgmParentMenu = NULL;
|
||||
InitActionsForInGameMenu();
|
||||
|
||||
_pGUIM->gmSinglePlayerMenu.Initialize_t();
|
||||
_pGUIM->gmSinglePlayerMenu.gm_strName = "SinglePlayer";
|
||||
_pGUIM->gmSinglePlayerMenu.gm_pmgSelectedByDefault = &_pGUIM->gmSinglePlayerMenu.gm_mgNewGame;
|
||||
_pGUIM->gmSinglePlayerMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
InitActionsForSinglePlayerMenu();
|
||||
_pGUIM->gmSinglePlayerMenu.Initialize_t();
|
||||
_pGUIM->gmSinglePlayerMenu.gm_strName = "SinglePlayer";
|
||||
_pGUIM->gmSinglePlayerMenu.gm_pmgSelectedByDefault = &_pGUIM->gmSinglePlayerMenu.gm_mgNewGame;
|
||||
_pGUIM->gmSinglePlayerMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
InitActionsForSinglePlayerMenu();
|
||||
|
||||
_pGUIM->gmSinglePlayerNewMenu.Initialize_t();
|
||||
_pGUIM->gmSinglePlayerNewMenu.gm_strName = "SinglePlayerNew";
|
||||
_pGUIM->gmSinglePlayerNewMenu.gm_pmgSelectedByDefault = &_pGUIM->gmSinglePlayerNewMenu.gm_mgMedium;
|
||||
_pGUIM->gmSinglePlayerNewMenu.gm_pgmParentMenu = &_pGUIM->gmSinglePlayerMenu;
|
||||
InitActionsForSinglePlayerNewMenu();
|
||||
_pGUIM->gmSinglePlayerNewMenu.Initialize_t();
|
||||
_pGUIM->gmSinglePlayerNewMenu.gm_strName = "SinglePlayerNew";
|
||||
_pGUIM->gmSinglePlayerNewMenu.gm_pmgSelectedByDefault = &_pGUIM->gmSinglePlayerNewMenu.gm_mgMedium;
|
||||
_pGUIM->gmSinglePlayerNewMenu.gm_pgmParentMenu = &_pGUIM->gmSinglePlayerMenu;
|
||||
InitActionsForSinglePlayerNewMenu();
|
||||
|
||||
_pGUIM->gmDisabledFunction.Initialize_t();
|
||||
_pGUIM->gmDisabledFunction.gm_strName = "DisabledFunction";
|
||||
_pGUIM->gmDisabledFunction.gm_pmgSelectedByDefault = &_pGUIM->gmDisabledFunction.gm_mgButton;
|
||||
_pGUIM->gmDisabledFunction.gm_pgmParentMenu = NULL;
|
||||
_pGUIM->gmDisabledFunction.Initialize_t();
|
||||
_pGUIM->gmDisabledFunction.gm_strName = "DisabledFunction";
|
||||
_pGUIM->gmDisabledFunction.gm_pmgSelectedByDefault = &_pGUIM->gmDisabledFunction.gm_mgButton;
|
||||
_pGUIM->gmDisabledFunction.gm_pgmParentMenu = NULL;
|
||||
|
||||
_pGUIM->gmPlayerProfile.Initialize_t();
|
||||
_pGUIM->gmPlayerProfile.gm_strName = "PlayerProfile";
|
||||
_pGUIM->gmPlayerProfile.gm_pmgSelectedByDefault = &_pGUIM->gmPlayerProfile.gm_mgNameField;
|
||||
InitActionsForPlayerProfileMenu();
|
||||
_pGUIM->gmPlayerProfile.Initialize_t();
|
||||
_pGUIM->gmPlayerProfile.gm_strName = "PlayerProfile";
|
||||
_pGUIM->gmPlayerProfile.gm_pmgSelectedByDefault = &_pGUIM->gmPlayerProfile.gm_mgNameField;
|
||||
InitActionsForPlayerProfileMenu();
|
||||
|
||||
_pGUIM->gmControls.Initialize_t();
|
||||
_pGUIM->gmControls.gm_strName = "Controls";
|
||||
_pGUIM->gmControls.gm_pmgSelectedByDefault = &_pGUIM->gmControls.gm_mgButtons;
|
||||
InitActionsForControlsMenu();
|
||||
_pGUIM->gmControls.Initialize_t();
|
||||
_pGUIM->gmControls.gm_strName = "Controls";
|
||||
_pGUIM->gmControls.gm_pmgSelectedByDefault = &_pGUIM->gmControls.gm_mgButtons;
|
||||
InitActionsForControlsMenu();
|
||||
|
||||
// warning! parent menu has to be set inside button activate function from where
|
||||
// Load/Save menu is called
|
||||
_pGUIM->gmLoadSaveMenu.Initialize_t();
|
||||
_pGUIM->gmLoadSaveMenu.gm_strName = "LoadSave";
|
||||
_pGUIM->gmLoadSaveMenu.gm_pmgSelectedByDefault = &_pGUIM->gmLoadSaveMenu.gm_amgButton[0];
|
||||
_pGUIM->gmLoadSaveMenu.Initialize_t();
|
||||
_pGUIM->gmLoadSaveMenu.gm_strName = "LoadSave";
|
||||
_pGUIM->gmLoadSaveMenu.gm_pmgSelectedByDefault = &_pGUIM->gmLoadSaveMenu.gm_amgButton[0];
|
||||
|
||||
_pGUIM->gmHighScoreMenu.Initialize_t();
|
||||
_pGUIM->gmHighScoreMenu.gm_strName = "HighScore";
|
||||
_pGUIM->gmHighScoreMenu.gm_pmgSelectedByDefault = &mgBack;
|
||||
_pGUIM->gmHighScoreMenu.Initialize_t();
|
||||
_pGUIM->gmHighScoreMenu.gm_strName = "HighScore";
|
||||
_pGUIM->gmHighScoreMenu.gm_pmgSelectedByDefault = &mgBack;
|
||||
|
||||
_pGUIM->gmCustomizeKeyboardMenu.Initialize_t();
|
||||
_pGUIM->gmCustomizeKeyboardMenu.gm_strName = "CustomizeKeyboard";
|
||||
_pGUIM->gmCustomizeKeyboardMenu.gm_pmgSelectedByDefault = &_pGUIM->gmCustomizeKeyboardMenu.gm_mgKey[0];
|
||||
_pGUIM->gmCustomizeKeyboardMenu.gm_pgmParentMenu = &_pGUIM->gmControls;
|
||||
_pGUIM->gmCustomizeKeyboardMenu.Initialize_t();
|
||||
_pGUIM->gmCustomizeKeyboardMenu.gm_strName = "CustomizeKeyboard";
|
||||
_pGUIM->gmCustomizeKeyboardMenu.gm_pmgSelectedByDefault = &_pGUIM->gmCustomizeKeyboardMenu.gm_mgKey[0];
|
||||
_pGUIM->gmCustomizeKeyboardMenu.gm_pgmParentMenu = &_pGUIM->gmControls;
|
||||
|
||||
_pGUIM->gmCustomizeAxisMenu.Initialize_t();
|
||||
_pGUIM->gmCustomizeAxisMenu.gm_strName = "CustomizeAxis";
|
||||
_pGUIM->gmCustomizeAxisMenu.gm_pmgSelectedByDefault = &_pGUIM->gmCustomizeAxisMenu.gm_mgActionTrigger;
|
||||
_pGUIM->gmCustomizeAxisMenu.gm_pgmParentMenu = &_pGUIM->gmControls;
|
||||
InitActionsForCustomizeAxisMenu();
|
||||
_pGUIM->gmCustomizeAxisMenu.Initialize_t();
|
||||
_pGUIM->gmCustomizeAxisMenu.gm_strName = "CustomizeAxis";
|
||||
_pGUIM->gmCustomizeAxisMenu.gm_pmgSelectedByDefault = &_pGUIM->gmCustomizeAxisMenu.gm_mgActionTrigger;
|
||||
_pGUIM->gmCustomizeAxisMenu.gm_pgmParentMenu = &_pGUIM->gmControls;
|
||||
InitActionsForCustomizeAxisMenu();
|
||||
|
||||
_pGUIM->gmOptionsMenu.Initialize_t();
|
||||
_pGUIM->gmOptionsMenu.gm_strName = "Options";
|
||||
_pGUIM->gmOptionsMenu.gm_pmgSelectedByDefault = &_pGUIM->gmOptionsMenu.gm_mgVideoOptions;
|
||||
_pGUIM->gmOptionsMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
InitActionsForOptionsMenu();
|
||||
_pGUIM->gmOptionsMenu.Initialize_t();
|
||||
_pGUIM->gmOptionsMenu.gm_strName = "Options";
|
||||
_pGUIM->gmOptionsMenu.gm_pmgSelectedByDefault = &_pGUIM->gmOptionsMenu.gm_mgVideoOptions;
|
||||
_pGUIM->gmOptionsMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
InitActionsForOptionsMenu();
|
||||
|
||||
_pGUIM->gmVideoOptionsMenu.Initialize_t();
|
||||
_pGUIM->gmVideoOptionsMenu.gm_strName = "VideoOptions";
|
||||
_pGUIM->gmVideoOptionsMenu.gm_pmgSelectedByDefault = &_pGUIM->gmVideoOptionsMenu.gm_mgDisplayAPITrigger;
|
||||
_pGUIM->gmVideoOptionsMenu.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
|
||||
InitActionsForVideoOptionsMenu();
|
||||
_pGUIM->gmVideoOptionsMenu.Initialize_t();
|
||||
_pGUIM->gmVideoOptionsMenu.gm_strName = "VideoOptions";
|
||||
_pGUIM->gmVideoOptionsMenu.gm_pmgSelectedByDefault = &_pGUIM->gmVideoOptionsMenu.gm_mgDisplayAPITrigger;
|
||||
_pGUIM->gmVideoOptionsMenu.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
|
||||
InitActionsForVideoOptionsMenu();
|
||||
|
||||
_pGUIM->gmAudioOptionsMenu.Initialize_t();
|
||||
_pGUIM->gmAudioOptionsMenu.gm_strName = "AudioOptions";
|
||||
_pGUIM->gmAudioOptionsMenu.gm_pmgSelectedByDefault = &_pGUIM->gmAudioOptionsMenu.gm_mgFrequencyTrigger;
|
||||
_pGUIM->gmAudioOptionsMenu.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
|
||||
InitActionsForAudioOptionsMenu();
|
||||
_pGUIM->gmAudioOptionsMenu.Initialize_t();
|
||||
_pGUIM->gmAudioOptionsMenu.gm_strName = "AudioOptions";
|
||||
_pGUIM->gmAudioOptionsMenu.gm_pmgSelectedByDefault = &_pGUIM->gmAudioOptionsMenu.gm_mgFrequencyTrigger;
|
||||
_pGUIM->gmAudioOptionsMenu.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
|
||||
InitActionsForAudioOptionsMenu();
|
||||
|
||||
_pGUIM->gmLevelsMenu.Initialize_t();
|
||||
_pGUIM->gmLevelsMenu.gm_strName = "Levels";
|
||||
_pGUIM->gmLevelsMenu.gm_pmgSelectedByDefault = &_pGUIM->gmLevelsMenu.gm_mgManualLevel[0];
|
||||
_pGUIM->gmLevelsMenu.gm_pgmParentMenu = &_pGUIM->gmSinglePlayerMenu;
|
||||
_pGUIM->gmLevelsMenu.Initialize_t();
|
||||
_pGUIM->gmLevelsMenu.gm_strName = "Levels";
|
||||
_pGUIM->gmLevelsMenu.gm_pmgSelectedByDefault = &_pGUIM->gmLevelsMenu.gm_mgManualLevel[0];
|
||||
_pGUIM->gmLevelsMenu.gm_pgmParentMenu = &_pGUIM->gmSinglePlayerMenu;
|
||||
|
||||
_pGUIM->gmVarMenu.Initialize_t();
|
||||
_pGUIM->gmVarMenu.gm_strName = "Var";
|
||||
_pGUIM->gmVarMenu.gm_pmgSelectedByDefault = &_pGUIM->gmVarMenu.gm_mgVar[0];
|
||||
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkStartMenu;
|
||||
InitActionsForVarMenu();
|
||||
_pGUIM->gmVarMenu.Initialize_t();
|
||||
_pGUIM->gmVarMenu.gm_strName = "Var";
|
||||
_pGUIM->gmVarMenu.gm_pmgSelectedByDefault = &_pGUIM->gmVarMenu.gm_mgVar[0];
|
||||
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkStartMenu;
|
||||
InitActionsForVarMenu();
|
||||
|
||||
_pGUIM->gmServersMenu.Initialize_t();
|
||||
_pGUIM->gmServersMenu.gm_strName = "Servers";
|
||||
_pGUIM->gmServersMenu.gm_pmgSelectedByDefault = &_pGUIM->gmServersMenu.gm_mgList;
|
||||
_pGUIM->gmServersMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkOpenMenu;
|
||||
InitActionsForServersMenu();
|
||||
_pGUIM->gmServersMenu.Initialize_t();
|
||||
_pGUIM->gmServersMenu.gm_strName = "Servers";
|
||||
_pGUIM->gmServersMenu.gm_pmgSelectedByDefault = &_pGUIM->gmServersMenu.gm_mgList;
|
||||
_pGUIM->gmServersMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkOpenMenu;
|
||||
InitActionsForServersMenu();
|
||||
|
||||
_pGUIM->gmNetworkMenu.Initialize_t();
|
||||
_pGUIM->gmNetworkMenu.gm_strName = "Network";
|
||||
_pGUIM->gmNetworkMenu.gm_pmgSelectedByDefault = &_pGUIM->gmNetworkMenu.gm_mgJoin;
|
||||
_pGUIM->gmNetworkMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
InitActionsForNetworkMenu();
|
||||
_pGUIM->gmNetworkMenu.Initialize_t();
|
||||
_pGUIM->gmNetworkMenu.gm_strName = "Network";
|
||||
_pGUIM->gmNetworkMenu.gm_pmgSelectedByDefault = &_pGUIM->gmNetworkMenu.gm_mgJoin;
|
||||
_pGUIM->gmNetworkMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
InitActionsForNetworkMenu();
|
||||
|
||||
_pGUIM->gmNetworkStartMenu.Initialize_t();
|
||||
_pGUIM->gmNetworkStartMenu.gm_strName = "NetworkStart";
|
||||
_pGUIM->gmNetworkStartMenu.gm_pmgSelectedByDefault = &_pGUIM->gmNetworkStartMenu.gm_mgStart;
|
||||
_pGUIM->gmNetworkStartMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkMenu;
|
||||
InitActionsForNetworkStartMenu();
|
||||
_pGUIM->gmNetworkStartMenu.Initialize_t();
|
||||
_pGUIM->gmNetworkStartMenu.gm_strName = "NetworkStart";
|
||||
_pGUIM->gmNetworkStartMenu.gm_pmgSelectedByDefault = &_pGUIM->gmNetworkStartMenu.gm_mgStart;
|
||||
_pGUIM->gmNetworkStartMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkMenu;
|
||||
InitActionsForNetworkStartMenu();
|
||||
|
||||
_pGUIM->gmNetworkJoinMenu.Initialize_t();
|
||||
_pGUIM->gmNetworkJoinMenu.gm_strName = "NetworkJoin";
|
||||
_pGUIM->gmNetworkJoinMenu.gm_pmgSelectedByDefault = &_pGUIM->gmNetworkJoinMenu.gm_mgLAN;
|
||||
_pGUIM->gmNetworkJoinMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkMenu;
|
||||
InitActionsForNetworkJoinMenu();
|
||||
_pGUIM->gmNetworkJoinMenu.Initialize_t();
|
||||
_pGUIM->gmNetworkJoinMenu.gm_strName = "NetworkJoin";
|
||||
_pGUIM->gmNetworkJoinMenu.gm_pmgSelectedByDefault = &_pGUIM->gmNetworkJoinMenu.gm_mgLAN;
|
||||
_pGUIM->gmNetworkJoinMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkMenu;
|
||||
InitActionsForNetworkJoinMenu();
|
||||
|
||||
_pGUIM->gmSelectPlayersMenu.gm_bAllowDedicated = FALSE;
|
||||
_pGUIM->gmSelectPlayersMenu.gm_bAllowObserving = FALSE;
|
||||
_pGUIM->gmSelectPlayersMenu.Initialize_t();
|
||||
_pGUIM->gmSelectPlayersMenu.gm_strName = "SelectPlayers";
|
||||
_pGUIM->gmSelectPlayersMenu.gm_pmgSelectedByDefault = &_pGUIM->gmSelectPlayersMenu.gm_mgStart;
|
||||
InitActionsForSelectPlayersMenu();
|
||||
_pGUIM->gmSelectPlayersMenu.gm_bAllowDedicated = FALSE;
|
||||
_pGUIM->gmSelectPlayersMenu.gm_bAllowObserving = FALSE;
|
||||
_pGUIM->gmSelectPlayersMenu.Initialize_t();
|
||||
_pGUIM->gmSelectPlayersMenu.gm_strName = "SelectPlayers";
|
||||
_pGUIM->gmSelectPlayersMenu.gm_pmgSelectedByDefault = &_pGUIM->gmSelectPlayersMenu.gm_mgStart;
|
||||
InitActionsForSelectPlayersMenu();
|
||||
|
||||
_pGUIM->gmNetworkOpenMenu.Initialize_t();
|
||||
_pGUIM->gmNetworkOpenMenu.gm_strName = "NetworkOpen";
|
||||
_pGUIM->gmNetworkOpenMenu.gm_pmgSelectedByDefault = &_pGUIM->gmNetworkOpenMenu.gm_mgJoin;
|
||||
_pGUIM->gmNetworkOpenMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkJoinMenu;
|
||||
InitActionsForNetworkOpenMenu();
|
||||
_pGUIM->gmNetworkOpenMenu.Initialize_t();
|
||||
_pGUIM->gmNetworkOpenMenu.gm_strName = "NetworkOpen";
|
||||
_pGUIM->gmNetworkOpenMenu.gm_pmgSelectedByDefault = &_pGUIM->gmNetworkOpenMenu.gm_mgJoin;
|
||||
_pGUIM->gmNetworkOpenMenu.gm_pgmParentMenu = &_pGUIM->gmNetworkJoinMenu;
|
||||
InitActionsForNetworkOpenMenu();
|
||||
|
||||
_pGUIM->gmSplitScreenMenu.Initialize_t();
|
||||
_pGUIM->gmSplitScreenMenu.gm_strName = "SplitScreen";
|
||||
_pGUIM->gmSplitScreenMenu.gm_pmgSelectedByDefault = &_pGUIM->gmSplitScreenMenu.gm_mgStart;
|
||||
_pGUIM->gmSplitScreenMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
InitActionsForSplitScreenMenu();
|
||||
_pGUIM->gmSplitScreenMenu.Initialize_t();
|
||||
_pGUIM->gmSplitScreenMenu.gm_strName = "SplitScreen";
|
||||
_pGUIM->gmSplitScreenMenu.gm_pmgSelectedByDefault = &_pGUIM->gmSplitScreenMenu.gm_mgStart;
|
||||
_pGUIM->gmSplitScreenMenu.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
|
||||
InitActionsForSplitScreenMenu();
|
||||
|
||||
_pGUIM->gmSplitStartMenu.Initialize_t();
|
||||
_pGUIM->gmSplitStartMenu.gm_strName = "SplitStart";
|
||||
_pGUIM->gmSplitStartMenu.gm_pmgSelectedByDefault = &_pGUIM->gmSplitStartMenu.gm_mgStart;
|
||||
_pGUIM->gmSplitStartMenu.gm_pgmParentMenu = &_pGUIM->gmSplitScreenMenu;
|
||||
InitActionsForSplitStartMenu();
|
||||
_pGUIM->gmSplitStartMenu.Initialize_t();
|
||||
_pGUIM->gmSplitStartMenu.gm_strName = "SplitStart";
|
||||
_pGUIM->gmSplitStartMenu.gm_pmgSelectedByDefault = &_pGUIM->gmSplitStartMenu.gm_mgStart;
|
||||
_pGUIM->gmSplitStartMenu.gm_pgmParentMenu = &_pGUIM->gmSplitScreenMenu;
|
||||
InitActionsForSplitStartMenu();
|
||||
}
|
||||
catch( char *strError)
|
||||
{
|
||||
|
@ -706,7 +706,7 @@ BOOL DoMenu( CDrawPort *pdp)
|
|||
FLOAT fScaleH = (FLOAT)pixH / 480.0f;
|
||||
PIX pixI0, pixJ0, pixI1, pixJ1;
|
||||
// put logo(s) to main menu (if logos exist)
|
||||
if (pgmCurrentMenu == &_pGUIM->gmMainMenu)
|
||||
if (pgmCurrentMenu == &_pGUIM->gmMainMenu)
|
||||
{
|
||||
if( _ptoLogoODI!=NULL) {
|
||||
CTextureData &td = (CTextureData&)*_ptoLogoODI->GetData();
|
||||
|
@ -744,7 +744,7 @@ BOOL DoMenu( CDrawPort *pdp)
|
|||
dpMenu.PutTexture(&_toLogoMenuB, PIXaabbox2D(
|
||||
PIX2D( pixCenterI, pixHeightJ),PIX2D( pixCenterI+pixSizeI, pixHeightJ+pixSizeJ)));
|
||||
}
|
||||
} else if (pgmCurrentMenu == &_pGUIM->gmAudioOptionsMenu) {
|
||||
} else if (pgmCurrentMenu == &_pGUIM->gmAudioOptionsMenu) {
|
||||
if( _ptoLogoEAX!=NULL) {
|
||||
CTextureData &td = (CTextureData&)*_ptoLogoEAX->GetData();
|
||||
const INDEX iSize = 95;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -34,196 +34,196 @@ extern CTString _strModServerSelected;
|
|||
|
||||
BOOL LSLoadSinglePlayer(const CTFileName &fnm)
|
||||
{
|
||||
_pGame->gm_StartSplitScreenCfg = CGame::SSC_PLAY1;
|
||||
_pGame->gm_StartSplitScreenCfg = CGame::SSC_PLAY1;
|
||||
|
||||
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_iSinglePlayer;
|
||||
_pGame->gm_aiStartLocalPlayers[1] = -1;
|
||||
_pGame->gm_aiStartLocalPlayers[2] = -1;
|
||||
_pGame->gm_aiStartLocalPlayers[3] = -1;
|
||||
_pGame->gm_strNetworkProvider = "Local";
|
||||
if (_pGame->LoadGame(fnm)) {
|
||||
StopMenus();
|
||||
_gmRunningGameMode = GM_SINGLE_PLAYER;
|
||||
}
|
||||
else {
|
||||
_gmRunningGameMode = GM_NONE;
|
||||
}
|
||||
return TRUE;
|
||||
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_iSinglePlayer;
|
||||
_pGame->gm_aiStartLocalPlayers[1] = -1;
|
||||
_pGame->gm_aiStartLocalPlayers[2] = -1;
|
||||
_pGame->gm_aiStartLocalPlayers[3] = -1;
|
||||
_pGame->gm_strNetworkProvider = "Local";
|
||||
if (_pGame->LoadGame(fnm)) {
|
||||
StopMenus();
|
||||
_gmRunningGameMode = GM_SINGLE_PLAYER;
|
||||
}
|
||||
else {
|
||||
_gmRunningGameMode = GM_NONE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LSLoadNetwork(const CTFileName &fnm)
|
||||
{
|
||||
// call local players menu
|
||||
_fnGameToLoad = fnm;
|
||||
StartSelectPlayersMenuFromNetworkLoad();
|
||||
return TRUE;
|
||||
// call local players menu
|
||||
_fnGameToLoad = fnm;
|
||||
StartSelectPlayersMenuFromNetworkLoad();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LSLoadSplitScreen(const CTFileName &fnm)
|
||||
{
|
||||
// call local players menu
|
||||
_fnGameToLoad = fnm;
|
||||
StartSelectPlayersMenuFromSplitScreenLoad();
|
||||
return TRUE;
|
||||
// call local players menu
|
||||
_fnGameToLoad = fnm;
|
||||
StartSelectPlayersMenuFromSplitScreenLoad();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void StartDemoPlay(void)
|
||||
{
|
||||
_pGame->gm_StartSplitScreenCfg = CGame::SSC_OBSERVER;
|
||||
// play the demo
|
||||
_pGame->gm_strNetworkProvider = "Local";
|
||||
if (_pGame->StartDemoPlay(_fnDemoToPlay))
|
||||
{
|
||||
// exit menu and pull up the console
|
||||
StopMenus();
|
||||
if (_pGame->gm_csConsoleState != CS_OFF) _pGame->gm_csConsoleState = CS_TURNINGOFF;
|
||||
_gmRunningGameMode = GM_DEMO;
|
||||
}
|
||||
else {
|
||||
_gmRunningGameMode = GM_NONE;
|
||||
}
|
||||
_pGame->gm_StartSplitScreenCfg = CGame::SSC_OBSERVER;
|
||||
// play the demo
|
||||
_pGame->gm_strNetworkProvider = "Local";
|
||||
if (_pGame->StartDemoPlay(_fnDemoToPlay))
|
||||
{
|
||||
// exit menu and pull up the console
|
||||
StopMenus();
|
||||
if (_pGame->gm_csConsoleState != CS_OFF) _pGame->gm_csConsoleState = CS_TURNINGOFF;
|
||||
_gmRunningGameMode = GM_DEMO;
|
||||
}
|
||||
else {
|
||||
_gmRunningGameMode = GM_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
extern BOOL LSLoadDemo(const CTFileName &fnm)
|
||||
{
|
||||
// call local players menu
|
||||
_fnDemoToPlay = fnm;
|
||||
StartDemoPlay();
|
||||
return TRUE;
|
||||
// call local players menu
|
||||
_fnDemoToPlay = fnm;
|
||||
StartDemoPlay();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LSLoadPlayerModel(const CTFileName &fnm)
|
||||
{
|
||||
// get base filename
|
||||
CTString strBaseName = fnm.FileName();
|
||||
// set it for current player
|
||||
CPlayerCharacter &pc = _pGame->gm_apcPlayers[*_pGUIM->gmPlayerProfile.gm_piCurrentPlayer];
|
||||
CPlayerSettings *pps = (CPlayerSettings *)pc.pc_aubAppearance;
|
||||
memset(pps->ps_achModelFile, 0, sizeof(pps->ps_achModelFile));
|
||||
strncpy(pps->ps_achModelFile, strBaseName, sizeof(pps->ps_achModelFile));
|
||||
// get base filename
|
||||
CTString strBaseName = fnm.FileName();
|
||||
// set it for current player
|
||||
CPlayerCharacter &pc = _pGame->gm_apcPlayers[*_pGUIM->gmPlayerProfile.gm_piCurrentPlayer];
|
||||
CPlayerSettings *pps = (CPlayerSettings *)pc.pc_aubAppearance;
|
||||
memset(pps->ps_achModelFile, 0, sizeof(pps->ps_achModelFile));
|
||||
strncpy(pps->ps_achModelFile, strBaseName, sizeof(pps->ps_achModelFile));
|
||||
|
||||
void MenuGoToParent(void);
|
||||
MenuGoToParent();
|
||||
return TRUE;
|
||||
void MenuGoToParent(void);
|
||||
MenuGoToParent();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LSLoadControls(const CTFileName &fnm)
|
||||
{
|
||||
try {
|
||||
ControlsMenuOn();
|
||||
_pGame->gm_ctrlControlsExtra.Load_t(fnm);
|
||||
ControlsMenuOff();
|
||||
}
|
||||
catch (char *strError) {
|
||||
CPrintF("%s", strError);
|
||||
}
|
||||
try {
|
||||
ControlsMenuOn();
|
||||
_pGame->gm_ctrlControlsExtra.Load_t(fnm);
|
||||
ControlsMenuOff();
|
||||
}
|
||||
catch (char *strError) {
|
||||
CPrintF("%s", strError);
|
||||
}
|
||||
|
||||
void MenuGoToParent(void);
|
||||
MenuGoToParent();
|
||||
return TRUE;
|
||||
void MenuGoToParent(void);
|
||||
MenuGoToParent();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LSLoadAddon(const CTFileName &fnm)
|
||||
{
|
||||
extern INDEX _iAddonExecState;
|
||||
extern CTFileName _fnmAddonToExec;
|
||||
_iAddonExecState = 1;
|
||||
_fnmAddonToExec = fnm;
|
||||
return TRUE;
|
||||
extern INDEX _iAddonExecState;
|
||||
extern CTFileName _fnmAddonToExec;
|
||||
_iAddonExecState = 1;
|
||||
_fnmAddonToExec = fnm;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LSLoadMod(const CTFileName &fnm)
|
||||
{
|
||||
_fnmModSelected = fnm;
|
||||
extern void ModConfirm(void);
|
||||
ModConfirm();
|
||||
return TRUE;
|
||||
_fnmModSelected = fnm;
|
||||
extern void ModConfirm(void);
|
||||
ModConfirm();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LSLoadCustom(const CTFileName &fnm)
|
||||
{
|
||||
_pGUIM->gmVarMenu.gm_mgTitle.mg_strText = TRANS("ADVANCED OPTIONS");
|
||||
// LoadStringVar(fnm.NoExt()+".des", mgVarTitle.mg_strText);
|
||||
// mgVarTitle.mg_strText.OnlyFirstLine();
|
||||
_pGUIM->gmVarMenu.gm_fnmMenuCFG = fnm;
|
||||
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmLoadSaveMenu;
|
||||
ChangeToMenu(&_pGUIM->gmVarMenu);
|
||||
return TRUE;
|
||||
_pGUIM->gmVarMenu.gm_mgTitle.mg_strText = TRANS("ADVANCED OPTIONS");
|
||||
// LoadStringVar(fnm.NoExt()+".des", mgVarTitle.mg_strText);
|
||||
// mgVarTitle.mg_strText.OnlyFirstLine();
|
||||
_pGUIM->gmVarMenu.gm_fnmMenuCFG = fnm;
|
||||
_pGUIM->gmVarMenu.gm_pgmParentMenu = &_pGUIM->gmLoadSaveMenu;
|
||||
ChangeToMenu(&_pGUIM->gmVarMenu);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LSLoadNetSettings(const CTFileName &fnm)
|
||||
{
|
||||
sam_strNetworkSettings = fnm;
|
||||
CTString strCmd;
|
||||
strCmd.PrintF("include \"%s\"", (const char*)sam_strNetworkSettings);
|
||||
_pShell->Execute(strCmd);
|
||||
sam_strNetworkSettings = fnm;
|
||||
CTString strCmd;
|
||||
strCmd.PrintF("include \"%s\"", (const char*)sam_strNetworkSettings);
|
||||
_pShell->Execute(strCmd);
|
||||
|
||||
void MenuGoToParent(void);
|
||||
MenuGoToParent();
|
||||
return TRUE;
|
||||
void MenuGoToParent(void);
|
||||
MenuGoToParent();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// same function for saving in singleplay, network and splitscreen
|
||||
BOOL LSSaveAnyGame(const CTFileName &fnm)
|
||||
{
|
||||
if (_pGame->SaveGame(fnm)) {
|
||||
StopMenus();
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
if (_pGame->SaveGame(fnm)) {
|
||||
StopMenus();
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LSSaveDemo(const CTFileName &fnm)
|
||||
{
|
||||
// save the demo
|
||||
if (_pGame->StartDemoRec(fnm)) {
|
||||
StopMenus();
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
// save the demo
|
||||
if (_pGame->StartDemoRec(fnm)) {
|
||||
StopMenus();
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void StartNetworkLoadGame(void)
|
||||
{
|
||||
// _pGame->gm_MenuSplitScreenCfg = (enum CGame::SplitScreenCfg) mgSplitScreenCfg.mg_iSelected;
|
||||
_pGame->gm_StartSplitScreenCfg = _pGame->gm_MenuSplitScreenCfg;
|
||||
// _pGame->gm_MenuSplitScreenCfg = (enum CGame::SplitScreenCfg) mgSplitScreenCfg.mg_iSelected;
|
||||
_pGame->gm_StartSplitScreenCfg = _pGame->gm_MenuSplitScreenCfg;
|
||||
|
||||
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_aiMenuLocalPlayers[0];
|
||||
_pGame->gm_aiStartLocalPlayers[1] = _pGame->gm_aiMenuLocalPlayers[1];
|
||||
_pGame->gm_aiStartLocalPlayers[2] = _pGame->gm_aiMenuLocalPlayers[2];
|
||||
_pGame->gm_aiStartLocalPlayers[3] = _pGame->gm_aiMenuLocalPlayers[3];
|
||||
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_aiMenuLocalPlayers[0];
|
||||
_pGame->gm_aiStartLocalPlayers[1] = _pGame->gm_aiMenuLocalPlayers[1];
|
||||
_pGame->gm_aiStartLocalPlayers[2] = _pGame->gm_aiMenuLocalPlayers[2];
|
||||
_pGame->gm_aiStartLocalPlayers[3] = _pGame->gm_aiMenuLocalPlayers[3];
|
||||
|
||||
_pGame->gm_strNetworkProvider = "TCP/IP Server";
|
||||
if (_pGame->LoadGame(_fnGameToLoad))
|
||||
{
|
||||
StopMenus();
|
||||
_gmRunningGameMode = GM_NETWORK;
|
||||
}
|
||||
else {
|
||||
_gmRunningGameMode = GM_NONE;
|
||||
}
|
||||
_pGame->gm_strNetworkProvider = "TCP/IP Server";
|
||||
if (_pGame->LoadGame(_fnGameToLoad))
|
||||
{
|
||||
StopMenus();
|
||||
_gmRunningGameMode = GM_NETWORK;
|
||||
}
|
||||
else {
|
||||
_gmRunningGameMode = GM_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
void StartSplitScreenGameLoad(void)
|
||||
{
|
||||
// _pGame->gm_MenuSplitScreenCfg = (enum CGame::SplitScreenCfg) mgSplitScreenCfg.mg_iSelected;
|
||||
_pGame->gm_StartSplitScreenCfg = _pGame->gm_MenuSplitScreenCfg;
|
||||
// _pGame->gm_MenuSplitScreenCfg = (enum CGame::SplitScreenCfg) mgSplitScreenCfg.mg_iSelected;
|
||||
_pGame->gm_StartSplitScreenCfg = _pGame->gm_MenuSplitScreenCfg;
|
||||
|
||||
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_aiMenuLocalPlayers[0];
|
||||
_pGame->gm_aiStartLocalPlayers[1] = _pGame->gm_aiMenuLocalPlayers[1];
|
||||
_pGame->gm_aiStartLocalPlayers[2] = _pGame->gm_aiMenuLocalPlayers[2];
|
||||
_pGame->gm_aiStartLocalPlayers[3] = _pGame->gm_aiMenuLocalPlayers[3];
|
||||
_pGame->gm_aiStartLocalPlayers[0] = _pGame->gm_aiMenuLocalPlayers[0];
|
||||
_pGame->gm_aiStartLocalPlayers[1] = _pGame->gm_aiMenuLocalPlayers[1];
|
||||
_pGame->gm_aiStartLocalPlayers[2] = _pGame->gm_aiMenuLocalPlayers[2];
|
||||
_pGame->gm_aiStartLocalPlayers[3] = _pGame->gm_aiMenuLocalPlayers[3];
|
||||
|
||||
_pGame->gm_strNetworkProvider = "Local";
|
||||
if (_pGame->LoadGame(_fnGameToLoad)) {
|
||||
StopMenus();
|
||||
_gmRunningGameMode = GM_SPLIT_SCREEN;
|
||||
}
|
||||
else {
|
||||
_gmRunningGameMode = GM_NONE;
|
||||
}
|
||||
_pGame->gm_strNetworkProvider = "Local";
|
||||
if (_pGame->LoadGame(_fnGameToLoad)) {
|
||||
StopMenus();
|
||||
_gmRunningGameMode = GM_SPLIT_SCREEN;
|
||||
}
|
||||
else {
|
||||
_gmRunningGameMode = GM_NONE;
|
||||
}
|
||||
}
|
|
@ -20,259 +20,259 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#define RADIOTRANS(str) ("ETRS" str)
|
||||
|
||||
extern CTString astrNoYes[] = {
|
||||
RADIOTRANS("No"),
|
||||
RADIOTRANS("Yes"),
|
||||
RADIOTRANS("No"),
|
||||
RADIOTRANS("Yes"),
|
||||
};
|
||||
|
||||
extern CTString astrComputerInvoke[] = {
|
||||
RADIOTRANS("Use"),
|
||||
RADIOTRANS("Double-click use"),
|
||||
RADIOTRANS("Use"),
|
||||
RADIOTRANS("Double-click use"),
|
||||
};
|
||||
|
||||
extern CTString astrWeapon[] = {
|
||||
RADIOTRANS("Only if new"),
|
||||
RADIOTRANS("Never"),
|
||||
RADIOTRANS("Always"),
|
||||
RADIOTRANS("Only if stronger"),
|
||||
RADIOTRANS("Only if new"),
|
||||
RADIOTRANS("Never"),
|
||||
RADIOTRANS("Always"),
|
||||
RADIOTRANS("Only if stronger"),
|
||||
};
|
||||
|
||||
extern PIX apixWidths[][2] = {
|
||||
320, 240,
|
||||
400, 300,
|
||||
512, 384,
|
||||
640, 240,
|
||||
640, 480,
|
||||
720, 540,
|
||||
800, 300,
|
||||
800, 600,
|
||||
960, 720,
|
||||
1024, 384,
|
||||
1024, 768,
|
||||
1152, 864,
|
||||
1280, 480,
|
||||
1280, 960,
|
||||
1600, 600,
|
||||
1600, 1200,
|
||||
1920, 720,
|
||||
1920, 1440,
|
||||
2048, 786,
|
||||
2048, 1536,
|
||||
320, 240,
|
||||
400, 300,
|
||||
512, 384,
|
||||
640, 240,
|
||||
640, 480,
|
||||
720, 540,
|
||||
800, 300,
|
||||
800, 600,
|
||||
960, 720,
|
||||
1024, 384,
|
||||
1024, 768,
|
||||
1152, 864,
|
||||
1280, 480,
|
||||
1280, 960,
|
||||
1600, 600,
|
||||
1600, 1200,
|
||||
1920, 720,
|
||||
1920, 1440,
|
||||
2048, 786,
|
||||
2048, 1536,
|
||||
};
|
||||
|
||||
extern CTString astrCrosshair[] = {
|
||||
"",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair1.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair2.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair3.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair4.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair5.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair6.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair7.tex",
|
||||
"",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair1.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair2.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair3.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair4.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair5.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair6.tex",
|
||||
"Textures\\Interface\\Crosshairs\\Crosshair7.tex",
|
||||
};
|
||||
|
||||
extern CTString astrMaxPlayersRadioTexts[] = {
|
||||
RADIOTRANS("2"),
|
||||
RADIOTRANS("3"),
|
||||
RADIOTRANS("4"),
|
||||
RADIOTRANS("5"),
|
||||
RADIOTRANS("6"),
|
||||
RADIOTRANS("7"),
|
||||
RADIOTRANS("8"),
|
||||
RADIOTRANS("9"),
|
||||
RADIOTRANS("10"),
|
||||
RADIOTRANS("11"),
|
||||
RADIOTRANS("12"),
|
||||
RADIOTRANS("13"),
|
||||
RADIOTRANS("14"),
|
||||
RADIOTRANS("15"),
|
||||
RADIOTRANS("16"),
|
||||
RADIOTRANS("2"),
|
||||
RADIOTRANS("3"),
|
||||
RADIOTRANS("4"),
|
||||
RADIOTRANS("5"),
|
||||
RADIOTRANS("6"),
|
||||
RADIOTRANS("7"),
|
||||
RADIOTRANS("8"),
|
||||
RADIOTRANS("9"),
|
||||
RADIOTRANS("10"),
|
||||
RADIOTRANS("11"),
|
||||
RADIOTRANS("12"),
|
||||
RADIOTRANS("13"),
|
||||
RADIOTRANS("14"),
|
||||
RADIOTRANS("15"),
|
||||
RADIOTRANS("16"),
|
||||
};
|
||||
// here, we just reserve space for up to 16 different game types
|
||||
// actual names are added later
|
||||
extern CTString astrGameTypeRadioTexts[] = {
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "",
|
||||
};
|
||||
|
||||
extern INDEX ctGameTypeRadioTexts = 1;
|
||||
|
||||
extern CTString astrDifficultyRadioTexts[] = {
|
||||
RADIOTRANS("Tourist"),
|
||||
RADIOTRANS("Easy"),
|
||||
RADIOTRANS("Normal"),
|
||||
RADIOTRANS("Hard"),
|
||||
RADIOTRANS("Serious"),
|
||||
RADIOTRANS("Mental"),
|
||||
RADIOTRANS("Tourist"),
|
||||
RADIOTRANS("Easy"),
|
||||
RADIOTRANS("Normal"),
|
||||
RADIOTRANS("Hard"),
|
||||
RADIOTRANS("Serious"),
|
||||
RADIOTRANS("Mental"),
|
||||
};
|
||||
|
||||
extern CTString astrSplitScreenRadioTexts[] = {
|
||||
RADIOTRANS("1"),
|
||||
RADIOTRANS("2 - split screen"),
|
||||
RADIOTRANS("3 - split screen"),
|
||||
RADIOTRANS("4 - split screen"),
|
||||
RADIOTRANS("1"),
|
||||
RADIOTRANS("2 - split screen"),
|
||||
RADIOTRANS("3 - split screen"),
|
||||
RADIOTRANS("4 - split screen"),
|
||||
};
|
||||
|
||||
extern CTString astrDisplayPrefsRadioTexts[] = {
|
||||
RADIOTRANS("Speed"),
|
||||
RADIOTRANS("Normal"),
|
||||
RADIOTRANS("Quality"),
|
||||
RADIOTRANS("Custom"),
|
||||
RADIOTRANS("Speed"),
|
||||
RADIOTRANS("Normal"),
|
||||
RADIOTRANS("Quality"),
|
||||
RADIOTRANS("Custom"),
|
||||
};
|
||||
|
||||
extern CTString astrDisplayAPIRadioTexts[] = {
|
||||
RADIOTRANS("OpenGL"),
|
||||
RADIOTRANS("Direct3D"),
|
||||
RADIOTRANS("OpenGL"),
|
||||
RADIOTRANS("Direct3D"),
|
||||
};
|
||||
|
||||
extern CTString astrBitsPerPixelRadioTexts[] = {
|
||||
RADIOTRANS("Desktop"),
|
||||
RADIOTRANS("16 BPP"),
|
||||
RADIOTRANS("32 BPP"),
|
||||
RADIOTRANS("Desktop"),
|
||||
RADIOTRANS("16 BPP"),
|
||||
RADIOTRANS("32 BPP"),
|
||||
};
|
||||
|
||||
extern CTString astrFrequencyRadioTexts[] = {
|
||||
RADIOTRANS("No sound"),
|
||||
RADIOTRANS("11kHz"),
|
||||
RADIOTRANS("22kHz"),
|
||||
RADIOTRANS("44kHz"),
|
||||
RADIOTRANS("No sound"),
|
||||
RADIOTRANS("11kHz"),
|
||||
RADIOTRANS("22kHz"),
|
||||
RADIOTRANS("44kHz"),
|
||||
};
|
||||
|
||||
extern CTString astrSoundAPIRadioTexts[] = {
|
||||
RADIOTRANS("WaveOut"),
|
||||
RADIOTRANS("DirectSound"),
|
||||
RADIOTRANS("EAX"),
|
||||
RADIOTRANS("WaveOut"),
|
||||
RADIOTRANS("DirectSound"),
|
||||
RADIOTRANS("EAX"),
|
||||
};
|
||||
|
||||
ULONG GetSpawnFlagsForGameType(INDEX iGameType)
|
||||
{
|
||||
if (iGameType == -1) return SPF_SINGLEPLAYER;
|
||||
if (iGameType == -1) return SPF_SINGLEPLAYER;
|
||||
|
||||
// get function that will provide us the flags
|
||||
CShellSymbol *pss = _pShell->GetSymbol("GetSpawnFlagsForGameTypeSS", /*bDeclaredOnly=*/ TRUE);
|
||||
// if none
|
||||
if (pss == NULL) {
|
||||
// error
|
||||
ASSERT(FALSE);
|
||||
return 0;
|
||||
}
|
||||
// get function that will provide us the flags
|
||||
CShellSymbol *pss = _pShell->GetSymbol("GetSpawnFlagsForGameTypeSS", /*bDeclaredOnly=*/ TRUE);
|
||||
// if none
|
||||
if (pss == NULL) {
|
||||
// error
|
||||
ASSERT(FALSE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ULONG(*pFunc)(INDEX) = (ULONG(*)(INDEX))pss->ss_pvValue;
|
||||
return pFunc(iGameType);
|
||||
ULONG(*pFunc)(INDEX) = (ULONG(*)(INDEX))pss->ss_pvValue;
|
||||
return pFunc(iGameType);
|
||||
}
|
||||
|
||||
BOOL IsMenuEnabled(const CTString &strMenuName)
|
||||
{
|
||||
// get function that will provide us the flags
|
||||
CShellSymbol *pss = _pShell->GetSymbol("IsMenuEnabledSS", /*bDeclaredOnly=*/ TRUE);
|
||||
// if none
|
||||
if (pss == NULL) {
|
||||
// error
|
||||
ASSERT(FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
// get function that will provide us the flags
|
||||
CShellSymbol *pss = _pShell->GetSymbol("IsMenuEnabledSS", /*bDeclaredOnly=*/ TRUE);
|
||||
// if none
|
||||
if (pss == NULL) {
|
||||
// error
|
||||
ASSERT(FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL(*pFunc)(const CTString &) = (BOOL(*)(const CTString &))pss->ss_pvValue;
|
||||
return pFunc(strMenuName);
|
||||
BOOL(*pFunc)(const CTString &) = (BOOL(*)(const CTString &))pss->ss_pvValue;
|
||||
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;
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
// 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;
|
||||
const CFileInfo &fi2 = **(CFileInfo **)elem2;
|
||||
return strcmp(fi1.fi_strName, fi2.fi_strName);
|
||||
const CFileInfo &fi1 = **(CFileInfo **)elem1;
|
||||
const CFileInfo &fi2 = **(CFileInfo **)elem2;
|
||||
return strcmp(fi1.fi_strName, fi2.fi_strName);
|
||||
}
|
||||
|
||||
int qsort_CompareFileInfos_NameDn(const void *elem1, const void *elem2)
|
||||
{
|
||||
const CFileInfo &fi1 = **(CFileInfo **)elem1;
|
||||
const CFileInfo &fi2 = **(CFileInfo **)elem2;
|
||||
return -strcmp(fi1.fi_strName, fi2.fi_strName);
|
||||
const CFileInfo &fi1 = **(CFileInfo **)elem1;
|
||||
const CFileInfo &fi2 = **(CFileInfo **)elem2;
|
||||
return -strcmp(fi1.fi_strName, fi2.fi_strName);
|
||||
}
|
||||
|
||||
int qsort_CompareFileInfos_FileUp(const void *elem1, const void *elem2)
|
||||
{
|
||||
const CFileInfo &fi1 = **(CFileInfo **)elem1;
|
||||
const CFileInfo &fi2 = **(CFileInfo **)elem2;
|
||||
return strcmp(fi1.fi_fnFile, fi2.fi_fnFile);
|
||||
const CFileInfo &fi1 = **(CFileInfo **)elem1;
|
||||
const CFileInfo &fi2 = **(CFileInfo **)elem2;
|
||||
return strcmp(fi1.fi_fnFile, fi2.fi_fnFile);
|
||||
}
|
||||
|
||||
int qsort_CompareFileInfos_FileDn(const void *elem1, const void *elem2)
|
||||
{
|
||||
const CFileInfo &fi1 = **(CFileInfo **)elem1;
|
||||
const CFileInfo &fi2 = **(CFileInfo **)elem2;
|
||||
return -strcmp(fi1.fi_fnFile, fi2.fi_fnFile);
|
||||
const CFileInfo &fi1 = **(CFileInfo **)elem1;
|
||||
const CFileInfo &fi2 = **(CFileInfo **)elem2;
|
||||
return -strcmp(fi1.fi_fnFile, fi2.fi_fnFile);
|
||||
}
|
||||
|
||||
INDEX APIToSwitch(enum GfxAPIType gat)
|
||||
{
|
||||
switch (gat) {
|
||||
case GAT_OGL: return 0;
|
||||
switch (gat) {
|
||||
case GAT_OGL: return 0;
|
||||
#ifdef SE1_D3D
|
||||
case GAT_D3D: return 1;
|
||||
case GAT_D3D: return 1;
|
||||
#endif // SE1_D3D
|
||||
default: ASSERT(FALSE); return 0;
|
||||
}
|
||||
default: ASSERT(FALSE); return 0;
|
||||
}
|
||||
}
|
||||
|
||||
enum GfxAPIType SwitchToAPI(INDEX i)
|
||||
{
|
||||
switch (i) {
|
||||
case 0: return GAT_OGL;
|
||||
switch (i) {
|
||||
case 0: return GAT_OGL;
|
||||
#ifdef SE1_D3D
|
||||
case 1: return GAT_D3D;
|
||||
case 1: return GAT_D3D;
|
||||
#endif // SE1_D3D
|
||||
default: ASSERT(FALSE); return GAT_OGL;
|
||||
}
|
||||
default: ASSERT(FALSE); return GAT_OGL;
|
||||
}
|
||||
}
|
||||
|
||||
INDEX DepthToSwitch(enum DisplayDepth dd)
|
||||
{
|
||||
switch (dd) {
|
||||
case DD_DEFAULT: return 0;
|
||||
case DD_16BIT: return 1;
|
||||
case DD_32BIT: return 2;
|
||||
default: ASSERT(FALSE); return 0;
|
||||
}
|
||||
switch (dd) {
|
||||
case DD_DEFAULT: return 0;
|
||||
case DD_16BIT: return 1;
|
||||
case DD_32BIT: return 2;
|
||||
default: ASSERT(FALSE); return 0;
|
||||
}
|
||||
}
|
||||
|
||||
enum DisplayDepth SwitchToDepth(INDEX i)
|
||||
{
|
||||
switch (i) {
|
||||
case 0: return DD_DEFAULT;
|
||||
case 1: return DD_16BIT;
|
||||
case 2: return DD_32BIT;
|
||||
default: ASSERT(FALSE); return DD_DEFAULT;
|
||||
}
|
||||
switch (i) {
|
||||
case 0: return DD_DEFAULT;
|
||||
case 1: return DD_16BIT;
|
||||
case 2: return DD_32BIT;
|
||||
default: ASSERT(FALSE); return DD_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
// controls that are currently customized
|
||||
|
@ -280,27 +280,27 @@ CTFileName _fnmControlsToCustomize = CTString("");
|
|||
|
||||
void ControlsMenuOn()
|
||||
{
|
||||
_pGame->SavePlayersAndControls();
|
||||
try {
|
||||
_pGame->gm_ctrlControlsExtra.Load_t(_fnmControlsToCustomize);
|
||||
}
|
||||
catch (char *strError) {
|
||||
WarningMessage(strError);
|
||||
}
|
||||
_pGame->SavePlayersAndControls();
|
||||
try {
|
||||
_pGame->gm_ctrlControlsExtra.Load_t(_fnmControlsToCustomize);
|
||||
}
|
||||
catch (char *strError) {
|
||||
WarningMessage(strError);
|
||||
}
|
||||
}
|
||||
|
||||
void ControlsMenuOff()
|
||||
{
|
||||
try {
|
||||
if (_pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count()>0) {
|
||||
_pGame->gm_ctrlControlsExtra.Save_t(_fnmControlsToCustomize);
|
||||
}
|
||||
}
|
||||
catch (char *strError) {
|
||||
FatalError(strError);
|
||||
}
|
||||
FORDELETELIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itAct) {
|
||||
delete &itAct.Current();
|
||||
}
|
||||
_pGame->LoadPlayersAndControls();
|
||||
try {
|
||||
if (_pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count()>0) {
|
||||
_pGame->gm_ctrlControlsExtra.Save_t(_fnmControlsToCustomize);
|
||||
}
|
||||
}
|
||||
catch (char *strError) {
|
||||
FatalError(strError);
|
||||
}
|
||||
FORDELETELIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itAct) {
|
||||
delete &itAct.Current();
|
||||
}
|
||||
_pGame->LoadPlayersAndControls();
|
||||
}
|
|
@ -29,7 +29,7 @@ static PIX _pixLastSizeI, _pixLastSizeJ;
|
|||
|
||||
// window procedure active while window changes are occuring
|
||||
LRESULT WindowProc_WindowChanging( HWND hWnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( message ) {
|
||||
case WM_PAINT: {
|
||||
|
@ -65,7 +65,7 @@ LRESULT WindowProc_WindowChanging( HWND hWnd, UINT message,
|
|||
|
||||
// window procedure active normally
|
||||
LRESULT WindowProc_Normal( HWND hWnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( message ) {
|
||||
|
||||
|
@ -77,7 +77,7 @@ LRESULT WindowProc_Normal( HWND hWnd, UINT message,
|
|||
case SC_RESTORE:
|
||||
case SC_MAXIMIZE:
|
||||
// relay to application
|
||||
PostMessage(NULL, message, wParam & ~0x0F, lParam);
|
||||
PostMessage(NULL, message, wParam & ~0x0F, lParam);
|
||||
// do not allow automatic resizing
|
||||
return 0;
|
||||
break;
|
||||
|
@ -90,7 +90,7 @@ LRESULT WindowProc_Normal( HWND hWnd, UINT message,
|
|||
// when close box is clicked
|
||||
case WM_CLOSE:
|
||||
// relay to application
|
||||
PostMessage(NULL, message, wParam, lParam);
|
||||
PostMessage(NULL, message, wParam, lParam);
|
||||
// do not pass to default wndproc
|
||||
return 0;
|
||||
|
||||
|
@ -102,7 +102,7 @@ LRESULT WindowProc_Normal( HWND hWnd, UINT message,
|
|||
case WM_KILLFOCUS:
|
||||
case WM_ACTIVATEAPP:
|
||||
// relay to application
|
||||
PostMessage(NULL, message, wParam, lParam);
|
||||
PostMessage(NULL, message, wParam, lParam);
|
||||
// pass to default wndproc
|
||||
break;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ LRESULT WindowProc_Normal( HWND hWnd, UINT message,
|
|||
|
||||
// main window procedure
|
||||
LRESULT CALLBACK WindowProc( HWND hWnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
// dispatch to proper window procedure
|
||||
if(_bWindowChanging) {
|
||||
|
@ -141,6 +141,7 @@ void MainWindow_Init(void)
|
|||
wc.lpszMenuName = APPLICATION_NAME;
|
||||
wc.lpszClassName = APPLICATION_NAME;
|
||||
wc.hIconSm = NULL;
|
||||
|
||||
if (0 == RegisterClassExA(&wc)) {
|
||||
DWORD dwError = GetLastError();
|
||||
CTString strErrorMessage(TRANS("Cannot open main window!"));
|
||||
|
@ -199,16 +200,16 @@ void OpenMainWindowNormal( PIX pixSizeI, PIX pixSizeJ)
|
|||
|
||||
// create a window, invisible initially
|
||||
_hwndMain = CreateWindowExA(
|
||||
WS_EX_APPWINDOW,
|
||||
APPLICATION_NAME,
|
||||
"", // title
|
||||
WS_EX_APPWINDOW,
|
||||
APPLICATION_NAME,
|
||||
"", // title
|
||||
WS_OVERLAPPED|WS_CAPTION|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_SYSMENU,
|
||||
10,10,
|
||||
100,100, // window size
|
||||
NULL,
|
||||
NULL,
|
||||
_hInstance,
|
||||
NULL);
|
||||
10,10,
|
||||
100,100, // window size
|
||||
NULL,
|
||||
NULL,
|
||||
_hInstance,
|
||||
NULL);
|
||||
// didn't make it?
|
||||
if( _hwndMain==NULL) FatalError(TRANS("Cannot open main window!"));
|
||||
SE_UpdateWindowHandle( _hwndMain);
|
||||
|
@ -255,16 +256,16 @@ void OpenMainWindowInvisible(void)
|
|||
ASSERT(_hwndMain==NULL);
|
||||
// create a window, invisible initially
|
||||
_hwndMain = CreateWindowExA(
|
||||
WS_EX_APPWINDOW,
|
||||
APPLICATION_NAME,
|
||||
"", // title
|
||||
WS_EX_APPWINDOW,
|
||||
APPLICATION_NAME,
|
||||
"", // title
|
||||
WS_POPUP,
|
||||
0,0,
|
||||
10, 10, // window size
|
||||
NULL,
|
||||
NULL,
|
||||
_hInstance,
|
||||
NULL);
|
||||
0,0,
|
||||
10, 10, // window size
|
||||
NULL,
|
||||
NULL,
|
||||
_hInstance,
|
||||
NULL);
|
||||
// didn't make it?
|
||||
if( _hwndMain==NULL) {
|
||||
DWORD dwError = GetLastError();
|
||||
|
@ -273,6 +274,7 @@ void OpenMainWindowInvisible(void)
|
|||
strError.PrintF("%s Error %d", strErrorMessage, dwError);
|
||||
FatalError(strError);
|
||||
}
|
||||
|
||||
SE_UpdateWindowHandle( _hwndMain);
|
||||
|
||||
// set window title
|
||||
|
|
|
@ -600,7 +600,7 @@ void End(void)
|
|||
|
||||
// destroy the main window and its canvas
|
||||
if (pvpViewPort!=NULL) {
|
||||
_pGfx->DestroyWindowCanvas( pvpViewPort);
|
||||
_pGfx->DestroyWindowCanvas( pvpViewPort);
|
||||
pvpViewPort = NULL;
|
||||
pdpNormal = NULL;
|
||||
}
|
||||
|
@ -1109,7 +1109,7 @@ int SubMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int
|
|||
// teleport player
|
||||
TeleportPlayer(msg.lParam);
|
||||
// restore
|
||||
PostMessage(NULL, WM_SYSCOMMAND, SC_RESTORE, 0);
|
||||
PostMessage(NULL, WM_SYSCOMMAND, SC_RESTORE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1240,7 +1240,7 @@ void CheckBrowser(void)
|
|||
|
||||
|
||||
int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine, int nCmdShow)
|
||||
LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
int iResult;
|
||||
CTSTREAM_BEGIN {
|
||||
|
@ -1273,7 +1273,7 @@ BOOL TryToSetDisplayMode( enum GfxAPIType eGfxAPI, INDEX iAdapter, PIX pixSizeI,
|
|||
// destroy canvas if existing
|
||||
_pGame->DisableLoadingHook();
|
||||
if( pvpViewPort!=NULL) {
|
||||
_pGfx->DestroyWindowCanvas( pvpViewPort);
|
||||
_pGfx->DestroyWindowCanvas( pvpViewPort);
|
||||
pvpViewPort = NULL;
|
||||
pdpNormal = NULL;
|
||||
}
|
||||
|
@ -1305,7 +1305,7 @@ BOOL TryToSetDisplayMode( enum GfxAPIType eGfxAPI, INDEX iAdapter, PIX pixSizeI,
|
|||
// create canvas
|
||||
ASSERT( pvpViewPort==NULL);
|
||||
ASSERT( pdpNormal==NULL);
|
||||
_pGfx->CreateWindowCanvas( _hwndMain, &pvpViewPort, &pdpNormal);
|
||||
_pGfx->CreateWindowCanvas( _hwndMain, &pvpViewPort, &pdpNormal);
|
||||
|
||||
// erase context of both buffers (for the sake of wide-screen)
|
||||
pdp = pdpNormal;
|
||||
|
@ -1344,7 +1344,7 @@ BOOL TryToSetDisplayMode( enum GfxAPIType eGfxAPI, INDEX iAdapter, PIX pixSizeI,
|
|||
// destroy canvas if existing
|
||||
if( pvpViewPort!=NULL) {
|
||||
_pGame->DisableLoadingHook();
|
||||
_pGfx->DestroyWindowCanvas( pvpViewPort);
|
||||
_pGfx->DestroyWindowCanvas( pvpViewPort);
|
||||
pvpViewPort = NULL;
|
||||
pdpNormal = NULL;
|
||||
}
|
||||
|
@ -1355,7 +1355,7 @@ BOOL TryToSetDisplayMode( enum GfxAPIType eGfxAPI, INDEX iAdapter, PIX pixSizeI,
|
|||
}
|
||||
|
||||
// remember new settings
|
||||
sam_bFullScreenActive = bFullScreenMode;
|
||||
sam_bFullScreenActive = bFullScreenMode;
|
||||
sam_iScreenSizeI = pixSizeI;
|
||||
sam_iScreenSizeJ = pixSizeJ;
|
||||
sam_iDisplayDepth = eColorDepth;
|
||||
|
|
|
@ -24,7 +24,7 @@ static BITMAP _bmSplashMask;
|
|||
static HWND hwnd = NULL;
|
||||
|
||||
static long FAR PASCAL SplashWindowProc( HWND hWnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( message ) {
|
||||
case WM_PAINT: {
|
||||
|
@ -68,8 +68,8 @@ void ShowSplashScreen(HINSTANCE hInstance)
|
|||
return;
|
||||
}
|
||||
|
||||
int iScreenX = ::GetSystemMetrics(SM_CXSCREEN); // screen size
|
||||
int iScreenY = ::GetSystemMetrics(SM_CYSCREEN);
|
||||
int iScreenX = ::GetSystemMetrics(SM_CXSCREEN); // screen size
|
||||
int iScreenY = ::GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
WNDCLASSA wc;
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||
|
@ -88,20 +88,20 @@ void ShowSplashScreen(HINSTANCE hInstance)
|
|||
* create a window
|
||||
*/
|
||||
hwnd = CreateWindowExA(
|
||||
WS_EX_TRANSPARENT|WS_EX_TOOLWINDOW,
|
||||
NAME,
|
||||
"SeriousSam loading...", // title
|
||||
WS_EX_TRANSPARENT|WS_EX_TOOLWINDOW,
|
||||
NAME,
|
||||
"SeriousSam loading...", // title
|
||||
WS_POPUP,
|
||||
iScreenX/2-_bmSplash.bmWidth/2,
|
||||
iScreenY/2-_bmSplash.bmHeight/2,
|
||||
_bmSplash.bmWidth,_bmSplash.bmHeight, // window size
|
||||
NULL,
|
||||
NULL,
|
||||
hInstance,
|
||||
NULL);
|
||||
iScreenX/2-_bmSplash.bmWidth/2,
|
||||
iScreenY/2-_bmSplash.bmHeight/2,
|
||||
_bmSplash.bmWidth,_bmSplash.bmHeight, // window size
|
||||
NULL,
|
||||
NULL,
|
||||
hInstance,
|
||||
NULL);
|
||||
|
||||
if(!hwnd) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
ShowWindow( hwnd, SW_SHOW);
|
||||
|
|
Loading…
Reference in New Issue
Block a user