forked from Moussa/TF2IdleGUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtf2idle.py
37 lines (33 loc) · 1.56 KB
/
tf2idle.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os, sys
import Config
from PyQt4 import QtCore, QtGui
from MainWindow import MainWindow
optionsfile = 'tf2idle.ini'
def setDefaultSettings():
Config.settings.set_section('Settings')
if not Config.settings.has_section('Settings'):
Config.settings.add_section()
if not Config.settings.has_option('steam_location'):
Config.settings.set_option('steam_location', 'C:/Program Files (x86)/Steam')
if not Config.settings.has_option('secondary_steamapps_location'):
Config.settings.set_option('secondary_steamapps_location', '')
if not Config.settings.has_option('sandboxie_location'):
Config.settings.set_option('sandboxie_location', 'C:/Program Files/Sandboxie')
if not Config.settings.has_option('API_key'):
Config.settings.set_option('API_key', '')
if not Config.settings.has_option('backpack_viewer') or Config.settings.get_option('backpack_viewer') == '':
Config.settings.set_option('backpack_viewer', 'OPTF2')
if not Config.settings.has_option('launch_options'):
Config.settings.set_option('launch_options', '+exec idle.cfg -textmode -nosound -low -novid -nopreload -nojoy -sw +sv_lan 1 -width 640 -height 480 +map itemtest')
if not Config.settings.has_option('ui_no_of_columns') or Config.settings.get_option('ui_no_of_columns') == '':
Config.settings.set_option('ui_no_of_columns', '2')
Config.settings.flush_configuration()
if __name__ == "__main__":
Config.init(optionsfile)
setDefaultSettings()
app = QtGui.QApplication(sys.argv)
myapp = MainWindow()
myapp.show()
returnCode = app.exec_()
Config.settings.flush_configuration()
sys.exit(returnCode)