改了一个bug

This commit is contained in:
ssssssssboom 2024-06-03 20:45:27 +08:00
parent d216939171
commit 85a84cc1df

View File

@ -808,15 +808,6 @@ class PressSelectShipButton(PressTextButton):
self.parent_window = parent_window
def on_mouse_release(self, x, y, buttons, modifiers):
logger.info(self.parent_window.ships_buttons_begin_y,self.parent_window.ships_buttons_end_y,x,y)
logger.info(y >= self.parent_window.ships_buttons_begin_y and y <= self.parent_window.ships_buttons_end_y)
if (
self.parent_window.show_ships_buttons
and x >= self.parent_window.ships_buttons_begin_x
and x <= self.parent_window.ships_buttons_end_x
and y >= self.parent_window.ships_buttons_begin_y
and y <= self.parent_window.ships_buttons_end_y
):
if self.pressed and (x, y) in self:
if self.draw_theme:
self.draw_theme.on_disable(self)
@ -870,6 +861,13 @@ class PressOpenShipButton(PressTextButton):
return self.y
def on_mouse_release(self, x, y, buttons, modifiers):
if (
self.parent_window.show_ships_buttons
and x >= self.parent_window.ships_buttons_begin_x
and x <= self.parent_window.ships_buttons_end_x
and y >= self.parent_window.ships_buttons_begin_y
and y <= self.parent_window.ships_buttons_end_y
):
if self.pressed and (x, y) in self:
if self.draw_theme:
self.draw_theme.on_disable(self)