extras: add client side first person view toggle
This commit is contained in:
parent
503ed0094b
commit
d83ecfc5a7
@ -110,9 +110,6 @@ self.btnPairOffsetReset.move(self.sliPairOffset.x() + self.sliPairOffset.size().
|
|||||||
self.lblPairOrder.move(self.lblPairOffset.x(), self.lblPairOffset.y()+144)
|
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.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
|
# Judge options
|
||||||
self.btnDefenseBar.setGeometry(self.gameTabs.x() + self.gameTabs.width() + 11, viewportBottom + 61, 84, 14)
|
self.btnDefenseBar.setGeometry(self.gameTabs.x() + self.gameTabs.width() + 11, viewportBottom + 61, 84, 14)
|
||||||
self.btnProsecutionBar.setGeometry(self.btnDefenseBar.x(), viewportBottom + 75, 84, 14)
|
self.btnProsecutionBar.setGeometry(self.btnDefenseBar.x(), viewportBottom + 75, 84, 14)
|
||||||
|
|||||||
44
gameview.py
44
gameview.py
@ -1353,9 +1353,14 @@ class GUI(QtGui.QWidget):
|
|||||||
self.cbAutoCaps = QtGui.QCheckBox()
|
self.cbAutoCaps = QtGui.QCheckBox()
|
||||||
self.cbAutoCaps.setChecked(False)
|
self.cbAutoCaps.setChecked(False)
|
||||||
self.cbAutoCaps.setText("Automatic caps and period")
|
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.cbMockText)
|
||||||
self.layMisc.addWidget(self.cbSpacing)
|
self.layMisc.addWidget(self.cbSpacing)
|
||||||
self.layMisc.addWidget(self.cbAutoCaps)
|
self.layMisc.addWidget(self.cbAutoCaps)
|
||||||
|
self.layMisc.addWidget(self.cbFirstPerson)
|
||||||
|
|
||||||
# Message queue
|
# Message queue
|
||||||
self.queueItems = QtGui.QListWidget(self.tabQueue)
|
self.queueItems = QtGui.QListWidget(self.tabQueue)
|
||||||
@ -2098,7 +2103,7 @@ class GUI(QtGui.QWidget):
|
|||||||
gameTabsHeight = self.gameTabs.height() - self.gameTabs.findChild(QtGui.QTabBar).height()
|
gameTabsHeight = self.gameTabs.height() - self.gameTabs.findChild(QtGui.QTabBar).height()
|
||||||
self.ICLog.setGeometry(0, 0, self.gameTabs.width(), gameTabsHeight)
|
self.ICLog.setGeometry(0, 0, self.gameTabs.width(), gameTabsHeight)
|
||||||
self.boxPrivateEvidence.setGeometry(8, 8, 192, 20)
|
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.evidenceImage.setGeometry(self.evidenceDescription.x() + self.evidenceDescription.width() - 70, 8, 70, 70)
|
||||||
self.boxEvidence.setGeometry(8, 8, self.evidenceImage.x() - 16, 20)
|
self.boxEvidence.setGeometry(8, 8, self.evidenceImage.x() - 16, 20)
|
||||||
self.btnEvidenceAdd.move(8, 32)
|
self.btnEvidenceAdd.move(8, 32)
|
||||||
@ -2158,9 +2163,6 @@ class GUI(QtGui.QWidget):
|
|||||||
self.lblPairOrder.move(self.lblPairOffset.x(), self.lblPairOffset.y()+144)
|
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.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
|
## Sidebar
|
||||||
oocBottom = self.OOCNameInput.y() + self.OOCNameInput.height() # 268
|
oocBottom = self.OOCNameInput.y() + self.OOCNameInput.height() # 268
|
||||||
self.OOCLogin.resize(48, 20)
|
self.OOCLogin.resize(48, 20)
|
||||||
@ -3165,7 +3167,7 @@ class GUI(QtGui.QWidget):
|
|||||||
|
|
||||||
msg += emote[1] + "#" #pre-anim
|
msg += emote[1] + "#" #pre-anim
|
||||||
msg += self.charName.title() + "#"
|
msg += self.charName.title() + "#"
|
||||||
msg += emote[2] + "#" #anim
|
msg += ("" if self.cbFirstPerson.isChecked() else emote[2]) + "#" #anim
|
||||||
msg += text + "#"
|
msg += text + "#"
|
||||||
msg += self.charSide + "#"
|
msg += self.charSide + "#"
|
||||||
|
|
||||||
@ -3484,7 +3486,7 @@ class GUI(QtGui.QWidget):
|
|||||||
mChatMessage[SHOWNAME] = mChatMessage[SHOWNAME].decode('utf-8')
|
mChatMessage[SHOWNAME] = mChatMessage[SHOWNAME].decode('utf-8')
|
||||||
|
|
||||||
fChar = mChatMessage[CHARNAME]
|
fChar = mChatMessage[CHARNAME]
|
||||||
evidence = int(mChatMessage[EVIDENCE])-1
|
evidence = int(mChatMessage[EVIDENCE]) - 1
|
||||||
|
|
||||||
# Some characters use " - " instead of "-" for no preanim.
|
# Some characters use " - " instead of "-" for no preanim.
|
||||||
mChatMessage[PREANIM] = mChatMessage[PREANIM].strip()
|
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"]
|
objections = ["holdit", "objection", "takethat", "custom_objections/"+customObjection if customObjection != "custom" else "custom"]
|
||||||
self.objectionView.stop()
|
self.objectionView.stop()
|
||||||
self.objectionView.play(objections[objectionMod-1], fChar.lower())
|
self.objectionView.play(objections[objectionMod - 1], fChar.lower())
|
||||||
self.presentedEvidence.hide()
|
self.presentedEvidence.hide()
|
||||||
self.playObjectionSound(fChar.lower(), objectionMod)
|
self.playObjectionSound(fChar.lower(), objectionMod)
|
||||||
|
|
||||||
@ -3605,6 +3607,8 @@ class GUI(QtGui.QWidget):
|
|||||||
|
|
||||||
def setScene(self, init=False):
|
def setScene(self, init=False):
|
||||||
if not init:
|
if not init:
|
||||||
|
if self.animIsEmpty:
|
||||||
|
return
|
||||||
side = self.mChatMessage[SIDE]
|
side = self.mChatMessage[SIDE]
|
||||||
# TODO: support custom positions
|
# TODO: support custom positions
|
||||||
if side not in self.defaultPositions:
|
if side not in self.defaultPositions:
|
||||||
@ -3726,10 +3730,11 @@ class GUI(QtGui.QWidget):
|
|||||||
self.ao2text.setAlignment(QtCore.Qt.AlignLeft)
|
self.ao2text.setAlignment(QtCore.Qt.AlignLeft)
|
||||||
self.text.setAlignment(QtCore.Qt.AlignLeft)
|
self.text.setAlignment(QtCore.Qt.AlignLeft)
|
||||||
|
|
||||||
if self.mChatMessage[FLIP] == "1":
|
if not self.animIsEmpty:
|
||||||
self.char.setFlipped(True)
|
if self.mChatMessage[FLIP] == "1":
|
||||||
else:
|
self.char.setFlipped(True)
|
||||||
self.char.setFlipped(False)
|
else:
|
||||||
|
self.char.setFlipped(False)
|
||||||
|
|
||||||
side = self.mChatMessage[SIDE]
|
side = self.mChatMessage[SIDE]
|
||||||
emoteMod = int(self.mChatMessage[EMOTE_MOD])
|
emoteMod = int(self.mChatMessage[EMOTE_MOD])
|
||||||
@ -3853,8 +3858,8 @@ class GUI(QtGui.QWidget):
|
|||||||
fChar = self.mChatMessage[CHARNAME].lower()
|
fChar = self.mChatMessage[CHARNAME].lower()
|
||||||
fPreanim = self.mChatMessage[PREANIM].strip()
|
fPreanim = self.mChatMessage[PREANIM].strip()
|
||||||
|
|
||||||
ao2Duration = ini.read_ini_int(AOpath + "characters/"+fChar+"/char.ini", "time", 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)
|
textDelay = ini.read_ini_int(AOpath + "characters/" + fChar + "/char.ini", "textdelay", fPreanim, -1)
|
||||||
sfxDelay = int(self.mChatMessage[SFX_DELAY]) * 60
|
sfxDelay = int(self.mChatMessage[SFX_DELAY]) * 60
|
||||||
|
|
||||||
if sfxDelay > 0:
|
if sfxDelay > 0:
|
||||||
@ -3864,9 +3869,9 @@ class GUI(QtGui.QWidget):
|
|||||||
|
|
||||||
preanimDuration = ao2Duration
|
preanimDuration = ao2Duration
|
||||||
|
|
||||||
animToFind = AOpath + "characters/"+fChar+"/"+fPreanim+".gif"
|
animToFind = AOpath + "characters/" + fChar + "/" + fPreanim + ".gif"
|
||||||
apngToFind = AOpath + "characters/"+fChar+"/"+fPreanim+".apng"
|
apngToFind = AOpath + "characters/" + fChar + "/" + fPreanim + ".apng"
|
||||||
webpToFind = AOpath + "characters/"+fChar+"/"+fPreanim+".webp"
|
webpToFind = AOpath + "characters/" + fChar + "/" + fPreanim + ".webp"
|
||||||
|
|
||||||
if (not animToFind and not apngToFind and not webpToFind) or preanimDuration < 0:
|
if (not animToFind and not apngToFind and not webpToFind) or preanimDuration < 0:
|
||||||
if nonInterrupting:
|
if nonInterrupting:
|
||||||
@ -3883,7 +3888,7 @@ class GUI(QtGui.QWidget):
|
|||||||
self.animState = 1
|
self.animState = 1
|
||||||
|
|
||||||
if textDelay >= 0:
|
if textDelay >= 0:
|
||||||
pass #text delay timer, but not now.
|
pass # TODO: text delay timer, but not now.
|
||||||
|
|
||||||
if nonInterrupting:
|
if nonInterrupting:
|
||||||
self.handleChatMessage3()
|
self.handleChatMessage3()
|
||||||
@ -4253,10 +4258,11 @@ class GUI(QtGui.QWidget):
|
|||||||
audio.playHandle(self.sndRealization, True)
|
audio.playHandle(self.sndRealization, True)
|
||||||
|
|
||||||
def playObjectionSound(self, charName, objection):
|
def playObjectionSound(self, charName, objection):
|
||||||
|
# TODO: Play objection sound when charname is unicode
|
||||||
try:
|
try:
|
||||||
charName = str(charName)
|
charName = str(charName)
|
||||||
except:
|
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
|
return
|
||||||
|
|
||||||
if self.sndObjection:
|
if self.sndObjection:
|
||||||
@ -4264,7 +4270,7 @@ class GUI(QtGui.QWidget):
|
|||||||
audio.stopHandle(self.sndObjection)
|
audio.stopHandle(self.sndObjection)
|
||||||
audio.freeHandle(self.sndObjection)
|
audio.freeHandle(self.sndObjection)
|
||||||
|
|
||||||
objecting = ["holdit", "objection", "takethat", "custom"][objection-1]
|
objecting = ["holdit", "objection", "takethat", "custom"][objection - 1]
|
||||||
|
|
||||||
if objecting:
|
if objecting:
|
||||||
if exists(AOpath + 'characters/' + charName + '/' + objecting + '.wav'):
|
if exists(AOpath + 'characters/' + charName + '/' + objecting + '.wav'):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user