Add porymap config file

This commit is contained in:
Marcus Huderle
2018-12-21 09:25:28 -06:00
parent dcf6b5af6b
commit 99a21ccf29
5 changed files with 200 additions and 63 deletions

33
include/config.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef CONFIG_H
#define CONFIG_H
#include <QString>
enum MapSortOrder {
Group = 0,
Area = 1,
Layout = 2,
};
class Config
{
public:
static void save();
static void load();
static void setRecentProject(QString project);
static void setRecentMap(QString map);
static void setMapSortOrder(MapSortOrder order);
static void setPrettyCursors(bool enabled);
static QString getRecentProject();
static QString getRecentMap();
static MapSortOrder getMapSortOrder();
static bool getPrettyCursors();
private:
static void parseConfigKeyValue(QString key, QString value);
static QString recentProject;
static QString recentMap;
static MapSortOrder mapSortOrder;
static bool prettyCursors;
};
#endif // CONFIG_H

View File

@@ -10,6 +10,7 @@
#include <QGraphicsSceneMouseEvent>
#include <QAbstractItemModel>
#include "project.h"
#include "config.h"
#include "map.h"
#include "editor.h"
#include "tileseteditor.h"
@@ -164,11 +165,7 @@ private:
bool isProgrammaticEventTabChange;
enum MapSortOrder {
Group = 0,
Name = 1,
Layout = 2,
} mapSortOrder;
MapSortOrder mapSortOrder;
bool setMap(QString, bool scrollTreeView = false);
void redrawMapScene();