autoselect
This commit is contained in:
parent
99819b0883
commit
a5582025bc
13
gameview.py
13
gameview.py
@ -2933,7 +2933,18 @@ class gui(QtGui.QWidget):
|
|||||||
buckets[0] = webAO_bucket
|
buckets[0] = webAO_bucket
|
||||||
|
|
||||||
self.charselect.setCharList(charlist)
|
self.charselect.setCharList(charlist)
|
||||||
self.charselect.show()
|
autopick = get_option("General", "auto pick").lower()
|
||||||
|
coincidence = -1
|
||||||
|
for i, char in enumerate(self.charlist):
|
||||||
|
if char[0].lower() == autopick and char[1] == 0:
|
||||||
|
coincidence = i
|
||||||
|
break
|
||||||
|
|
||||||
|
if coincidence > -1:
|
||||||
|
print(coincidence)
|
||||||
|
self.tcp.send("CC#0#"+str(coincidence)+"#ur mom gay#%")
|
||||||
|
else:
|
||||||
|
self.charselect.show()
|
||||||
|
|
||||||
self.oocnameinput.setText(ini.read_ini("AO2XP.ini", "General", "OOC name", "unnamed"))
|
self.oocnameinput.setText(ini.read_ini("AO2XP.ini", "General", "OOC name", "unnamed"))
|
||||||
self.shownameedit.setText(ini.read_ini("AO2XP.ini", "General", "Showname"))
|
self.shownameedit.setText(ini.read_ini("AO2XP.ini", "General", "Showname"))
|
||||||
|
15
options.py
15
options.py
@ -100,6 +100,18 @@ class Settings(QtGui.QDialog):
|
|||||||
autoconnect_layout = QtGui.QHBoxLayout()
|
autoconnect_layout = QtGui.QHBoxLayout()
|
||||||
autoconnect_label = QtGui.QLabel("Connect automatically to this server")
|
autoconnect_label = QtGui.QLabel("Connect automatically to this server")
|
||||||
self.autoconnect = QtGui.QComboBox()
|
self.autoconnect = QtGui.QComboBox()
|
||||||
|
|
||||||
|
autopick_layout = QtGui.QHBoxLayout()
|
||||||
|
autopick_label = QtGui.QLabel("Pick this character automatically after connecting")
|
||||||
|
self.autopick = QtGui.QComboBox()
|
||||||
|
for folder in listdir(unicode(AOpath + 'characters')):
|
||||||
|
if exists(AOpath + 'characters/' + folder + '/char.ini'):
|
||||||
|
self.autopick.addItem(folder)
|
||||||
|
self.autopick.setEditable(1)
|
||||||
|
|
||||||
|
autopick_layout.addWidget(autopick_label)
|
||||||
|
autopick_layout.addWidget(self.autopick)
|
||||||
|
|
||||||
self.autoconnect.addItem("Always show server list")
|
self.autoconnect.addItem("Always show server list")
|
||||||
if exists(AOpath+'serverlist.txt'):
|
if exists(AOpath+'serverlist.txt'):
|
||||||
with open(AOpath+'serverlist.txt') as file:
|
with open(AOpath+'serverlist.txt') as file:
|
||||||
@ -131,6 +143,7 @@ class Settings(QtGui.QDialog):
|
|||||||
general_layout.addLayout(currtheme_layout)
|
general_layout.addLayout(currtheme_layout)
|
||||||
general_layout.addWidget(separators[3])
|
general_layout.addWidget(separators[3])
|
||||||
general_layout.addLayout(autoconnect_layout)
|
general_layout.addLayout(autoconnect_layout)
|
||||||
|
general_layout.addLayout(autopick_layout)
|
||||||
general_layout.addLayout(update_layout)
|
general_layout.addLayout(update_layout)
|
||||||
general_layout.addWidget(savechangeswarn, 50, QtCore.Qt.AlignBottom)
|
general_layout.addWidget(savechangeswarn, 50, QtCore.Qt.AlignBottom)
|
||||||
|
|
||||||
@ -207,6 +220,7 @@ class Settings(QtGui.QDialog):
|
|||||||
self.allowdownload_evidence.setChecked(ini.read_ini_bool(self.inifile, "General", "download evidence"))
|
self.allowdownload_evidence.setChecked(ini.read_ini_bool(self.inifile, "General", "download evidence"))
|
||||||
self.currtheme.setCurrentIndex(self.themes.index(ini.read_ini(self.inifile, "General", "theme", "default")))
|
self.currtheme.setCurrentIndex(self.themes.index(ini.read_ini(self.inifile, "General", "theme", "default")))
|
||||||
self.autoconnect.setCurrentIndex(ini.read_ini_int(self.inifile, "General", "auto connect", -1) + 1)
|
self.autoconnect.setCurrentIndex(ini.read_ini_int(self.inifile, "General", "auto connect", -1) + 1)
|
||||||
|
self.autopick.setEditText(ini.read_ini(self.inifile, "General", "auto pick"))
|
||||||
self.check_updates.setChecked(ini.read_ini_bool(self.inifile, "General", "install updates", False)) # Automatic updates are opt-in!
|
self.check_updates.setChecked(ini.read_ini_bool(self.inifile, "General", "install updates", False)) # Automatic updates are opt-in!
|
||||||
|
|
||||||
self.device_list.setCurrentIndex(ini.read_ini_int(self.inifile, "Audio", "device", audio.getcurrdevice()))
|
self.device_list.setCurrentIndex(ini.read_ini_int(self.inifile, "Audio", "device", audio.getcurrdevice()))
|
||||||
@ -257,6 +271,7 @@ class Settings(QtGui.QDialog):
|
|||||||
self.inifile.set("General", "download evidence", self.allowdownload_evidence.isChecked())
|
self.inifile.set("General", "download evidence", self.allowdownload_evidence.isChecked())
|
||||||
self.inifile.set("General", "theme", self.currtheme.currentText())
|
self.inifile.set("General", "theme", self.currtheme.currentText())
|
||||||
self.inifile.set("General", "auto connect", self.autoconnect.currentIndex() - 1)
|
self.inifile.set("General", "auto connect", self.autoconnect.currentIndex() - 1)
|
||||||
|
self.inifile.set("General", "auto pick", self.autopick.currentText())
|
||||||
self.inifile.set("General", "install updates", self.check_updates.isChecked())
|
self.inifile.set("General", "install updates", self.check_updates.isChecked())
|
||||||
|
|
||||||
self.inifile.set("Audio", "device", self.device_list.currentIndex())
|
self.inifile.set("Audio", "device", self.device_list.currentIndex())
|
||||||
|
Loading…
Reference in New Issue
Block a user