extras: add client side first person view toggle

This commit is contained in:
cidoku 2025-10-27 03:09:12 -03:00
parent 503ed0094b
commit d83ecfc5a7
2 changed files with 25 additions and 22 deletions

View File

@ -110,9 +110,6 @@ self.btnPairOffsetReset.move(self.sliPairOffset.x() + self.sliPairOffset.size().
self.lblPairOrder.move(self.lblPairOffset.x(), self.lblPairOffset.y()+144)
self.boxPairOrder.setGeometry(self.sliPairOffset.x(), self.lblPairOrder.y()-4, 80, self.btnPairOffsetReset.sizeHint().height())
self.cbSpacing.move(self.cbMockText.x(), self.cbMockText.y()+24)
self.cbAutoCaps.move(self.cbSpacing.x(), self.cbSpacing.y()+24)
# Judge options
self.btnDefenseBar.setGeometry(self.gameTabs.x() + self.gameTabs.width() + 11, viewportBottom + 61, 84, 14)
self.btnProsecutionBar.setGeometry(self.btnDefenseBar.x(), viewportBottom + 75, 84, 14)

View File

@ -1353,9 +1353,14 @@ class GUI(QtGui.QWidget):
self.cbAutoCaps = QtGui.QCheckBox()
self.cbAutoCaps.setChecked(False)
self.cbAutoCaps.setText("Automatic caps and period")
self.cbFirstPerson = QtGui.QCheckBox()
self.cbFirstPerson.setChecked(False)
self.cbFirstPerson.setText("First person view")
self.cbFirstPerson.setToolTip('Sends your message without displaying your character')
self.layMisc.addWidget(self.cbMockText)
self.layMisc.addWidget(self.cbSpacing)
self.layMisc.addWidget(self.cbAutoCaps)
self.layMisc.addWidget(self.cbFirstPerson)
# Message queue
self.queueItems = QtGui.QListWidget(self.tabQueue)
@ -2098,7 +2103,7 @@ class GUI(QtGui.QWidget):
gameTabsHeight = self.gameTabs.height() - self.gameTabs.findChild(QtGui.QTabBar).height()
self.ICLog.setGeometry(0, 0, self.gameTabs.width(), gameTabsHeight)
self.boxPrivateEvidence.setGeometry(8, 8, 192, 20)
self.evidenceDescription.setGeometry(8, 108, self.gameTabs.width() - 22, 112)
self.evidenceDescription.setGeometry(8, 108, self.gameTabs.width() - 22, gameTabsHeight - 110)
self.evidenceImage.setGeometry(self.evidenceDescription.x() + self.evidenceDescription.width() - 70, 8, 70, 70)
self.boxEvidence.setGeometry(8, 8, self.evidenceImage.x() - 16, 20)
self.btnEvidenceAdd.move(8, 32)
@ -2158,9 +2163,6 @@ class GUI(QtGui.QWidget):
self.lblPairOrder.move(self.lblPairOffset.x(), self.lblPairOffset.y()+144)
self.boxPairOrder.setGeometry(self.sliPairOffset.x(), self.lblPairOrder.y()-4, 80, self.btnPairOffsetReset.sizeHint().height())
self.cbSpacing.move(self.cbMockText.x(), self.cbMockText.y()+24)
self.cbAutoCaps.move(self.cbSpacing.x(), self.cbSpacing.y()+24)
## Sidebar
oocBottom = self.OOCNameInput.y() + self.OOCNameInput.height() # 268
self.OOCLogin.resize(48, 20)
@ -3165,7 +3167,7 @@ class GUI(QtGui.QWidget):
msg += emote[1] + "#" #pre-anim
msg += self.charName.title() + "#"
msg += emote[2] + "#" #anim
msg += ("" if self.cbFirstPerson.isChecked() else emote[2]) + "#" #anim
msg += text + "#"
msg += self.charSide + "#"
@ -3484,7 +3486,7 @@ class GUI(QtGui.QWidget):
mChatMessage[SHOWNAME] = mChatMessage[SHOWNAME].decode('utf-8')
fChar = mChatMessage[CHARNAME]
evidence = int(mChatMessage[EVIDENCE])-1
evidence = int(mChatMessage[EVIDENCE]) - 1
# Some characters use " - " instead of "-" for no preanim.
mChatMessage[PREANIM] = mChatMessage[PREANIM].strip()
@ -3547,7 +3549,7 @@ class GUI(QtGui.QWidget):
objections = ["holdit", "objection", "takethat", "custom_objections/"+customObjection if customObjection != "custom" else "custom"]
self.objectionView.stop()
self.objectionView.play(objections[objectionMod-1], fChar.lower())
self.objectionView.play(objections[objectionMod - 1], fChar.lower())
self.presentedEvidence.hide()
self.playObjectionSound(fChar.lower(), objectionMod)
@ -3605,6 +3607,8 @@ class GUI(QtGui.QWidget):
def setScene(self, init=False):
if not init:
if self.animIsEmpty:
return
side = self.mChatMessage[SIDE]
# TODO: support custom positions
if side not in self.defaultPositions:
@ -3726,10 +3730,11 @@ class GUI(QtGui.QWidget):
self.ao2text.setAlignment(QtCore.Qt.AlignLeft)
self.text.setAlignment(QtCore.Qt.AlignLeft)
if self.mChatMessage[FLIP] == "1":
self.char.setFlipped(True)
else:
self.char.setFlipped(False)
if not self.animIsEmpty:
if self.mChatMessage[FLIP] == "1":
self.char.setFlipped(True)
else:
self.char.setFlipped(False)
side = self.mChatMessage[SIDE]
emoteMod = int(self.mChatMessage[EMOTE_MOD])
@ -3853,8 +3858,8 @@ class GUI(QtGui.QWidget):
fChar = self.mChatMessage[CHARNAME].lower()
fPreanim = self.mChatMessage[PREANIM].strip()
ao2Duration = ini.read_ini_int(AOpath + "characters/"+fChar+"/char.ini", "time", fPreanim, -1)
textDelay = ini.read_ini_int(AOpath + "characters/"+fChar+"/char.ini", "textdelay", fPreanim, -1)
ao2Duration = ini.read_ini_int(AOpath + "characters/" + fChar + "/char.ini", "time", fPreanim, -1)
textDelay = ini.read_ini_int(AOpath + "characters/" + fChar + "/char.ini", "textdelay", fPreanim, -1)
sfxDelay = int(self.mChatMessage[SFX_DELAY]) * 60
if sfxDelay > 0:
@ -3864,9 +3869,9 @@ class GUI(QtGui.QWidget):
preanimDuration = ao2Duration
animToFind = AOpath + "characters/"+fChar+"/"+fPreanim+".gif"
apngToFind = AOpath + "characters/"+fChar+"/"+fPreanim+".apng"
webpToFind = AOpath + "characters/"+fChar+"/"+fPreanim+".webp"
animToFind = AOpath + "characters/" + fChar + "/" + fPreanim + ".gif"
apngToFind = AOpath + "characters/" + fChar + "/" + fPreanim + ".apng"
webpToFind = AOpath + "characters/" + fChar + "/" + fPreanim + ".webp"
if (not animToFind and not apngToFind and not webpToFind) or preanimDuration < 0:
if nonInterrupting:
@ -3883,7 +3888,7 @@ class GUI(QtGui.QWidget):
self.animState = 1
if textDelay >= 0:
pass #text delay timer, but not now.
pass # TODO: text delay timer, but not now.
if nonInterrupting:
self.handleChatMessage3()
@ -4253,10 +4258,11 @@ class GUI(QtGui.QWidget):
audio.playHandle(self.sndRealization, True)
def playObjectionSound(self, charName, objection):
# TODO: Play objection sound when charname is unicode
try:
charName = str(charName)
except:
print "WARNING: Can't play objection sound if charName is unicode yet"
print "[warning] Can't play objection sound if charName is unicode yet"
return
if self.sndObjection:
@ -4264,7 +4270,7 @@ class GUI(QtGui.QWidget):
audio.stopHandle(self.sndObjection)
audio.freeHandle(self.sndObjection)
objecting = ["holdit", "objection", "takethat", "custom"][objection-1]
objecting = ["holdit", "objection", "takethat", "custom"][objection - 1]
if objecting:
if exists(AOpath + 'characters/' + charName + '/' + objecting + '.wav'):