Zoom buttons and toolbar config

added toolbar buttons for zoom in/out (#217)
changed structure config to a more general toolbar config
tweaked some icons
This commit is contained in:
Cubitect 2023-06-28 20:34:24 +02:00
parent e4437b32db
commit 26e5ed7e13
24 changed files with 360 additions and 268 deletions

View File

@ -103,6 +103,7 @@ SOURCES += \
src/formsearchcontrol.cpp \
src/gotodialog.cpp \
src/headless.cpp \
src/maptoolsdialog.cpp \
src/message.cpp \
src/presetdialog.cpp \
src/protobasedialog.cpp \
@ -118,7 +119,6 @@ SOURCES += \
src/tabtriggers.cpp \
src/mainwindow.cpp \
src/main.cpp \
src/structuredialog.cpp \
src/world.cpp
HEADERS += \
@ -168,6 +168,7 @@ HEADERS += \
src/formsearchcontrol.h \
src/gotodialog.h \
src/headless.h \
src/maptoolsdialog.h \
src/message.h \
src/presetdialog.h \
src/protobasedialog.h \
@ -184,7 +185,6 @@ HEADERS += \
src/tabstructures.h \
src/tabtriggers.h \
src/mainwindow.h \
src/structuredialog.h \
src/world.h
FORMS += \
@ -198,6 +198,7 @@ FORMS += \
src/formgen48.ui \
src/formsearchcontrol.ui \
src/gotodialog.ui \
src/maptoolsdialog.ui \
src/presetdialog.ui \
src/protobasedialog.ui \
src/layerdialog.ui \
@ -205,8 +206,7 @@ FORMS += \
src/rangedialog.ui \
src/tabbiomes.ui \
src/tabstructures.ui \
src/tabtriggers.ui \
src/structuredialog.ui
src/tabtriggers.ui
RESOURCES += \

View File

@ -80,5 +80,8 @@
<file>icons/well_d.png</file>
<file>icons/geode_d.png</file>
<file>icons/geode.png</file>
<file>icons/zoom_in.png</file>
<file>icons/zoom_out.png</file>
<file>icons/zoom.png</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 B

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 B

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 201 B

BIN
rc/icons/zoom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

BIN
rc/icons/zoom_in.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

BIN
rc/icons/zoom_out.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="de_DE">
<TS version="2.1" language="de_DE">
<context>
<name>AboutDialog</name>
<message>
@ -1394,210 +1394,210 @@ Trozdem fortfahren?</translation>
<context>
<name>ConfigDialog</name>
<message>
<location filename="../../src/configdialog.ui" line="14"/>
<location filename="../../src/configdialog.ui" line="6"/>
<source>Preferences</source>
<translation>Einstellungen</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="24"/>
<location filename="../../src/configdialog.ui" line="16"/>
<source>Session</source>
<translation>Sitzung</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="30"/>
<location filename="../../src/configdialog.ui" line="22"/>
<source>Restore previous session at launch</source>
<translation>Vorherige Sitzung beim Start widerherstellen</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="37"/>
<location filename="../../src/configdialog.ui" line="29"/>
<source>Autosave every:</source>
<translation>Autosave jede:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="44"/>
<location filename="../../src/configdialog.ui" line="36"/>
<source> min</source>
<translation></translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="73"/>
<location filename="../../src/configdialog.ui" line="65"/>
<source>Export</source>
<translation>Export</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="82"/>
<location filename="../../src/configdialog.ui" line="74"/>
<source>CSV cell quotation:</source>
<translation>CSV Zellen quotieren:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="89"/>
<location filename="../../src/configdialog.ui" line="81"/>
<source>CSV column separator:</source>
<translation>CSV Spaltentrennung:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="97"/>
<location filename="../../src/configdialog.ui" line="89"/>
<source>Where necessary</source>
<translation>Wenn notwendig</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="102"/>
<location filename="../../src/configdialog.ui" line="94"/>
<source>Single quotes (&apos;)</source>
<translation>Einfache Anführungszeichen (&apos;)</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="107"/>
<location filename="../../src/configdialog.ui" line="99"/>
<source>Double quotes (&quot;)</source>
<translation>Anfürungszeichen (&quot;)</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="118"/>
<location filename="../../src/configdialog.ui" line="110"/>
<source>Search</source>
<translation>Suche</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="124"/>
<location filename="../../src/configdialog.ui" line="116"/>
<source>Maximum number of matching seeds:</source>
<translation>Maximale Anzahl von Ergebnis Seeds:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="137"/>
<location filename="../../src/configdialog.ui" line="129"/>
<source>Miscellaneous</source>
<translation>Anderes</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="143"/>
<location filename="../../src/configdialog.ui" line="135"/>
<source>Check GitHub for updates at startup</source>
<translation>Prüfe GitHub beim Start nach Updates</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="153"/>
<location filename="../../src/configdialog.ui" line="145"/>
<source>Interface</source>
<translation>Oberfläche</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="394"/>
<location filename="../../src/configdialog.ui" line="386"/>
<source>Monospace font:</source>
<translation>Monospacefont:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="205"/>
<location filename="../../src/configdialog.ui" line="197"/>
<source>Maximum structure zoom:</source>
<translation>Struktursichtbarkeit:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="191"/>
<location filename="../../src/configdialog.ui" line="183"/>
<source>Outline known bounding boxes</source>
<translation>Bekannte Bounding Boxes zeichnen</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="232"/>
<location filename="../../src/configdialog.ui" line="224"/>
<source>Custom grid multiplier:</source>
<translation>Raster Skalierungsfaktor:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="263"/>
<location filename="../../src/configdialog.ui" line="255"/>
<source> MB</source>
<translation></translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="253"/>
<location filename="../../src/configdialog.ui" line="245"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Simulate inertia for the map view&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="184"/>
<location filename="../../src/configdialog.ui" line="176"/>
<source>Application font:</source>
<translation>Anwendungsfont:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="256"/>
<location filename="../../src/configdialog.ui" line="248"/>
<source>Smooth map motion</source>
<translation>Gleichmäßige Kartenbewegung</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="286"/>
<location filename="../../src/configdialog.ui" line="278"/>
<location filename="../../src/configdialog.cpp" line="69"/>
<source>None</source>
<translation>Keine</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="291"/>
<location filename="../../src/configdialog.ui" line="283"/>
<source>2</source>
<translation></translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="296"/>
<location filename="../../src/configdialog.ui" line="288"/>
<source>4</source>
<translation></translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="301"/>
<location filename="../../src/configdialog.ui" line="293"/>
<source>5</source>
<translation></translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="306"/>
<location filename="../../src/configdialog.ui" line="298"/>
<source>10</source>
<translation></translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="350"/>
<location filename="../../src/configdialog.ui" line="342"/>
<source>Threads for map:</source>
<translation>Threads für die Karte:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="378"/>
<location filename="../../src/configdialog.ui" line="370"/>
<source>System</source>
<translation>System</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="383"/>
<location filename="../../src/configdialog.ui" line="375"/>
<source>Dark</source>
<translation>Dunkel</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="239"/>
<location filename="../../src/configdialog.ui" line="231"/>
<source>Edit map visibility limits...</source>
<translation>Struktursichtbarkeit editieren...</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="225"/>
<location filename="../../src/configdialog.ui" line="217"/>
<source>Edit biome colors...</source>
<translation>Biomfarben editieren...</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="215"/>
<location filename="../../src/configdialog.ui" line="207"/>
<source>[none]</source>
<translation>[keine]</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="159"/>
<location filename="../../src/configdialog.ui" line="151"/>
<source>Use a fixed grid in blocks instead of outlining the generated map tiles
Leave blank for the default behaviour</source>
<translation>Manueller Rasterabstand, ansonsten wird ein Umriss um jedes Kartensegment gezeichnet
leer lassen für das Standardverhalten</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="163"/>
<location filename="../../src/configdialog.ui" line="155"/>
<source>Custom grid spacing:</source>
<translation>Rasterabstand:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="170"/>
<location filename="../../src/configdialog.ui" line="162"/>
<source>Map cache size:</source>
<translation>Cache für Karte:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="198"/>
<location filename="../../src/configdialog.ui" line="190"/>
<source>Biome color customization:</source>
<translation>Biomfarbendefinition:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="246"/>
<location filename="../../src/configdialog.ui" line="238"/>
<source>GUI style:</source>
<translation>GUI Style:</translation>
</message>
<message>
<location filename="../../src/configdialog.ui" line="177"/>
<location filename="../../src/configdialog.ui" line="169"/>
<source>Language:</source>
<translation>Sprache:</translation>
</message>
@ -3484,8 +3484,8 @@ Trozdem fortfahren?</translation>
</message>
<message>
<location filename="../../src/mainwindow.ui" line="686"/>
<source>Structure visibility...</source>
<translation>Strukturanzeige...</translation>
<source>Map toolbar options...</source>
<translation>Kartenwerkzeuge...</translation>
</message>
<message>
<location filename="../../src/mainwindow.ui" line="694"/>
@ -3569,8 +3569,8 @@ Trozdem fortfahren?</translation>
</message>
<message>
<location filename="../../src/mainwindow.ui" line="776"/>
<location filename="../../src/mainwindow.cpp" line="864"/>
<location filename="../../src/mainwindow.cpp" line="1099"/>
<location filename="../../src/mainwindow.cpp" line="876"/>
<location filename="../../src/mainwindow.cpp" line="1113"/>
<source>Undock map</source>
<translation>Karte ausdocken</translation>
</message>
@ -3625,117 +3625,127 @@ Trozdem fortfahren?</translation>
<translation>Goto origin</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="135"/>
<location filename="../../src/mainwindow.cpp" line="131"/>
<source>Zoom In</source>
<translation>Vergrößern</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="132"/>
<source>Zoom Out</source>
<translation>Verkleinern</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="142"/>
<source>Overworld</source>
<translation>Oberwelt</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="136"/>
<location filename="../../src/mainwindow.cpp" line="143"/>
<source>Nether</source>
<translation>Nether</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="137"/>
<location filename="../../src/mainwindow.cpp" line="144"/>
<source>End</source>
<translation>Ende</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="195"/>
<location filename="../../src/mainwindow.cpp" line="202"/>
<source>Conditions</source>
<translation>Bedingungen</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="198"/>
<location filename="../../src/mainwindow.cpp" line="205"/>
<source>Help: Conditions</source>
<translation>Hilfe: Bedingungen</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="199"/>
<location filename="../../src/mainwindow.cpp" line="206"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The search conditions define the properties by which potential seeds are filtered.&lt;/p&gt;&lt;p&gt;Conditions can reference each other to produce relative positional dependencies (indicated with the ID in square brackets [XY]). When a condition passes its check, it usually yields just one location that other conditions can reference. An exception to this are structure conditions with exactly one required instance. In this case, each found structure occurence is examined separately instead. On the other hand, a condition that checks for a structure cluster, will average the position of all occurences and yield a single position.&lt;/p&gt;&lt;p&gt;Standard biome conditions yield the center of the testing area as they evaluate the area as a whole. To locate the position of a given biome you can use the designated &lt;b&gt;locate&lt;/b&gt; filters, or use a spiral iterator to scan an area with a localized condition.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="223"/>
<location filename="../../src/mainwindow.cpp" line="230"/>
<source>Seed generator (48-bit)</source>
<translation>Seedgenerator (48-bit)</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="226"/>
<location filename="../../src/mainwindow.cpp" line="233"/>
<source>Help: Seed generator</source>
<translation>Hilfe: Seedgenerator</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="227"/>
<location filename="../../src/mainwindow.cpp" line="234"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;For some searches, the 48-bit structure seed candidates can be generated without searching, which can vastly reduce the search space that has to be checked.&lt;/p&gt;&lt;p&gt;The generator mode &lt;b&gt;Auto&lt;/b&gt; is recommended for general use, which automatically selects suitable options based on the conditions list.&lt;/p&gt;&lt;p&gt;The &lt;b&gt;Quad-feature&lt;/b&gt; mode produces candidates for quad&amp;#8209;structures that have a uniform distribution of region&amp;#8209;size=32 and chunk&amp;#8209;gap=8, such as swamp huts.&lt;/p&gt;&lt;p&gt;A perfect &lt;b&gt;Quad-monument&lt;/b&gt; structure constellation does not actually exist, but some extremely rare structure seed bases get close, with over 90&amp;#37; of the area within 128 blocks. The generator uses a precomputed list of these seed bases.&lt;/p&gt;&lt;p&gt;Using a &lt;b&gt;Seed list&lt;/b&gt; you can provide a custom set of 48-bit candidates. Optionally, a salt value can be added and the seeds can be region transposed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="251"/>
<location filename="../../src/mainwindow.cpp" line="258"/>
<source>Matching seeds</source>
<translation>Passende Seeds</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="257"/>
<location filename="../../src/mainwindow.cpp" line="264"/>
<source>Help: Matching seeds</source>
<translation>Hilfe: Passende Seeds</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="258"/>
<location filename="../../src/mainwindow.cpp" line="265"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The list of seeds acts as a buffer onto which suitable seeds are added when they are found. You can also copy the seed list, or paste seeds into the list. Selecting a seed will open it in the map view.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="312"/>
<location filename="../../src/mainwindow.cpp" line="319"/>
<source>Show %1</source>
<translation>%1 anzeigen</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="706"/>
<location filename="../../src/mainwindow.cpp" line="718"/>
<source>text</source>
<comment>Seed input type</comment>
<translatorcomment>Seed-Eingabetyp</translatorcomment>
<translation>Text</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="708"/>
<location filename="../../src/mainwindow.cpp" line="720"/>
<source>random</source>
<comment>Seed input type</comment>
<translatorcomment>Seed-Eingabetyp</translatorcomment>
<translation>zufällig</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="716"/>
<location filename="../../src/mainwindow.cpp" line="728"/>
<source>Save progress</source>
<translation>Vortschritt speichern</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="716"/>
<location filename="../../src/mainwindow.cpp" line="728"/>
<location filename="../../src/mainwindow.cpp" line="740"/>
<source>Text files (*.txt);;Any files (*)</source>
<translation>Textdateien (*.txt);;Alle Dateien (*)</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="728"/>
<location filename="../../src/mainwindow.cpp" line="740"/>
<source>Load progress</source>
<translation>Vortschritt laden</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="850"/>
<location filename="../../src/mainwindow.cpp" line="862"/>
<source>Save screenshot</source>
<translation>Screenshot speichern</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="850"/>
<location filename="../../src/mainwindow.cpp" line="862"/>
<source>Images (*.png *.jpg *.ppm)</source>
<translation>Bilder (*.png *.jpg *.ppm)</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="870"/>
<location filename="../../src/mainwindow.cpp" line="882"/>
<source>Redock map</source>
<translation>Karte andocken</translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="983"/>
<location filename="../../src/mainwindow.cpp" line="995"/>
<source>The application will need to be restarted before all changes can take effect.</source>
<translation>Die Anwendung muss neugestartet werden um alle Änderungen wirksam zu machen.</translation>
</message>
@ -3873,6 +3883,31 @@ Trozdem fortfahren?</translation>
<translation>Endtransitportale</translation>
</message>
</context>
<context>
<name>MapToolsDialog</name>
<message>
<location filename="../../src/maptoolsdialog.ui" line="6"/>
<source>Map Toolbar Options</source>
<translation>Kartenwerkzeuge</translation>
</message>
<message>
<location filename="../../src/maptoolsdialog.ui" line="43"/>
<source>Zoom In/Out</source>
<translation>Zoom</translation>
</message>
<message>
<location filename="../../src/maptoolsdialog.ui" line="56"/>
<source>Maximum visible scale
(blocks per pixel)</source>
<translation>Maximaler Maßstab
(Meter pro Pixel)</translation>
</message>
<message>
<location filename="../../src/maptoolsdialog.ui" line="71"/>
<source>Enabled tools</source>
<translation>Atkive Werkzeuge</translation>
</message>
</context>
<context>
<name>MapView</name>
<message>
@ -4395,29 +4430,6 @@ Weiter auf den Stop der Threads warten?</numerusform>
<translation>(gebündelt)</translation>
</message>
</context>
<context>
<name>StructureDialog</name>
<message>
<location filename="../../src/structuredialog.ui" line="6"/>
<source>Structure Visibility</source>
<translation>Struktursichtbarkeit</translation>
</message>
<message>
<location filename="../../src/structuredialog.ui" line="26"/>
<source>Maximum scale for structure visibility</source>
<translation>Maximaler Maßstab für Struktursichtbarkeit</translation>
</message>
<message>
<location filename="../../src/structuredialog.cpp" line="22"/>
<source>enabled</source>
<translation>Aktiv</translation>
</message>
<message>
<location filename="../../src/structuredialog.cpp" line="23"/>
<source>blocks per pixel</source>
<translation>Meter pro Pixel</translation>
</message>
</context>
<context>
<name>TabBiomes</name>
<message>

View File

@ -4,7 +4,7 @@
<context>
<name>ConfigDialog</name>
<message numerus="yes">
<location filename="../../src/configdialog.cpp" line="137"/>
<location filename="../../src/configdialog.cpp" line="146"/>
<source>[%n biome(s)] %1</source>
<translation>
<numerusform>[%n biome] %1</numerusform>
@ -15,7 +15,7 @@
<context>
<name>FormConditions</name>
<message numerus="yes">
<location filename="../../src/formconditions.cpp" line="260"/>
<location filename="../../src/formconditions.cpp" line="295"/>
<source>Cut %n condition(s)</source>
<translation>
<numerusform>Cut %n condition</numerusform>
@ -23,8 +23,8 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/formconditions.cpp" line="265"/>
<location filename="../../src/formconditions.cpp" line="283"/>
<location filename="../../src/formconditions.cpp" line="300"/>
<location filename="../../src/formconditions.cpp" line="318"/>
<source>Copy %n condition(s)</source>
<translation>
<numerusform>Copy %n condition</numerusform>
@ -32,7 +32,7 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/formconditions.cpp" line="271"/>
<location filename="../../src/formconditions.cpp" line="306"/>
<source>Paste %n condition(s)</source>
<translation>
<numerusform>Paste %n condition</numerusform>
@ -40,7 +40,7 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/formconditions.cpp" line="276"/>
<location filename="../../src/formconditions.cpp" line="311"/>
<source>Remove %n condition(s)</source>
<translation>
<numerusform>Remove %n condition</numerusform>
@ -51,7 +51,7 @@
<context>
<name>FormGen48</name>
<message numerus="yes">
<location filename="../../src/formgen48.cpp" line="144"/>
<location filename="../../src/formgen48.cpp" line="140"/>
<source>[%n seed(s)] %1</source>
<translation>
<numerusform>[%n seed] %1</numerusform>
@ -62,7 +62,7 @@
<context>
<name>FormSearchControl</name>
<message numerus="yes">
<location filename="../../src/formsearchcontrol.cpp" line="443"/>
<location filename="../../src/formsearchcontrol.cpp" line="461"/>
<source>Paste %n seed(s) from clipboard</source>
<translation>
<numerusform>Paste %n seed from clipboard</numerusform>
@ -73,7 +73,7 @@
<context>
<name>SearchMaster</name>
<message numerus="yes">
<location filename="../../src/searchthread.cpp" line="165"/>
<location filename="../../src/searchthread.cpp" line="276"/>
<source>Biome condition with ID %1 includes %n biome(s) that do not generate in MC %2.</source>
<translation>
<numerusform>Biome condition with ID %1 includes %n biome that does not generate in MC %2.</numerusform>
@ -81,7 +81,7 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/searchthread.cpp" line="560"/>
<location filename="../../src/searchthread.cpp" line="690"/>
<source>Failed to stop %n worker thread(s).
Keep waiting for threads to stop?</source>
<translation>

View File

@ -260,29 +260,46 @@ MapConfig::MapConfig(bool init)
opts[0].scale = -1;
}
bool MapConfig::equals(const MapConfig& a) const
bool MapConfig::hasScale(int opt) const
{
return opt >= D_DESERT && opt <= D_STRONGHOLD;
}
int MapConfig::getDim(int opt) const
{
if (opt >= D_PORTALN && opt <= D_BASTION) return DIM_NETHER;
if (opt >= D_ENDCITY && opt <= D_GATEWAY) return DIM_END;
return DIM_OVERWORLD;
};
int MapConfig::getTileSize(int opt) const
{
if (opt == D_MANSION)
return 1280 * 16;
return 512 * 16;
}
bool MapConfig::sameMapOpts(const MapConfig& a) const
{
return memcmp(opts, a.opts, sizeof(opts)) == 0;
}
void MapConfig::reset()
{
for (int i = D_DESERT; i < D_SPAWN; i++)
for (int i = 0; i < D_STRUCT_NUM; i++)
{
opts[i].scale = 32;
opts[i].scale = hasScale(i) ? 32 : 1;
opts[i].enabled = true;
opts[i].valid = true;
}
opts[D_GEODE].scale = 16;
zoomEnabled = false;
}
void MapConfig::load(QSettings& settings)
{
reset();
for (int opt = D_DESERT; opt < D_SPAWN; opt++)
for (int opt = 0; opt < D_STRUCT_NUM; opt++)
{
if (!valid(opt))
continue;
const char *name = mapopt2str(opt);
double x = scale(opt);
if (!enabled(opt))
@ -291,18 +308,21 @@ void MapConfig::load(QSettings& settings)
opts[opt].scale = fabs(x);
opts[opt].enabled = x > 0;
}
zoomEnabled = settings.value("structscale/zoom", zoomEnabled).toBool();
}
void MapConfig::save(QSettings& settings)
{
for (int opt = D_DESERT; opt < D_SPAWN; opt++)
for (int opt = 0; opt < D_STRUCT_NUM; opt++)
{
const char *name = mapopt2str(opt);
double x = scale(opt);
if (x == 0) x = 1;
if (!enabled(opt))
x = -x;
settings.setValue(QString("structscale/") + name, x);
}
settings.setValue(QString("structscale/zoom"), zoomEnabled);
}
void Config::reset()

View File

@ -140,18 +140,20 @@ struct MapConfig
{
double scale;
bool enabled;
bool valid;
Opt() : scale(),enabled(),valid() {}
Opt() : scale(),enabled() {}
};
Opt opts[D_STRUCT_NUM];
bool zoomEnabled;
MapConfig(bool init = true);
double scale(int opt) const { return opts[opt].scale; }
bool enabled(int opt) const { return opts[opt].enabled; }
bool valid(int opt) const { return (unsigned)opt < D_STRUCT_NUM && opts[opt].valid; }
bool hasScale(int opt) const;
int getDim(int opt) const;
int getTileSize(int opt) const;
bool equals(const MapConfig& a) const;
bool sameMapOpts(const MapConfig& a) const;
void reset();
void load(QSettings& settings);

View File

@ -2,7 +2,7 @@
#include "ui_configdialog.h"
#include "biomecolordialog.h"
#include "structuredialog.h"
#include "maptoolsdialog.h"
#include "world.h"
#include "cutil.h"
@ -195,7 +195,7 @@ void ConfigDialog::on_buttonBiomeColor_clicked()
void ConfigDialog::on_buttonStructVisEdit_clicked()
{
StructureDialog *dialog = new StructureDialog(this);
MapToolsDialog *dialog = new MapToolsDialog(this);
connect(dialog, SIGNAL(updateMapConfig()), this, SLOT(onUpdateMapConfig()));
dialog->show();
}

View File

@ -6,7 +6,7 @@
#include "conditiondialog.h"
#include "extgendialog.h"
#include "biomecolordialog.h"
#include "structuredialog.h"
#include "maptoolsdialog.h"
#include "exportdialog.h"
#include "layerdialog.h"
#include "tabtriggers.h"
@ -127,9 +127,16 @@ MainWindow::MainWindow(QString sessionpath, QString resultspath, QWidget *parent
addAction(act);
}
QAction *toorigin = new QAction(QIcon(":/icons/origin.png"), tr("Goto origin"), this);
connect(toorigin, &QAction::triggered, [=](){ this->mapGoto(0,0,16); });
ui->toolBar->addAction(toorigin);
acthome = new QAction(QIcon(":/icons/origin.png"), tr("Goto origin"), this);
actzoom[0] = new QAction(QIcon(":/icons/zoom_in.png"), tr("Zoom In"), this);
actzoom[1] = new QAction(QIcon(":/icons/zoom_out.png"), tr("Zoom Out"), this);
connect(acthome, &QAction::triggered, [=](){ this->mapGoto(0,0,16); });
connect(actzoom[0], &QAction::triggered, [=](){ this->mapZoom(pow(2.0, +0.5)); });
connect(actzoom[1], &QAction::triggered, [=](){ this->mapZoom(pow(2.0, -0.5)); });
ui->toolBar->addAction(acthome);
ui->toolBar->addAction(actzoom[0]);
ui->toolBar->addAction(actzoom[1]);
ui->toolBar->addSeparator();
dimactions[0] = addMapAction(":/icons/overworld", tr("Overworld"));
@ -669,6 +676,11 @@ void MainWindow::mapGoto(qreal x, qreal z, qreal scale)
getMapView()->setView(x, z, scale);
}
void MainWindow::mapZoom(qreal factor)
{
getMapView()->zoom(factor);
}
void MainWindow::setBiomeColorRc(QString rc)
{
config.biomeColorPath = rc;
@ -762,9 +774,9 @@ void MainWindow::on_actionOpenShadow_triggered()
}
}
void MainWindow::on_actionStructure_visibility_triggered()
void MainWindow::on_actionToolbarConfig_triggered()
{
StructureDialog *dialog = new StructureDialog(this);
MapToolsDialog *dialog = new MapToolsDialog(this);
connect(dialog, SIGNAL(updateMapConfig()), this, SLOT(onUpdateMapConfig()));
dialog->show();
}
@ -1037,16 +1049,18 @@ void MainWindow::onUpdateMapConfig()
MapConfig old = mconfig;
mconfig.load();
if (!old.equals(mconfig))
if (!old.sameMapOpts(mconfig))
{
for (int opt = D_GRID; opt < D_STRUCT_NUM; opt++)
for (int opt = 0; opt < D_STRUCT_NUM; opt++)
{
if (saction[opt] && mconfig.valid(opt))
saction[opt]->setVisible(mconfig.enabled(opt));
if (QAction *act = saction[opt])
act->setVisible(mconfig.enabled(opt));
}
getMapView()->deleteWorld();
updateMapSeed();
}
actzoom[0]->setVisible(mconfig.zoomEnabled);
actzoom[1]->setVisible(mconfig.zoomEnabled);
}
void MainWindow::onBiomeColorChange()

View File

@ -72,6 +72,7 @@ signals:
public slots:
void mapGoto(qreal x, qreal z, qreal scale);
void mapZoom(qreal factor);
void setBiomeColorRc(QString rc);
private slots:
@ -87,7 +88,7 @@ private slots:
void on_actionPreferences_triggered();
void on_actionGo_to_triggered();
void on_actionOpenShadow_triggered();
void on_actionStructure_visibility_triggered();
void on_actionToolbarConfig_triggered();
void on_actionBiome_colors_triggered();
void on_actionPresetLoad_triggered();
void on_actionExamples_triggered();
@ -139,6 +140,8 @@ public:
QVector<QAction*> laction;
QVector<QAction*> saction;
QAction *acthome;
QAction *actzoom[2];
QAction *dimactions[3];
QActionGroup *dimgroup;
};

View File

@ -474,7 +474,7 @@ QToolButton:checked {
<addaction name="actionScreenshot"/>
<addaction name="actionExportImg"/>
<addaction name="actionBiome_colors"/>
<addaction name="actionStructure_visibility"/>
<addaction name="actionToolbarConfig"/>
<addaction name="separator"/>
</widget>
<widget class="QMenu" name="menuHelp">
@ -681,9 +681,9 @@ QToolButton:checked {
<string>Export biomes as image...</string>
</property>
</action>
<action name="actionStructure_visibility">
<action name="actionToolbarConfig">
<property name="text">
<string>Structure visibility...</string>
<string>Map toolbar options...</string>
</property>
</action>
<action name="actionParaTemperature">

View File

@ -1,5 +1,5 @@
#include "structuredialog.h"
#include "ui_structuredialog.h"
#include "maptoolsdialog.h"
#include "ui_maptoolsdialog.h"
#include <QLabel>
#include <QCheckBox>
@ -10,41 +10,39 @@
#include "cutil.h"
#include "world.h"
StructureDialog::StructureDialog(QWidget *parent)
MapToolsDialog::MapToolsDialog(QWidget *parent)
: QDialog(parent)
, ui(new Ui::StructureDialog)
, ui(new Ui::MapToolsDialog)
, mconfig()
, modified()
{
ui->setupUi(this);
QGridLayout *grid = new QGridLayout(ui->groupVis);
QGridLayout *grid = (QGridLayout*) ui->scrollContent->layout();
grid->addWidget(new QLabel(tr("Enabled map options")), 0, 0, 1, 3);
grid->addWidget(new QLabel(tr("Maximum visible scale\n(blocks per pixel)")), 0, 3);
int i = 1;
for (int opt = D_GRID; opt < D_SPAWN; opt++)
int i = grid->rowCount();
for (int opt = 0; opt < D_STRUCT_NUM; opt++)
{
if (!mconfig.valid(opt))
if (opt == D_PORTALN)
continue;
int j = 0;
QCheckBox *check = new QCheckBox();
vui[opt].check = check;
grid->addWidget(check, i, j++);
grid->addWidget(check, i, 0);
QLabel *icon = new QLabel();
icon->setPixmap(getMapIcon(opt));
grid->addWidget(icon, i, j++);
icon->setPixmap(QPixmap(QString(":/icons/") + mapopt2str(opt)));
grid->addWidget(icon, i, 1);
QString name = mapopt2display(opt);
QLabel *label = new QLabel(name + ":");
grid->addWidget(label, i, j++);
QLabel *label = new QLabel(mapopt2display(opt));
grid->addWidget(label, i, 2);
QLineEdit *line = new QLineEdit();
line->setValidator(new QDoubleValidator(0.125, 256.0, 3, grid));
vui[opt].line = line;
grid->addWidget(line, i, j++);
if (mconfig.hasScale(opt))
{
label->setText(label->text() + ":");
QLineEdit *line = new QLineEdit();
line->setValidator(new QDoubleValidator(0.125, 256.0, 3, grid));
vui[opt].line = line;
grid->addWidget(line, i, 3);
}
i++;
}
@ -52,23 +50,24 @@ StructureDialog::StructureDialog(QWidget *parent)
refresh();
}
StructureDialog::~StructureDialog()
MapToolsDialog::~MapToolsDialog()
{
delete ui;
}
void StructureDialog::refresh()
void MapToolsDialog::refresh()
{
for (int opt = D_DESERT; opt < D_SPAWN; opt++)
for (int opt = 0; opt < D_STRUCT_NUM; opt++)
{
if (vui[opt].check)
vui[opt].check->setChecked(mconfig.enabled(opt));
if (vui[opt].line)
vui[opt].line->setText(QString::number(mconfig.scale(opt)));
}
ui->checkZoom->setChecked(mconfig.zoomEnabled);
}
void StructureDialog::on_buttonBox_clicked(QAbstractButton *button)
void MapToolsDialog::on_buttonBox_clicked(QAbstractButton *button)
{
int role = ui->buttonBox->buttonRole(button);
if (role == QDialogButtonBox::ResetRole)
@ -78,7 +77,7 @@ void StructureDialog::on_buttonBox_clicked(QAbstractButton *button)
}
else if (role == QDialogButtonBox::AcceptRole || role == QDialogButtonBox::ApplyRole)
{
for (int opt = D_DESERT; opt < D_SPAWN; opt++)
for (int opt = 0; opt < D_STRUCT_NUM; opt++)
{
MapConfig::Opt *p_opt = &mconfig.opts[opt];
if (vui[opt].check)
@ -98,6 +97,8 @@ void StructureDialog::on_buttonBox_clicked(QAbstractButton *button)
}
}
}
mconfig.opts[D_PORTALN] = mconfig.opts[D_PORTAL];
mconfig.zoomEnabled = ui->checkZoom->isChecked();
mconfig.save();
emit updateMapConfig();
}

View File

@ -1,5 +1,5 @@
#ifndef STRUCTUREDIALOG_H
#define STRUCTUREDIALOG_H
#ifndef MAPTOOLSDIALOG_H
#define MAPTOOLSDIALOG_H
#include <QDialog>
#include <QAbstractButton>
@ -7,19 +7,19 @@
#include "config.h"
namespace Ui {
class StructureDialog;
class MapToolsDialog;
}
class QCheckBox;
class QLineEdit;
class StructureDialog : public QDialog
class MapToolsDialog : public QDialog
{
Q_OBJECT
public:
explicit StructureDialog(QWidget *parent = nullptr);
~StructureDialog();
explicit MapToolsDialog(QWidget *parent = nullptr);
~MapToolsDialog();
void refresh();
@ -30,7 +30,7 @@ signals:
void updateMapConfig();
private:
Ui::StructureDialog *ui;
Ui::MapToolsDialog *ui;
struct VisUi
{
QCheckBox *check;
@ -43,4 +43,4 @@ public:
bool modified;
};
#endif // STRUCTUREDIALOG_H
#endif // MAPTOOLSDIALOG_H

125
src/maptoolsdialog.ui Normal file
View File

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MapToolsDialog</class>
<widget class="QDialog" name="MapToolsDialog">
<property name="windowTitle">
<string>Map Toolbar Options</string>
</property>
<property name="windowIcon">
<iconset resource="../rc/icons.qrc">
<normaloff>:/icons/logo.png</normaloff>:/icons/logo.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollContent">
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../rc/icons.qrc">:/icons/zoom.png</pixmap>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Zoom In/Out</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Maximum visible scale
(blocks per pixel)</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="4">
<widget class="Line" name="lineH">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label">
<property name="text">
<string>Enabled tools</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkZoom">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../rc/icons.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>MapToolsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>MapToolsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -200,7 +200,7 @@ void MapView::settingsToWorld()
if (!world)
return;
for (int s = 0; s < D_STRUCT_NUM; s++)
world->sshow[s] = sshow[s];
world->sshow[s] = sshow[s] && world->mconfig.enabled(s);
world->showBB = config.showBBoxes;
world->gridspacing = config.gridSpacing;
world->gridmultiplier = config.gridMultiplier;

View File

@ -1,77 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>StructureDialog</class>
<widget class="QDialog" name="StructureDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>413</width>
<height>86</height>
</rect>
</property>
<property name="windowTitle">
<string>Structure Visibility</string>
</property>
<property name="windowIcon">
<iconset resource="../rc/icons.qrc">
<normaloff>:/icons/logo.png</normaloff>:/icons/logo.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupVis">
<property name="title">
<string>Maximum scale for structure visibility</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../rc/icons.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>StructureDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>StructureDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -25,6 +25,7 @@ const QPixmap& getMapIcon(int opt, VarPos *vp)
init = true;
for (int sopt = D_DESERT; sopt <= D_STRONGHOLD; sopt++)
icons[sopt] = QPixmap(QString(":/icons/") + mapopt2str(sopt) + ".png");
icons[D_PORTALN] = icons[D_PORTAL];
iconzvil = QPixmap(":/icons/zombie.png");
icongiant = QPixmap(":/icons/portal_giant.png");
iconship = QPixmap(":/icons/end_ship.png");
@ -573,17 +574,17 @@ void Level::init4map(QWorld *w, int pix, int layerscale)
}
}
void Level::init4struct(QWorld *w, int dim, int blocks, double vis, int sopt)
void Level::init4struct(QWorld *w, int sopt)
{
this->world = w;
this->wi = w->wi;
this->dim = dim;
this->blocks = blocks;
this->dim = w->mconfig.getDim(sopt);
this->blocks = w->mconfig.getTileSize(sopt);
this->pixs = -1;
this->scale = -1;
this->sopt = sopt;
this->lopt = w->lopt;
this->vis = vis;
this->vis = 1.0 / w->mconfig.scale(sopt);
this->isdel = &w->isdel;
}
@ -722,6 +723,7 @@ QWorld::QWorld(WorldInfo wi, int dim, LayerOpt lopt)
: QObject()
, wi(wi)
, dim(dim)
, mconfig()
, lopt(lopt)
, lvb()
, lvs()
@ -762,26 +764,12 @@ QWorld::QWorld(WorldInfo wi, int dim, LayerOpt lopt)
setDim(dim, lopt);
QSettings settings(APP_STRING, APP_STRING);
MapConfig mconfig;
mconfig.load(settings);
lvs.resize(D_SPAWN);
for (int opt = D_DESERT; opt < D_SPAWN; opt++)
{
if (!mconfig.enabled(opt))
continue;
int sdim = 0, qsiz = 512*16;
switch (opt) {
case D_PORTALN: sdim = -1; break;
case D_FORTESS: sdim = -1; break;
case D_BASTION: sdim = -1; break;
case D_ENDCITY: sdim = +1; break;
case D_GATEWAY: sdim = +1; break;
case D_MANSION: qsiz = 1280*16; break;
}
double v = 1.0 / mconfig.scale(opt);
lvs[opt].init4struct(this, sdim, qsiz, v, opt);
}
if (mconfig.enabled(opt))
lvs[opt].init4struct(this, opt);
memset(sshow, 0, sizeof(sshow));
}

View File

@ -89,7 +89,7 @@ struct Level
~Level();
void init4map(QWorld *world, int pix, int layerscale);
void init4struct(QWorld *world, int dim, int blocks, double vis, int sopt);
void init4struct(QWorld *world, int sopt);
void resizeLevel(std::vector<Quad*>& cache, int64_t x, int64_t z, int64_t w, int64_t h);
void update(std::vector<Quad*>& cache, qreal bx0, qreal bz0, qreal bx1, qreal bz1);
@ -169,6 +169,7 @@ signals:
public:
WorldInfo wi;
int dim;
MapConfig mconfig;
LayerOpt lopt;
Generator g;
SurfaceNoise sn;