From e4b7207c61c639478a8e77e097606c6a79b1443a Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 12 Nov 2017 02:00:15 +0100 Subject: [PATCH] Remove "Hook Steam button" Making it pretty much mandatory if not manually set through .ini --- GloSC/GloSC.cpp | 36 ++++++++---------------------------- GloSC/GloSC.h | 3 +++ GloSC/GloSC.ui | 19 +------------------ 3 files changed, 12 insertions(+), 46 deletions(-) diff --git a/GloSC/GloSC.cpp b/GloSC/GloSC.cpp index 004f8e9..cba2380 100644 --- a/GloSC/GloSC.cpp +++ b/GloSC/GloSC.cpp @@ -56,7 +56,7 @@ void GloSC::writeIni(QString entryName) const settings.setValue("bEnableOverlay", 0 + ui.cbOverlay->isChecked()); settings.setValue("bEnableControllers", 0 + ui.cbControllers->isChecked()); settings.setValue("bUseDesktopConfig", 0 + ui.cbUseDesktop->isChecked()); - settings.setValue("bHookSteam", 0 + ui.cbHookSteam->isChecked()); + settings.setValue("bHookSteam", hook_steam_); settings.setValue("version", GLOSC_VERSION); settings.endGroup(); @@ -142,10 +142,9 @@ void GloSC::animate(int to) anim->start(QPropertyAnimation::DeleteWhenStopped); } -void GloSC::on_cbUseDesktop_toggled(bool checked) const +void GloSC::on_cbUseDesktop_toggled(bool checked) { - ui.cbHookSteam->setEnabled(!checked); - ui.cbHookSteam->setChecked(!checked); + hook_steam_ = !checked; } void GloSC::on_pbCreateNew_clicked() @@ -154,7 +153,7 @@ void GloSC::on_pbCreateNew_clicked() ui.cbOverlay->setChecked(true); ui.cbControllers->setChecked(true); - ui.cbHookSteam->setChecked(true); + hook_steam_ = true; ui.cbLaunchGame->setChecked(false); ui.lePath->setText(""); @@ -445,7 +444,7 @@ void GloSC::on_pbUWP_clicked() } -void GloSC::on_lwInstances_currentRowChanged(int row) const +void GloSC::on_lwInstances_currentRowChanged(int row) { if (row < 0) return; @@ -461,13 +460,11 @@ void GloSC::on_lwInstances_currentRowChanged(int row) const ui.cbUseDesktop->setChecked(settings.value("bUseDesktopConfig").toBool()); if (ui.cbUseDesktop->isChecked()) { - ui.cbHookSteam->setChecked(false); - ui.cbHookSteam->setEnabled(false); + hook_steam_ = false; } else { - ui.cbHookSteam->setEnabled(true); - ui.cbHookSteam->setChecked(settings.value("bHookSteam").toBool()); + hook_steam_ = true; } settings.endGroup(); @@ -489,22 +486,5 @@ void GloSC::on_lwInstances_itemSelectionChanged() if (width() != wide_x) { animate(wide_x); - } else { - ui.configBox->setGraphicsEffect(&opEff); - QPropertyAnimation* anim = new QPropertyAnimation(&opEff, "opacity"); - anim->setEasingCurve(QEasingCurve::OutExpo); - anim->setDuration(160); - anim->setStartValue(1.f); - anim->setEndValue(0.f); - connect(anim, &QPropertyAnimation::finished, this, [this]() - { - QPropertyAnimation* anim2 = new QPropertyAnimation(&opEff, "opacity"); - anim2->setEasingCurve(QEasingCurve::InExpo); - anim2->setDuration(160); - anim2->setStartValue(0.f); - anim2->setEndValue(1.f); - anim2->start(QPropertyAnimation::DeleteWhenStopped); - }); - anim->start(QPropertyAnimation::DeleteWhenStopped); - } + } } diff --git a/GloSC/GloSC.h b/GloSC/GloSC.h index c9aeec1..989b490 100644 --- a/GloSC/GloSC.h +++ b/GloSC/GloSC.h @@ -43,6 +43,8 @@ class GloSC : public QMainWindow public: GloSC(QWidget *parent = Q_NULLPTR); + bool hook_steam_ = true; + private: Ui::GloSCClass ui; @@ -65,6 +67,7 @@ private: void animate(int to); + private slots: void on_cbUseDesktop_toggled(bool checked) const; void on_pbCreateNew_clicked(); diff --git a/GloSC/GloSC.ui b/GloSC/GloSC.ui index f57a168..bcc219e 100644 --- a/GloSC/GloSC.ui +++ b/GloSC/GloSC.ui @@ -169,24 +169,7 @@ Use Desktop-Config -Disables hooking, per application bindings won't work - - - - - - 10 - 160 - 371 - 41 - - - - Hook Steam -Enforces bindings reliably by hooking into Steam - - - true +Doesn't work if GloSC window is in focus