Skip to content

Commit 808afc5

Browse files
committedMar 1, 2025·
Remember which chunks are selected (#203)
1 parent 82a4792 commit 808afc5

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed
 

‎src/widgets/ExportChunksDialog.cpp

+20-9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
** along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
****************************************************************************/
1818
#include "ExportChunksDialog.h"
19+
#include "core/Config.h"
1920

2021
ExportChunksDialog::ExportChunksDialog(QWidget *parent) :
2122
QDialog(parent, Qt::Dialog | Qt::WindowCloseButtonHint)
@@ -33,15 +34,15 @@ ExportChunksDialog::ExportChunksDialog(QWidget *parent) :
3334
mim = new QCheckBox(tr("Chunk 9: Background (PC only)"));
3435
palette = new QCheckBox(tr("Chunk 4: Palette (PC only)"));
3536

36-
scripts->setChecked(scripts->isEnabled());
37-
ca->setChecked(ca->isEnabled());
38-
id->setChecked(id->isEnabled());
39-
tiles->setChecked(tiles->isEnabled());
40-
encounter->setChecked(encounter->isEnabled());
41-
inf->setChecked(inf->isEnabled());
42-
model->setChecked(model->isEnabled());
43-
mim->setChecked(mim->isEnabled());
44-
palette->setChecked(palette->isEnabled());
37+
scripts->setChecked(Config::value("exportChunksCheckedScripts", true).toBool());
38+
ca->setChecked(Config::value("exportChunksCheckedCa", true).toBool());
39+
id->setChecked(Config::value("exportChunksCheckedId", true).toBool());
40+
tiles->setChecked(Config::value("exportChunksCheckedTiles", true).toBool());
41+
encounter->setChecked(Config::value("exportChunksCheckedEncounter", true).toBool());
42+
inf->setChecked(Config::value("exportChunksCheckedInf", true).toBool());
43+
model->setChecked(Config::value("exportChunksCheckedModel", true).toBool());
44+
mim->setChecked(Config::value("exportChunksCheckedMim", true).toBool());
45+
palette->setChecked(Config::value("exportChunksCheckedPalette", true).toBool());
4546

4647
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
4748

@@ -80,5 +81,15 @@ Field::FieldSections ExportChunksDialog::parts() const
8081
if (inf->isChecked()) parts |= Field::Inf;
8182
if (mim->isChecked()) parts |= Field::Background;
8283

84+
Config::setValue("exportChunksCheckedScripts", scripts->isChecked());
85+
Config::setValue("exportChunksCheckedCa", ca->isChecked());
86+
Config::setValue("exportChunksCheckedModel", model->isChecked());
87+
Config::setValue("exportChunksCheckedPalette", palette->isChecked());
88+
Config::setValue("exportChunksCheckedId", id->isChecked());
89+
Config::setValue("exportChunksCheckedTiles", tiles->isChecked());
90+
Config::setValue("exportChunksCheckedEncounter", encounter->isChecked());
91+
Config::setValue("exportChunksCheckedInf", inf->isChecked());
92+
Config::setValue("exportChunksCheckedMim", mim->isChecked());
93+
8394
return parts;
8495
}

0 commit comments

Comments
 (0)
Please sign in to comment.