diff --git a/gameview.py b/gameview.py index 5ce227e..e946e49 100644 --- a/gameview.py +++ b/gameview.py @@ -1017,6 +1017,7 @@ class Chatbox(QtGui.QLabel): def __init__(self, parent): QtGui.QLabel.__init__(self, parent) self.parent = parent + self.initial = None self.geometrySet = False def setGeometry(self, x, y, w, h): @@ -1024,6 +1025,7 @@ class Chatbox(QtGui.QLabel): return self.geometrySet = True super(Chatbox, self).setGeometry(x - self.parent.x(), y - self.parent.y(), w, h) + self.initial = self.geometry() def resetGeometry(self): self.geometrySet = False @@ -1142,6 +1144,7 @@ class GUI(QtGui.QWidget): self.text.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.text.setReadOnly(True) self.text.setTextInteractionFlags(QtCore.Qt.NoTextInteraction) + self.text.initial = None self.ao2text = QtGui.QTextEdit(self.chatbox) self.ao2text.setFrameStyle(QtGui.QFrame.NoFrame) @@ -1910,7 +1913,8 @@ class GUI(QtGui.QWidget): self.sideChar.resize() self.slideWitness.resize() self.slideSpeaker.resize() - self.ao2text.setGeometry(self.text.geometry()) + self.text.initial = self.text.geometry() + self.ao2text.setGeometry(self.text.initial) self.ao2text.setStyleSheet(self.text.styleSheet()) self.sliDemoSeekbar.setGeometry(self.ICChatInput.geometry()) @@ -1923,8 +1927,7 @@ class GUI(QtGui.QWidget): if not self.chatbox.geometrySet: self.chatboxWidth = self.viewport.width() self.chatboxHeight = chatboxPixmap.size().height() * self.viewportScale - self.chatbox.resize(self.chatboxWidth, self.chatboxHeight) - self.chatbox.move(0, self.viewport.height() - self.chatboxHeight) + self.chatbox.setGeometry(0, self.viewport.height() - self.chatboxHeight, self.chatboxWidth, self.chatboxHeight) else: self.chatboxWidth = self.chatbox.width() self.chatboxHeight = self.chatbox.height() @@ -2169,17 +2172,13 @@ class GUI(QtGui.QWidget): self.zoom.move(random.randint(-shakeForce, shakeForce), random.randint(-shakeForce, shakeForce)) self.char.move(self.char.xx + random.randint(-shakeForce, shakeForce), self.char.yy + random.randint(-shakeForce, shakeForce), True) self.sideChar.move(self.sideChar.xx + random.randint(-shakeForce, shakeForce), self.sideChar.yy + random.randint(-shakeForce, shakeForce), True) - self.chatbox.move(random.randint(-shakeForce, shakeForce), self.viewport.height() - self.chatboxHeight + random.randint(-shakeForce, shakeForce)) - self.ao2text.move(-self.chatbox.x()+16, (self.viewport.height()-self.chatboxHeight-self.chatbox.y())+32) - self.text.move(-self.chatbox.x()+16, (self.viewport.height()-self.chatboxHeight-self.chatbox.y())+-1) + self.chatbox.move(self.chatbox.initial.x() + random.randint(-shakeForce, shakeForce), self.chatbox.initial.y() + random.randint(-shakeForce, shakeForce)) else: self.court.move(0,0) self.zoom.move(0,0) self.char.move(self.char.xx, self.char.yy, True) self.sideChar.move(self.sideChar.xx, self.sideChar.yy, True) - self.chatbox.move(0, self.viewport.height()-self.chatboxHeight) - self.ao2text.move(16, 32) - self.text.move(16,32) + self.chatbox.move(self.chatbox.initial.topLeft()) self.screenshake.stop() def ICChatFocus(self):