More settings in OpenTyrian
This commit is contained in:
@@ -3089,7 +3089,7 @@ redo:
|
||||
{
|
||||
*mouseX_ = this_player->x;
|
||||
*mouseY_ = this_player->y;
|
||||
if(autoFireMode != AUTOFIRE_BUTTON)
|
||||
if(autoFireMode != AUTOFIRE_BUTTON && autoFireMode != AUTOFIRE_BUTTON_TOUCH)
|
||||
button[1-1] = false;
|
||||
button[2-1] = false;
|
||||
button[3-1] = false;
|
||||
@@ -3179,30 +3179,53 @@ redo:
|
||||
if ((inputDevice == 0 || inputDevice == 1 || inputDevice == 2) && !play_demo)
|
||||
{
|
||||
/* Move ship above user finger */
|
||||
int shifted_mouse_x = mouse_x + 15;
|
||||
int shifted_mouse_y = mouse_y;
|
||||
if( shifted_mouse_y > 160 )
|
||||
shifted_mouse_y += shifted_mouse_y - 160;
|
||||
if( touchscreenMode == TOUCHSCREEN_SHIP_ABOVE_FINGER )
|
||||
{
|
||||
if( shifted_mouse_y > 160 )
|
||||
shifted_mouse_y += shifted_mouse_y - 160;
|
||||
shifted_mouse_y -= 45;
|
||||
}
|
||||
if( touchscreenMode == TOUCHSCREEN_SHIP_TO_THE_LEFT )
|
||||
{
|
||||
shifted_mouse_x -= 30;
|
||||
}
|
||||
|
||||
if (keysactive[keySettings[0]] ||
|
||||
(has_mouse && mouse_pressed[0] && shifted_mouse_y < (this_player->y + 45)))
|
||||
(has_mouse && mouse_pressed[0] && (shifted_mouse_y < this_player->y && touchscreenMode < TOUCHSCREEN_FIRE_ONLY)))
|
||||
this_player->y -= CURRENT_KEY_SPEED;
|
||||
if (keysactive[keySettings[1]] ||
|
||||
(has_mouse && mouse_pressed[0] && shifted_mouse_y > (this_player->y + 45)))
|
||||
(has_mouse && mouse_pressed[0] && (shifted_mouse_y > this_player->y && touchscreenMode < TOUCHSCREEN_FIRE_ONLY)))
|
||||
this_player->y += CURRENT_KEY_SPEED;
|
||||
|
||||
if (keysactive[keySettings[2]] ||
|
||||
(has_mouse && mouse_pressed[0] && mouse_x < (this_player->x - 15)))
|
||||
(has_mouse && mouse_pressed[0] && (shifted_mouse_x < this_player->x && touchscreenMode < TOUCHSCREEN_FIRE_ONLY)))
|
||||
this_player->x -= CURRENT_KEY_SPEED;
|
||||
if (keysactive[keySettings[3]] ||
|
||||
(has_mouse && mouse_pressed[0] && mouse_x > (this_player->x - 15)))
|
||||
(has_mouse && mouse_pressed[0] && (shifted_mouse_x > this_player->x && touchscreenMode < TOUCHSCREEN_FIRE_ONLY)))
|
||||
this_player->x += CURRENT_KEY_SPEED;
|
||||
|
||||
if(autoFireMode == AUTOFIRE_BUTTON)
|
||||
if( autoFireMode == AUTOFIRE_BUTTON || autoFireMode == AUTOFIRE_BUTTON_TOUCH )
|
||||
{
|
||||
if(newkey && keydown && lastkey_sym == keySettings[4])
|
||||
button[0] = ! button[0];
|
||||
else if (autoFireMode == AUTOFIRE_BUTTON_TOUCH)
|
||||
{
|
||||
static int prevState = 0;
|
||||
if( mouse_pressed[0] && prevState != button[0] )
|
||||
{
|
||||
button[0] = ! button[0];
|
||||
prevState = button[0];
|
||||
}
|
||||
else if( ! mouse_pressed[0] )
|
||||
prevState = ! button[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
button[0] = button[0] || keysactive[keySettings[4]] || ( mouse_pressed[0] && ( autoFireMode == AUTOFIRE_TOUCHSCREEN ) );
|
||||
{
|
||||
button[0] = button[0] || keysactive[keySettings[4]] || ( mouse_pressed[0] && ( touchscreenMode != TOUCHSCREEN_NONE ) );
|
||||
}
|
||||
|
||||
button[3] = button[3] || keysactive[keySettings[5]];
|
||||
button[1] = button[1] || keysactive[keySettings[6]];
|
||||
|
||||
Reference in New Issue
Block a user