mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 09:59:59 +03:00
Added properties to Instance class
This commit is contained in:
parent
2d6e785e4e
commit
f0cb300d04
2 changed files with 129 additions and 139 deletions
|
|
@ -27,7 +27,7 @@ Instance::Instance(const QString &rootDir, QObject *parent) :
|
|||
QObject(parent)
|
||||
{
|
||||
m_rootDir = rootDir;
|
||||
m_settings = new INISettingsObject(PathCombine(rootDir, "instance.cfg"), this);
|
||||
m_settings = new INISettingsObject(configFile(), this);
|
||||
|
||||
settings().registerSetting(new Setting("name", "Unnamed Instance"));
|
||||
settings().registerSetting(new Setting("iconKey", "default"));
|
||||
|
|
@ -82,7 +82,12 @@ QString Instance::minecraftDir() const
|
|||
if (dotMCDir.exists() && !mcDir.exists())
|
||||
return dotMCDir.filePath();
|
||||
else
|
||||
return mcDir.filePath();
|
||||
return mcDir.filePath();
|
||||
}
|
||||
|
||||
QString Instance::instModsDir() const
|
||||
{
|
||||
return PathCombine(rootDir(), "instMods");
|
||||
}
|
||||
|
||||
QString Instance::binDir() const
|
||||
|
|
@ -125,6 +130,21 @@ QString Instance::mcJar() const
|
|||
return PathCombine(binDir(), "minecraft.jar");
|
||||
}
|
||||
|
||||
QString Instance::mcBackup() const
|
||||
{
|
||||
return PathCombine(binDir(), "mcbackup.jar");
|
||||
}
|
||||
|
||||
QString Instance::configFile() const
|
||||
{
|
||||
return PathCombine(rootDir(), "instance.cfg");
|
||||
}
|
||||
|
||||
QString Instance::modListFile() const
|
||||
{
|
||||
return PathCombine(rootDir(), "modlist");
|
||||
}
|
||||
|
||||
SettingsObject &Instance::settings() const
|
||||
{
|
||||
return *m_settings;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue