diff --git a/charselect.py b/charselect.py index ae831dc..9f219ac 100644 --- a/charselect.py +++ b/charselect.py @@ -25,7 +25,6 @@ class charselect(QtGui.QWidget): super(charselect, self).__init__(parent) self.parent = parent self.populated = False - self.dropdownloaded = False self.page = 0 self.image = QtGui.QLabel(self) self.image.setPixmap(QtGui.QPixmap(AO2XPpath+"themes/default/charselect_background.png")) @@ -98,6 +97,7 @@ class charselect(QtGui.QWidget): def populateCharacterDropdown(self): self.charDropdown.clear() + self.charDropdown.addItem("") for char in self.charlist: self.charDropdown.addItem(char[0]) self.populated = True @@ -159,10 +159,9 @@ class charselect(QtGui.QWidget): self.selectChar(ind+(self.page*self.max_chars_on_page)) def onDropdownSelect(self, index): - if self.dropdownloaded: - self.selectChar(index) - else: - self.dropdownloaded = True + if index == 0 or self.charDropdown.count() == 1: + return + self.selectChar(index - 1) def selectChar(self, charIndex): self.parent.tcp.send("CC#0#"+str(charIndex)+"#ur mom gay#%") @@ -171,6 +170,9 @@ class charselect(QtGui.QWidget): self.hide() self.parent.gamewindow.setFixedSize(self.parent.width, self.parent.height) self.parent.gamewindow.center() + + def onDisconnect(self): + self.populated = False def show(self): super(charselect, self).show()