Mods
This commit is contained in:
parent
14d4588425
commit
d1bd618d70
|
@ -63,6 +63,7 @@ class Config:
|
||||||
icon_off: str = "❌"
|
icon_off: str = "❌"
|
||||||
ant: str = "🐜"
|
ant: str = "🐜"
|
||||||
arguments_path: Path
|
arguments_path: Path
|
||||||
|
fade_duration: int = 500
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def prepare() -> None:
|
def prepare() -> None:
|
||||||
|
|
|
@ -155,18 +155,18 @@ class Game:
|
||||||
if fade:
|
if fade:
|
||||||
opacity_effect = QGraphicsOpacityEffect(item)
|
opacity_effect = QGraphicsOpacityEffect(item)
|
||||||
item.setGraphicsEffect(opacity_effect)
|
item.setGraphicsEffect(opacity_effect)
|
||||||
fade_in = QPropertyAnimation(opacity_effect, b"opacity")
|
animation = QPropertyAnimation(opacity_effect, b"opacity")
|
||||||
fade_in.setDuration(500)
|
animation.setDuration(Config.fade_duration)
|
||||||
fade_in.setStartValue(0)
|
animation.setStartValue(0)
|
||||||
fade_in.setEndValue(1)
|
animation.setEndValue(1)
|
||||||
fade_in.setEasingCurve(QEasingCurve.InOutQuad)
|
animation.setEasingCurve(QEasingCurve.InOutQuad)
|
||||||
fade_in.finished.connect(lambda: Game.animations.remove(fade_in))
|
animation.finished.connect(lambda: Game.animations.remove(animation))
|
||||||
Game.animations.append(fade_in)
|
Game.animations.append(animation)
|
||||||
|
|
||||||
Window.view.insertWidget(0, item)
|
Window.view.insertWidget(0, item)
|
||||||
|
|
||||||
if fade:
|
if fade:
|
||||||
fade_in.start()
|
animation.start()
|
||||||
|
|
||||||
while Window.view.count() > Config.max_updates:
|
while Window.view.count() > Config.max_updates:
|
||||||
item = Window.view.takeAt(Window.view.count() - 1)
|
item = Window.view.takeAt(Window.view.count() - 1)
|
||||||
|
|
Loading…
Reference in New Issue