Skip to content

Commit fd84834

Browse files
committed
checkpoint
1 parent d751786 commit fd84834

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2695
-1374
lines changed

src/data/animz.obl

985 Bytes
Binary file not shown.

src/data/annie.obl

218 Bytes
Binary file not shown.

src/data/bosses.obl

-22.4 KB
Binary file not shown.

src/data/sheet0.obl

33.9 KB
Binary file not shown.

src/data/sheet1.obl

53.5 KB
Binary file not shown.

src/data/tiles.obl

2.24 KB
Binary file not shown.

src/dlgstat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ CDlgStat::CDlgStat(const uint8_t tileID, const uint8_t attr, QWidget *parent)
6868
QString CDlgStat::attr2text(const uint8_t attr) {
6969
if (RANGE(attr, ATTR_MSG_MIN, ATTR_MSG_MAX)) {
7070
return "Message";
71-
} else if (RANGE(attr, ATTR_WAIT_MIN, ATTR_WAIT_MAX)) {
71+
} else if (RANGE(attr, ATTR_IDLE_MIN, ATTR_IDLE_MAX)) {
7272
return tr("Wait");
7373
} else if (attr == ATTR_FREEZE_TRAP) {
7474
return tr("Freeze Trap");

src/dlgtest.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ void CDlgTest::setZoom(bool zoom)
8484
{
8585
CGameMixin::setZoom(zoom);
8686
int factor = m_zoom ? 2 : 1;
87-
this->setMaximumSize(QSize(WIDTH * factor, HEIGHT * factor));
88-
this->setMinimumSize(QSize(WIDTH * factor, HEIGHT * factor));
89-
this->resize(QSize(WIDTH * factor, HEIGHT * factor));
87+
this->setMaximumSize(QSize(getWidth() * factor, getHeight() * factor));
88+
this->setMinimumSize(QSize(getWidth() * factor, getHeight() * factor));
89+
this->resize(QSize(getWidth() * factor, getHeight() * factor));
9090
}
9191

9292
void CDlgTest::paintEvent(QPaintEvent *)
9393
{
94-
CFrame bitmap(WIDTH, HEIGHT);
94+
CFrame bitmap(getWidth(), getHeight());
9595
switch (m_game->mode())
9696
{
9797
case CGame::MODE_CHUTE:
@@ -114,12 +114,13 @@ void CDlgTest::paintEvent(QPaintEvent *)
114114
case CGame::MODE_LEVEL_SUMMARY:
115115
case CGame::MODE_SKLLSELECT:
116116
case CGame::MODE_NEW_INPUTNAME:
117+
case CGame::MODE_TEST:
117118
break;
118119
}
119120

120121
// show the screen
121122
const QImage & img = QImage(reinterpret_cast<uint8_t*>(bitmap.getRGB().data()), bitmap.width(), bitmap.height(), QImage::Format_RGBX8888);
122-
const QPixmap & pixmap = QPixmap::fromImage(m_zoom ? img.scaled(QSize(WIDTH * 2, HEIGHT * 2)): img);
123+
const QPixmap & pixmap = QPixmap::fromImage(m_zoom ? img.scaled(QSize(getWidth() * 2, getHeight() * 2)): img);
123124
QPainter p(this);
124125
p.drawPixmap(0, 0, pixmap);
125126
p.end();
@@ -177,7 +178,8 @@ void CDlgTest::preloadAssets()
177178
{":/data/tiles.obl", &m_tiles},
178179
{":/data/animz.obl", &m_animz},
179180
{":/data/annie.obl", &m_users},
180-
{":/data/bosses.obl", &m_bosses},
181+
{":/data/sheet0.obl", &m_sheet0},
182+
{":/data/sheet1.obl", &m_sheet1},
181183
{":/data/uisheet.png", &m_uisheet}
182184
};
183185

src/mainwindow.cpp

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "report.h"
2525
#include "keyvaluedialog.h"
2626
#include "runtime/statedata.h"
27-
#include "dlgmsgs.h"
27+
//#include "dlgmsgs.h"
2828
#include "mapprops.h"
2929

3030
MainWindow::MainWindow(QWidget *parent)
@@ -678,7 +678,16 @@ void MainWindow::on_actionEdit_Next_Map_triggered()
678678

679679
void MainWindow::on_actionEdit_Add_Map_triggered()
680680
{
681+
bool ok;
682+
QString text = QInputDialog::getText(this, tr("Add New Map"),
683+
tr("Name:"), QLineEdit::Normal,
684+
m_doc.map()->title(), &ok);
685+
if (!ok)
686+
return;
687+
text = text.trimmed().mid(0, 254);
688+
681689
std::unique_ptr<CMap> map = std::make_unique<CMap>(64,64);
690+
map->setTitle(text.toLatin1());
682691
m_doc.add(std::move(map));
683692
m_doc.setCurrentIndex(m_doc.size() - 1);
684693
m_doc.setDirty(true);
@@ -706,8 +715,17 @@ void MainWindow::on_actionEdit_Delete_Map_triggered()
706715

707716
void MainWindow::on_actionEdit_Insert_Map_triggered()
708717
{
718+
bool ok;
719+
QString text = QInputDialog::getText(this, tr("Insert New Map"),
720+
tr("Name:"), QLineEdit::Normal,
721+
m_doc.map()->title(), &ok);
722+
if (!ok)
723+
return;
724+
text = text.trimmed().mid(0, 254);
725+
709726
int index = m_doc.currentIndex();
710727
std::unique_ptr<CMap> map = std::make_unique<CMap>(64, 64);
728+
map->setTitle(text.toLatin1());
711729
m_doc.insertAt(index, std::move(map)); // Only ONE move operation
712730
m_doc.setDirty(true);
713731
emit mapChanged(m_doc.map());
@@ -984,12 +1002,10 @@ void MainWindow::on_actionExport_Screenshots_triggered()
9841002

9851003
void MainWindow::on_actionEdit_Edit_Messages_triggered()
9861004
{
987-
CDlgMsgs dialog(this);
988-
dialog.setWindowTitle(tr("Edit Messages"));
989-
dialog.populateData(*m_doc.map());
1005+
MapPropertiesDialog dialog(m_doc.map(), this, MapPropertiesDialog::TAB_MESSAGES);
9901006
if (dialog.exec() == QDialog::Accepted) {
1007+
// Changes have been saved to the states object
9911008
m_doc.setDirty(true);
992-
dialog.saveData(*m_doc.map());
9931009
}
9941010
}
9951011

@@ -1001,4 +1017,3 @@ void MainWindow::on_actionEdit_Map_Properties_triggered()
10011017
m_doc.setDirty(true);
10021018
}
10031019
}
1004-

src/mapedit.pro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs depr
1111
INCLUDEPATH += runtime/shared/
1212
DEFINES += USE_QFILE=1
1313
#DEFINES += USE_SDL_MIXER=1
14-
#DEFINES += USE_HUNSPELL=1
14+
DEFINES += USE_HUNSPELL=1
1515

1616
SOURCES += \
1717
runtime/ai_path.cpp \
@@ -46,7 +46,7 @@ SOURCES += \
4646
runtime/strhelper.cpp \
4747
runtime/boss.cpp \
4848
dlgattr.cpp \
49-
dlgmsgs.cpp \
49+
#dlgmsgs.cpp \
5050
dlgresize.cpp \
5151
dlgabout.cpp \
5252
dlgselect.cpp \
@@ -112,7 +112,7 @@ HEADERS += \
112112
runtime/joyaim.h \
113113
app_version.h \
114114
dlgattr.h \
115-
dlgmsgs.h \
115+
#dlgmsgs.h \
116116
dlgresize.h \
117117
dlgabout.h \
118118
dlgselect.h \
@@ -129,7 +129,7 @@ HEADERS += \
129129

130130
FORMS += \
131131
dlgattr.ui \
132-
dlgmsgs.ui \
132+
# dlgmsgs.ui \
133133
dlgresize.ui \
134134
dlgabout.ui \
135135
dlgselect.ui \

0 commit comments

Comments
 (0)