Skip to content

Commit

Permalink
Changes for 3.3.0
Browse files Browse the repository at this point in the history
added biome noise visualization for beta 1.7 climates (#212)
added keyboard controls to navigate the map (#217)
added desert wells map option and finders (#218)
added trail ruins map option and finders
added amethyst geode map option
added indicator for igloos with basement
added command line option --reset-all to clear the sessions and settings
added visibility toggles for structures that can be used to de-clutter the toolbar
updated structure icons, replacing several amidst icons that had non-standard sizes
changed UI so multiple conditions can be enabled/disabled at once (#216)
changed warning message for small areas to be more informative (#220)
changed compiler flags for debug builds
changed the toolbar position to its anchor is resored upon restart
changed preferences dialog to be non-blocking
fixed missing y-level option for locate biome center finders (#221)
fixed incorrect stronghold positions for 1.6- (#228)
fixed secondary spawn pass for 1.18+ (#219)
  • Loading branch information
Cubitect committed May 21, 2023
1 parent c7d6062 commit 09e6bfd
Show file tree
Hide file tree
Showing 100 changed files with 1,511 additions and 852 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cubiomes-viewer.pro.user
build
src/libwinsane/*.o
**/.directory
2 changes: 1 addition & 1 deletion cubiomes
Submodule cubiomes updated 6 files
+398 −243 finders.c
+13 −5 finders.h
+14 −13 generator.c
+150 −159 layers.c
+1 −1 makefile
+11 −0 rng.h
18 changes: 11 additions & 7 deletions cubiomes-viewer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ QT += core widgets

CHARSET = -finput-charset=UTF-8 -fexec-charset=UTF-8
QMAKE_CFLAGS = $$CHARSET -fwrapv -DSTRUCT_CONFIG_OVERRIDE=1
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -std=gnu++11
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -std=gnu++11 -Wno-deprecated-copy
QMAKE_CXXFLAGS_RELEASE *= -O3

win32: {
CONFIG += static_gnu

# thanks to nullprogram for dealing with the Windows UTF-16 nonsense
# thank you nullprogram for dealing with the Windows UTF-16 nonsense
LIBWINSANE = $$PWD/src/libwinsane
libwinsane.target = libwinsane
libwinsane.output = $$LIBWINSANE/libwinsane.o
Expand All @@ -33,12 +33,15 @@ static_gnu: {
LIBS += -static -static-libgcc -static-libstdc++
}

# compile cubiomes
release: {
CUTARGET = release
} else: { # may need the release target to be disabled: qmake CONFIG-=release
CONFIG(debug, debug|release): {
CUTARGET = debug
QMAKE_CFLAGS += -fsanitize=undefined
LIBS += -lubsan -ldl
} else {
CUTARGET = release
}

# compile cubiomes
CUPATH = $$PWD/cubiomes
QMAKE_PRE_LINK += $(MAKE) -C $$CUPATH -f $$CUPATH/makefile CFLAGS=\"$$QMAKE_CFLAGS\" $$CUTARGET
QMAKE_CLEAN += $$CUPATH/*.o $$CUPATH/libcubiomes.a
Expand Down Expand Up @@ -85,6 +88,7 @@ SOURCES += \
src/biomecolordialog.cpp \
src/collapsible.cpp \
src/conditiondialog.cpp \
src/config.cpp \
src/configdialog.cpp \
src/extgendialog.cpp \
src/exportdialog.cpp \
Expand Down Expand Up @@ -147,6 +151,7 @@ HEADERS += \
src/biomecolordialog.h \
src/collapsible.h \
src/conditiondialog.h \
src/config.h \
src/configdialog.h \
src/extgendialog.h \
src/exportdialog.h \
Expand All @@ -169,7 +174,6 @@ HEADERS += \
src/tabstructures.h \
src/tabtriggers.h \
src/mainwindow.h \
src/settings.h \
src/structuredialog.h \
src/world.h

Expand Down
8 changes: 8 additions & 0 deletions rc/icons.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,13 @@
<file>icons/check_include_d.png</file>
<file>icons/check_unchecked.png</file>
<file>icons/height.png</file>
<file>icons/trail.png</file>
<file>icons/missing.png</file>
<file>icons/well.png</file>
<file>icons/well_d.png</file>
<file>icons/trail_d.png</file>
<file>icons/geode_d.png</file>
<file>icons/geode.png</file>
<file>icons/igloo_basement.png</file>
</qresource>
</RCC>
4 changes: 0 additions & 4 deletions rc/icons/.directory

This file was deleted.

Binary file modified rc/icons/ancient_city.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/ancient_city_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/bastion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/bastion_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/cancel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/clear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/desert.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/desert_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/end_ship.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/fortress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/fortress_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/gateway.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/gateway_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rc/icons/geode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rc/icons/geode_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/hut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/hut_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/igloo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rc/icons/igloo_basement.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/mansion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/mansion_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/mineshaft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/mineshaft_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rc/icons/missing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rc/icons/monument.png
Binary file modified rc/icons/nether.png
Binary file modified rc/icons/nether_d.png
Binary file modified rc/icons/outpost.png
Binary file modified rc/icons/outpost_d.png
Binary file modified rc/icons/overworld_d.png
Binary file modified rc/icons/portal_lit.png
Binary file modified rc/icons/quad.png
Binary file modified rc/icons/ruins.png
Binary file modified rc/icons/ruins_d.png
Binary file modified rc/icons/search.png
Binary file modified rc/icons/shipwreck.png
Binary file modified rc/icons/shipwreck_d.png
Binary file modified rc/icons/slime_d.png
Binary file modified rc/icons/the_end.png
Binary file modified rc/icons/the_end_d.png
Binary file added rc/icons/trail.png
Binary file added rc/icons/trail_d.png
Binary file modified rc/icons/treasure.png
Binary file modified rc/icons/treasure_d.png
Binary file modified rc/icons/village.png
Binary file modified rc/icons/village_d.png
Binary file added rc/icons/well.png
Binary file added rc/icons/well_d.png
Binary file modified rc/icons/zombie.png
Binary file modified rc/icons/zombie_d.png
4 changes: 2 additions & 2 deletions src/aboutdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <QString>

#define VERS_MAJOR 3
#define VERS_MINOR 2
#define VERS_PATCH 1 // negative patch number designates a development version
#define VERS_MINOR 3
#define VERS_PATCH -1 // 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
2 changes: 1 addition & 1 deletion src/biomecolordialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "ui_biomecolordialog.h"

#include "cutil.h"
#include "settings.h"
#include "config.h"

#include <QPixmap>
#include <QPainter>
Expand Down
34 changes: 26 additions & 8 deletions src/conditiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ ConditionDialog::ConditionDialog(FormConditions *parent, Config *config, int mcv
ui->lineRadius->setValidator(uintval);

ui->lineBiomeSize->setValidator(new QIntValidator(1, INT_MAX, this));
ui->lineTollerance->setValidator(new QIntValidator(0, 255, this));
ui->lineTolerance->setValidator(new QIntValidator(0, 255, this));

ui->comboY->lineEdit()->setValidator(new QIntValidator(-64, 320, this));

Expand Down Expand Up @@ -293,7 +293,6 @@ ConditionDialog::ConditionDialog(FormConditions *parent, Config *config, int mcv
ui->checkSkipRef->setChecked(false);
ui->radioSquare->setChecked(true);
ui->checkRadius->setChecked(false);
ui->lineBiomeSize->setText("");
onCheckStartChanged(false);
on_comboClimatePara_currentIndexChanged(0);

Expand Down Expand Up @@ -352,7 +351,10 @@ ConditionDialog::ConditionDialog(FormConditions *parent, Config *config, int mcv
if (ui->comboY->itemText(i).section(' ', 0, 0).toInt() == cond.y)
break;
if (i >= n)
{
ui->comboY->addItem(QString::number(cond.y));
ui->comboY2->addItem(QString::number(cond.y));
}
ui->comboY->setCurrentIndex(i);

if (cond.x1 == cond.z1 && cond.x1 == -cond.x2 && cond.x1 == -cond.z2)
Expand Down Expand Up @@ -400,8 +402,8 @@ ConditionDialog::ConditionDialog(FormConditions *parent, Config *config, int mcv
}
}

ui->lineBiomeSize->setText(QString::number(cond.biomeSize));
ui->lineTollerance->setText(QString::number(cond.tol));
ui->lineBiomeSize->setText(QString::number(cond.biomeSize ? cond.biomeSize : 1));
ui->lineTolerance->setText(QString::number(cond.tol));

auto totristate = [](uint16_t st, uint16_t msk) {
return (st & msk) ? (st & Condition::VAR_NOT) ? Qt::Checked : Qt::PartiallyChecked : Qt::Unchecked;
Expand Down Expand Up @@ -795,7 +797,10 @@ int ConditionDialog::warnIfBad(Condition cond)
int h = cond.z2 - cond.z1 + 1;
if ((unsigned int)(w * h) < cond.count * cond.biomeSize)
{
QString text = tr("Area is too small for the required biome size.");
QString text = tr(
"The biome locator checks for %1 instances of size %2 each, "
"which cannot be satisfied by an area of size %3%4%5 = %6.")
.arg(cond.count).arg(cond.biomeSize).arg(w).arg(QChar(0xD7)).arg(h).arg(w * h);
QMessageBox::warning(this, tr("Area Insufficient"), text, QMessageBox::Ok);
return QMessageBox::Cancel;
}
Expand Down Expand Up @@ -964,6 +969,8 @@ void ConditionDialog::on_buttonOk_clicked()
else
c.rmax = 0;

c.y = ui->comboY->currentText().section(' ', 0, 0).toInt();

if (ui->stackedWidget->currentWidget() == ui->pageBiomes)
{
c.biomeToFind = c.biomeToFindM = 0;
Expand Down Expand Up @@ -993,7 +1000,7 @@ void ConditionDialog::on_buttonOk_clicked()
{
c.biomeId = ui->comboMatchBiome->currentData().toInt();
c.biomeSize = ui->lineBiomeSize->text().toInt();
c.tol = ui->lineTollerance->text().toInt();
c.tol = ui->lineTolerance->text().toInt();
}
if (ui->stackedWidget->currentWidget() == ui->pageMinMax)
{
Expand All @@ -1016,8 +1023,6 @@ void ConditionDialog::on_buttonOk_clicked()
}
}

c.y = ui->comboY->currentText().section(' ', 0, 0).toInt();

c.flags = 0;
if (ui->checkApprox->isChecked())
c.flags |= Condition::FLG_APPROX;
Expand Down Expand Up @@ -1450,3 +1455,16 @@ void ConditionDialog::on_comboClimatePara_currentIndexChanged(int)
ui->comboOctaves->addItems(items);
}


void ConditionDialog::on_comboY_currentTextChanged(const QString &text)
{
if (ui->comboY2->currentText() != text)
ui->comboY2->setCurrentText(text);
}
void ConditionDialog::on_comboY2_currentTextChanged(const QString &text)
{
if (ui->comboY->currentText() != text)
ui->comboY->setCurrentText(text);
}


3 changes: 3 additions & 0 deletions src/conditiondialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ private slots:

void on_comboClimatePara_currentIndexChanged(int index);

void on_comboY_currentTextChanged(const QString &text);
void on_comboY2_currentTextChanged(const QString &text);

private:
Ui::ConditionDialog *ui;
QTextEdit *textDescription;
Expand Down
Loading

0 comments on commit 09e6bfd

Please sign in to comment.