GH-3427 add low effort datapack button to worlds

This commit is contained in:
Petr Mrázek 2020-11-24 22:31:19 +01:00
parent 66c0999901
commit 88d6b6ea3f
3 changed files with 28 additions and 0 deletions

View File

@ -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();

View File

@ -90,6 +90,7 @@ private slots:
void on_actionRename_triggered();
void on_actionRefresh_triggered();
void on_actionView_Folder_triggered();
void on_actionDatapacks_triggered();
void on_actionReset_Icon_triggered();
void worldChanged(const QModelIndex &current, const QModelIndex &previous);
void mceditState(LoggedProcess::State state);

View File

@ -85,6 +85,7 @@
<addaction name="actionCopy"/>
<addaction name="actionRemove"/>
<addaction name="actionMCEdit"/>
<addaction name="actionDatapacks"/>
<addaction name="actionReset_Icon"/>
<addaction name="separator"/>
<addaction name="actionCopy_Seed"/>
@ -139,6 +140,14 @@
<string>Remove world icon to make the game re-generate it on next load.</string>
</property>
</action>
<action name="actionDatapacks">
<property name="text">
<string>Datapacks</string>
</property>
<property name="toolTip">
<string>Manage datapacks inside the world.</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>