diff --git a/core/assets-raw/sprites/ui/icons/icon-database.png b/core/assets-raw/sprites/ui/icons/icon-database.png new file mode 100644 index 0000000000..f5bc48c80d Binary files /dev/null and b/core/assets-raw/sprites/ui/icons/icon-database.png differ diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index 0d307368c2..d79f35e02e 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -8918,48 +8918,55 @@ icon-cursor orig: 10, 10 offset: 0, 0 index: -1 -icon-dev-builds +icon-database rotate: false xy: 1363, 545 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -icon-discord +icon-dev-builds rotate: false xy: 1837, 541 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -icon-donate +icon-discord rotate: false xy: 1863, 473 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -icon-dots +icon-donate rotate: false xy: 1889, 439 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -icon-editor +icon-dots rotate: false xy: 1351, 409 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -icon-egg +icon-editor rotate: false xy: 1380, 375 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 +icon-egg + rotate: false + xy: 1407, 307 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 icon-elevation rotate: false xy: 433, 27 @@ -8976,7 +8983,7 @@ icon-eraser index: -1 icon-exit rotate: false - xy: 1407, 307 + xy: 579, 191 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -8997,7 +9004,7 @@ icon-file-image index: -1 icon-file-text rotate: false - xy: 579, 191 + xy: 997, 141 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9011,7 +9018,7 @@ icon-fill index: -1 icon-floppy rotate: false - xy: 997, 141 + xy: 1433, 273 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9025,14 +9032,14 @@ icon-floppy-16 index: -1 icon-folder rotate: false - xy: 1433, 273 + xy: 1767, 903 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-folder-parent rotate: false - xy: 1767, 903 + xy: 513, 191 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9046,14 +9053,14 @@ icon-generated index: -1 icon-github rotate: false - xy: 513, 191 + xy: 513, 175 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-google-play rotate: false - xy: 513, 175 + xy: 1867, 253 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9081,28 +9088,28 @@ icon-holdDelete index: -1 icon-home rotate: false - xy: 1867, 253 + xy: 1031, 114 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-host rotate: false - xy: 1031, 114 + xy: 845, 971 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-info rotate: false - xy: 845, 971 + xy: 1843, 801 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-itch.io rotate: false - xy: 1843, 801 + xy: 1757, 407 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9130,7 +9137,7 @@ icon-line index: -1 icon-link rotate: false - xy: 1757, 407 + xy: 535, 1084 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9144,7 +9151,7 @@ icon-liquid-small index: -1 icon-load rotate: false - xy: 535, 1084 + xy: 1553, 779 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9186,7 +9193,7 @@ icon-logic index: -1 icon-map rotate: false - xy: 1553, 779 + xy: 569, 457 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9270,7 +9277,7 @@ icon-pencil index: -1 icon-pencil-small rotate: false - xy: 569, 457 + xy: 623, 907 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9291,14 +9298,14 @@ icon-play index: -1 icon-play-2 rotate: false - xy: 623, 907 + xy: 1363, 529 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-play-custom rotate: false - xy: 1363, 529 + xy: 579, 175 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9326,7 +9333,7 @@ icon-power-small index: -1 icon-quit rotate: false - xy: 579, 175 + xy: 2009, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9340,14 +9347,14 @@ icon-redo index: -1 icon-refresh rotate: false - xy: 2009, 1 + xy: 1031, 98 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rename rotate: false - xy: 1031, 98 + xy: 2025, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9361,35 +9368,35 @@ icon-resize index: -1 icon-rotate rotate: false - xy: 2025, 1 + xy: 2033, 541 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-arrow rotate: false - xy: 2033, 541 + xy: 2033, 525 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-left rotate: false - xy: 2033, 525 + xy: 2033, 509 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-right rotate: false - xy: 2033, 509 + xy: 2033, 493 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-save rotate: false - xy: 2033, 493 + xy: 1879, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9431,7 +9438,7 @@ icon-terrain index: -1 icon-tools rotate: false - xy: 1879, 1 + xy: 1895, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9452,7 +9459,7 @@ icon-touchDelete index: -1 icon-trash rotate: false - xy: 1895, 1 + xy: 1911, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9480,14 +9487,14 @@ icon-tree-locked index: -1 icon-trello rotate: false - xy: 1911, 1 + xy: 1927, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-tutorial rotate: false - xy: 1927, 1 + xy: 451, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9508,14 +9515,14 @@ icon-unlocked index: -1 icon-unlocks rotate: false - xy: 451, 1 + xy: 467, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-wiki rotate: false - xy: 467, 1 + xy: 483, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -9543,7 +9550,7 @@ icon-zoom index: -1 icon-zoom-small rotate: false - xy: 483, 1 + xy: 2033, 477 size: 14, 14 orig: 14, 14 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 5875b0e7ba..cc76ebfda7 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/ui/dialogs/DatabaseDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/DatabaseDialog.java index 879a9340e1..1ef64d2c51 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/DatabaseDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/DatabaseDialog.java @@ -1,19 +1,17 @@ package io.anuke.mindustry.ui.dialogs; import io.anuke.arc.collection.Array; -import io.anuke.mindustry.Vars; -import io.anuke.mindustry.game.Content; -import io.anuke.mindustry.game.UnlockableContent; -import io.anuke.mindustry.graphics.Pal; -import io.anuke.mindustry.type.ContentType; import io.anuke.arc.scene.event.HandCursorListener; import io.anuke.arc.scene.ui.Image; import io.anuke.arc.scene.ui.ScrollPane; import io.anuke.arc.scene.ui.Tooltip; import io.anuke.arc.scene.ui.layout.Table; import io.anuke.arc.scene.utils.UIUtils; - -import static io.anuke.mindustry.Vars.*; +import io.anuke.mindustry.Vars; +import io.anuke.mindustry.game.Content; +import io.anuke.mindustry.game.UnlockableContent; +import io.anuke.mindustry.graphics.Pal; +import io.anuke.mindustry.type.ContentType; public class DatabaseDialog extends FloatingDialog{ @@ -56,11 +54,11 @@ public class DatabaseDialog extends FloatingDialog{ for(int i = 0; i < array.size; i++){ UnlockableContent unlock = (UnlockableContent) array.get(i); - Image image = data.isUnlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image("icon-tree-locked"); + Image image = unlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image("icon-tree-locked"); image.addListener(new HandCursorListener()); list.add(image).size(size).pad(3); - if(data.isUnlocked(unlock)){ + if(unlocked(unlock)){ image.clicked(() -> Vars.ui.content.show(unlock)); image.addListener(new Tooltip<>(new Table("button"){{ add(unlock.localizedName()); @@ -77,4 +75,8 @@ public class DatabaseDialog extends FloatingDialog{ cont.add(pane); } + + boolean unlocked(UnlockableContent content){ + return !Vars.world.isZone() || content.unlocked(); + } } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java index 4ad7908bec..7e95935bef 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java @@ -63,7 +63,7 @@ public class FloatingDialog extends Dialog{ @Override public void addCloseButton(){ - buttons.addImageTextButton("$back", "icon-arrow-left", 30f, this::hide).size(230f, 64f); + buttons.addImageTextButton("$back", "icon-arrow-left", 30f, this::hide).size(210f, 64f); keyDown(key -> { if(key == KeyCode.ESCAPE || key == KeyCode.BACK) { diff --git a/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java index 76cb78078f..d6d775f3c0 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java @@ -40,7 +40,11 @@ public class PausedDialog extends FloatingDialog{ cont.addButton("$back", this::hide).colspan(2).width(dw*2 + 20f); cont.row(); - cont.addButton("$techtree", ui.tech::show); + if(world.isZone()){ + cont.addButton("$techtree", ui.tech::show); + }else{ + cont.addButton("$database", ui.database::show); + } cont.addButton("$settings", ui.settings::show); if(!world.isZone()){ diff --git a/core/src/io/anuke/mindustry/ui/dialogs/TechTreeDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/TechTreeDialog.java index 01f140c155..5401b901f6 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/TechTreeDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/TechTreeDialog.java @@ -47,6 +47,11 @@ public class TechTreeDialog extends FloatingDialog{ shown(() -> checkNodes(root)); hidden(ui.deploy::setup); addCloseButton(); + + buttons.addImageTextButton("$database", "icon-database", 14*2, () -> { + hide(); + ui.database.show(); + }).size(210f, 64f); } @Override diff --git a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java index a09eee83c7..f3dac5a8c3 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java @@ -93,7 +93,7 @@ public class HudFragment extends Fragment{ if(Net.active() && mobile){ i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-chat"); }else{ - i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-unlocks"); + i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-database"); } }).get(); diff --git a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java index 58c4354f4c..5e721f9d45 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java @@ -63,7 +63,6 @@ public class MenuFragment extends Fragment{ join = new MobileButton("icon-add", isize, "$joingame", ui.join::show), editor = new MobileButton("icon-editor", isize, "$editor", () -> ui.loadAnd(ui.editor::show)), tools = new MobileButton("icon-tools", isize, "$settings", ui.settings::show), - unlocks = new MobileButton("icon-unlocks", isize, "$database", ui.database::show), donate = new MobileButton("icon-donate", isize, "$donate", Platform.instance::openDonations); if(Core.graphics.getWidth() > Core.graphics.getHeight()){ @@ -78,7 +77,6 @@ public class MenuFragment extends Fragment{ table.add(editor); table.add(tools); - table.add(unlocks); if(Platform.instance.canDonate()) table.add(donate); }).colspan(4); @@ -96,8 +94,6 @@ public class MenuFragment extends Fragment{ container.table(table -> { table.defaults().set(container.defaults()); - table.add(unlocks); - if(Platform.instance.canDonate()) table.add(donate); }).colspan(2); } diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 73bba397d2..749e26f756 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -552,6 +552,11 @@ public class Block extends BlockStorage{ return buildVisibility.get() && !isHidden(); } + @Override + public boolean isHidden(){ + return !buildVisibility.get(); + } + @Override public boolean alwaysUnlocked(){ return alwaysUnlocked;