From c53991d5da874e1db690bccfebe3f0ce2cc5812c Mon Sep 17 00:00:00 2001 From: Headshot Date: Wed, 6 Jan 2021 20:55:55 -0430 Subject: [PATCH] add more platform dependent stuff --- AO2XP.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/AO2XP.py b/AO2XP.py index f1d5721..a5b1558 100644 --- a/AO2XP.py +++ b/AO2XP.py @@ -1,13 +1,20 @@ -import sys, thread, time, os +import sys, thread, time, os, platform from os.path import exists from PyQt4 import QtGui, QtCore app = QtGui.QApplication(sys.argv) +osname = platform.system() +bassdll = "bass.dll" +if osname == "Darwin": + bassdll = "libbass.dylib" +elif osname == "Linux": + bassdll = "libbass.so" + debugmode = len(sys.argv) > 1 and sys.argv[1] == "debug" if not debugmode: fakebass = len(sys.argv) > 1 and sys.argv[1] == "bass" - if not exists("bass.dll") or fakebass: - QtGui.QMessageBox.critical(None, "Unable to launch game", "Couldn't find the file 'bass.dll' on the client folder.\nAO2XP needs this file in order to play sounds and music.\nThe file is included in the client's zip file, make sure it's in the same folder as AO2XP.exe") + if not exists(bassdll) or fakebass: + QtGui.QMessageBox.critical(None, "Unable to launch game", "Couldn't find the file %s on the client folder.\nAO2XP needs this file in order to play sounds and music.\nThe file is included in the client's zip file, make sure it's in the same folder as the AO2XP exe." % bassdll) os._exit(-2) class gamewindow(QtGui.QMainWindow):