Skip to content

Commit

Permalink
Added support for MC 1.0 - 1.5 + arraged feature icons by MC version
Browse files Browse the repository at this point in the history
  • Loading branch information
Cubitect committed Jul 23, 2021
1 parent 4805092 commit 93f915a
Show file tree
Hide file tree
Showing 11 changed files with 337 additions and 282 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Cubiomes Viewer provides a graphical interface for the efficient and flexible seed-finding utilities provided by [cubiomes](https://github.com/Cubitect/cubiomes) and a map viewer for the Minecraft biomes and structure generation.

The tool is designed for high performance and currently supports Minecraft Java Edition 1.6 - 1.17.
The tool is designed for high performance and supports Minecraft Java Edition main releases 1.0 - 1.17.


## Download
Expand Down
2 changes: 1 addition & 1 deletion cubiomes
Submodule cubiomes updated 6 files
+74 −32 generator.c
+1 −1 generator.h
+5 −0 layers.c
+4 −3 layers.h
+15 −12 tests.c
+12 −0 util.c
2 changes: 1 addition & 1 deletion src/aboutdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#define VERS_MAJOR 1
#define VERS_MINOR 9
#define VERS_PATCH -1 // negative patch number designates a development version
#define VERS_PATCH 0 // negative patch number designates a development version

// returns +1 if newer, -1 if older and 0 if equal
inline int cmpVers(int major, int minor, int patch)
Expand Down
34 changes: 27 additions & 7 deletions src/filterdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <QPixmap>
#include <QPainter>
#include <QPainterPath>
#include <QMessageBox>


#define SETUP_BIOME_CHECKBOX(B) do {\
Expand Down Expand Up @@ -50,6 +51,10 @@ FilterDialog::FilterDialog(FormConditions *parent, int mcversion, QListWidgetIte
memset(&cond, 0, sizeof(cond));
ui->setupUi(this);

textDescription = new QTextEdit(this);
textDescription->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
ui->collapseDescription->init("Description", textDescription, true);

QString mcs = "MC ";
mcs += (mc2str(mc) ? mc2str(mc) : "?");
ui->labelMC->setText(mcs);
Expand Down Expand Up @@ -360,8 +365,8 @@ void FilterDialog::updateMode()
ui->lineEditZ1->setToolTip(lowtip);
ui->lineEditX2->setToolTip(uptip);
ui->lineEditZ2->setToolTip(uptip);
ui->textDescription->setText(ft.desription);
ui->buttonOk->setEnabled(filterindex != F_SELECT);
textDescription->setText(ft.description);
}

void FilterDialog::enableSet(const int *ids, int n)
Expand Down Expand Up @@ -610,19 +615,34 @@ void FilterDialog::on_comboBoxCat_currentIndexChanged(int idx)
int slot = 0;
ui->comboBoxType->insertItem(slot, "Select filter", QVariant::fromValue((int)F_SELECT));

const FilterInfo *ft_list[FILTER_MAX] = {};
const FilterInfo *ft;

for (int i = 1; i < FILTER_MAX; i++)
{
ft = &g_filterinfo.list[i];
if (ft->cat == idx)
ft_list[ft->disp] = ft;
}

for (int i = 1; i < FILTER_MAX; i++)
{
const FilterInfo &ft = g_filterinfo.list[i];
if (ft.cat != idx)
ft = ft_list[i];
if (!ft)
continue;
slot++;
if (ft.icon)
ui->comboBoxType->insertItem(slot, QIcon(ft.icon), ft.name, i);
QVariant vidx = QVariant::fromValue((int)(ft - g_filterinfo.list));
if (ft->icon)
ui->comboBoxType->insertItem(slot, QIcon(ft->icon), ft->name, vidx);
else
ui->comboBoxType->insertItem(slot, ft.name, i);
ui->comboBoxType->insertItem(slot, ft->name, vidx);

if (mc < ft.mcmin)
if (mc < ft->mcmin)
ui->comboBoxType->setItemData(slot, false, Qt::UserRole-1); // deactivate
if (ft == g_filterinfo.list + F_FORTRESS)
ui->comboBoxType->insertSeparator(slot++);
if (ft == g_filterinfo.list + F_ENDCITY)
ui->comboBoxType->insertSeparator(slot++);
}

updateMode();
Expand Down
19 changes: 8 additions & 11 deletions src/filterdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <QSpinBox>
#include <QLineEdit>
#include <QListWidgetItem>
#include <QTextEdit>

#include "search.h"
#include "formconditions.h"
Expand Down Expand Up @@ -46,18 +47,12 @@ class SpinExclude : public QSpinBox
public slots:
void change(int v)
{
const char *style = "";
if (v < 0)
{
setStyleSheet("background: #28ff0000");
}
else if (v > 0)
{
setStyleSheet("background: #2800ff00");
}
else
{
setStyleSheet("");
}
style = "background: #28ff0000";
if (v > 0)
style = "background: #2800ff00";
setStyleSheet(style);
findChild<QLineEdit*>()->deselect();
}
};
Expand Down Expand Up @@ -102,6 +97,8 @@ private slots:

private:
Ui::FilterDialog *ui;
QTextEdit *textDescription;

QCheckBox *biomecboxes[256];
SpinExclude *tempsboxes[9];
bool custom;
Expand Down
Loading

0 comments on commit 93f915a

Please sign in to comment.