-
Notifications
You must be signed in to change notification settings - Fork 9
/
launcherprofileloader.h
76 lines (64 loc) · 1.63 KB
/
launcherprofileloader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef LAUNCHERPROFILELOADER_H
#define LAUNCHERPROFILELOADER_H
#include <QString>
#include <string>
#include <vector>
#include <json/reader.h>
#include <json/writer.h>
#include <json/value.h>
#include "settingsmanager.h"
#include "FileUtilities.h"
using namespace Json;
using namespace std;
extern QString playerName, minecraftPath, javaPath, launchMode, last;
extern int maxMemory;
extern bool loaded, debug;
class LauncherProfileLoader;
extern bool lpLoaded;
extern LauncherProfileLoader *loader;
class Authentication
{
public:
QString username, accessToken, uuid, displayName;
};
class Resolution
{
public:
int height, width;
Resolution(){}
Resolution(int w, int h):height(h), width(w){}
};
class Profile
{
public:
QString name, gameDir, javaDir, javaArgs, lastVersionId,playerUUID;
bool hasGameDir, hasJavaDir, hasJavaArgs;
bool hasResolution, hasAllowedReleaseTypes;
bool hasLastVersionId, hasPlayerUUID, hasFullScreen;
bool fullscreen;
Resolution r;
Profile(){}
Profile(QString n):name(n){
hasAllowedReleaseTypes = hasGameDir = hasJavaArgs =
hasJavaDir = hasLastVersionId = hasPlayerUUID =
hasResolution = hasFullScreen = false;
}
};
class LauncherProfileLoader
{
public:
QString selectedProfile, clientToken;
vector<Profile> profiles;
vector<Authentication> authenticationDatabase;
LauncherProfileLoader(QString lp);
QString generateString();
};
class ProfilesManager
{
public:
static void load();
static void save();
static void add(Profile p);
static Profile *find(QString name);
};
#endif // LAUNCHERPROFILELOADER_H