Fara: Exit when pressing 'X' button. Press enter to start game instead of stupid number buttons. Reduced flicker on window redraw.

git-svn-id: svn://kolibrios.org@4484 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2014-01-19 17:00:32 +00:00
parent af2492b78b
commit b90b0dc20e
8 changed files with 33 additions and 20 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1000,6 +1000,9 @@ int GameLoop()
{
switch ( buttonID )
{
case 1:
kos_ExitApp();
case 0xA:
result = GM_ABORT;
break;
@ -1427,7 +1430,7 @@ void DrawGameWindow()
kos_DefineAndDrawWindow(
WNDLEFT, WNDTOP,
gcx + 1, gcy + 21,
0x14, 0x0,
0x54, 0x0, // Skinned fixed size window, dont fill working area, window has caption
0, WNDHEADCOLOUR,
gameWndTitle
);

View File

@ -20,14 +20,12 @@ RGB bmPMButton[] = {
#if LANG == RUS
char mainWndTitle[] = "PHARAON's CRYPT\0";
char mainWndCopyright[] = "(C) MMVI by Rabid Rabbit";
char mainWndMenuStart[] = "1. <20> ç âì ¨£àã";
char mainWndMenuExit[] = "2. ‚ë室";
char mainWndMenuStart[] = "Enter -<2D><>碪 見飹";
char mainWndMenuLevel[] = "<EFBFBD> ç «ì­ë© ã஢¥­ì - %U";
#else
char mainWndTitle[] = "PHARAON's CRYPT\0";
char mainWndTitle[] = "PHARAOH's CRYPT\0";
char mainWndCopyright[] = "(C) MMVI by Rabid Rabbit";
char mainWndMenuStart[] = "1. Start game";
char mainWndMenuExit[] = "2. Exit";
char mainWndMenuStart[] = "Enter - Start game";
char mainWndMenuLevel[] = "Starting level - %U";
#endif
//
@ -75,11 +73,11 @@ int MainWndLoop()
//
switch ( keyCode )
{
case '1':
case 13: // enter
result = MW_START_GAME;
break;
case '2':
case 27: // escape
result = MW_EXIT_APP;
break;
@ -96,6 +94,9 @@ int MainWndLoop()
switch ( buttonID )
{
//
case 1:
result = MW_EXIT_APP;
break;
case BT_SIZE_X_MINUS:
if ( --startGameLevel < 1 )
startGameLevel = 1;
@ -151,7 +152,7 @@ void DrawMainWindow()
kos_DefineAndDrawWindow(
WNDLEFT, WNDTOP,
mcx + 1, mcy + 21,
0x14, 0x0,
0x54, 0x0, // Skinned fixed size window, dont fill working area, window has caption
0, WNDHEADCOLOUR,
mainWndTitle
);
@ -164,12 +165,6 @@ void DrawMainWindow()
0, 0x0,
mainWndMenuStart, sizeof(mainWndMenuStart)-1
);
// âòîðàÿ ñòðîêà
kos_WriteTextToWindow(
8, 48,
0, 0x0,
mainWndMenuExit, sizeof(mainWndMenuExit)-1
);
// òðåòüÿ ñòðîêà
sprintf( line, mainWndMenuLevel, startGameLevel);
kos_WriteTextToWindow(

View File

@ -243,7 +243,7 @@ void DrawTop10Window()
kos_DefineAndDrawWindow(
100, 100,
TOP10_WND_SIZE_X, TOP10_WND_SIZE_Y,
0x14, 0,
0x34, 0, // Relative coordinates, Skinned fixed size window, window has caption
0, 0x2040A0,
Top10WndTitle
);
@ -254,7 +254,7 @@ void DrawTop10Window()
{
//
kos_WriteTextToWindow(
6, 21 + 2 + (i * 10),
6, 0 + 2 + (i * 10),
0x0, enterName != i ? 0xFFFFFF : 0x00FF00,
heroTbl[i].name,
sizeof( heroTbl[0].name )
@ -263,7 +263,7 @@ void DrawTop10Window()
kos_DisplayNumberToWindow(
heroTbl[i].score,
8,
112, 21 + 2 + (i * 10),
112, 0 + 2 + (i * 10),
0xFFFF55,
nbDecimal,
false
@ -271,7 +271,7 @@ void DrawTop10Window()
}
//
kos_WriteTextToWindow(
6, 21 + 6 + (i * 10),
6, 0 + 6 + (i * 10),
0x10, 0x1060D0,
enterName >= 0 ? top10str1 : top10str2,
enterName >= 0 ? sizeof(top10str1) - 1 : sizeof(top10str2) - 1
@ -283,6 +283,7 @@ void DrawTop10Window()
void Top10Loop()
{
Byte keyCode;
Dword buttonID;
//
SetUpTop10();
@ -348,7 +349,21 @@ void Top10Loop()
}
//
break;
case 3:
if ( kos_GetButtonID( buttonID ) )
{
//
switch ( buttonID )
{
//
case 1:
kos_ExitApp();
default:
break;
}
}
default:
break;
}