From 8f0eefa97e4f839e382630eccf535e3cb90f475c Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 3 Oct 2019 22:26:13 -0400 Subject: [PATCH] Bug report link, proper minimap colors --- core/assets/bundles/bundle.properties | 1 + core/src/io/anuke/mindustry/Vars.java | 2 ++ .../mindustry/ui/dialogs/ModsDialog.java | 7 +++++- core/src/io/anuke/mindustry/world/Block.java | 22 +++++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 33bbc8c1f9..650e4c293e 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -71,6 +71,7 @@ mods.alpha = [accent](Alpha) mods = Mods mods.none = [LIGHT_GRAY]No mods found! mods.guide = Modding Guide +mods.report = Report Bug mod.enabled = [lightgray]Enabled mod.disabled = [scarlet]Disabled mod.disable = Disable diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index cdf98c8d2e..9b0593cc33 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -47,6 +47,8 @@ public class Vars implements Loadable{ public static final String crashReportURL = "http://mins.us.to/report"; /** URL the links to the wiki's modding guide.*/ public static final String modGuideURL = "https://mindustrygame.github.io/wiki/modding/"; + /** URL the links to the wiki's modding guide.*/ + public static final String reportIssueURL = "https://github.com/Anuken/Mindustry/issues/new?template=bug_report.md"; /** list of built-in servers.*/ public static final Array defaultServers = Array.with(/*"mins.us.to"*/); /** maximum distance between mine and core that supports automatic transferring */ diff --git a/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java index 5a542f31ea..183a542af4 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java @@ -19,9 +19,14 @@ public class ModsDialog extends FloatingDialog{ public ModsDialog(){ super("$mods"); addCloseButton(); + + buttons.addImageTextButton("$mods.report", Icon.link, + () -> Core.net.openURI(reportIssueURL)) + .size(250f, 64f); + buttons.addImageTextButton("$mods.guide", Icon.wiki, () -> Core.net.openURI(modGuideURL)) - .size(290f, 64f); + .size(280f, 64f); shown(this::setup); diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index a22eb1d174..c8122f0b6e 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -672,6 +672,28 @@ public class Block extends BlockStorage{ super.createIcons(out, editor); editor.pack(name + "-icon-editor", Core.atlas.getPixmap((AtlasRegion)icon(Cicon.full)).crop()); + + if(!synthetic()){ + PixmapRegion image = Core.atlas.getPixmap((AtlasRegion)icon(Cicon.full)); + + Color average = this.color; + Color color = new Color(); + for(int x = 0; x < image.width; x++){ + for(int y = 0; y < image.height; y++){ + image.getPixel(x, y, color); + average.r += color.r; + average.g += color.g; + average.b += color.b; + } + } + average.mul(1f / (image.width * image.height)); + if(isFloor()){ + average.mul(0.8f); + }else{ + average.mul(1.1f); + } + average.a = 1f; + } } /** Never use outside of the editor! */