2015-02-02 22:25:30 +00:00
|
|
|
/* Copyright 2013-2015 MultiMC Contributors
|
2013-11-04 01:53:05 +00:00
|
|
|
*
|
|
|
|
* 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 03:21:36 +01:00
|
|
|
#pragma once
|
2014-01-23 20:31:41 +00:00
|
|
|
|
2015-02-09 00:51:14 +00:00
|
|
|
#include "BaseInstaller.h"
|
2014-01-23 20:31:41 +00:00
|
|
|
|
2013-09-22 03:21:36 +01:00
|
|
|
#include <QString>
|
2013-10-06 00:13:40 +01:00
|
|
|
#include <memory>
|
2013-09-22 03:21:36 +01:00
|
|
|
|
2015-01-27 21:31:07 +00:00
|
|
|
class MinecraftProfile;
|
2014-04-23 01:27:40 +01:00
|
|
|
class ForgeInstallTask;
|
2014-07-01 00:23:49 +01:00
|
|
|
struct ForgeVersion;
|
2013-09-22 03:21:36 +01:00
|
|
|
|
2014-01-23 20:31:41 +00:00
|
|
|
class ForgeInstaller : public BaseInstaller
|
2013-09-22 03:21:36 +01:00
|
|
|
{
|
2014-04-23 01:27:40 +01:00
|
|
|
friend class ForgeInstallTask;
|
2013-09-22 03:21:36 +01:00
|
|
|
public:
|
2014-03-14 19:48:57 +00:00
|
|
|
ForgeInstaller();
|
2014-09-06 17:16:56 +01:00
|
|
|
virtual ~ForgeInstaller(){}
|
2014-04-23 01:27:40 +01:00
|
|
|
virtual ProgressProvider *createInstallTask(OneSixInstance *instance, BaseVersionPtr version, QObject *parent) override;
|
2014-09-06 17:16:56 +01:00
|
|
|
virtual QString id() const override { return "net.minecraftforge"; }
|
2013-09-22 03:21:36 +01:00
|
|
|
|
2014-04-23 01:27:40 +01:00
|
|
|
protected:
|
2014-03-14 19:48:57 +00:00
|
|
|
void prepare(const QString &filename, const QString &universalUrl);
|
2014-01-24 17:12:02 +00:00
|
|
|
bool add(OneSixInstance *to) override;
|
2014-04-23 01:27:40 +01:00
|
|
|
bool addLegacy(OneSixInstance *to);
|
2014-03-14 19:48:57 +00:00
|
|
|
|
2013-09-22 03:21:36 +01:00
|
|
|
private:
|
2014-04-23 01:27:40 +01:00
|
|
|
// the parsed version json, read from the installer
|
2015-01-27 21:31:07 +00:00
|
|
|
std::shared_ptr<MinecraftProfile> m_forge_json;
|
2014-04-23 01:27:40 +01:00
|
|
|
// the actual forge version
|
|
|
|
std::shared_ptr<ForgeVersion> m_forge_version;
|
2013-09-22 03:21:36 +01:00
|
|
|
QString internalPath;
|
|
|
|
QString finalPath;
|
2014-02-01 13:52:21 +00:00
|
|
|
QString m_forgeVersionString;
|
2013-09-22 03:21:36 +01:00
|
|
|
QString m_universal_url;
|
|
|
|
};
|