mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-24 17:46:19 -05:00
Don't crash on startup if recent map can't be loaded. Write logs to porymap.log file
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#include <QString>
|
||||
#include <QPixmap>
|
||||
#include <QMap>
|
||||
#include <QDebug>
|
||||
|
||||
class EventType
|
||||
{
|
||||
|
||||
@@ -13,7 +13,6 @@ public:
|
||||
friend QDebug operator<<(QDebug debug, const HealLocation &hl);
|
||||
|
||||
public:
|
||||
//QString group;
|
||||
QString name;
|
||||
int index;
|
||||
uint16_t x;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include <QPixmap>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QGraphicsPixmapItem>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define MAPCONNECTION_H
|
||||
|
||||
#include <QString>
|
||||
#include <QDebug>
|
||||
|
||||
class MapConnection {
|
||||
public:
|
||||
|
||||
@@ -39,7 +39,8 @@ public:
|
||||
void save();
|
||||
void undo();
|
||||
void redo();
|
||||
void setMap(QString map_name);
|
||||
void closeProject();
|
||||
bool setMap(QString map_name);
|
||||
void displayMap();
|
||||
void displayMetatileSelector();
|
||||
void displayMapMetatiles();
|
||||
|
||||
22
include/log.h
Normal file
22
include/log.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef LOG_H
|
||||
#define LOG_H
|
||||
|
||||
#include <QApplication>
|
||||
#include <QtDebug>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QString>
|
||||
#include <QDebug>
|
||||
|
||||
enum LogType {
|
||||
LOG_ERROR,
|
||||
LOG_WARN,
|
||||
LOG_INFO,
|
||||
};
|
||||
|
||||
void logInfo(QString message);
|
||||
void logWarn(QString message);
|
||||
void logError(QString message);
|
||||
void log(QString message, LogType type);
|
||||
|
||||
#endif // LOG_H
|
||||
@@ -150,13 +150,13 @@ private:
|
||||
Layout = 2,
|
||||
} mapSortOrder;
|
||||
|
||||
void setMap(QString, bool scrollTreeView = false);
|
||||
bool setMap(QString, bool scrollTreeView = false);
|
||||
void redrawMapScene();
|
||||
void loadDataStructures();
|
||||
void populateMapList();
|
||||
void sortMapList();
|
||||
QString getExistingDirectory(QString);
|
||||
void openProject(QString dir);
|
||||
bool openProject(QString dir);
|
||||
QString getDefaultMap();
|
||||
void setRecentMap(QString map_name);
|
||||
QStandardItem* createMapItem(QString mapName, int groupNum, int inGroupNum);
|
||||
@@ -168,6 +168,7 @@ private:
|
||||
void displayMapProperties();
|
||||
void checkToolButtons();
|
||||
|
||||
void initWindow();
|
||||
void initCustomUI();
|
||||
void initExtraShortcuts();
|
||||
void initExtraSignals();
|
||||
@@ -175,7 +176,7 @@ private:
|
||||
void initMiscHeapObjects();
|
||||
void initMapSortOrder();
|
||||
void loadUserSettings();
|
||||
void openRecentProject();
|
||||
bool openRecentProject();
|
||||
void updateTilesetEditor();
|
||||
|
||||
bool isProjectOpen();
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
QList<QStringList>* getLabelMacros(QList<QStringList>*, QString);
|
||||
QStringList* getLabelValues(QList<QStringList>*, QString);
|
||||
void readMapHeader(Map*);
|
||||
bool readMapHeader(Map*);
|
||||
void readMapLayoutsTable();
|
||||
void readAllMapLayouts();
|
||||
QStringList* readLayoutValues(QString layoutName);
|
||||
|
||||
Reference in New Issue
Block a user