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

@ -653,6 +653,7 @@ SET(MULTIMC_SOURCES
pages/instance/VersionPage.h
pages/instance/TexturePackPage.h
pages/instance/ResourcePackPage.h
pages/instance/ShaderPackPage.h
pages/instance/ModFolderPage.cpp
pages/instance/ModFolderPage.h
pages/instance/NotesPage.cpp

View File

@ -9,6 +9,7 @@
#include "pages/instance/ModFolderPage.h"
#include "pages/instance/ResourcePackPage.h"
#include "pages/instance/TexturePackPage.h"
#include "pages/instance/ShaderPackPage.h"
#include "pages/instance/NotesPage.h"
#include "pages/instance/ScreenshotsPage.h"
#include "pages/instance/InstanceSettingsPage.h"
@ -44,6 +45,7 @@ public:
values.append(new CoreModFolderPage(onesix.get(), onesix->coreModList(), "coremods", "coremods", tr("Core mods"), "Core-mods"));
values.append(new ResourcePackPage(onesix.get()));
values.append(new TexturePackPage(onesix.get()));
values.append(new ShaderPackPage(onesix.get()));
values.append(new NotesPage(onesix.get()));
values.append(new WorldListPage(onesix.get(), onesix->worldList()));
values.append(new ServersPage(onesix));

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;

View File

@ -0,0 +1,22 @@
#pragma once
#include "ModFolderPage.h"
#include "ui_ModFolderPage.h"
class ShaderPackPage : public ModFolderPage
{
Q_OBJECT
public:
explicit ShaderPackPage(MinecraftInstance *instance, QWidget *parent = 0)
: ModFolderPage(instance, instance->shaderPackList(), "shaderpacks",
"shaderpacks", tr("Shader packs"), "Resource-packs", parent)
{
ui->actionView_configs->setVisible(false);
}
virtual ~ShaderPackPage() {}
virtual bool shouldDisplay() const override
{
return true;
}
};

View File

@ -30,6 +30,7 @@
<file>scalable/resourcepacks.svg</file>
<file>scalable/screenshots.svg</file>
<file>scalable/settings.svg</file>
<file>scalable/shaderpacks.svg</file>
<file>scalable/status-bad.svg</file>
<file>scalable/status-good.svg</file>
<file>scalable/status-yellow.svg</file>

View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xml:space="preserve"
enable-background="new 0 0 32 32"
viewBox="0 0 32 32"
y="0px"
x="0px"
id="Calque_1"
version="1.1"
sodipodi:docname="shaderpacks.svg"
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"><sodipodi:namedview
id="namedview14"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="14.584077"
inkscape:cx="24.478752"
inkscape:cy="13.165043"
inkscape:window-width="2399"
inkscape:window-height="1183"
inkscape:window-x="2321"
inkscape:window-y="798"
inkscape:window-maximized="0"
inkscape:current-layer="Calque_1" /><metadata
id="metadata19"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs17"><linearGradient
id="linearGradient3249"
inkscape:swatch="solid"><stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop3247" /></linearGradient>
</defs><g
id="g6"><path
id="path2"
d="M26,0H6C2.7,0,0,2.7,0,6v3h32V6C32,2.7,29.3,0,26,0z"
fill="#39B54A" /><path
id="path4"
d="M0,26c0,3.3,2.7,6,6,6h20c3.3,0,6-2.7,6-6V9H0V26z"
fill="#8C6239" /></g><path
fill="#F2F2F2"
fill-rule="evenodd"
clip-rule="evenodd"
id="path8"
d="M28,6c0-1.1-0.9-2-2-2H6C4.9,4,4,4.9,4,6v20c0,1.1,0.9,2,2,2h20 c1.1,0,2-0.9,2-2V6z" /><rect
x="6.0678372"
y="6.0678444"
fill-rule="evenodd"
clip-rule="evenodd"
fill="none"
width="19.864313"
height="19.864313"
id="rect838"
style="stroke-width:1.98049" /><path
id="polygon840"
style="clip-rule:evenodd;fill:#294eab;fill-rule:evenodd;stroke-width:3.19043"
transform="matrix(0.62075979,0,0,0.62075979,293.47962,-158.4335)"
d="m -433,272.1 v 17.8 l -14,7.1 v -17.8 z" /><path
id="polygon842"
style="clip-rule:evenodd;fill:#39b54a;fill-rule:evenodd;stroke-width:3.19043"
transform="matrix(0.62075979,0,0,0.62075979,293.47962,-158.4335)"
d="m -461,272.1 v 17.8 l 14,7.1 v -17.8 z" /><path
id="polygon844"
style="clip-rule:evenodd;fill:#ed4c31;fill-rule:evenodd;stroke-width:3.19043"
transform="matrix(0.62075979,0,0,0.62075979,293.47962,-158.4335)"
d="m -447,265 -14,7.1 14,7.1 14,-7.1 z" /></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB