NOISSUE add shader pack page for instances

Only theme with an icon is simple colored, rest is TBD
This commit is contained in:
Petr Mrázek
2021-09-23 21:26:56 +02:00
parent a5956194df
commit 0f3cf0595b
7 changed files with 128 additions and 0 deletions

View File

@ -222,6 +222,11 @@ QString MinecraftInstance::texturePacksDir() const
return FS::PathCombine(gameRoot(), "texturepacks");
}
QString MinecraftInstance::shaderPacksDir() const
{
return FS::PathCombine(gameRoot(), "shaderpacks");
}
QString MinecraftInstance::instanceConfigFolder() const
{
return FS::PathCombine(gameRoot(), "config");
@ -1010,6 +1015,17 @@ std::shared_ptr<ModFolderModel> MinecraftInstance::texturePackList() const
return m_texture_pack_list;
}
std::shared_ptr<ModFolderModel> MinecraftInstance::shaderPackList() const
{
if (!m_shader_pack_list)
{
m_shader_pack_list.reset(new ResourcePackFolderModel(shaderPacksDir()));
m_shader_pack_list->disableInteraction(isRunning());
connect(this, &BaseInstance::runningStatusChanged, m_shader_pack_list.get(), &ModFolderModel::disableInteraction);
}
return m_shader_pack_list;
}
std::shared_ptr<WorldList> MinecraftInstance::worldList() const
{
if (!m_world_list)

View File

@ -39,6 +39,7 @@ public:
QString jarModsDir() const;
QString resourcePacksDir() const;
QString texturePacksDir() const;
QString shaderPacksDir() const;
QString loaderModsDir() const;
QString coreModsDir() const;
QString modsCacheLocation() const;
@ -71,6 +72,7 @@ public:
std::shared_ptr<ModFolderModel> coreModList() const;
std::shared_ptr<ModFolderModel> resourcePackList() const;
std::shared_ptr<ModFolderModel> texturePackList() const;
std::shared_ptr<ModFolderModel> shaderPackList() const;
std::shared_ptr<WorldList> worldList() const;
std::shared_ptr<GameOptions> gameOptionsModel() const;
@ -124,6 +126,7 @@ protected: // data
mutable std::shared_ptr<ModFolderModel> m_loader_mod_list;
mutable std::shared_ptr<ModFolderModel> m_core_mod_list;
mutable std::shared_ptr<ModFolderModel> m_resource_pack_list;
mutable std::shared_ptr<ModFolderModel> m_shader_pack_list;
mutable std::shared_ptr<ModFolderModel> m_texture_pack_list;
mutable std::shared_ptr<WorldList> m_world_list;
mutable std::shared_ptr<GameOptions> m_game_options;