mirror of
https://github.com/Sinbing/cubiomes-viewer.git
synced 2025-01-08 11:47:52 +08:00
Fixes, tweaks and new colors
* added version dependent biome names * added option for custom biome color overrides * tweaked biome colors for a slightly better contrast in 1.18 * fixed oceans getting ignored by biome filter for 1.18 * fixed 48-bit search for structures (hopefully better this time)
This commit is contained in:
parent
30bbf9c865
commit
d40853e5f8
2
cubiomes
2
cubiomes
@ -1 +1 @@
|
||||
Subproject commit 0cd6e8134a0d257685867f8a77f5cd6c01ab8353
|
||||
Subproject commit fa3ed2af5961d6129aceb15974e05402a2db06d8
|
@ -5,7 +5,7 @@
|
||||
|
||||
#define VERS_MAJOR 1
|
||||
#define VERS_MINOR 11
|
||||
#define VERS_PATCH 2 // negative patch number designates a development version
|
||||
#define VERS_PATCH 3 // 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)
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>589</width>
|
||||
<height>340</height>
|
||||
<width>609</width>
|
||||
<height>343</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -43,24 +43,24 @@
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:16pt; font-weight:600;">Cubiomes-Viewer _MAJOR_._MINOR_._PATCH_</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">Built: _DATE_</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">URL: </span><a href="https://github.com/Cubitect/cubiomes-viewer"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/Cubitect/cubiomes-viewer</span></a></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">License: </span><a href="https://www.gnu.org/licenses/gpl-3.0.en.html"><span style=" text-decoration: underline; color:#0057ae;">GPLv3</span></a></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:12pt; font-weight:600;">Components and Legal Information</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:12pt; font-weight:600;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">— Minecraft biome and structure generation from </span><a href="https://github.com/Cubitect/cubiomes/"><span style=" text-decoration: underline; color:#0057ae;">cubiomes</span></a><span style=" font-family:'Sans';">, licensed under </span><a href="https://mit-license.org/"><span style=" text-decoration: underline; color:#0057ae;">MIT</span></a><span style=" font-family:'Sans';">.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">— Cross platform GUI toolkit: Qt _QT_MAJOR_._QT_MINOR_, available under </span><a href="https://www.qt.io/licensing/"><span style=" text-decoration: underline; color:#0057ae;">(L)GPLv3</span></a><span style=" font-family:'Sans';">.</span></p>
|
||||
</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt; font-weight:600;">Cubiomes-Viewer _MAJOR_._MINOR_._PATCH_</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">— Dark Qt theme derived from </span><a href="https://github.com/ColinDuquesnoy/QDarkStyleSheet"><span style=" text-decoration: underline; color:#0057ae;">QDarkStyleSheet</span></a><span style=" font-family:'Sans';">, licensed under MIT.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">— Colors and icons are in part modified from </span><a href="https://github.com/toolbox4minecraft/amidst"><span style=" text-decoration: underline; color:#0057ae;">Amidst</span></a><span style=" font-family:'Sans';">, licensed under GPLv3.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">NOT APPROVED BY OR ASSOCIATED WITH MOJANG.</p></body></html></string>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Built: _DATE_</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">URL: <a href="https://github.com/Cubitect/cubiomes-viewer"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">https://github.com/Cubitect/cubiomes-viewer</span></a></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">License: <a href="https://www.gnu.org/licenses/gpl-3.0.en.html"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">GPLv3</span></a></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Components and Legal Information</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">— Minecraft biome and structure generation from <a href="https://github.com/Cubitect/cubiomes/"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">cubiomes</span></a>, licensed under <a href="https://mit-license.org/"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">MIT</span></a>.</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">— Cross platform GUI toolkit: Qt _QT_MAJOR_._QT_MINOR_, available under <a href="https://www.qt.io/licensing/"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">(L)GPLv3</span></a>.</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">— Dark Qt theme derived from <a href="https://github.com/ColinDuquesnoy/QDarkStyleSheet"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">QDarkStyleSheet</span></a>, licensed under MIT.</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">— Colors and icons are inspired by <a href="https://github.com/toolbox4minecraft/amidst"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">Amidst</span></a>, licensed under GPLv3.</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif';">NOT APPROVED BY OR ASSOCIATED WITH MOJANG.</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -1,13 +1,21 @@
|
||||
#include "configdialog.h"
|
||||
#include "ui_configdialog.h"
|
||||
#include "cutil.h"
|
||||
|
||||
#include <QThread>
|
||||
#include <QFileInfo>
|
||||
#include <QFileDialog>
|
||||
|
||||
ConfigDialog::ConfigDialog(QWidget *parent, Config *config) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ConfigDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QFont mono = QFont("Monospace", 9);
|
||||
mono.setStyleHint(QFont::TypeWriter);
|
||||
ui->buttonBiomeColor->setFont(mono);
|
||||
|
||||
ui->lineQueueSize->setValidator(new QIntValidator(1, 9999, ui->lineQueueSize));
|
||||
ui->lineMatching->setValidator(new QIntValidator(1, 99999999, ui->lineMatching));
|
||||
for (int i = 0; i < 16; i++)
|
||||
@ -32,6 +40,8 @@ void ConfigDialog::initSettings(Config *config)
|
||||
ui->cboxItemSize->setCurrentText(QString::number(config->seedsPerItem));
|
||||
ui->lineQueueSize->setText(QString::number(config->queueSize));
|
||||
ui->lineMatching->setText(QString::number(config->maxMatching));
|
||||
|
||||
setBiomeColorPath(config->biomeColorPath);
|
||||
}
|
||||
|
||||
Config ConfigDialog::getSettings()
|
||||
@ -52,6 +62,51 @@ Config ConfigDialog::getSettings()
|
||||
return conf;
|
||||
}
|
||||
|
||||
void ConfigDialog::setBiomeColorPath(QString path)
|
||||
{
|
||||
unsigned char cols[256][3];
|
||||
initBiomeColors(cols);
|
||||
QPalette pal = this->palette();
|
||||
|
||||
conf.biomeColorPath = path;
|
||||
|
||||
if (path.isEmpty())
|
||||
{
|
||||
ui->buttonBiomeColor->setText("...");
|
||||
}
|
||||
else
|
||||
{
|
||||
QFileInfo finfo(path);
|
||||
QFile file(path);
|
||||
int n = -1;
|
||||
|
||||
if (file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
char buf[32*1024];
|
||||
qint64 siz = file.read(buf, sizeof(buf)-1);
|
||||
file.close();
|
||||
if (siz >= 0)
|
||||
{
|
||||
buf[siz] = 0;
|
||||
n = parseBiomeColors(cols, buf);
|
||||
}
|
||||
}
|
||||
|
||||
if (n >= 0)
|
||||
{
|
||||
QString txt = QString::asprintf("[%d biomes] ", n) + finfo.baseName();
|
||||
ui->buttonBiomeColor->setText(txt);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->buttonBiomeColor->setText(finfo.baseName());
|
||||
pal.setColor(QPalette::ButtonText, QColor(Qt::red));
|
||||
}
|
||||
}
|
||||
|
||||
ui->buttonBiomeColor->setPalette(pal);
|
||||
}
|
||||
|
||||
void ConfigDialog::on_buttonBox_clicked(QAbstractButton *button)
|
||||
{
|
||||
if (ui->buttonBox->buttonRole(button) == QDialogButtonBox::ResetRole)
|
||||
@ -60,3 +115,20 @@ void ConfigDialog::on_buttonBox_clicked(QAbstractButton *button)
|
||||
initSettings(&conf);
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigDialog::on_buttonBiomeColor_clicked()
|
||||
{
|
||||
QFileInfo finfo(conf.biomeColorPath);
|
||||
QString fnam = QFileDialog::getOpenFileName(this, "Load biome color map", finfo.absolutePath(), "Text files (*.txt);;Any files (*)");
|
||||
if (!fnam.isNull())
|
||||
{
|
||||
conf.biomeColorPath = fnam;
|
||||
setBiomeColorPath(fnam);
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigDialog::on_buttonClear_clicked()
|
||||
{
|
||||
conf.biomeColorPath.clear();
|
||||
setBiomeColorPath("");
|
||||
}
|
||||
|
@ -24,9 +24,15 @@ public:
|
||||
|
||||
Config getSettings();
|
||||
|
||||
void setBiomeColorPath(QString path);
|
||||
|
||||
private slots:
|
||||
void on_buttonBox_clicked(QAbstractButton *button);
|
||||
|
||||
void on_buttonBiomeColor_clicked();
|
||||
|
||||
void on_buttonClear_clicked();
|
||||
|
||||
private:
|
||||
Ui::ConfigDialog *ui;
|
||||
Config conf;
|
||||
|
@ -2,6 +2,14 @@
|
||||
<ui version="4.0">
|
||||
<class>ConfigDialog</class>
|
||||
<widget class="QDialog" name="ConfigDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>433</width>
|
||||
<height>435</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Preferences</string>
|
||||
</property>
|
||||
@ -10,11 +18,132 @@
|
||||
<normaloff>:/icons/map.png</normaloff>:/icons/map.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Maximum number of matching seeds:</string>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Size of search item queue:
|
||||
(limits usable threads)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Seeds per thread search item:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Maximum number of matching seeds:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineMatching"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cboxItemSize">
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineQueueSize"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Interface</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="buttonBiomeColor">
|
||||
<property name="text">
|
||||
<string>[none]</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="comboStyle">
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>System</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Dark</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="checkBBoxes">
|
||||
<property name="text">
|
||||
<string>Outline known bounding boxes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>GUI style:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="checkSmooth">
|
||||
<property name="toolTip">
|
||||
<string>Simulate innertia for the map view</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Smooth map motion</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Biome color customization:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="buttonClear">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/clear.png</normaloff>:/icons/clear.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="2">
|
||||
@ -27,109 +156,43 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Size of search item queue:
|
||||
(limits usable threads)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Seeds per thread search item:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkSmooth">
|
||||
<property name="toolTip">
|
||||
<string>Simulate innertia for the map view</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Smooth map motion</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLineEdit" name="lineQueueSize"/>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QComboBox" name="cboxItemSize">
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QLineEdit" name="lineMatching"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="checkAutosave">
|
||||
<property name="text">
|
||||
<string>Autosave every:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QSpinBox" name="spinAutosave">
|
||||
<property name="suffix">
|
||||
<string> min</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>120</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>GUI style:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QComboBox" name="comboStyle">
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>System</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Dark</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkBBoxes">
|
||||
<property name="text">
|
||||
<string>Outline known bounding boxes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="checkRestore">
|
||||
<property name="text">
|
||||
<string>Restore previous session at launch</string>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Session</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0" rowspan="2" colspan="3">
|
||||
<widget class="QCheckBox" name="checkRestore">
|
||||
<property name="text">
|
||||
<string>Restore previous session at launch</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="checkAutosave">
|
||||
<property name="text">
|
||||
<string>Autosave every:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QSpinBox" name="spinAutosave">
|
||||
<property name="suffix">
|
||||
<string> min</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>120</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -18,7 +18,7 @@ inline const char* struct2str(int stype)
|
||||
switch (stype)
|
||||
{
|
||||
case Desert_Pyramid: return "desert_pyramid";
|
||||
case Jungle_Pyramid: return "jungle_pyramid";
|
||||
case Jungle_Temple: return "jungle_temple";
|
||||
case Swamp_Hut: return "swamp_hut";
|
||||
case Igloo: return "igloo";
|
||||
case Village: return "village";
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
#define SETUP_BIOME_CHECKBOX(B) do {\
|
||||
biomecboxes[B] = new QCheckBox(#B);\
|
||||
biomecboxes[B] = new QCheckBox(biome2str(mc, B));\
|
||||
ui->gridLayoutBiomes->addWidget(biomecboxes[B], (B) % 128, (B) / 128);\
|
||||
biomecboxes[B]->setTristate(true);\
|
||||
} while (0)
|
||||
@ -35,10 +35,10 @@ static QString getTip(int mc, int layer, int id)
|
||||
QString tip = "Generates any of:";
|
||||
for (int j = 0; j < 64; j++)
|
||||
if (mL & (1ULL << j))
|
||||
tip += QString("\n") + biome2str(j);
|
||||
tip += QString("\n") + biome2str(mc, j);
|
||||
for (int j = 0; j < 64; j++)
|
||||
if (mM & (1ULL << j))
|
||||
tip += QString("\n") + biome2str(128+j);
|
||||
tip += QString("\n") + biome2str(mc, 128+j);
|
||||
return tip;
|
||||
}
|
||||
|
||||
@ -490,12 +490,12 @@ void FilterDialog::updateBiomeSelection()
|
||||
for (int j = 0; j < 64; j++)
|
||||
{
|
||||
if (mL & (1ULL << j))
|
||||
tip += QString("\n") + biome2str(j);
|
||||
tip += QString("\n") + biome2str(mc, j);
|
||||
}
|
||||
for (int j = 0; j < 64; j++)
|
||||
{
|
||||
if (mM & (1ULL << j))
|
||||
tip += QString("\n") + biome2str(j+128);
|
||||
tip += QString("\n") + biome2str(mc, j+128);
|
||||
}
|
||||
cb->setToolTip(tip);
|
||||
}
|
||||
|
@ -312,6 +312,7 @@ void MainWindow::saveSettings()
|
||||
settings.setValue("config/seedsPerItem", config.seedsPerItem);
|
||||
settings.setValue("config/queueSize", config.queueSize);
|
||||
settings.setValue("config/maxMatching", config.maxMatching);
|
||||
settings.setValue("config/biomeColorPath", config.biomeColorPath);
|
||||
|
||||
settings.setValue("world/saltOverride", g_extgen.saltOverride);
|
||||
for (int st = 0; st < FEATURE_NUM; st++)
|
||||
@ -382,6 +383,10 @@ void MainWindow::loadSettings()
|
||||
config.seedsPerItem = settings.value("config/seedsPerItem", config.seedsPerItem).toInt();
|
||||
config.queueSize = settings.value("config/queueSize", config.queueSize).toInt();
|
||||
config.maxMatching = settings.value("config/maxMatching", config.maxMatching).toInt();
|
||||
config.biomeColorPath = settings.value("config/biomeColorPath", config.biomeColorPath).toString();
|
||||
|
||||
if (!config.biomeColorPath.isEmpty())
|
||||
onBiomeColorChange();
|
||||
|
||||
ui->mapView->setShowBB(config.showBBoxes);
|
||||
ui->mapView->setSmoothMotion(config.smoothMotion);
|
||||
@ -725,9 +730,36 @@ void MainWindow::on_actionPreferences_triggered()
|
||||
{
|
||||
autosaveTimer.stop();
|
||||
}
|
||||
|
||||
if (!config.biomeColorPath.isEmpty() || !oldConfig.biomeColorPath.isEmpty())
|
||||
{
|
||||
onBiomeColorChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::onBiomeColorChange()
|
||||
{
|
||||
QFile file(config.biomeColorPath);
|
||||
if (file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
char buf[32*1024];
|
||||
qint64 siz = file.read(buf, sizeof(buf)-1);
|
||||
file.close();
|
||||
if (siz >= 0)
|
||||
{
|
||||
buf[siz] = 0;
|
||||
initBiomeColors(biomeColors);
|
||||
parseBiomeColors(biomeColors, buf);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
initBiomeColors(biomeColors);
|
||||
}
|
||||
ui->mapView->refresh();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionGo_to_triggered()
|
||||
{
|
||||
GotoDialog *dialog = new GotoDialog(this, ui->mapView->getX(), ui->mapView->getZ(), ui->mapView->getScale());
|
||||
@ -972,7 +1004,7 @@ void MainWindow::on_buttonAnalysis_clicked()
|
||||
if (cnt <= 0)
|
||||
continue;
|
||||
const char *s;
|
||||
if (!(s = biome2str(id)))
|
||||
if (!(s = biome2str(wi.mc, id)))
|
||||
continue;
|
||||
QTreeWidgetItem* item =
|
||||
new QTreeWidgetItem(item_cat, QTreeWidgetItem::UserType + id);
|
||||
|
@ -104,6 +104,7 @@ private slots:
|
||||
void onSelectedSeedChanged(uint64_t seed);
|
||||
void onSearchStatusChanged(bool running);
|
||||
void onStyleChanged(int style);
|
||||
void onBiomeColorChange();
|
||||
void copyCoord();
|
||||
void copyTeleportCommand();
|
||||
|
||||
|
@ -818,7 +818,7 @@ QToolButton:checked {
|
||||
</action>
|
||||
<action name="actionExtGen">
|
||||
<property name="text">
|
||||
<string>World settings...</string>
|
||||
<string>Advanced world settings...</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
|
@ -22,8 +22,6 @@ bool MapOverlay::event(QEvent *e)
|
||||
void MapOverlay::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
|
||||
const char *bname = biome2str(id);
|
||||
if (bname)
|
||||
{
|
||||
QString s = QString::asprintf("%s [%d,%d]", bname, pos.x, pos.z);
|
||||
@ -78,6 +76,17 @@ void MapView::deleteWorld()
|
||||
world = NULL;
|
||||
}
|
||||
|
||||
void MapView::refresh()
|
||||
{
|
||||
if (world)
|
||||
{
|
||||
WorldInfo wi = world->wi;
|
||||
int dim = world->dim;
|
||||
delete world;
|
||||
world = new QWorld(wi, dim);
|
||||
}
|
||||
}
|
||||
|
||||
void MapView::setSeed(WorldInfo wi, int dim)
|
||||
{
|
||||
prevx = focusx = getX();
|
||||
@ -203,7 +212,7 @@ void MapView::paintEvent(QPaintEvent *)
|
||||
qreal bz = (cur.y() - height()/2.0) / blocks2pix + fz;
|
||||
Pos p = {(int)bx, (int)bz};
|
||||
overlay->pos = p;
|
||||
overlay->id = world->getBiome(p);
|
||||
overlay->bname = biome2str(world->wi.mc, world->getBiome(p));
|
||||
|
||||
if (QThreadPool::globalInstance()->activeThreadCount() > 0 || velx || velz)
|
||||
updatecounter = 2;
|
||||
|
@ -12,7 +12,7 @@ class MapOverlay : public QWidget
|
||||
|
||||
public:
|
||||
explicit MapOverlay(QWidget *parent = nullptr)
|
||||
: QWidget(parent),pos{},id(-1) {}
|
||||
: QWidget(parent),pos{},bname(nullptr) {}
|
||||
~MapOverlay() {}
|
||||
|
||||
public slots:
|
||||
@ -21,7 +21,7 @@ public slots:
|
||||
|
||||
public:
|
||||
Pos pos;
|
||||
int id;
|
||||
const char *bname;
|
||||
};
|
||||
|
||||
class MapView : public QWidget
|
||||
@ -37,6 +37,7 @@ public:
|
||||
qreal getScale() const { return 1.0 / blocks2pix; }
|
||||
|
||||
void deleteWorld();
|
||||
void refresh();
|
||||
void setSeed(WorldInfo wi, int dim);
|
||||
void setView(qreal x, qreal z, qreal scale = 0);
|
||||
|
||||
|
@ -459,27 +459,24 @@ L_qm_any:
|
||||
continue;
|
||||
if (pc.x < x1 || pc.x > x2 || pc.z < z1 || pc.z > z2)
|
||||
continue;
|
||||
if (pass < PASS_FULL_48 || (pass == PASS_FAST_48 && finfo.dim == 0))
|
||||
if (pass == PASS_FULL_64 || (pass == PASS_FULL_48 && !finfo.dep64))
|
||||
{
|
||||
xt += pc.x;
|
||||
zt += pc.z;
|
||||
n++;
|
||||
continue;
|
||||
}
|
||||
gen->init4Dim(finfo.dim);
|
||||
if (!isViableStructurePos(st, &gen->g, pc.x, pc.z, 0))
|
||||
continue;
|
||||
if (st == End_City)
|
||||
{
|
||||
gen->setSurfaceNoise();
|
||||
if (!isViableEndCityTerrain(
|
||||
&gen->g.en, &gen->sn, pc.x, pc.z))
|
||||
continue;
|
||||
}
|
||||
else if (gen->mc >= MC_1_18)
|
||||
{
|
||||
if (!isViableStructureTerrain(st, &gen->g, pc.x, pc.z))
|
||||
if (*abort) return COND_FAILED;
|
||||
gen->init4Dim(finfo.dim);
|
||||
if (!isViableStructurePos(st, &gen->g, pc.x, pc.z, 0))
|
||||
continue;
|
||||
if (st == End_City)
|
||||
{
|
||||
gen->setSurfaceNoise();
|
||||
if (!isViableEndCityTerrain(
|
||||
&gen->g.en, &gen->sn, pc.x, pc.z))
|
||||
continue;
|
||||
}
|
||||
else if (gen->mc >= MC_1_18)
|
||||
{
|
||||
if (!isViableStructureTerrain(st, &gen->g, pc.x, pc.z))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
xt += pc.x;
|
||||
zt += pc.z;
|
||||
@ -492,14 +489,13 @@ L_qm_any:
|
||||
cent->x = xt / n;
|
||||
cent->z = zt / n;
|
||||
|
||||
if (pass != PASS_FULL_64 && finfo.dep64)
|
||||
{ // some non-exhaustive structure clusters do not
|
||||
// have known center positions with 48-bit seeds
|
||||
if (cond->count != (1+rx2-rx1) * (1+rz2-rz1))
|
||||
return COND_MAYBE_POS_INVAL;
|
||||
return COND_MAYBE_POS_VALID;
|
||||
}
|
||||
return COND_OK;
|
||||
if (pass == PASS_FULL_64 || (pass == PASS_FULL_48 && !finfo.dep64))
|
||||
return COND_OK;
|
||||
// some non-exhaustive structure clusters do not
|
||||
// have known center positions with 48-bit seeds
|
||||
if (cond->count != (1+rx2-rx1) * (1+rz2-rz1))
|
||||
return COND_MAYBE_POS_INVAL;
|
||||
return COND_MAYBE_POS_VALID;
|
||||
}
|
||||
return COND_FAILED;
|
||||
|
||||
@ -741,11 +737,8 @@ L_noise_biome:
|
||||
return COND_MAYBE_POS_VALID;
|
||||
// the Nether and End require only the 48-bit seed
|
||||
// (except voronoi uses the full 64-bits)
|
||||
if (pass == PASS_FULL_48)
|
||||
{
|
||||
if (s == 0 || finfo.dim == 0)
|
||||
return COND_MAYBE_POS_VALID;
|
||||
}
|
||||
if (pass == PASS_FULL_48 && finfo.dep64)
|
||||
return COND_MAYBE_POS_VALID;
|
||||
rx1 = ((cond->x1 << s) + at.x) >> s;
|
||||
rz1 = ((cond->z1 << s) + at.z) >> s;
|
||||
rx2 = ((cond->x2 << s) + at.x) >> s;
|
||||
|
@ -58,6 +58,7 @@ struct Config
|
||||
int seedsPerItem;
|
||||
int queueSize;
|
||||
int maxMatching;
|
||||
QString biomeColorPath;
|
||||
|
||||
Config() { reset(); }
|
||||
|
||||
@ -71,6 +72,7 @@ struct Config
|
||||
seedsPerItem = 64;
|
||||
queueSize = QThread::idealThreadCount();
|
||||
maxMatching = 65536;
|
||||
biomeColorPath = "";
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user