Merge pull request #1105 from flowln/better_resource_packs
Add basic resource pack parsing and fix issues
This commit is contained in:
@ -135,6 +135,16 @@ bool ModFolderPage::onSelectionChanged(const QModelIndex& current, const QModelI
|
||||
return true;
|
||||
}
|
||||
|
||||
void ModFolderPage::removeItem()
|
||||
{
|
||||
|
||||
if (!m_controlsEnabled)
|
||||
return;
|
||||
|
||||
auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection());
|
||||
m_model->deleteMods(selection.indexes());
|
||||
}
|
||||
|
||||
void ModFolderPage::installMods()
|
||||
{
|
||||
if (!m_controlsEnabled)
|
||||
|
@ -59,6 +59,8 @@ class ModFolderPage : public ExternalResourcesPage {
|
||||
bool onSelectionChanged(const QModelIndex& current, const QModelIndex& previous) override;
|
||||
|
||||
private slots:
|
||||
void removeItem() override;
|
||||
|
||||
void installMods();
|
||||
void updateMods();
|
||||
|
||||
|
@ -61,4 +61,15 @@ public:
|
||||
return !m_instance->traits().contains("no-texturepacks") &&
|
||||
!m_instance->traits().contains("texturepacks");
|
||||
}
|
||||
|
||||
public slots:
|
||||
bool onSelectionChanged(const QModelIndex& current, const QModelIndex& previous) override
|
||||
{
|
||||
auto sourceCurrent = m_filterModel->mapToSource(current);
|
||||
int row = sourceCurrent.row();
|
||||
auto& rp = static_cast<ResourcePack&>(m_model->at(row));
|
||||
ui->frame->updateWithResourcePack(rp);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user