OpenTyrian: configurable auto-fire mode

This commit is contained in:
pelya
2010-09-24 15:08:49 +03:00
parent e2bb6ea0f2
commit c3d6cbfb03
5 changed files with 41 additions and 9 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, 11, (SAVE_FILES_NUM / 2) + 2, 0, 0, 6, 4, 6, 7, 5 };
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_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 <= 11; x++)
for (int x = 2; x <= 12; x++)
{
if (x == curSel[curMenu])
{
@@ -393,7 +393,14 @@ void JE_itemScreen( void )
temp2 = 28;
}
JE_textShade(VGAScreen, 166, 38 + (x - 2)*12, menuInt[curMenu + 1][x-1], temp2 / 16, temp2 % 16 - 8, DARKEN);
if( x == 12 )
{
char *AutoFireNames[] = { "Touchscreen", "Fire 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);
}
else
JE_textShade(VGAScreen, 166, 38 + (x - 2)*12, menuInt[curMenu + 1][x-1], temp2 / 16, temp2 % 16 - 8, DARKEN);
if (x < 10) /* 10 = reset to defaults, 11 = done */
{
@@ -402,7 +409,7 @@ void JE_itemScreen( void )
}
}
menuChoices[5] = 11;
menuChoices[5] = 12;
}
/* Joystick settings menu */
@@ -2646,7 +2653,14 @@ void JE_menuFunction( JE_byte select )
break;
case 5: /* keyboard settings */
if (curSelect == 10) /* reset to defaults */
if (curSelect == 12) /* Auto-Fire mode */
{
autoFireMode = (AutoFireMode_t)(autoFireMode + 1);
if(autoFireMode >= AUTOFIRE_LAST)
autoFireMode = AUTOFIRE_TOUCHSCREEN;
JE_saveConfiguration();
}
else if (curSelect == 10) /* reset to defaults */
{
memcpy(keySettings, defaultKeySettings, sizeof(keySettings));
}