From 88d6b6ea3fb8b6f3711d4d829f78c367e497945a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 24 Nov 2020 22:31:19 +0100 Subject: GH-3427 add low effort datapack button to worlds --- application/pages/instance/WorldListPage.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'application/pages/instance/WorldListPage.cpp') diff --git a/application/pages/instance/WorldListPage.cpp b/application/pages/instance/WorldListPage.cpp index 75741d22..4d737025 100644 --- a/application/pages/instance/WorldListPage.cpp +++ b/application/pages/instance/WorldListPage.cpp @@ -170,6 +170,24 @@ void WorldListPage::on_actionView_Folder_triggered() DesktopServices::openDirectory(m_worlds->dir().absolutePath(), true); } +void WorldListPage::on_actionDatapacks_triggered() +{ + QModelIndex index = getSelectedWorld(); + + if (!index.isValid()) + { + return; + } + + if(!worldSafetyNagQuestion()) + return; + + auto fullPath = m_worlds->data(index, WorldList::FolderRole).toString(); + + DesktopServices::openDirectory(FS::PathCombine(fullPath, "datapacks"), true); +} + + void WorldListPage::on_actionReset_Icon_triggered() { auto proxiedIndex = getSelectedWorld(); -- cgit v1.2.3