mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-12 10:55:38 -05:00
Merge branch 'master' of https://github.com/huderlem/porymap into new-map-dialog
This commit is contained in:
@@ -9,11 +9,14 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- Redesigned the Connections tab, adding a number of new features including the option to open or display diving maps and a list UI for easier edit access.
|
||||
- Add the ability to edit layouts with no corresponding map.
|
||||
- Add a `Close Project` option
|
||||
- Add charts to the `Wild Pokémon` tab that show species and level distributions.
|
||||
- Add options for customizing the map grid under `View -> Grid Settings`.
|
||||
- An alert will be displayed when attempting to open a seemingly invalid project.
|
||||
- Add support for defining project values with `enum` where `#define` was expected.
|
||||
- Add button to enable editing map groups including renaming groups and rearranging the maps within them.
|
||||
- Add buttons to hide and show empty folders in each map tree view.
|
||||
|
||||
### Changed
|
||||
- Edits to map connections now have Undo/Redo and can be viewed in exported timelapses.
|
||||
@@ -24,6 +27,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
|
||||
- It's now possible to cancel quitting if there are unsaved changes in sub-windows.
|
||||
- The triple-layer metatiles setting can now be set automatically using a project constant.
|
||||
- `Export Map Stitch Image` now shows a preview of the full image, not just the current map.
|
||||
- Maps and layouts were internally separated.
|
||||
|
||||
### Fixed
|
||||
- Fix `Add Region Map...` not updating the region map settings file.
|
||||
@@ -52,6 +56,10 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
|
||||
- Stop sliders in the Palette Editor from creating a bunch of edit history when used.
|
||||
- Fix scrolling on some containers locking up when the mouse stops over a spin box or combo box.
|
||||
- Fix some file dialogs returning to an incorrect window when closed.
|
||||
- Fix bug where reloading a layout would overwrite all unsaved changes.
|
||||
- Fix bug where layout json and blockdata could be saved separately leading to inconsistent data.
|
||||
- Fix crash when saving tilesets with fewer palettes than the maximum.
|
||||
- Fix projects not opening on Windows if the project filepath contains certain characters.
|
||||
|
||||
## [5.4.1] - 2024-03-21
|
||||
### Fixed
|
||||
|
||||
@@ -2832,6 +2832,10 @@
|
||||
<property name="text">
|
||||
<string>Summary Chart...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<normaloff>:/icons/chart_bar.ico</normaloff>:/icons/chart_bar.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <QString>
|
||||
|
||||
namespace fex
|
||||
{
|
||||
@@ -89,9 +90,7 @@ namespace fex
|
||||
Lexer() = default;
|
||||
~Lexer() = default;
|
||||
|
||||
std::vector<Token> LexFile(const std::string &path);
|
||||
std::vector<Token> LexString(const std::string &data);
|
||||
void LexFileDumpTokens(const std::string &path, const std::string &out);
|
||||
std::vector<Token> LexFile(const QString &path);
|
||||
|
||||
private:
|
||||
std::vector<Token> Lex();
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace fex
|
||||
std::vector<Array> ParseTopLevelArrays(std::vector<Token> tokens);
|
||||
tsl::ordered_map<std::string, ArrayValue> ParseTopLevelObjects(std::vector<Token> tokens);
|
||||
|
||||
tsl::ordered_map<std::string, int> ReadDefines(const std::string &filename, std::vector<std::string> matching);
|
||||
tsl::ordered_map<std::string, int> ReadDefines(const QString &filename, std::vector<std::string> matching);
|
||||
|
||||
private:
|
||||
int EvaluateExpression(std::vector<Token> tokens);
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef PARSER_UTIL_H
|
||||
#define PARSER_UTIL_H
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
class ParserUtil
|
||||
{
|
||||
public:
|
||||
ParserUtil(QString root);
|
||||
QStringList ReadDefines(QString filename, QString prefix);
|
||||
QStringList ReadDefinesValueSort(QString filename, QString prefix);
|
||||
|
||||
private:
|
||||
QString root_;
|
||||
};
|
||||
|
||||
|
||||
#endif // PARSER_UTIL_H
|
||||
@@ -45,7 +45,6 @@ SOURCES += src/core/advancemapparser.cpp \
|
||||
src/core/editcommands.cpp \
|
||||
src/lib/fex/lexer.cpp \
|
||||
src/lib/fex/parser.cpp \
|
||||
src/lib/fex/parser_util.cpp \
|
||||
src/lib/collapsiblesection.cpp \
|
||||
src/lib/orderedjson.cpp \
|
||||
src/core/regionmapeditcommands.cpp \
|
||||
@@ -157,7 +156,6 @@ HEADERS += include/core/advancemapparser.h \
|
||||
include/lib/fex/define_statement.h \
|
||||
include/lib/fex/lexer.h \
|
||||
include/lib/fex/parser.h \
|
||||
include/lib/fex/parser_util.h \
|
||||
include/lib/collapsiblesection.h \
|
||||
include/lib/orderedmap.h \
|
||||
include/lib/orderedjson.h \
|
||||
|
||||
BIN
resources/icons/chart_bar.ico
Executable file
BIN
resources/icons/chart_bar.ico
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
@@ -1,6 +1,7 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>icons/add.ico</file>
|
||||
<file>icons/chart_bar.ico</file>
|
||||
<file>icons/collapse_all.ico</file>
|
||||
<file>icons/cursor.ico</file>
|
||||
<file>icons/delete.ico</file>
|
||||
|
||||
@@ -596,7 +596,7 @@ bool ParseUtil::gameStringToBool(QString gameString, bool * ok) {
|
||||
tsl::ordered_map<QString, QHash<QString, QString>> ParseUtil::readCStructs(const QString &filename, const QString &label, const QHash<int, QString> &memberMap) {
|
||||
QString filePath = this->root + "/" + filename;
|
||||
auto cParser = fex::Parser();
|
||||
auto tokens = fex::Lexer().LexFile(filePath.toStdString());
|
||||
auto tokens = fex::Lexer().LexFile(filePath);
|
||||
auto topLevelObjects = cParser.ParseTopLevelObjects(tokens);
|
||||
tsl::ordered_map<QString, QHash<QString, QString>> structs;
|
||||
for (auto it = topLevelObjects.begin(); it != topLevelObjects.end(); it++) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <QFile>
|
||||
|
||||
namespace fex
|
||||
{
|
||||
@@ -155,48 +156,26 @@ namespace fex
|
||||
return Token(Token::Type::kDefine, filename_, line_number_);
|
||||
}
|
||||
|
||||
std::vector<Token> Lexer::LexString(const std::string &data)
|
||||
std::vector<Token> Lexer::LexFile(const QString &path)
|
||||
{
|
||||
filename_ = "string literal";
|
||||
line_number_ = 1;
|
||||
index_ = 0;
|
||||
data_ = data;
|
||||
|
||||
return Lex();
|
||||
}
|
||||
|
||||
std::vector<Token> Lexer::LexFile(const std::string &path)
|
||||
{
|
||||
filename_ = path;
|
||||
filename_ = path.toStdString();
|
||||
line_number_ = 1;
|
||||
|
||||
std::ifstream file;
|
||||
file.open(path);
|
||||
// Note: Using QFile instead of ifstream to handle encoding differences between platforms
|
||||
// (specifically to handle accented characters on Windows)
|
||||
QFile file(path);
|
||||
file.open(QIODevice::ReadOnly);
|
||||
|
||||
std::stringstream stream;
|
||||
stream << file.rdbuf();
|
||||
const QByteArray data = file.readAll();
|
||||
|
||||
index_ = 0;
|
||||
data_ = stream.str();
|
||||
data_ = data.toStdString();
|
||||
|
||||
file.close();
|
||||
|
||||
return Lex();
|
||||
}
|
||||
|
||||
void Lexer::LexFileDumpTokens(const std::string &path, const std::string &out)
|
||||
{
|
||||
std::ofstream file;
|
||||
file.open(out);
|
||||
|
||||
for (Token token : LexFile(path))
|
||||
{
|
||||
file << token.ToString() << std::endl;
|
||||
}
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
std::vector<Token> Lexer::Lex()
|
||||
{
|
||||
std::vector<Token> tokens;
|
||||
|
||||
@@ -337,7 +337,7 @@ namespace fex
|
||||
return DefineStatement(identifer, value);
|
||||
}
|
||||
|
||||
tsl::ordered_map<std::string, int> Parser::ReadDefines(const std::string &filename, std::vector<std::string> matching)
|
||||
tsl::ordered_map<std::string, int> Parser::ReadDefines(const QString &filename, std::vector<std::string> matching)
|
||||
{
|
||||
tsl::ordered_map<std::string, int> out;
|
||||
|
||||
|
||||
@@ -46,9 +46,9 @@ void MapView::drawForeground(QPainter *painter, const QRectF&) {
|
||||
// Draw map grid
|
||||
if (editor->mapGrid && editor->mapGrid->isVisible()) {
|
||||
painter->save();
|
||||
if (editor->map) {
|
||||
if (editor->layout) {
|
||||
// We're clipping here to hide parts of the grid that are outside the map.
|
||||
const QRectF mapRect(-0.5, -0.5, editor->map->getWidth() * 16 + 1.5, editor->map->getHeight() * 16 + 1.5);
|
||||
const QRectF mapRect(-0.5, -0.5, editor->layout->getWidth() * 16 + 1.5, editor->layout->getHeight() * 16 + 1.5);
|
||||
painter->setClipping(true);
|
||||
painter->setClipRect(mapRect);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "uintspinbox.h"
|
||||
#include <QWheelEvent>
|
||||
|
||||
UIntSpinBox::UIntSpinBox(QWidget *parent)
|
||||
: QAbstractSpinBox(parent)
|
||||
@@ -178,8 +179,11 @@ QAbstractSpinBox::StepEnabled UIntSpinBox::stepEnabled() const {
|
||||
|
||||
void UIntSpinBox::wheelEvent(QWheelEvent *event) {
|
||||
// Only allow scrolling to modify contents when it explicitly has focus.
|
||||
if (hasFocus())
|
||||
if (hasFocus()) {
|
||||
QAbstractSpinBox::wheelEvent(event);
|
||||
} else {
|
||||
event->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
void UIntSpinBox::focusOutEvent(QFocusEvent *event) {
|
||||
|
||||
Reference in New Issue
Block a user