@@ -345,6 +345,7 @@ def __init__(self, buttons, coords, dim, scroll_group, window, default_text, wil
345345 self .handled = - 1
346346
347347 def button_checks (self ):
348+ #print(self.selected.coords)
348349 # inefficient way of checking if buttons were pressed (TODO : Find faster way?)
349350 if (self .extended ):
350351 for sprite in self .scroll_group .sprites ():
@@ -355,6 +356,7 @@ def button_checks(self):
355356 self .selected = sprite .copy ()
356357 #self.selected.setCoords(self.coords)
357358 self .selected .setDim (self .dim )
359+ self .selected .setCoords (self .coords )
358360 self .selected .is_chosen = True
359361 time .sleep (0.3 ) # TODO : Fix bug to not click buttons behind it
360362 self .toggle ()
@@ -422,7 +424,6 @@ def draw_drop_menu(self):
422424
423425 self .init_mouse_y = pygame .mouse .get_pos ()[1 ]
424426
425-
426427 def toggle (self ):
427428 if (not self .drag ):
428429 self .extended = not self .extended
@@ -435,15 +436,6 @@ def toggle(self):
435436 self .scroll_group .add (self .selected )
436437 self .scroll_button .set_pressable ()
437438 self .selected .set_pressable ()
438-
439- # If its in options, advanced tools, etc where a window would pop up, the button shouldn't be pressed
440- def check_overlap (self ):
441- if (self .window .screen == Screen .NONE and self .screen != Screen .NONE ):
442- self .scroll_button .set_unpressable ()
443- self .selected .set_unpressable ()
444- else :
445- self .scroll_button .set_pressable ()
446- self .selected .set_pressable ()
447439
448440 def set_pressable (self ):
449441 self .scroll_button .set_pressable ()
@@ -524,7 +516,7 @@ def slide(self):
524516 self .window .window .blit (self .text , self .textRect )
525517
526518 def copy (self ):
527- copy = ScrollButton (self .copy_text , self .function , self .window )
519+ copy = ScrollButton (self .copy_text , self .function , self .window , False , None )
528520 return copy
529521
530522 def setDim (self , dim ):
0 commit comments