Remove some redundant global calls, minify a few lines

This commit is contained in:
Firepup Sixfifty 2024-05-05 10:38:08 -05:00
parent 10b2b7f3bf
commit decd8422f1
Signed by: Firepup650
GPG key ID: 7C92E2ABBBFAB9BA
2 changed files with 2 additions and 10 deletions

View file

@ -9,13 +9,9 @@ from fallout_functions import soundTest, queueIsEmpty, addSound
from time import sleep from time import sleep
import sys import sys
hard = False hard = "--hard" in sys.argv
if "--hard" in sys.argv:
hard = True
skip = False skip = "--skip" in sys.argv
if "--skip" in sys.argv:
skip = True
if "--preload" in sys.argv: if "--preload" in sys.argv:
soundTest() soundTest()

View file

@ -27,7 +27,6 @@ _playing = False
_soundQueue = [] _soundQueue = []
global _queueRunning
_queueRunning = False _queueRunning = False
@ -129,7 +128,6 @@ def _playQueue():
Internal use - play sounds from a queue Internal use - play sounds from a queue
""" """
global _queueRunning global _queueRunning
global _soundQueue
if _queueRunning: if _queueRunning:
return return
_queueRunning = True _queueRunning = True
@ -161,7 +159,6 @@ def soundTest():
addSound("poweron") addSound("poweron")
addSound("poweroff") addSound("poweroff")
addSound("poweroff") addSound("poweroff")
global _soundQueue
while not queueIsEmpty(): while not queueIsEmpty():
sleep(0.2) sleep(0.2)
@ -170,7 +167,6 @@ def addSound(file):
""" """
Add sounds to the queue Add sounds to the queue
""" """
global _soundQueue
if _soundCheck(): if _soundCheck():
_soundQueue.extend([file]) _soundQueue.extend([file])