Compare commits
2 Commits
ac75a9eeb1
...
57ec422712
Author | SHA1 | Date | |
---|---|---|---|
57ec422712 | |||
4a40d65c3a |
@ -25,7 +25,6 @@ class charselect(QtGui.QWidget):
|
|||||||
super(charselect, self).__init__(parent)
|
super(charselect, self).__init__(parent)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.populated = False
|
self.populated = False
|
||||||
self.dropdownloaded = False
|
|
||||||
self.page = 0
|
self.page = 0
|
||||||
self.image = QtGui.QLabel(self)
|
self.image = QtGui.QLabel(self)
|
||||||
self.image.setPixmap(QtGui.QPixmap(AO2XPpath+"themes/default/charselect_background.png"))
|
self.image.setPixmap(QtGui.QPixmap(AO2XPpath+"themes/default/charselect_background.png"))
|
||||||
@ -98,6 +97,7 @@ class charselect(QtGui.QWidget):
|
|||||||
|
|
||||||
def populateCharacterDropdown(self):
|
def populateCharacterDropdown(self):
|
||||||
self.charDropdown.clear()
|
self.charDropdown.clear()
|
||||||
|
self.charDropdown.addItem("")
|
||||||
for char in self.charlist:
|
for char in self.charlist:
|
||||||
self.charDropdown.addItem(char[0])
|
self.charDropdown.addItem(char[0])
|
||||||
self.populated = True
|
self.populated = True
|
||||||
@ -133,6 +133,8 @@ class charselect(QtGui.QWidget):
|
|||||||
self.prevpage.hide()
|
self.prevpage.hide()
|
||||||
|
|
||||||
char = self.charlist[ind][0].lower()
|
char = self.charlist[ind][0].lower()
|
||||||
|
if not exists(AOpath+"characters/"+ char):
|
||||||
|
print char, "doesn't exist"
|
||||||
if exists(AOpath+"characters/"+ char +"/char_icon.png"): # AO2
|
if exists(AOpath+"characters/"+ char +"/char_icon.png"): # AO2
|
||||||
self.setBtnImage.emit(AOpath+"characters/"+ char +"/char_icon.png", i)
|
self.setBtnImage.emit(AOpath+"characters/"+ char +"/char_icon.png", i)
|
||||||
elif exists(AOpath+"misc/demothings/"+ char +"_char_icon.png"): # AO 1.7.5/1.8
|
elif exists(AOpath+"misc/demothings/"+ char +"_char_icon.png"): # AO 1.7.5/1.8
|
||||||
@ -159,10 +161,9 @@ class charselect(QtGui.QWidget):
|
|||||||
self.selectChar(ind+(self.page*self.max_chars_on_page))
|
self.selectChar(ind+(self.page*self.max_chars_on_page))
|
||||||
|
|
||||||
def onDropdownSelect(self, index):
|
def onDropdownSelect(self, index):
|
||||||
if self.dropdownloaded:
|
if index == 0 or self.charDropdown.count() == 1:
|
||||||
self.selectChar(index)
|
return
|
||||||
else:
|
self.selectChar(index - 1)
|
||||||
self.dropdownloaded = True
|
|
||||||
|
|
||||||
def selectChar(self, charIndex):
|
def selectChar(self, charIndex):
|
||||||
self.parent.tcp.send("CC#0#"+str(charIndex)+"#ur mom gay#%")
|
self.parent.tcp.send("CC#0#"+str(charIndex)+"#ur mom gay#%")
|
||||||
@ -171,6 +172,9 @@ class charselect(QtGui.QWidget):
|
|||||||
self.hide()
|
self.hide()
|
||||||
self.parent.gamewindow.setFixedSize(self.parent.width, self.parent.height)
|
self.parent.gamewindow.setFixedSize(self.parent.width, self.parent.height)
|
||||||
self.parent.gamewindow.center()
|
self.parent.gamewindow.center()
|
||||||
|
|
||||||
|
def onDisconnect(self):
|
||||||
|
self.populated = False
|
||||||
|
|
||||||
def show(self):
|
def show(self):
|
||||||
super(charselect, self).show()
|
super(charselect, self).show()
|
||||||
|
Loading…
Reference in New Issue
Block a user