mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-30 12:17:52 +00:00
Merge branch 'MultiMC:develop' into develop
This commit is contained in:
@@ -312,6 +312,10 @@ set(MINECRAFT_SOURCES
|
||||
minecraft/mod/ModFolderLoadTask.cpp
|
||||
minecraft/mod/LocalModParseTask.h
|
||||
minecraft/mod/LocalModParseTask.cpp
|
||||
minecraft/mod/ResourcePackFolderModel.h
|
||||
minecraft/mod/ResourcePackFolderModel.cpp
|
||||
minecraft/mod/TexturePackFolderModel.h
|
||||
minecraft/mod/TexturePackFolderModel.cpp
|
||||
|
||||
# Assets
|
||||
minecraft/AssetsUtils.h
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "meta/VersionList.h"
|
||||
|
||||
#include "mod/ModFolderModel.h"
|
||||
#include "mod/ResourcePackFolderModel.h"
|
||||
#include "mod/TexturePackFolderModel.h"
|
||||
#include "WorldList.h"
|
||||
|
||||
#include "icons/IIconList.h"
|
||||
@@ -998,7 +1000,7 @@ std::shared_ptr<ModFolderModel> MinecraftInstance::resourcePackList() const
|
||||
{
|
||||
if (!m_resource_pack_list)
|
||||
{
|
||||
m_resource_pack_list.reset(new ModFolderModel(resourcePacksDir()));
|
||||
m_resource_pack_list.reset(new ResourcePackFolderModel(resourcePacksDir()));
|
||||
m_resource_pack_list->disableInteraction(isRunning());
|
||||
connect(this, &BaseInstance::runningStatusChanged, m_resource_pack_list.get(), &ModFolderModel::disableInteraction);
|
||||
}
|
||||
@@ -1009,7 +1011,7 @@ std::shared_ptr<ModFolderModel> MinecraftInstance::texturePackList() const
|
||||
{
|
||||
if (!m_texture_pack_list)
|
||||
{
|
||||
m_texture_pack_list.reset(new ModFolderModel(texturePacksDir()));
|
||||
m_texture_pack_list.reset(new TexturePackFolderModel(texturePacksDir()));
|
||||
m_texture_pack_list->disableInteraction(isRunning());
|
||||
connect(this, &BaseInstance::runningStatusChanged, m_texture_pack_list.get(), &ModFolderModel::disableInteraction);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ void CreateGameFolders::executeTask()
|
||||
if(!FS::ensureFolderPathExists(minecraftInstance->gameRoot()))
|
||||
{
|
||||
emit logLine("Couldn't create the main game folder", MessageLevel::Error);
|
||||
emitFailed("Couldn't create the main game folder");
|
||||
emitFailed(tr("Couldn't create the main game folder"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@ void DirectJavaLaunch::executeTask()
|
||||
auto realWrapperCommand = QStandardPaths::findExecutable(wrapperCommand);
|
||||
if (realWrapperCommand.isEmpty())
|
||||
{
|
||||
QString reason = tr("The wrapper command \"%1\" couldn't be found.").arg(wrapperCommand);
|
||||
emit logLine(reason, MessageLevel::Fatal);
|
||||
emitFailed(reason);
|
||||
const char *reason = QT_TR_NOOP("The wrapper command \"%1\" couldn't be found.");
|
||||
emit logLine(QString(reason).arg(wrapperCommand), MessageLevel::Fatal);
|
||||
emitFailed(tr(reason).arg(wrapperCommand));
|
||||
return;
|
||||
}
|
||||
emit logLine("Wrapper command is:\n" + wrapperCommandStr + "\n\n", MessageLevel::MultiMC);
|
||||
@@ -87,18 +87,17 @@ void DirectJavaLaunch::on_state(LoggedProcess::State state)
|
||||
{
|
||||
case LoggedProcess::FailedToStart:
|
||||
{
|
||||
//: Error message displayed if instace can't start
|
||||
QString reason = tr("Could not launch minecraft!");
|
||||
//: Error message displayed if instance can't start
|
||||
const char *reason = QT_TR_NOOP("Could not launch minecraft!");
|
||||
emit logLine(reason, MessageLevel::Fatal);
|
||||
emitFailed(reason);
|
||||
emitFailed(tr(reason));
|
||||
return;
|
||||
}
|
||||
case LoggedProcess::Aborted:
|
||||
case LoggedProcess::Crashed:
|
||||
|
||||
{
|
||||
m_parent->setPid(-1);
|
||||
emitFailed("Game crashed.");
|
||||
emitFailed(tr("Game crashed."));
|
||||
return;
|
||||
}
|
||||
case LoggedProcess::Finished:
|
||||
@@ -108,7 +107,7 @@ void DirectJavaLaunch::on_state(LoggedProcess::State state)
|
||||
auto exitCode = m_process.exitCode();
|
||||
if(exitCode != 0)
|
||||
{
|
||||
emitFailed("Game crashed.");
|
||||
emitFailed(tr("Game crashed."));
|
||||
return;
|
||||
}
|
||||
//FIXME: make this work again
|
||||
@@ -118,7 +117,7 @@ void DirectJavaLaunch::on_state(LoggedProcess::State state)
|
||||
break;
|
||||
}
|
||||
case LoggedProcess::Running:
|
||||
emit logLine(tr("Minecraft process ID: %1\n\n").arg(m_process.processId()), MessageLevel::MultiMC);
|
||||
emit logLine(QString("Minecraft process ID: %1\n\n").arg(m_process.processId()), MessageLevel::MultiMC);
|
||||
m_parent->setPid(m_process.processId());
|
||||
m_parent->instance()->setLastLaunch();
|
||||
break;
|
||||
|
||||
@@ -94,9 +94,9 @@ void ExtractNatives::executeTask()
|
||||
{
|
||||
if(!unzipNatives(source, outputPath, jniHackEnabled, nativeOpenAL, nativeGLFW))
|
||||
{
|
||||
auto reason = tr("Couldn't extract native jar '%1' to destination '%2'").arg(source, outputPath);
|
||||
emit logLine(reason, MessageLevel::Fatal);
|
||||
emitFailed(reason);
|
||||
const char *reason = QT_TR_NOOP("Couldn't extract native jar '%1' to destination '%2'");
|
||||
emit logLine(QString(reason).arg(source, outputPath), MessageLevel::Fatal);
|
||||
emitFailed(tr(reason).arg(source, outputPath));
|
||||
}
|
||||
}
|
||||
emitSucceeded();
|
||||
|
||||
@@ -118,9 +118,9 @@ void LauncherPartLaunch::executeTask()
|
||||
auto realWrapperCommand = QStandardPaths::findExecutable(wrapperCommand);
|
||||
if (realWrapperCommand.isEmpty())
|
||||
{
|
||||
QString reason = tr("The wrapper command \"%1\" couldn't be found.").arg(wrapperCommand);
|
||||
emit logLine(reason, MessageLevel::Fatal);
|
||||
emitFailed(reason);
|
||||
const char *reason = QT_TR_NOOP("The wrapper command \"%1\" couldn't be found.");
|
||||
emit logLine(QString(reason).arg(wrapperCommand), MessageLevel::Fatal);
|
||||
emitFailed(tr(reason).arg(wrapperCommand));
|
||||
return;
|
||||
}
|
||||
emit logLine("Wrapper command is:\n" + wrapperCommandStr + "\n\n", MessageLevel::MultiMC);
|
||||
@@ -140,17 +140,16 @@ void LauncherPartLaunch::on_state(LoggedProcess::State state)
|
||||
case LoggedProcess::FailedToStart:
|
||||
{
|
||||
//: Error message displayed if instace can't start
|
||||
QString reason = tr("Could not launch minecraft!");
|
||||
const char *reason = QT_TR_NOOP("Could not launch minecraft!");
|
||||
emit logLine(reason, MessageLevel::Fatal);
|
||||
emitFailed(reason);
|
||||
emitFailed(tr(reason));
|
||||
return;
|
||||
}
|
||||
case LoggedProcess::Aborted:
|
||||
case LoggedProcess::Crashed:
|
||||
|
||||
{
|
||||
m_parent->setPid(-1);
|
||||
emitFailed("Game crashed.");
|
||||
emitFailed(tr("Game crashed."));
|
||||
return;
|
||||
}
|
||||
case LoggedProcess::Finished:
|
||||
@@ -160,7 +159,7 @@ void LauncherPartLaunch::on_state(LoggedProcess::State state)
|
||||
auto exitCode = m_process.exitCode();
|
||||
if(exitCode != 0)
|
||||
{
|
||||
emitFailed("Game crashed.");
|
||||
emitFailed(tr("Game crashed."));
|
||||
return;
|
||||
}
|
||||
//FIXME: make this work again
|
||||
@@ -170,7 +169,7 @@ void LauncherPartLaunch::on_state(LoggedProcess::State state)
|
||||
break;
|
||||
}
|
||||
case LoggedProcess::Running:
|
||||
emit logLine(tr("Minecraft process ID: %1\n\n").arg(m_process.processId()), MessageLevel::MultiMC);
|
||||
emit logLine(QString("Minecraft process ID: %1\n\n").arg(m_process.processId()), MessageLevel::MultiMC);
|
||||
m_parent->setPid(m_process.processId());
|
||||
m_parent->instance()->setLastLaunch();
|
||||
// send the launch script to the launcher part
|
||||
|
||||
23
api/logic/minecraft/mod/ResourcePackFolderModel.cpp
Normal file
23
api/logic/minecraft/mod/ResourcePackFolderModel.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "ResourcePackFolderModel.h"
|
||||
|
||||
ResourcePackFolderModel::ResourcePackFolderModel(const QString &dir) : ModFolderModel(dir) {
|
||||
}
|
||||
|
||||
QVariant ResourcePackFolderModel::headerData(int section, Qt::Orientation orientation, int role) const {
|
||||
if (role == Qt::ToolTipRole) {
|
||||
switch (section) {
|
||||
case ActiveColumn:
|
||||
return tr("Is the resource pack enabled?");
|
||||
case NameColumn:
|
||||
return tr("The name of the resource pack.");
|
||||
case VersionColumn:
|
||||
return tr("The version of the resource pack.");
|
||||
case DateColumn:
|
||||
return tr("The date and time this resource pack was last changed (or added).");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
return ModFolderModel::headerData(section, orientation, role);
|
||||
}
|
||||
13
api/logic/minecraft/mod/ResourcePackFolderModel.h
Normal file
13
api/logic/minecraft/mod/ResourcePackFolderModel.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "ModFolderModel.h"
|
||||
|
||||
class MULTIMC_LOGIC_EXPORT ResourcePackFolderModel : public ModFolderModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ResourcePackFolderModel(const QString &dir);
|
||||
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
||||
};
|
||||
23
api/logic/minecraft/mod/TexturePackFolderModel.cpp
Normal file
23
api/logic/minecraft/mod/TexturePackFolderModel.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "TexturePackFolderModel.h"
|
||||
|
||||
TexturePackFolderModel::TexturePackFolderModel(const QString &dir) : ModFolderModel(dir) {
|
||||
}
|
||||
|
||||
QVariant TexturePackFolderModel::headerData(int section, Qt::Orientation orientation, int role) const {
|
||||
if (role == Qt::ToolTipRole) {
|
||||
switch (section) {
|
||||
case ActiveColumn:
|
||||
return tr("Is the texture pack enabled?");
|
||||
case NameColumn:
|
||||
return tr("The name of the texture pack.");
|
||||
case VersionColumn:
|
||||
return tr("The version of the texture pack.");
|
||||
case DateColumn:
|
||||
return tr("The date and time this texture pack was last changed (or added).");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
return ModFolderModel::headerData(section, orientation, role);
|
||||
}
|
||||
13
api/logic/minecraft/mod/TexturePackFolderModel.h
Normal file
13
api/logic/minecraft/mod/TexturePackFolderModel.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "ModFolderModel.h"
|
||||
|
||||
class MULTIMC_LOGIC_EXPORT TexturePackFolderModel : public ModFolderModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TexturePackFolderModel(const QString &dir);
|
||||
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
||||
};
|
||||
Reference in New Issue
Block a user