diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2023-07-17 06:42:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-17 06:42:46 +0200 |
commit | aaf1726965313a0f8712479d0619ddc81f6347a0 (patch) | |
tree | 665f5ae9af8ab793520c64aa3a596a0086787181 /launcher/ui/pages | |
parent | 6b970954d6531f74fb661cd629c9e760e6a785d3 (diff) | |
parent | a2a09ffe01fe8eb6cd1f557b0feb98ed0271151e (diff) | |
download | PrismLauncher-aaf1726965313a0f8712479d0619ddc81f6347a0.tar.gz PrismLauncher-aaf1726965313a0f8712479d0619ddc81f6347a0.tar.bz2 PrismLauncher-aaf1726965313a0f8712479d0619ddc81f6347a0.zip |
Merge pull request #1357 from getchoo/quilt-beacon
feat: add toggle for quilt beacon
Diffstat (limited to 'launcher/ui/pages')
-rw-r--r-- | launcher/ui/pages/global/MinecraftPage.cpp | 6 | ||||
-rw-r--r-- | launcher/ui/pages/global/MinecraftPage.ui | 19 | ||||
-rw-r--r-- | launcher/ui/pages/instance/InstanceSettingsPage.cpp | 15 | ||||
-rw-r--r-- | launcher/ui/pages/instance/InstanceSettingsPage.ui | 25 |
4 files changed, 64 insertions, 1 deletions
diff --git a/launcher/ui/pages/global/MinecraftPage.cpp b/launcher/ui/pages/global/MinecraftPage.cpp index eca3e865..95482356 100644 --- a/launcher/ui/pages/global/MinecraftPage.cpp +++ b/launcher/ui/pages/global/MinecraftPage.cpp @@ -2,6 +2,7 @@ /* * PolyMC - Minecraft Launcher * Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org> + * Copyright (C) 2023 seth <getchoo at tuta dot io> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -99,6 +100,9 @@ void MinecraftPage::applySettings() // Miscellaneous s->set("CloseAfterLaunch", ui->closeAfterLaunchCheck->isChecked()); s->set("QuitAfterGameStop", ui->quitAfterGameStopCheck->isChecked()); + + // Mod loader settings + s->set("DisableQuiltBeacon", ui->disableQuiltBeaconCheckBox->isChecked()); } void MinecraftPage::loadSettings() @@ -137,6 +141,8 @@ void MinecraftPage::loadSettings() ui->closeAfterLaunchCheck->setChecked(s->get("CloseAfterLaunch").toBool()); ui->quitAfterGameStopCheck->setChecked(s->get("QuitAfterGameStop").toBool()); + + ui->disableQuiltBeaconCheckBox->setChecked(s->get("DisableQuiltBeacon").toBool()); } void MinecraftPage::retranslate() diff --git a/launcher/ui/pages/global/MinecraftPage.ui b/launcher/ui/pages/global/MinecraftPage.ui index 8f5de725..a3188dcc 100644 --- a/launcher/ui/pages/global/MinecraftPage.ui +++ b/launcher/ui/pages/global/MinecraftPage.ui @@ -191,6 +191,25 @@ </attribute> <layout class="QVBoxLayout" name="verticalLayout_12"> <item> + <widget class="QGroupBox" name="modLoaderSettingsGroupBox"> + <property name="title"> + <string>Mod loader settings</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_13"> + <item> + <widget class="QCheckBox" name="disableQuiltBeaconCheckBox"> + <property name="text"> + <string>Disable Quilt Loader Beacon</string> + </property> + <property name="toolTip"> + <string>Disable Quilt loader's beacon for counting monthly active users</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="nativeLibWorkaroundGroupBox"> <property name="title"> <string>Native library workarounds</string> diff --git a/launcher/ui/pages/instance/InstanceSettingsPage.cpp b/launcher/ui/pages/instance/InstanceSettingsPage.cpp index 943ff17f..25cc1a0d 100644 --- a/launcher/ui/pages/instance/InstanceSettingsPage.cpp +++ b/launcher/ui/pages/instance/InstanceSettingsPage.cpp @@ -3,6 +3,7 @@ * PolyMC - Minecraft Launcher * Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org> * Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net> + * Copyright (C) 2023 seth <getchoo at tuta dot io> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,9 +51,9 @@ #include "Application.h" #include "minecraft/auth/AccountList.h" +#include "FileSystem.h" #include "java/JavaInstallList.h" #include "java/JavaUtils.h" -#include "FileSystem.h" InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent) : QWidget(parent), ui(new Ui::InstanceSettingsPage), m_instance(inst) @@ -280,6 +281,14 @@ void InstanceSettingsPage::applySettings() m_settings->reset("InstanceAccountId"); } + bool overrideModLoaderSettings = ui->modLoaderSettingsGroupBox->isChecked(); + m_settings->set("OverrideModLoaderSettings", overrideModLoaderSettings); + if (overrideModLoaderSettings) { + m_settings->set("DisableQuiltBeacon", ui->disableQuiltBeaconCheckBox->isChecked()); + } else { + m_settings->reset("DisableQuiltBeacon"); + } + // FIXME: This should probably be called by a signal instead m_instance->updateRuntimeContext(); } @@ -380,6 +389,10 @@ void InstanceSettingsPage::loadSettings() ui->instanceAccountGroupBox->setChecked(m_settings->get("UseAccountForInstance").toBool()); updateAccountsMenu(); + + // Mod loader specific settings + ui->modLoaderSettingsGroupBox->setChecked(m_settings->get("OverrideModLoaderSettings").toBool()); + ui->disableQuiltBeaconCheckBox->setChecked(m_settings->get("DisableQuiltBeacon").toBool()); } void InstanceSettingsPage::on_javaDetectBtn_clicked() diff --git a/launcher/ui/pages/instance/InstanceSettingsPage.ui b/launcher/ui/pages/instance/InstanceSettingsPage.ui index 8427965d..323890b9 100644 --- a/launcher/ui/pages/instance/InstanceSettingsPage.ui +++ b/launcher/ui/pages/instance/InstanceSettingsPage.ui @@ -542,6 +542,31 @@ </attribute> <layout class="QVBoxLayout" name="verticalLayout_9"> <item> + <widget class="QGroupBox" name="modLoaderSettingsGroupBox"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>false</bool> + </property> + <property name="title"> + <string>Mod loader settings</string> + </property> + <layout class="QVBoxLayout" name="VerticalLayout_16"> + <item> + <widget class="QCheckBox" name="disableQuiltBeaconCheckBox"> + <property name="text"> + <string>Disable Quilt Loader Beacon</string> + </property> + <property name="toolTip"> + <string>Disable Quilt loader's beacon for counting monthly active users</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="gameTimeGroupBox"> <property name="enabled"> <bool>true</bool> |