use 2 space indentation

This commit is contained in:
DasMoorhuhn 2024-12-15 21:36:50 +01:00
parent a66a2e8e97
commit 7a4edf66ed
2 changed files with 54 additions and 49 deletions

View File

@ -137,6 +137,9 @@ class VPet:
self.frames = Frames()
self.activity = Activity()
self.animation_start = 0
self.animation_end = 0
def action_loop(self):
if self.activity.is_interacting_with_user:
self.is_busy = True

View File

@ -11,26 +11,28 @@ from vpet import VPet
def get_primary_monitor():
m = next((monitor for monitor in get_monitors() if monitor.is_primary), None)
print(m.height)
print(m.width)
print(int(m.width/2))
return m
return next((monitor for monitor in get_monitors() if monitor.is_primary), None)
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.FPS = 60
self.interval = 60
self.primary_monitor = get_primary_monitor()
# self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
self.setWindowFlags(Qt.WindowStaysOnTopHint)
# self.setAttribute(Qt.WA_TranslucentBackground)
self.click_event_time = 0
self.v_pet = VPet(self.move, self.pos, self.draw, self.primary_monitor, x=int(self.primary_monitor.width/2), y=self.primary_monitor.height)
self.v_pet = VPet(self.move,
self.pos,
self.draw,
self.primary_monitor,
x=int(self.primary_monitor.width / 2),
y=self.primary_monitor.height)
self.loop_timer = QTimer(self)
self.loop_timer.setSingleShot(False)
self.loop_timer.setInterval(self.FPS)
self.loop_timer.setInterval(self.interval)
self.loop_timer.timeout.connect(self.loop)
self.loop_timer.start()