Skip to content

Commit a9c0d7d

Browse files
committed
fix(settings): fix ely.by settings
Signed-off-by: so5iso4ka <so5iso4ka@icloud.com>
1 parent 66c2e83 commit a9c0d7d

2 files changed

Lines changed: 35 additions & 55 deletions

File tree

launcher/ui/widgets/MinecraftSettingsWidget.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ MinecraftSettingsWidget::MinecraftSettingsWidget(MinecraftInstancePtr instance,
7878
m_ui->perfomanceGroupBox->setCheckable(true);
7979
m_ui->gameTimeGroupBox->setCheckable(true);
8080
m_ui->legacySettingsGroupBox->setCheckable(true);
81+
m_ui->elybyGroupBox->setCheckable(true);
8182

8283
m_quickPlaySingleplayer = m_instance->traits().contains("feature:is_quick_play_singleplayer");
8384
if (m_quickPlaySingleplayer) {
@@ -203,6 +204,10 @@ void MinecraftSettingsWidget::loadSettings()
203204
m_ui->useDiscreteGpuCheck->setChecked(settings->get("UseDiscreteGpu").toBool());
204205
m_ui->useZink->setChecked(settings->get("UseZink").toBool());
205206

207+
// Elyby
208+
m_ui->elySkinSystemComboBox->setCurrentIndex(settings->get("UseElySkins").toInt());
209+
m_ui->useInjectorCheckBox->setChecked(settings->get("UseElyAuthlibInjector").toBool());
210+
206211
m_ui->serverJoinGroupBox->setChecked(settings->get("JoinServerOnLaunch").toBool());
207212

208213
if (m_instance != nullptr) {
@@ -353,6 +358,16 @@ void MinecraftSettingsWidget::saveSettings()
353358
settings->reset("UseDiscreteGpu");
354359
settings->reset("UseZink");
355360
}
361+
// Elyby
362+
bool elyby = m_instance == nullptr || m_ui->elybyGroupBox->isChecked();
363+
364+
if (elyby) {
365+
settings->set("UseElySkins", m_ui->elySkinSystemComboBox->currentIndex());
366+
settings->set("UseElyAuthlibInjector", m_ui->useInjectorCheckBox->isChecked());
367+
} else {
368+
settings->reset("UseElySkins");
369+
settings->reset("UseElyAuthlibInjector");
370+
}
356371

357372
// Game time
358373
bool gameTime = m_instance == nullptr || m_ui->gameTimeGroupBox->isChecked();

launcher/ui/widgets/MinecraftSettingsWidget.ui

Lines changed: 20 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</sizepolicy>
5353
</property>
5454
<property name="horizontalScrollBarPolicy">
55-
<enum>Qt::ScrollBarAlwaysOff</enum>
55+
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
5656
</property>
5757
<property name="widgetResizable">
5858
<bool>true</bool>
@@ -61,9 +61,9 @@
6161
<property name="geometry">
6262
<rect>
6363
<x>0</x>
64-
<y>-253</y>
65-
<width>610</width>
66-
<height>550</height>
64+
<y>0</y>
65+
<width>568</width>
66+
<height>593</height>
6767
</rect>
6868
</property>
6969
<layout class="QVBoxLayout" name="verticalLayout_5">
@@ -264,13 +264,13 @@
264264
</widget>
265265
</item>
266266
<item>
267-
<widget class="QGroupBox" name="ElybyGroupBox">
267+
<widget class="QGroupBox" name="elybyGroupBox">
268268
<property name="title">
269269
<string>Ely.by</string>
270270
</property>
271-
<layout class="QVBoxLayout" name="verticalLayout_7">
271+
<layout class="QVBoxLayout" name="verticalLayout_7">
272272
<item>
273-
<layout class="QHBoxLayout" name="horizontalLayout">
273+
<layout class="QHBoxLayout" name="horizontalLayout">
274274
<item>
275275
<widget class="QLabel" name="label">
276276
<property name="text">
@@ -279,9 +279,9 @@
279279
</widget>
280280
</item>
281281
<item>
282-
<widget class="QComboBox" name="elySkinSystemComboBox">
282+
<widget class="QComboBox" name="elySkinSystemComboBox">
283283
<property name="sizePolicy">
284-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
284+
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
285285
<horstretch>0</horstretch>
286286
<verstretch>0</verstretch>
287287
</sizepolicy>
@@ -326,7 +326,7 @@
326326
<item>
327327
<spacer name="verticalSpacer_2">
328328
<property name="orientation">
329-
<enum>Qt::Vertical</enum>
329+
<enum>Qt::Orientation::Vertical</enum>
330330
</property>
331331
<property name="sizeHint" stdset="0">
332332
<size>
@@ -357,8 +357,8 @@
357357
<rect>
358358
<x>0</x>
359359
<y>0</y>
360-
<width>624</width>
361-
<height>297</height>
360+
<width>568</width>
361+
<height>580</height>
362362
</rect>
363363
</property>
364364
</widget>
@@ -374,7 +374,7 @@
374374
<item>
375375
<widget class="QScrollArea" name="scrollArea_2">
376376
<property name="horizontalScrollBarPolicy">
377-
<enum>Qt::ScrollBarAlwaysOff</enum>
377+
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
378378
</property>
379379
<property name="widgetResizable">
380380
<bool>true</bool>
@@ -383,9 +383,9 @@
383383
<property name="geometry">
384384
<rect>
385385
<x>0</x>
386-
<y>-101</y>
387-
<width>610</width>
388-
<height>398</height>
386+
<y>0</y>
387+
<width>568</width>
388+
<height>580</height>
389389
</rect>
390390
</property>
391391
<layout class="QVBoxLayout" name="verticalLayout_7">
@@ -541,7 +541,7 @@
541541
<item>
542542
<spacer name="verticalSpacer">
543543
<property name="orientation">
544-
<enum>Qt::Vertical</enum>
544+
<enum>Qt::Orientation::Vertical</enum>
545545
</property>
546546
<property name="sizeHint" stdset="0">
547547
<size>
@@ -572,8 +572,8 @@
572572
<rect>
573573
<x>0</x>
574574
<y>0</y>
575-
<width>624</width>
576-
<height>297</height>
575+
<width>568</width>
576+
<height>580</height>
577577
</rect>
578578
</property>
579579
<layout class="QVBoxLayout" name="verticalLayout_14">
@@ -612,41 +612,6 @@
612612
</layout>
613613
</widget>
614614
</item>
615-
<item>
616-
<widget class="QGroupBox" name="elySettingsGroupBox">
617-
<property name="title">
618-
<string>Override Ely.by settings</string>
619-
</property>
620-
<property name="checkable">
621-
<bool>true</bool>
622-
</property>
623-
<property name="checked">
624-
<bool>false</bool>
625-
</property>
626-
<layout class="QVBoxLayout" name="verticalLayout_7">
627-
<item>
628-
<widget class="QCheckBox" name="useElyCheckBox">
629-
<property name="sizePolicy">
630-
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
631-
<horstretch>0</horstretch>
632-
<verstretch>0</verstretch>
633-
</sizepolicy>
634-
</property>
635-
<property name="text">
636-
<string>Use Ely.by skin system</string>
637-
</property>
638-
</widget>
639-
</item>
640-
<item>
641-
<widget class="QCheckBox" name="useInjectorCheckBox">
642-
<property name="text">
643-
<string>Use Authlib Injector</string>
644-
</property>
645-
</widget>
646-
</item>
647-
</layout>
648-
</widget>
649-
</item>
650615
<item>
651616
<widget class="QGroupBox" name="serverJoinGroupBox">
652617
<property name="title">
@@ -685,7 +650,7 @@
685650
<item>
686651
<spacer name="verticalSpacer_3">
687652
<property name="orientation">
688-
<enum>Qt::Vertical</enum>
653+
<enum>Qt::Orientation::Vertical</enum>
689654
</property>
690655
<property name="sizeHint" stdset="0">
691656
<size>

0 commit comments

Comments
 (0)