Save all tilesets
because the loader wants to have them all
This commit is contained in:
parent
1b62c15ba4
commit
af96054baf
3 changed files with 29 additions and 30 deletions
|
@ -7,22 +7,25 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>410</width>
|
||||
<height>515</height>
|
||||
<height>508</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>New Map Options</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QFrame" name="frame_NewMap_Options">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
|
@ -36,6 +39,13 @@
|
|||
<property name="verticalSpacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_newMap_Name">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_NewMap_Name">
|
||||
<property name="toolTip">
|
||||
|
@ -186,13 +196,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="checkBox_NewMap_Allow_Running">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_NewMap_Allow_Biking">
|
||||
<property name="text">
|
||||
|
@ -200,13 +203,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="checkBox_NewMap_Allow_Biking">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_NewMap_Allow_Escape_Rope">
|
||||
<property name="text">
|
||||
|
@ -214,17 +210,24 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QCheckBox" name="checkBox_NewMap_Allow_Escape_Rope">
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="checkBox_NewMap_Allow_Running">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_newMap_Name">
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="checkBox_NewMap_Allow_Biking">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QCheckBox" name="checkBox_NewMap_Allow_Escape_Rope">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -246,7 +249,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>410</width>
|
||||
<height>22</height>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
|
|
@ -111,8 +111,6 @@ bool Tileset::appendToHeaders(QString headerFile, QString friendlyName){
|
|||
}
|
||||
|
||||
bool Tileset::appendToGraphics(QString graphicsFile, QString friendlyName, bool primary) {
|
||||
int startPaletteId = primary ? 0 : Project::getNumPalettesPrimary();
|
||||
int endPaletteId = primary ? Project::getNumPalettesPrimary() : Project::getNumPalettesTotal();
|
||||
QString primaryString = primary ? "primary" : "secondary";
|
||||
QFile file(graphicsFile);
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Append)) {
|
||||
|
@ -121,7 +119,7 @@ bool Tileset::appendToGraphics(QString graphicsFile, QString friendlyName, bool
|
|||
}
|
||||
QString dataString = "\r\n\t.align 2\r\n";
|
||||
dataString.append(QString("gTilesetPalettes_%1::\r\n").arg(friendlyName));
|
||||
for(int i = startPaletteId; i < endPaletteId; ++i) {
|
||||
for(int i = 0; i < Project::getNumPalettesTotal(); ++i) {
|
||||
QString paletteString;
|
||||
paletteString.sprintf("%02d.gbapal", i);
|
||||
dataString.append(QString("\t.incbin \"data/tilesets/%1/%2/palettes/%3\"\r\n").arg(primaryString, friendlyName.toLower(), paletteString));
|
||||
|
|
|
@ -721,9 +721,7 @@ void Project::saveTilesetTilesImage(Tileset *tileset) {
|
|||
}
|
||||
|
||||
void Project::saveTilesetPalettes(Tileset *tileset, bool primary) {
|
||||
int startPaletteId = primary ? 0 : Project::getNumPalettesPrimary();
|
||||
int endPaletteId = primary ? Project::getNumPalettesPrimary() : Project::getNumPalettesTotal();
|
||||
for (int i = startPaletteId; i < endPaletteId; i++) {
|
||||
for (int i = 0; i < Project::getNumPalettesTotal(); i++) {
|
||||
QString filepath = tileset->palettePaths.at(i);
|
||||
QString content = "JASC-PAL\r\n";
|
||||
content += "0100\r\n";
|
||||
|
|
Loading…
Reference in a new issue