From 0ea97aa03dd84daee7b4ae0f10b2c2c013fac621 Mon Sep 17 00:00:00 2001 From: Auric Vente Date: Sun, 21 Jul 2024 10:56:49 -0600 Subject: [PATCH] Mods --- cromulant/game.py | 4 +++- cromulant/window.py | 2 +- utils/tag.py | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 utils/tag.py diff --git a/cromulant/game.py b/cromulant/game.py index 36016cf..67e9b73 100644 --- a/cromulant/game.py +++ b/cromulant/game.py @@ -231,10 +231,12 @@ class Game: if speed == "fast": delay = Config.loop_delay_fast + elif speed == "normal": + delay = Config.loop_delay_normal elif speed == "slow": delay = Config.loop_delay_slow else: - delay = Config.loop_delay_normal + return Game.timer = QTimer() Game.timer.timeout.connect(Game.get_status) diff --git a/cromulant/window.py b/cromulant/window.py index cde8456..90e669d 100644 --- a/cromulant/window.py +++ b/cromulant/window.py @@ -227,7 +227,7 @@ class Window: tooltip += f"Normal: {Utils.get_seconds(Config.loop_delay_normal)}\n" tooltip += f"Slow: {Utils.get_seconds(Config.loop_delay_slow)}" Window.speed.setToolTip(tooltip) - Window.speed.addItems(["Fast", "Normal", "Slow"]) + Window.speed.addItems(["Fast", "Normal", "Slow", "Paused"]) Window.speed.setCurrentIndex(1) Window.speed.currentIndexChanged.connect(Game.update_speed) diff --git a/utils/tag.py b/utils/tag.py new file mode 100755 index 0000000..3acd77c --- /dev/null +++ b/utils/tag.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +# This is used to create a tag in the git repo +# You probably don't want to run this + +# pacman: python-gitpython +import os +import git +import json +from pathlib import Path + +here = Path(__file__).resolve() +parent = here.parent.parent +os.chdir(parent) + +with open("cromulant/manifest.json") as f: + manifest = json.loads(f.read()) + +version = manifest["version"] +repo = git.Repo(".") +repo.create_tag(version) +repo.remotes.origin.push(version) +print(f"Created tag: {version}")