finished new layout, fixed cross examination, graphics resized properly

This commit is contained in:
cidoku 2025-02-11 19:31:05 -03:00
parent 411260fbd0
commit d06bc9943d
11 changed files with 32 additions and 32 deletions

View File

@ -3,7 +3,7 @@ self.gamewindow.setFixedSize(820, 730)
self.ooclog.setGeometry(814 - 288, 0, 288, 248) self.ooclog.setGeometry(814 - 288, 0, 288, 248)
self.oocnameinput.resize(self.oocnameinput.sizeHint().width() - 32, self.oocnameinput.sizeHint().height()) self.oocnameinput.resize(self.oocnameinput.sizeHint().width() - 32, self.oocnameinput.sizeHint().height())
self.oocnameinput.move(814 - 288, 248) self.oocnameinput.move(814 - 288, 248)
self.oocinput.resize(176, self.oocinput.sizeHint().height()) self.oocinput.resize(self.ooclog.width() - self.oocnameinput.width(), self.oocinput.sizeHint().height())
self.oocinput.move(814 - 288 + self.oocnameinput.size().width(), 248) self.oocinput.move(814 - 288 + self.oocnameinput.size().width(), 248)
self.ooclogin.resize(48, 20) self.ooclogin.resize(48, 20)
self.ooclogin.move(814 - (self.ooclogin.size().width()), self.oocinput.y() + self.ooclogin.size().height()) self.ooclogin.move(814 - (self.ooclogin.size().width()), self.oocinput.y() + self.ooclogin.size().height())

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

View File

Before

Width:  |  Height:  |  Size: 343 KiB

After

Width:  |  Height:  |  Size: 343 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 238 B

BIN
freeglut.dll Normal file

Binary file not shown.

View File

@ -218,12 +218,12 @@ class AOCharMovie(QtGui.QLabel):
QtGui.QLabel.__init__(self, parent) QtGui.QLabel.__init__(self, parent)
self.resize(VIEWPORT_W, VIEWPORT_H) self.resize(VIEWPORT_W, VIEWPORT_H)
self.setAlignment(QtCore.Qt.AlignCenter)
self.time_mod = 62 self.time_mod = 62
self.play_once = True self.play_once = True
self.m_flipped = False self.m_flipped = False
self.m_movie = QtGui.QMovie() self.m_movie = QtGui.QMovie()
self.setScaledContents(True)
self.preanim_timer = QtCore.QTimer(self) self.preanim_timer = QtCore.QTimer(self)
self.preanim_timer.setSingleShot(True) self.preanim_timer.setSingleShot(True)
@ -403,8 +403,8 @@ class AOCharMovie(QtGui.QLabel):
@QtCore.pyqtSlot(int) @QtCore.pyqtSlot(int)
def frame_change(self, n_frame): def frame_change(self, n_frame):
f_img = self.m_movie.currentImage().mirrored(self.m_flipped, False) f_img = self.m_movie.currentImage().mirrored(self.m_flipped, False)
if f_img.size().width() != 256 or f_img.size().height() != 192: if not f_img.isNull() and (f_img.size().width() != VIEWPORT_W or f_img.size().height() != VIEWPORT_H):
f_img = f_img.scaled(256, 192, transformMode=QtCore.Qt.SmoothTransformation) f_img = f_img.scaled(VIEWPORT_W, VIEWPORT_H, QtCore.Qt.KeepAspectRatioByExpanding, QtCore.Qt.FastTransformation)
f_pixmap = QtGui.QPixmap.fromImage(f_img) f_pixmap = QtGui.QPixmap.fromImage(f_img)
self.setPixmap(f_pixmap) self.setPixmap(f_pixmap)
@ -430,8 +430,8 @@ class AOCharMovie(QtGui.QLabel):
def set_pillow_frame(self): def set_pillow_frame(self):
f_img = self.pillow_frames[self.pillow_frame][0].mirrored(self.m_flipped, False) f_img = self.pillow_frames[self.pillow_frame][0].mirrored(self.m_flipped, False)
if f_img.size().width() != 256 or f_img.size().height() != 192: if not f_img.isNull() and (f_img.size().width() != VIEWPORT_W or f_img.size().height() != VIEWPORT_H):
f_img = f_img.scaled(256, 192, transformMode=QtCore.Qt.SmoothTransformation) f_img = f_img.scaled(VIEWPORT_W, VIEWPORT_H, QtCore.Qt.KeepAspectRatioByExpanding, QtCore.Qt.FastTransformation)
f_pixmap = QtGui.QPixmap.fromImage(f_img) f_pixmap = QtGui.QPixmap.fromImage(f_img)
self.setPixmap(f_pixmap) self.setPixmap(f_pixmap)
@ -541,8 +541,8 @@ class AOMovie(QtGui.QLabel):
if not self.pillow_frames: return if not self.pillow_frames: return
f_img = self.pillow_frames[self.pillow_frame][0] f_img = self.pillow_frames[self.pillow_frame][0]
if f_img.size().width() != 256 or f_img.size().height() != 192: if not f_img.isNull() and (f_img.size().width() != VIEWPORT_W or f_img.size().height() != VIEWPORT_H):
f_img = f_img.scaled(256, 192, transformMode=QtCore.Qt.SmoothTransformation) f_img = f_img.scaled(VIEWPORT_W, VIEWPORT_H, QtCore.Qt.KeepAspectRatioByExpanding, QtCore.Qt.FastTransformation)
f_pixmap = QtGui.QPixmap.fromImage(f_img) f_pixmap = QtGui.QPixmap.fromImage(f_img)
self.setPixmap(f_pixmap) self.setPixmap(f_pixmap)
@ -583,13 +583,12 @@ class WTCE_View(QtGui.QLabel):
self.finalframe_timer.setSingleShot(False) self.finalframe_timer.setSingleShot(False)
self.finalframe_timer.timeout.connect(self.finished) self.finalframe_timer.timeout.connect(self.finished)
self.resize(VIEWPORT_W, VIEWPORT_H) self.resize(VIEWPORT_W, VIEWPORT_H)
self.setScaledContents(True)
def frame_change(self, frame): def frame_change(self, frame):
if self.movie.state() != QtGui.QMovie.Running: if self.movie.state() != QtGui.QMovie.Running:
return return
img = self.movie.currentImage() img = self.movie.currentImage()
self.setPixmap(QtGui.QPixmap.fromImage(img)) self.setPixmap(QtGui.QPixmap.fromImage(img).scaled(VIEWPORT_W, VIEWPORT_H, QtCore.Qt.KeepAspectRatioByExpanding, QtCore.Qt.FastTransformation))
if self.movie.currentFrameNumber() == self.movie.frameCount() - 1: if self.movie.currentFrameNumber() == self.movie.frameCount() - 1:
self.finalframe_timer.start(self.movie.nextFrameDelay()) self.finalframe_timer.start(self.movie.nextFrameDelay())
@ -695,8 +694,8 @@ class gui(QtGui.QWidget):
self.bench = QtGui.QLabel(self.viewport) self.bench = QtGui.QLabel(self.viewport)
self.bench.resize(VIEWPORT_W, VIEWPORT_H) self.bench.resize(VIEWPORT_W, VIEWPORT_H)
bench = QtGui.QPixmap(AOpath + 'background/default/defensedesk.png') bench = QtGui.QPixmap(AOpath + 'background/default/defensedesk.png')
self.court.setPixmap(QtGui.QPixmap(AOpath + 'background/default/defenseempty.png')) self.court.setPixmap(QtGui.QPixmap(AOpath + 'background/default/defenseempty.png').scaled(VIEWPORT_W, VIEWPORT_H, QtCore.Qt.KeepAspectRatioByExpanding, QtCore.Qt.FastTransformation))
self.bench.setPixmap(bench) self.bench.setPixmap(bench.scaled(VIEWPORT_W, VIEWPORT_H, QtCore.Qt.KeepAspectRatioByExpanding, QtCore.Qt.FastTransformation))
self.effectview = AOMovie(self.viewport) self.effectview = AOMovie(self.viewport)
@ -727,16 +726,15 @@ class gui(QtGui.QWidget):
self.ao2text.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.ao2text.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.ao2text.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.ao2text.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.ao2text.setReadOnly(True) self.ao2text.setReadOnly(True)
self.ao2text.setGeometry(16, 32, VIEWPORT_W - 16, 112) self.ao2text.setGeometry(16, 32, VIEWPORT_W - 32, 112)
self.ao2text.setTextInteractionFlags(QtCore.Qt.NoTextInteraction) self.ao2text.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
self.ao2text.setStyleSheet("background-color: rgba(0, 0, 0, 0); color: white;") self.ao2text.setStyleSheet("background-color: rgba(0, 0, 0, 0); color: white;")
self.ao2text.setFont(ao2text_font) self.ao2text.setFont(ao2text_font)
self.name = QtGui.QLabel(self.chatbox) self.name = QtGui.QLabel(self.chatbox)
self.name.setStyleSheet('color: white') self.name.setStyleSheet('color: white')
self.name.move(16, 0) self.name.move(16, -1)
self.name.resize(248, 32) self.name.resize(248, 32)
#self.name.resize(248, self.name.sizeHint().height())
self.name.setFont(name_font) self.name.setFont(name_font)
self.wtceview = WTCE_View(self) self.wtceview = WTCE_View(self)
@ -749,7 +747,8 @@ class gui(QtGui.QWidget):
self.whiteflashlab = QtGui.QLabel(self.viewport) self.whiteflashlab = QtGui.QLabel(self.viewport)
self.whiteflashlab.setPixmap(QtGui.QPixmap(AO2XPpath + 'themes/default/realizationflash.png')) self.whiteflashlab.setPixmap(QtGui.QPixmap(AO2XPpath + 'themes/default/realizationflash.png'))
self.whiteflashlab.setGeometry(0, 0, 256, 192) self.whiteflashlab.setGeometry(0, 0, VIEWPORT_W, VIEWPORT_H)
self.whiteflashlab.setScaledContents(True)
self.whiteflashlab.hide() self.whiteflashlab.hide()
self.whiteflash = QtCore.QTimer() self.whiteflash = QtCore.QTimer()
self.whiteflash.setSingleShot(False) self.whiteflash.setSingleShot(False)
@ -761,18 +760,18 @@ class gui(QtGui.QWidget):
self.ooclog = ChatLogs(self, 1) self.ooclog = ChatLogs(self, 1)
self.ooclog.setReadOnly(True) self.ooclog.setReadOnly(True)
p = self.ooclog.viewport().palette() #p = self.ooclog.viewport().palette()
p.setColor(self.ooclog.viewport().backgroundRole(), QtGui.QColor(139,139,139)) #p.setColor(self.ooclog.viewport().backgroundRole(), QtGui.QColor(139,139,139))
self.ooclog.viewport().setPalette(p) #self.ooclog.viewport().setPalette(p)
self.ooclog.textChanged.connect(self.ooclog_update) self.ooclog.textChanged.connect(self.ooclog_update)
self.oocnameinput = QtGui.QLineEdit(self) self.oocnameinput = QtGui.QLineEdit(self)
self.oocnameinput.setPlaceholderText('Enter a name...') self.oocnameinput.setPlaceholderText('Enter a name...')
self.oocnameinput.setStyleSheet('background-color: rgb(139, 139, 139);') #self.oocnameinput.setStyleSheet('background-color: rgb(139, 139, 139);')
self.oocinput = QtGui.QLineEdit(self) self.oocinput = QtGui.QLineEdit(self)
self.oocinput.setPlaceholderText('Server chat/OOC chat...') self.oocinput.setPlaceholderText('Server chat/OOC chat...')
self.oocinput.setStyleSheet('background-color: rgb(139, 139, 139);') #self.oocinput.setStyleSheet('background-color: rgb(139, 139, 139);')
self.oocinput.returnPressed.connect(self.onOOCreturn) self.oocinput.returnPressed.connect(self.onOOCreturn)
self.ooclogin = QtGui.QPushButton("Login", self) self.ooclogin = QtGui.QPushButton("Login", self)
@ -908,7 +907,7 @@ class gui(QtGui.QWidget):
self.flipbutton = QtGui.QCheckBox(self) self.flipbutton = QtGui.QCheckBox(self)
self.flipbutton.stateChanged.connect(self.changeFlipCheck) self.flipbutton.stateChanged.connect(self.changeFlipCheck)
self.flipbutton.setText('Mirror') self.flipbutton.setText('Flip')
self.flipbutton.resize(self.flipbutton.sizeHint()) self.flipbutton.resize(self.flipbutton.sizeHint())
self.flipbutton.move(self.posdropdown.x() + self.posdropdown.width() + 4, self.colordropdown.y() - 5) self.flipbutton.move(self.posdropdown.x() + self.posdropdown.width() + 4, self.colordropdown.y() - 5)
@ -1080,17 +1079,17 @@ class gui(QtGui.QWidget):
self.zoom.move(random.randint(-shakeforce, shakeforce), random.randint(-shakeforce, shakeforce)) 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.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.sidechar.move(self.sidechar.xx + random.randint(-shakeforce, shakeforce), self.sidechar.yy + random.randint(-shakeforce, shakeforce), True)
self.chatbox.move(random.randint(-shakeforce, shakeforce), 192 - self.chatboxheight + random.randint(-shakeforce, shakeforce)) self.chatbox.move(random.randint(-shakeforce, shakeforce), VIEWPORT_H - self.chatboxheight + random.randint(-shakeforce, shakeforce))
self.ao2text.move(-self.chatbox.x()+2, (192-self.chatboxheight-self.chatbox.y())+16) self.ao2text.move(-self.chatbox.x()+16, (VIEWPORT_H-self.chatboxheight-self.chatbox.y())+32)
self.text.move(-self.chatbox.x()+6, (192-self.chatboxheight-self.chatbox.y())+20) self.text.move(-self.chatbox.x()+16, (VIEWPORT_H-self.chatboxheight-self.chatbox.y())+-1)
else: else:
self.court.move(0,0) self.court.move(0,0)
self.zoom.move(0,0) self.zoom.move(0,0)
self.char.move(self.char.xx, self.char.yy, True) self.char.move(self.char.xx, self.char.yy, True)
self.sidechar.move(self.sidechar.xx, self.sidechar.yy, True) self.sidechar.move(self.sidechar.xx, self.sidechar.yy, True)
self.chatbox.move(0, 192-self.chatboxheight) self.chatbox.move(0, VIEWPORT_H-self.chatboxheight)
self.ao2text.move(2,16) self.ao2text.move(16, 32)
self.text.move(6,20) self.text.move(16,-1)
self.screenshake.stop() self.screenshake.stop()
def onAdditiveCheck(self): def onAdditiveCheck(self):
@ -1109,7 +1108,8 @@ class gui(QtGui.QWidget):
def onOOCLoginBtn(self): def onOOCLoginBtn(self):
password, ok = QtGui.QInputDialog.getText(self, "Login as moderator", "Enter password.") password, ok = QtGui.QInputDialog.getText(self, "Login as moderator", "Enter password.")
if password and ok: if password and ok:
self.sendOOCchat(self.oocnameinput.text().toUtf8(), "/login "+password.toUtf8()) self.sendOOCchat(self.oocnameinput.text().toUtf8(), "/login")
self.sendOOCchat(self.oocnameinput.text().toUtf8(), password.toUtf8())
def setPing(self, newping): def setPing(self, newping):
self.pinglabel.setText("Ping: %d" % newping) self.pinglabel.setText("Ping: %d" % newping)
@ -1672,7 +1672,7 @@ class gui(QtGui.QWidget):
bgimg = QtGui.QImage(AOpath + 'background/' + bg + '/' + bgfile[1] + '.png') bgimg = QtGui.QImage(AOpath + 'background/' + bg + '/' + bgfile[1] + '.png')
if not bgimg.isNull(): if not bgimg.isNull():
if bgimg.size().width() != VIEWPORT_W or bgimg.size().height() != VIEWPORT_H: if bgimg.size().width() != VIEWPORT_W or bgimg.size().height() != VIEWPORT_H:
setattr(self, bgfile[0], QtGui.QPixmap.fromImage(bgimg.scaled(VIEWPORT_W, VIEWPORT_H, transformMode=QtCore.Qt.SmoothTransformation))) setattr(self, bgfile[0], QtGui.QPixmap.fromImage(bgimg.scaled(VIEWPORT_W, VIEWPORT_H, QtCore.Qt.KeepAspectRatioByExpanding, QtCore.Qt.FastTransformation)))
else: else:
setattr(self, bgfile[0], QtGui.QPixmap.fromImage(bgimg)) setattr(self, bgfile[0], QtGui.QPixmap.fromImage(bgimg))
else: else:
@ -1722,7 +1722,7 @@ class gui(QtGui.QWidget):
if self.msgqueue: if self.msgqueue:
chatmsgcomp = str(self.msgqueue[0].split('#')[5]).decode('utf-8').replace('<dollar>', '$').replace('<percent>', '%').replace('<and>', '&').replace('<num>', '#') chatmsgcomp = str(self.msgqueue[0].split('#')[5]).decode('utf-8').replace('<dollar>', '$').replace('<percent>', '%').replace('<and>', '&').replace('<num>', '#')
if f_char_id == self.mychar and self.m_chatmessage[CHATMSG] == chatmsgcomp: # our message showed up if (chatmsgcomp == '>' or chatmsgcomp == '<') or (f_char_id == self.mychar and self.m_chatmessage[CHATMSG] == chatmsgcomp): # our message showed up
del self.msgqueue[0] del self.msgqueue[0]
self.msgqueueList.takeItem(0) self.msgqueueList.takeItem(0)
if self.additivebtn.isChecked(): if self.additivebtn.isChecked():
@ -2413,7 +2413,7 @@ class gui(QtGui.QWidget):
for bucket in buckets: for bucket in buckets:
if not bucket: continue if not bucket: continue
print "music stream:", bucket+'base/sounds/music/' + mus.lower() print "music stream:", bucket+'base/sounds/music/' + mus.lower()
self.music = audio.loadURLhandle(bucket+'base/sounds/music/' + mus.lower(), 0, BASS_STREAM_BLOCK) self.music = audio.loadURLhandle(bucket+'base/sounds/music/' + mus.lower(), 0, BASS_STREAM_BLOCK | BASS_SAMPLE_LOOP)
if self.music: break if self.music: break
if self.music: if self.music: