soundlist.ini: add sound list combobox to ui
This commit is contained in:
parent
683af1ca34
commit
c613a63d04
@ -16,26 +16,30 @@ self.textFontPointSize = 12 * self.viewportScale
|
||||
# IC input and demo slider
|
||||
viewportRight = max(self.viewport.x() + self.viewport.width(), 512)
|
||||
viewportBottom = self.viewport.y() + self.viewport.height()
|
||||
self.ICChatInput.setGeometry(self.viewport.x(), viewportBottom, self.viewport.width(), 23)
|
||||
self.ICChatInput.move(self.viewport.x(), viewportBottom)
|
||||
self.shownameEdit.resize(self.shownameEdit.sizeHint().width(), self.shownameEdit.sizeHint().height())
|
||||
self.shownameEdit.move(self.viewport.x() + self.viewport.width() - self.shownameEdit.width(), self.ICChatInput.y())
|
||||
self.ICChatInput.resize(self.viewport.width() - self.shownameEdit.width(), self.shownameEdit.height())
|
||||
self.sliDemoSeekbar.setGeometry(self.ICChatInput.x(), self.ICChatInput.y(), self.viewport.width(), 23)
|
||||
viewportBottom += self.ICChatInput.height() # 407
|
||||
|
||||
# IC options
|
||||
self.boxEmotes.setGeometry(164 - 28, viewportBottom + 7, 72, 20)
|
||||
self.boxColors.setGeometry(self.boxEmotes.x(), viewportBottom + 33, 72, 20)
|
||||
self.boxPositions.setGeometry(self.boxEmotes.x() + self.boxEmotes.size().width() + 4, self.boxEmotes.y(), 72, 20)
|
||||
self.cbFlip.move(self.boxPositions.x() + self.boxPositions.width() + 4, self.boxColors.y() - 5)
|
||||
self.cbPreanim.move(self.cbFlip.x(), self.cbFlip.y() + 14)
|
||||
self.cbNoInterrupt.move(self.cbFlip.x() + 140, self.cbFlip.y())
|
||||
self.cbAdditive.move(self.cbNoInterrupt.x(), self.cbPreanim.y())
|
||||
self.cbBench.move(self.cbFlip.x() + 70, self.cbFlip.y())
|
||||
self.cbSlide.move(self.cbBench.x(), self.cbPreanim.y())
|
||||
self.boxEffects.setGeometry(self.boxPositions.x(), self.boxColors.y(), 72, 20)
|
||||
self.btnCallMod.setGeometry(10, viewportBottom + 31, 60, 23)
|
||||
self.btnSettings.setGeometry(self.btnCallMod.x()+self.btnCallMod.size().width(), viewportBottom + 31, self.btnCallMod.width(), 23)
|
||||
self.btnChangeChar.setGeometry(10, viewportBottom + 7, self.btnCallMod.size().width() + self.btnSettings.size().width(), 23)
|
||||
self.shownameEdit.move(self.boxPositions.x() + self.boxPositions.width() + 4, self.boxPositions.y())
|
||||
self.shownameEdit.resize(viewportRight - self.shownameEdit.x(), 20)
|
||||
self.btnChangeChar.setGeometry(8, viewportBottom + 7, 120, self.btnChangeChar.sizeHint().height())
|
||||
self.btnCallMod.setGeometry(self.btnChangeChar.x(), self.btnChangeChar.y() + self.btnChangeChar.height(), self.btnChangeChar.width() / 2, 23)
|
||||
self.btnSettings.setGeometry(self.btnCallMod.x() + self.btnCallMod.size().width(), self.btnCallMod.y(), self.btnCallMod.width(), 23)
|
||||
|
||||
_boxWidth, _boxHeight, _sep = (80 if self.viewportScale < 2.5 else 100, self.boxEmotes.sizeHint().height(), 4)
|
||||
self.boxEmotes.setGeometry(self.btnChangeChar.x() + self.btnChangeChar.width() + _sep, self.btnChangeChar.y(), _boxWidth, _boxHeight)
|
||||
self.boxColors.setGeometry(self.boxEmotes.x(), self.btnCallMod.y(), _boxWidth, _boxHeight)
|
||||
self.boxPositions.setGeometry(self.boxEmotes.x() + _boxWidth + _sep, self.boxEmotes.y(), _boxWidth, _boxHeight)
|
||||
self.boxEffects.setGeometry(self.boxPositions.x(), self.boxColors.y(), _boxWidth, _boxHeight)
|
||||
self.boxSounds.setGeometry(self.boxPositions.x() + _boxWidth + _sep, self.boxEmotes.y(), _boxWidth, _boxHeight)
|
||||
self.cbFlip.move(self.boxSounds.x() + _boxWidth + _sep, self.boxSounds.y() - 2)
|
||||
self.cbPreanim.move(self.cbFlip.x() + (((viewportRight - self.cbFlip.x()) / 2) if self.viewportScale < 2.5 else _boxWidth), self.cbFlip.y())
|
||||
self.cbBench.move(self.cbFlip.x(), self.cbFlip.y() + self.cbFlip.height())
|
||||
self.cbSlide.move(self.cbPreanim.x(), self.cbBench.y())
|
||||
self.cbNoInterrupt.move(self.cbBench.x(), self.cbBench.y() + self.cbBench.height())
|
||||
self.cbAdditive.move(self.cbPreanim.x(), self.cbNoInterrupt.y())
|
||||
|
||||
self.gameTabs.setGeometry(8, viewportBottom + 61, viewportRight - 102, 256)
|
||||
|
||||
|
||||
26
gameview.py
26
gameview.py
@ -1483,6 +1483,13 @@ class GUI(QtGui.QWidget):
|
||||
self.ICChatInput.returnPressed.connect(self.onICReturn)
|
||||
self.ICChatInput.setPlaceholderText('Game chat')
|
||||
|
||||
self.showname = ""
|
||||
self.shownameEdit = QtGui.QLineEdit(self)
|
||||
self.shownameEdit.textChanged.connect(self.onShownameChanged)
|
||||
self.shownameEdit.setPlaceholderText("Showname")
|
||||
self.shownameEdit.setToolTip('Set a custom name for your character')
|
||||
self.shownameEdit.setObjectName("ui_ic_chat_name")
|
||||
|
||||
self.btnChangeChar = QtGui.QPushButton(self)
|
||||
self.btnChangeChar.clicked.connect(self.onChangeCharClicked)
|
||||
self.btnChangeChar.setObjectName("ui_change_character")
|
||||
@ -1524,12 +1531,11 @@ class GUI(QtGui.QWidget):
|
||||
self.boxEffects.setToolTip('Show this effect on your next message')
|
||||
self.boxEffects.setObjectName('ui_effects_dropdown')
|
||||
|
||||
self.showname = ""
|
||||
self.shownameEdit = QtGui.QLineEdit(self)
|
||||
self.shownameEdit.textChanged.connect(self.onShownameChanged)
|
||||
self.shownameEdit.setPlaceholderText("Showname")
|
||||
self.shownameEdit.setToolTip('Set a custom name for your character')
|
||||
self.shownameEdit.setObjectName("ui_ic_chat_name")
|
||||
self.boxSounds = QtGui.QComboBox(self)
|
||||
self.boxSounds.currentIndexChanged.connect(self.ICChatFocus)
|
||||
self.boxSounds.setToolTip('Play this sound effect')
|
||||
self.boxSounds.setObjectName('ui_sfx_dropdown')
|
||||
self.boxSounds.addItem("Default")
|
||||
|
||||
self.cbFlip = QtGui.QCheckBox(self)
|
||||
self.cbFlip.stateChanged.connect(self.changeFlipCheck)
|
||||
@ -1819,6 +1825,7 @@ class GUI(QtGui.QWidget):
|
||||
"blip_slider": self.sliBlipsVolume,
|
||||
"emote_dropdown": self.boxEmotes,
|
||||
"effects_dropdown": self.boxEffects,
|
||||
"sfx_dropdown": self.boxSounds,
|
||||
"pos_dropdown": self.boxPositions,
|
||||
"text_color": self.boxColors,
|
||||
"change_character": self.btnChangeChar,
|
||||
@ -3160,7 +3167,7 @@ class GUI(QtGui.QWidget):
|
||||
msg += emote[2] + "#" #anim
|
||||
msg += text + "#"
|
||||
msg += self.charSide + "#"
|
||||
#msg += (ini.get_effect_sound(self.boxEffects.currentText(), self.charName) if self.boxEffects.currentIndex() > 0 else emote[4]) + "#" #sfx
|
||||
msg += (ini.get_sound(self.boxSounds.currentText(), self.charName) if self.boxSounds.currentIndex() > 0 else emote[4]) + "#" #sfx
|
||||
msg += emote[4] + "#"
|
||||
msg += str(modifier) + "#" #emote modifier
|
||||
msg += str(self.myChar) + "#" #character ID
|
||||
@ -3228,6 +3235,8 @@ class GUI(QtGui.QWidget):
|
||||
p_effect = ini.read_ini(AOpath + "characters/"+self.charName+"/char.ini", "options", "effects")
|
||||
msg += str(fx + "|" + p_effect + "|" + fxSound + "#").encode('utf-8')
|
||||
self.boxEffects.setCurrentIndex(0)
|
||||
|
||||
self.boxSounds.setCurrentIndex(0)
|
||||
|
||||
# AO 2.10.2+
|
||||
if "custom_blips" in self.features:
|
||||
@ -4747,7 +4756,7 @@ class GUI(QtGui.QWidget):
|
||||
self.tabMusic, self.boxEmotes, self.boxPositions,
|
||||
self.cbFlip, self.cbPreanim, self.cbNoInterrupt,
|
||||
self.boxEffects, self.cbSlide, self.cbBench,
|
||||
self.cbAdditive, self.areaItems, self.shownameEdit,
|
||||
self.cbAdditive, self.areaItems,
|
||||
self.boxColors, self.btnDefenseBar.btnMinus, self.btnProsecutionBar.btnMinus,
|
||||
self.btnDefenseBar.btnPlus, self.btnProsecutionBar.btnPlus, self.btnWitnessTestimony,
|
||||
self.btnCrossExamination, self.btnNotGuilty, self.btnGuilty,
|
||||
@ -4755,6 +4764,7 @@ class GUI(QtGui.QWidget):
|
||||
]:
|
||||
widget.setEnabled(not demo)
|
||||
self.sliDemoSeekbar.setVisible(demo)
|
||||
self.shownameEdit.setVisible(not demo)
|
||||
self.ICChatInput.setVisible(not demo)
|
||||
|
||||
if demo:
|
||||
|
||||
4
ini.py
4
ini.py
@ -134,6 +134,10 @@ def get_effect_sound(fx_name, char):
|
||||
if fx_name == read_ini(inifile, section, "name", "").strip():
|
||||
return read_ini(inifile, section, "sound", "").strip()
|
||||
return read_sectionless_ini(default_path, fx_name).strip()
|
||||
|
||||
# TODO: Sound list not implemented
|
||||
def get_sound(fx_name, char):
|
||||
return ""
|
||||
|
||||
def get_effects(char):
|
||||
p_effect = read_ini("base/characters/"+char+"/char.ini", "options", "effects", "default/effects")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user