mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-05-26 03:42:15 +02:00
Just disable world selection when there is no world
Signed-off-by: Yihe Li <winmikedows@hotmail.com>
This commit is contained in:
parent
a89caf7362
commit
8425861fb1
@ -67,7 +67,9 @@ CreateShortcutDialog::CreateShortcutDialog(InstancePtr instance, QWidget* parent
|
|||||||
|
|
||||||
auto mInst = std::dynamic_pointer_cast<MinecraftInstance>(instance);
|
auto mInst = std::dynamic_pointer_cast<MinecraftInstance>(instance);
|
||||||
m_QuickJoinSupported = mInst && mInst->traits().contains("feature:is_quick_play_singleplayer");
|
m_QuickJoinSupported = mInst && mInst->traits().contains("feature:is_quick_play_singleplayer");
|
||||||
if (!m_QuickJoinSupported) {
|
auto worldList = mInst->worldList();
|
||||||
|
worldList->update();
|
||||||
|
if (!m_QuickJoinSupported || worldList->empty()) {
|
||||||
ui->worldTarget->hide();
|
ui->worldTarget->hide();
|
||||||
ui->worldSelectionBox->hide();
|
ui->worldSelectionBox->hide();
|
||||||
ui->serverTarget->setChecked(true);
|
ui->serverTarget->setChecked(true);
|
||||||
@ -90,8 +92,6 @@ CreateShortcutDialog::CreateShortcutDialog(InstancePtr instance, QWidget* parent
|
|||||||
|
|
||||||
// Populate worlds
|
// Populate worlds
|
||||||
if (m_QuickJoinSupported) {
|
if (m_QuickJoinSupported) {
|
||||||
auto worldList = mInst->worldList();
|
|
||||||
worldList->update();
|
|
||||||
for (const auto& world : worldList->allWorlds()) {
|
for (const auto& world : worldList->allWorlds()) {
|
||||||
// Entry name: World Name [Game Mode] - Last Played: DateTime
|
// Entry name: World Name [Game Mode] - Last Played: DateTime
|
||||||
QString entry_name = tr("%1 [%2] - Last Played: %3")
|
QString entry_name = tr("%1 [%2] - Last Played: %3")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user