fixes
This commit is contained in:
parent
2b7b025456
commit
db71a05430
|
@ -2001,11 +2001,6 @@ void mouse_reset(int hl)
|
||||||
|
|
||||||
disable_use();
|
disable_use();
|
||||||
|
|
||||||
if (motion_mode) {
|
|
||||||
click_x = -1;
|
|
||||||
click_y = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hl)
|
if (hl)
|
||||||
motion_mode = 0;
|
motion_mode = 0;
|
||||||
old_xref = old_el = NULL;
|
old_xref = old_el = NULL;
|
||||||
|
@ -2065,7 +2060,7 @@ int mouse_filter(int filter)
|
||||||
old_counter = timer_counter;
|
old_counter = timer_counter;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
/* action: 0 - first click,1 - second, -1 - restore */
|
||||||
int game_click(int x, int y, int action, int filter)
|
int game_click(int x, int y, int action, int filter)
|
||||||
{
|
{
|
||||||
int menu_mode = 0;
|
int menu_mode = 0;
|
||||||
|
@ -2075,11 +2070,11 @@ int game_click(int x, int y, int action, int filter)
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
xref_t xref = NULL;
|
xref_t xref = NULL;
|
||||||
char *xref_txt;
|
char *xref_txt;
|
||||||
|
int was_mode = motion_mode;
|
||||||
if (!action) {
|
if (!action) {
|
||||||
click_x = x;
|
click_x = x;
|
||||||
click_y = y;
|
click_y = y;
|
||||||
} else {
|
} else if (action == 1) {
|
||||||
click_x = -1;
|
click_x = -1;
|
||||||
click_y = -1;
|
click_y = -1;
|
||||||
}
|
}
|
||||||
|
@ -2087,7 +2082,7 @@ int game_click(int x, int y, int action, int filter)
|
||||||
if (action)
|
if (action)
|
||||||
motion_mode = 0;
|
motion_mode = 0;
|
||||||
|
|
||||||
if (filter && opt_filter && action) {
|
if (filter && opt_filter && action == 1) {
|
||||||
xref_t new_xref;
|
xref_t new_xref;
|
||||||
struct el *new_elem;
|
struct el *new_elem;
|
||||||
new_xref = look_xref(x, y, &new_elem);
|
new_xref = look_xref(x, y, &new_elem);
|
||||||
|
@ -2100,7 +2095,8 @@ int game_click(int x, int y, int action, int filter)
|
||||||
old_xref = NULL;
|
old_xref = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (action) {
|
|
||||||
|
if (action == 1) {
|
||||||
xref = old_xref;
|
xref = old_xref;
|
||||||
elem = old_el;
|
elem = old_el;
|
||||||
old_xref = NULL;
|
old_xref = NULL;
|
||||||
|
@ -2114,7 +2110,8 @@ int game_click(int x, int y, int action, int filter)
|
||||||
(!box_isscroll_up(elem->id) || !box_isscroll_down(elem->id))) {
|
(!box_isscroll_up(elem->id) || !box_isscroll_down(elem->id))) {
|
||||||
motion_mode = 1;
|
motion_mode = 1;
|
||||||
motion_id = elem->id;
|
motion_id = elem->id;
|
||||||
motion_y =y;
|
if (!action || !was_mode)
|
||||||
|
motion_y = y;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
old_xref = xref;
|
old_xref = xref;
|
||||||
|
@ -2218,8 +2215,7 @@ int game_click(int x, int y, int action, int filter)
|
||||||
|
|
||||||
void mouse_restore(void)
|
void mouse_restore(void)
|
||||||
{
|
{
|
||||||
if (click_x != -1 && click_y != -1)
|
game_click(click_x, click_y, -1, 0);
|
||||||
game_click(click_x, click_y, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void game_cursor(int on)
|
void game_cursor(int on)
|
||||||
|
@ -2922,7 +2918,7 @@ int game_loop(void)
|
||||||
game_restart();
|
game_restart();
|
||||||
if (old_menu != -1)
|
if (old_menu != -1)
|
||||||
game_menu(old_menu);
|
game_menu(old_menu);
|
||||||
} else if (game_theme.gfx_mode == GFX_MODE_DIRECT) {
|
} else if (game_theme.gfx_mode == GFX_MODE_DIRECT && !menu_shown) {
|
||||||
; // nothing todo
|
; // nothing todo
|
||||||
} else if (!alt_pressed && (!is_key(&ev, "return") || !is_key(&ev, "enter")
|
} else if (!alt_pressed && (!is_key(&ev, "return") || !is_key(&ev, "enter")
|
||||||
#ifdef S60
|
#ifdef S60
|
||||||
|
@ -3016,7 +3012,7 @@ int game_loop(void)
|
||||||
select_frame(0);
|
select_frame(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else if (game_theme.gfx_mode == GFX_MODE_DIRECT) {
|
} else if (game_theme.gfx_mode == GFX_MODE_DIRECT && !menu_shown) {
|
||||||
; // nothing todo
|
; // nothing todo
|
||||||
} else if (ev.type == MOUSE_DOWN) {
|
} else if (ev.type == MOUSE_DOWN) {
|
||||||
if (ev.code != 1)
|
if (ev.code != 1)
|
||||||
|
|
|
@ -5,7 +5,7 @@ sprite = {
|
||||||
system_type = true;
|
system_type = true;
|
||||||
|
|
||||||
ini = function(s)
|
ini = function(s)
|
||||||
if type(s.load) == 'function' then
|
if type(s.init) == 'function' then
|
||||||
sprites_free();
|
sprites_free();
|
||||||
sprite.init();
|
sprite.init();
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue