def _set_values(self, t: Trigger): # general self.triggerNameLineEdit.setText(t.name) self.triggerNameLineEdit.setValidator(QRegExpValidator(QRegExp(".+"))) self.triggerDurationLineEdit.setText(t.duration) self.triggerDurationLineEdit.setValidator( QRegExpValidator(QRegExp("^(\\d\\d:)?(\\d\\d:)?\\d\\d$"))) # trigger if t.text: self.triggerTextRadio.setChecked(True) self.triggerTextLineEdit.setText(t.text) elif t.regex: self.triggerRegexRadio.setChecked(True) self.triggerRegexLineEdit.setText(t.regex) else: self.triggerTextRadio.setChecked(True) # start action self.startTimerTextLineEdit.setText(t.start_action.timer.text) self.startTimerEnabledCheckBox.setChecked(t.start_action.timer.enabled) self.startTimerDurationLineEdit.setText(t.start_action.timer.duration) self.startTimerIconSpinBox.setValue(t.start_action.timer.icon) set_qcolor( self.startTimerExample, QColor(*t.start_action.timer.text_color), QColor(*t.start_action.timer.bar_color), ) self.startTimerIconSpinBoxChanged(self.startTimerIconSpinBox.value()) self.startTextEnabledCheckBox.setChecked(t.start_action.text.enabled) self.startTextTextLineEdit.setText(t.start_action.text.text) self.startTextSizeSpinBox.setValue(t.start_action.text.text_size) set_qcolor(self.startTextExample, QColor(*t.start_action.text.color)) self.startSoundEnabledCheckBox.setChecked(t.start_action.sound.enabled) self.startSoundFileLabel.setText(t.start_action.sound.name) self.startSoundVolumeSlider.setValue(t.start_action.sound.volume) # end action self.endTimerTextLineEdit.setText(t.end_action.timer.text) self.endTimerEnabledCheckBox.setChecked(t.end_action.timer.enabled) self.endTimerDurationLineEdit.setText(t.end_action.timer.duration) self.endTimerIconSpinBox.setValue(t.end_action.timer.icon) set_qcolor( self.endTimerExample, QColor(*t.end_action.timer.text_color), QColor(*t.end_action.timer.bar_color), ) self.endTimerIconSpinBoxChanged(self.endTimerIconSpinBox.value()) self.endTextEnabledCheckBox.setChecked(t.end_action.text.enabled) self.endTextTextLineEdit.setText(t.end_action.text.text) self.endTextSizeSpinBox.setValue(t.end_action.text.text_size) set_qcolor(self.endTextExample, QColor(*t.end_action.text.color)) self.endSoundEnabledCheckBox.setChecked(t.end_action.sound.enabled) self.endSoundFileLabel.setText(t.end_action.sound.name) self.endSoundVolumeSlider.setValue(t.end_action.sound.volume)
def endTextColorButtonClicked(self): set_qcolor( self.endTextExample, foreground=get_color( self, get_rgb(self.endTextExample, QPalette.Foreground)), )
def startTimerTextColorButtonClicked(self) -> None: set_qcolor( self.startTimerExample, foreground=get_color( self, get_rgb(self.startTimerExample, QPalette.Foreground)), )
def endTimerBarColorButtonClicked(self) -> None: set_qcolor( self.endTimerExample, background=get_color( self, get_rgb(self.endTimerExample, QPalette.Background)), )
def spellsDebuffBarColorButtonClicked(self) -> None: set_qcolor( self.spellsDebuffBarLabel, background=self._get_color( get_rgb(self.spellsDebuffBarLabel, QPalette.Background)), )
def spellsYouColorButtonClicked(self) -> None: set_qcolor( self.spellsYouTargetLabel, background=self._get_color( get_rgb(self.spellsYouTargetLabel, QPalette.Background)), )
def spellsDebuffTextColorButtonClicked(self) -> None: set_qcolor( self.spellsDebuffBarLabel, foreground=self._get_color( get_rgb(self.spellsDebuffBarLabel, QPalette.Foreground)), )
def set_values(self): # fill combo boxes self.ttsRefreshButtonClicked() self.textDirectionComboBox.clear() self.textDirectionComboBox.addItems(["up", "down"]) # General self.updateCheckCheckBox.setChecked(app_config.update_check) self.eqDirectoryLabel.setText(app_config.eq_dir) self.qtScalingSpinBox.setValue(app_config.qt_scale_factor) # Maps self.mapOpacitySpinBox.setValue(profile.maps.opacity) self.mapLineSizeSpinBox.setValue(profile.maps.line_width) self.mapGridLineSizeSpinBox.setValue(profile.maps.grid_line_width) self.mapCurrentLevelSpinBox.setValue(profile.maps.current_z_alpha) self.mapClosestLevelSpinBox.setValue(profile.maps.closest_z_alpha) self.mapOtherLevelSpinBox.setValue(profile.maps.other_z_alpha) # Spells self.spellsUseCastingWindowCheckBox.setChecked( profile.spells.use_casting_window) self.spellsPersistentBuffTimersCheckBox.setChecked( profile.spells.persistent_buffs) self.spellsPersistentDebuffTimersCheckBox.setChecked( profile.spells.persistent_debuffs) self.spellsCastingWindowTimeSpinBox.setValue( profile.spells.casting_window_buffer) self.spellsSoundEnabledCheckBox.setChecked( profile.spells.sound_enabled) self.spellsSoundFileLabel.setText(profile.spells.sound_file) self.spellsSoundVolumeSlider.setValue(profile.spells.sound_volume) self.spellsUsePVPSpellDurationsCheckBox.setChecked( profile.spells.use_secondary_all) set_qcolor( self.spellsBuffBarLabel, foreground=QColor(*profile.spells.buff_text_color), background=QColor(*profile.spells.buff_bar_color), ) set_qcolor( self.spellsDebuffBarLabel, foreground=QColor(*profile.spells.debuff_text_color), background=QColor(*profile.spells.debuff_bar_color), ) set_qcolor( self.spellsYouTargetLabel, foreground=QColor(*profile.spells.target_text_color), background=QColor(*profile.spells.you_target_color), ) set_qcolor( self.spellsFriendlyTargetLabel, foreground=QColor(*profile.spells.target_text_color), background=QColor(*profile.spells.friendly_target_color), ) set_qcolor( self.spellsEnemyTargetLabel, foreground=QColor(*profile.spells.target_text_color), background=QColor(*profile.spells.enemy_target_color), ) # Text self.textDirectionComboBox.setCurrentText(profile.text.direction) self.textFadeSecondsSpinBox.setValue(profile.text.fade_seconds) self.textPixelsPerSecondSpinBox.setValue( profile.text.pixels_per_second) self.textShadowBlurRadiusSpinBox.setValue( profile.text.shadow_blur_radius) set_qcolor( self.textShadowColorLabel, background=QColor(*profile.text.shadow_color), ) # Remove triggertree if it exists and reinsert it try: self.triggerTree.setParent(None) except: pass self.triggerTree = TriggerTree() self.treeViewLayout.insertWidget(0, self.triggerTree, 1)
def textShadowColorButtonClicked(self, _) -> None: set_qcolor( self.textShadowColorLabel, background=self._get_color( get_rgb(self.textShadowColorLabel, QPalette.Background)), )
def spellsTargetTextColorButtonClicked(self, _) -> None: color = self._get_color( get_rgb(self.spellsYouTargetLabel, QPalette.Foreground)) set_qcolor(self.spellsYouTargetLabel, foreground=color) set_qcolor(self.spellsFriendlyTargetLabel, foreground=color) set_qcolor(self.spellsEnemyTargetLabel, foreground=color)
def spellsFriendlyColorButtonClicked(self, _) -> None: set_qcolor( self.spellsFriendlyTargetLabel, background=self._get_color( get_rgb(self.spellsFriendlyTargetLabel, QPalette.Background)), )