More settings in OpenTyrian

This commit is contained in:
pelya
2010-09-28 17:36:16 +03:00
parent e5cd332f5d
commit f58373279e
7 changed files with 77 additions and 20 deletions

View File

@@ -82,7 +82,7 @@ static PlayerItems old_items[2]; // TODO: should not be global if possible
static struct cube_struct cube[4];
static const JE_MenuChoiceType menuChoicesDefault = { 7, 9, 8, 0, 0, 12, (SAVE_FILES_NUM / 2) + 2, 0, 0, 6, 4, 6, 7, 5 };
static const JE_MenuChoiceType menuChoicesDefault = { 7, 9, 8, 0, 0, 13, (SAVE_FILES_NUM / 2) + 2, 0, 0, 6, 4, 6, 7, 5 };
static const JE_byte menuEsc[MAX_MENU] = { 0, 1, 1, 1, 2, 3, 3, 1, 8, 0, 0, 11, 3, 0 };
static const JE_byte itemAvailMap[7] = { 1, 2, 3, 9, 4, 6, 7 };
static const JE_word planetX[21] = { 200, 150, 240, 300, 270, 280, 320, 260, 220, 150, 160, 210, 80, 240, 220, 180, 310, 330, 150, 240, 200 };
@@ -380,7 +380,7 @@ void JE_itemScreen( void )
/* keyboard settings menu */
if (curMenu == 5)
{
for (int x = 2; x <= 12; x++)
for (int x = 2; x <= 13; x++)
{
if (x == curSel[curMenu])
{
@@ -395,9 +395,15 @@ void JE_itemScreen( void )
if( x == 12 )
{
char *AutoFireNames[] = { "Touchscreen", "Fire button", "None" };
char *AutoFireNames[] = { "Touchscreen", "Fire button", "Touch and Button", "None" };
JE_textShade(VGAScreen, 166, 38 + (x - 2)*12, "Auto-Fire", temp2 / 16, temp2 % 16 - 8, DARKEN);
JE_textShade(VGAScreen, 236, 38 + (x - 2)*12, AutoFireNames[autoFireMode], temp2 / 16, temp2 % 16 - 8, DARKEN);
JE_textShade(VGAScreen, 230, 38 + (x - 2)*12, AutoFireNames[autoFireMode], temp2 / 16, temp2 % 16 - 8, DARKEN);
}
else if( x == 13 )
{
char *TouchscreenNames[] = { "Ship above finger", "Ship to the left", "Ship below finger", "Fire only", "None" };
JE_textShade(VGAScreen, 166, 38 + (x - 2)*12, "Touchscreen", temp2 / 16, temp2 % 16 - 8, DARKEN);
JE_textShade(VGAScreen, 230, 38 + (x - 2)*12, TouchscreenNames[touchscreenMode], temp2 / 16, temp2 % 16 - 8, DARKEN);
}
else
JE_textShade(VGAScreen, 166, 38 + (x - 2)*12, menuInt[curMenu + 1][x-1], temp2 / 16, temp2 % 16 - 8, DARKEN);
@@ -405,11 +411,11 @@ void JE_itemScreen( void )
if (x < 10) /* 10 = reset to defaults, 11 = done */
{
temp2 = (x == curSel[curMenu]) ? 252 : 250;
JE_textShade(VGAScreen, 236, 38 + (x - 2)*12, SDL_GetKeyName(keySettings[x-2]), temp2 / 16, temp2 % 16 - 8, DARKEN);
JE_textShade(VGAScreen, 230, 38 + (x - 2)*12, SDL_GetKeyName(keySettings[x-2]), temp2 / 16, temp2 % 16 - 8, DARKEN);
}
}
menuChoices[5] = 12;
menuChoices[5] = 13;
}
/* Joystick settings menu */
@@ -2660,6 +2666,13 @@ void JE_menuFunction( JE_byte select )
autoFireMode = AUTOFIRE_TOUCHSCREEN;
JE_saveConfiguration();
}
else if (curSelect == 13) /* Touchscreen mode */
{
touchscreenMode = (TouchscreenMode_t)(touchscreenMode + 1);
if(touchscreenMode >= TOUCHSCREEN_LAST)
touchscreenMode = TOUCHSCREEN_SHIP_ABOVE_FINGER;
JE_saveConfiguration();
}
else if (curSelect == 10) /* reset to defaults */
{
memcpy(keySettings, defaultKeySettings, sizeof(keySettings));