2013-11-04 07:23:05 +05:30
|
|
|
/* Copyright 2013 MultiMC Contributors
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
#pragma once
|
2014-01-24 02:01:41 +05:30
|
|
|
|
2014-04-23 05:57:40 +05:30
|
|
|
#include "logic/BaseInstaller.h"
|
2014-01-24 02:01:41 +05:30
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
#include <QString>
|
2013-10-06 04:43:40 +05:30
|
|
|
#include <memory>
|
2013-09-22 07:51:36 +05:30
|
|
|
|
2014-05-19 05:52:09 +05:30
|
|
|
class InstanceVersion;
|
2014-04-23 05:57:40 +05:30
|
|
|
class ForgeInstallTask;
|
|
|
|
class ForgeVersion;
|
2013-09-22 07:51:36 +05:30
|
|
|
|
2014-01-24 02:01:41 +05:30
|
|
|
class ForgeInstaller : public BaseInstaller
|
2013-09-22 07:51:36 +05:30
|
|
|
{
|
2014-04-23 05:57:40 +05:30
|
|
|
friend class ForgeInstallTask;
|
2013-09-22 07:51:36 +05:30
|
|
|
public:
|
2014-03-15 01:18:57 +05:30
|
|
|
ForgeInstaller();
|
2014-04-23 05:57:40 +05:30
|
|
|
virtual ~ForgeInstaller(){};
|
|
|
|
virtual ProgressProvider *createInstallTask(OneSixInstance *instance, BaseVersionPtr version, QObject *parent) override;
|
2013-09-22 07:51:36 +05:30
|
|
|
|
2014-04-23 05:57:40 +05:30
|
|
|
protected:
|
|
|
|
virtual QString id() const override { return "net.minecraftforge"; }
|
2014-03-15 01:18:57 +05:30
|
|
|
void prepare(const QString &filename, const QString &universalUrl);
|
2014-01-24 22:42:02 +05:30
|
|
|
bool add(OneSixInstance *to) override;
|
2014-04-23 05:57:40 +05:30
|
|
|
bool addLegacy(OneSixInstance *to);
|
2014-03-15 01:18:57 +05:30
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
private:
|
2014-04-23 05:57:40 +05:30
|
|
|
// the parsed version json, read from the installer
|
2014-05-19 05:52:09 +05:30
|
|
|
std::shared_ptr<InstanceVersion> m_forge_json;
|
2014-04-23 05:57:40 +05:30
|
|
|
// the actual forge version
|
|
|
|
std::shared_ptr<ForgeVersion> m_forge_version;
|
2013-09-22 07:51:36 +05:30
|
|
|
QString internalPath;
|
|
|
|
QString finalPath;
|
|
|
|
QString realVersionId;
|
2014-02-01 19:22:21 +05:30
|
|
|
QString m_forgeVersionString;
|
2013-09-22 07:51:36 +05:30
|
|
|
QString m_universal_url;
|
|
|
|
};
|