def handle(self, event):
if event.type == pygame.MOUSEMOTION:
# check if cursor is not in the top right corner as it would happen on mobile after finger up
if event.pos[0] + event.pos[1] > 0:
self.on_mouse_over()
else:
self.deselect_all()
self.mainloop.info.buttons_restore()
self.mainloop.info.reset_titles()
elif event.type == pygame.MOUSEBUTTONUP and event.button == 1:
if not (self.mainloop.m.ldrag or self.mainloop.m.rdrag):
if self.mainloop.m.active_o is not None:
self.mainloop.m.active_o.state = 0
self.mainloop.m.active_o = None
if self.mainloop.m.active_cat_o is not None:
self.mainloop.m.active_cat_o.deactivate()
self.mainloop.m.active_cat_o = None
if self.state < 2:
self.mainloop.sfx.play(4)
self.state = 2
self.mainloop.m.active_cat = 0
self.mainloop.m.game_constructor = game000.Board
self.mainloop.m.game_variant = 0
self.mainloop.m.active_game_id = 0
self.mainloop.m.game_started_id = -1
self.mainloop.m.tab_game_id = -5
self.mainloop.m.tab_r_scroll = 0
self.mainloop.redraw_needed = [True, True, True]
评论列表
文章目录