diff --git a/annotations/src/main/java/mindustry/annotations/BaseProcessor.java b/annotations/src/main/java/mindustry/annotations/BaseProcessor.java index 010a9949c0..fd2c05dca2 100644 --- a/annotations/src/main/java/mindustry/annotations/BaseProcessor.java +++ b/annotations/src/main/java/mindustry/annotations/BaseProcessor.java @@ -229,7 +229,7 @@ public abstract class BaseProcessor extends AbstractProcessor{ try{ process(roundEnv); }catch(Throwable e){ - e.printStackTrace(); + Log.err(e); throw new RuntimeException(e); } return true; diff --git a/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java b/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java index bca6c7660a..497a622749 100644 --- a/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java +++ b/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java @@ -49,8 +49,13 @@ public class AssetsProcess extends BaseProcessor{ ictype.addField(FieldSpec.builder(ParameterizedTypeName.get(ObjectMap.class, String.class, TextureRegionDrawable.class), "icons", Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL).initializer("new ObjectMap<>()").build()); + ObjectSet used = new ObjectSet<>(); + for(Jval val : icons.get("glyphs").asArray()){ String name = capitalize(val.getString("css", "")); + + if(!val.getBool("selected", true) || !used.add(name)) continue; + int code = val.getInt("code", 0); ichtype.addField(FieldSpec.builder(char.class, name, Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL).initializer("(char)" + code).build()); diff --git a/core/assets-raw/fontgen/icons/logic.svg b/core/assets-raw/fontgen/extra/logic.svg similarity index 100% rename from core/assets-raw/fontgen/icons/logic.svg rename to core/assets-raw/fontgen/extra/logic.svg diff --git a/core/assets-raw/fontgen/icons/admin.svg b/core/assets-raw/fontgen/icons/admin.svg deleted file mode 100644 index 8b6e5e5220..0000000000 --- a/core/assets-raw/fontgen/icons/admin.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/book.svg b/core/assets-raw/fontgen/icons/book.svg deleted file mode 100644 index 4ce30ae7ee..0000000000 --- a/core/assets-raw/fontgen/icons/book.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/chat.svg b/core/assets-raw/fontgen/icons/chat.svg deleted file mode 100644 index dab837b908..0000000000 --- a/core/assets-raw/fontgen/icons/chat.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/command-attack.svg b/core/assets-raw/fontgen/icons/command-attack.svg deleted file mode 100644 index ffd597b7a5..0000000000 --- a/core/assets-raw/fontgen/icons/command-attack.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/command-rally.svg b/core/assets-raw/fontgen/icons/command-rally.svg deleted file mode 100644 index b402671f69..0000000000 --- a/core/assets-raw/fontgen/icons/command-rally.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/command-retreat.svg b/core/assets-raw/fontgen/icons/command-retreat.svg deleted file mode 100644 index a608141b9b..0000000000 --- a/core/assets-raw/fontgen/icons/command-retreat.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/crafting.svg b/core/assets-raw/fontgen/icons/crafting.svg deleted file mode 100644 index 7f2e56d27c..0000000000 --- a/core/assets-raw/fontgen/icons/crafting.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/defense.svg b/core/assets-raw/fontgen/icons/defense.svg deleted file mode 100644 index 0891560c0a..0000000000 --- a/core/assets-raw/fontgen/icons/defense.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/distribution.svg b/core/assets-raw/fontgen/icons/distribution.svg deleted file mode 100644 index f60b2f7251..0000000000 --- a/core/assets-raw/fontgen/icons/distribution.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/effect.svg b/core/assets-raw/fontgen/icons/effect.svg deleted file mode 100644 index 004fecdb71..0000000000 --- a/core/assets-raw/fontgen/icons/effect.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/exit.svg b/core/assets-raw/fontgen/icons/exit.svg deleted file mode 100644 index 2a9a6ddc8f..0000000000 --- a/core/assets-raw/fontgen/icons/exit.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/fill.svg b/core/assets-raw/fontgen/icons/fill.svg deleted file mode 100644 index 4435469aac..0000000000 --- a/core/assets-raw/fontgen/icons/fill.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/hammer.svg b/core/assets-raw/fontgen/icons/hammer.svg deleted file mode 100644 index a9ec0312f5..0000000000 --- a/core/assets-raw/fontgen/icons/hammer.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/host.svg b/core/assets-raw/fontgen/icons/host.svg deleted file mode 100644 index e927c7af2f..0000000000 --- a/core/assets-raw/fontgen/icons/host.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/itchio.svg b/core/assets-raw/fontgen/icons/itchio.svg deleted file mode 100644 index d26eb1780a..0000000000 --- a/core/assets-raw/fontgen/icons/itchio.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/line.svg b/core/assets-raw/fontgen/icons/line.svg deleted file mode 100644 index 91e2e2fb29..0000000000 --- a/core/assets-raw/fontgen/icons/line.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/link.svg b/core/assets-raw/fontgen/icons/link.svg deleted file mode 100644 index 34b8a163d7..0000000000 --- a/core/assets-raw/fontgen/icons/link.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/liquid.svg b/core/assets-raw/fontgen/icons/liquid.svg deleted file mode 100644 index 6eb50596d8..0000000000 --- a/core/assets-raw/fontgen/icons/liquid.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/mode-attack.svg b/core/assets-raw/fontgen/icons/mode-attack.svg deleted file mode 100644 index cc78940688..0000000000 --- a/core/assets-raw/fontgen/icons/mode-attack.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/mode-pvp.svg b/core/assets-raw/fontgen/icons/mode-pvp.svg deleted file mode 100644 index 76c7f31f77..0000000000 --- a/core/assets-raw/fontgen/icons/mode-pvp.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/mode-survival.svg b/core/assets-raw/fontgen/icons/mode-survival.svg deleted file mode 100644 index aa5d0dcac8..0000000000 --- a/core/assets-raw/fontgen/icons/mode-survival.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/paste.svg b/core/assets-raw/fontgen/icons/paste.svg deleted file mode 100644 index 67a323b6ea..0000000000 --- a/core/assets-raw/fontgen/icons/paste.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/pencil.svg b/core/assets-raw/fontgen/icons/pencil.svg deleted file mode 100644 index f2bfa70403..0000000000 --- a/core/assets-raw/fontgen/icons/pencil.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/players.svg b/core/assets-raw/fontgen/icons/players.svg deleted file mode 100644 index 3cdfa46245..0000000000 --- a/core/assets-raw/fontgen/icons/players.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/power.svg b/core/assets-raw/fontgen/icons/power.svg deleted file mode 100644 index 6d6a5063f2..0000000000 --- a/core/assets-raw/fontgen/icons/power.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/production.svg b/core/assets-raw/fontgen/icons/production.svg deleted file mode 100644 index 74f0f882a9..0000000000 --- a/core/assets-raw/fontgen/icons/production.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/refresh.svg b/core/assets-raw/fontgen/icons/refresh.svg deleted file mode 100644 index 1cde3c7e11..0000000000 --- a/core/assets-raw/fontgen/icons/refresh.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/save.svg b/core/assets-raw/fontgen/icons/save.svg deleted file mode 100644 index d2b0776e95..0000000000 --- a/core/assets-raw/fontgen/icons/save.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/spray.svg b/core/assets-raw/fontgen/icons/spray.svg deleted file mode 100644 index a1b0cf95f7..0000000000 --- a/core/assets-raw/fontgen/icons/spray.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/terrain.svg b/core/assets-raw/fontgen/icons/terrain.svg deleted file mode 100644 index acb45bd0de..0000000000 --- a/core/assets-raw/fontgen/icons/terrain.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/trash.svg b/core/assets-raw/fontgen/icons/trash.svg deleted file mode 100644 index 22ed1dee35..0000000000 --- a/core/assets-raw/fontgen/icons/trash.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/turret.svg b/core/assets-raw/fontgen/icons/turret.svg deleted file mode 100644 index 12009fa1f3..0000000000 --- a/core/assets-raw/fontgen/icons/turret.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/units.svg b/core/assets-raw/fontgen/icons/units.svg deleted file mode 100644 index 969b63e096..0000000000 --- a/core/assets-raw/fontgen/icons/units.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/icons/upgrade.svg b/core/assets-raw/fontgen/icons/upgrade.svg deleted file mode 100644 index 9cee75f283..0000000000 --- a/core/assets-raw/fontgen/icons/upgrade.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/core/assets-raw/fontgen/merge.pe b/core/assets-raw/fontgen/merge.pe index 2dfaf77598..a4644c0c5e 100755 --- a/core/assets-raw/fontgen/merge.pe +++ b/core/assets-raw/fontgen/merge.pe @@ -1,3 +1,3 @@ -Open("core/assets/fonts/font.ttf") -MergeFonts("core/assets-raw/fontgen/out/font.ttf") -Generate("core/assets/fonts/font.ttf") +Open("core/assets/fonts/font.woff") +MergeFonts("core/assets-raw/fontgen/out/font.woff") +Generate("core/assets/fonts/font.woff") diff --git a/core/assets-raw/icons/about.png b/core/assets-raw/icons/about.png new file mode 100644 index 0000000000..3943975b97 Binary files /dev/null and b/core/assets-raw/icons/about.png differ diff --git a/core/assets-raw/icons/add.png b/core/assets-raw/icons/add.png new file mode 100644 index 0000000000..328c8ca469 Binary files /dev/null and b/core/assets-raw/icons/add.png differ diff --git a/core/assets-raw/icons/admin.png b/core/assets-raw/icons/admin.png new file mode 100644 index 0000000000..f4101c0423 Binary files /dev/null and b/core/assets-raw/icons/admin.png differ diff --git a/core/assets-raw/icons/book.png b/core/assets-raw/icons/book.png new file mode 100644 index 0000000000..a4395e4ed5 Binary files /dev/null and b/core/assets-raw/icons/book.png differ diff --git a/core/assets-raw/icons/break.png b/core/assets-raw/icons/break.png new file mode 100644 index 0000000000..c4b079735c Binary files /dev/null and b/core/assets-raw/icons/break.png differ diff --git a/core/assets-raw/icons/cancel.png b/core/assets-raw/icons/cancel.png new file mode 100644 index 0000000000..03ea12174f Binary files /dev/null and b/core/assets-raw/icons/cancel.png differ diff --git a/core/assets-raw/icons/changelog.png b/core/assets-raw/icons/changelog.png new file mode 100644 index 0000000000..e6fbf8d3c1 Binary files /dev/null and b/core/assets-raw/icons/changelog.png differ diff --git a/core/assets-raw/icons/chat.png b/core/assets-raw/icons/chat.png new file mode 100644 index 0000000000..85f52fa41c Binary files /dev/null and b/core/assets-raw/icons/chat.png differ diff --git a/core/assets-raw/icons/check.png b/core/assets-raw/icons/check.png new file mode 100644 index 0000000000..db96907362 Binary files /dev/null and b/core/assets-raw/icons/check.png differ diff --git a/core/assets-raw/icons/command-attack.png b/core/assets-raw/icons/command-attack.png new file mode 100644 index 0000000000..655f819338 Binary files /dev/null and b/core/assets-raw/icons/command-attack.png differ diff --git a/core/assets-raw/icons/command-rally.png b/core/assets-raw/icons/command-rally.png new file mode 100644 index 0000000000..4271a5a321 Binary files /dev/null and b/core/assets-raw/icons/command-rally.png differ diff --git a/core/assets-raw/icons/command-retreat.png b/core/assets-raw/icons/command-retreat.png new file mode 100644 index 0000000000..f40dcfe5cf Binary files /dev/null and b/core/assets-raw/icons/command-retreat.png differ diff --git a/core/assets-raw/icons/copy.png b/core/assets-raw/icons/copy.png new file mode 100644 index 0000000000..0f03ee5d04 Binary files /dev/null and b/core/assets-raw/icons/copy.png differ diff --git a/core/assets-raw/icons/crafting.png b/core/assets-raw/icons/crafting.png new file mode 100644 index 0000000000..3f7022e87b Binary files /dev/null and b/core/assets-raw/icons/crafting.png differ diff --git a/core/assets-raw/icons/cursor.png b/core/assets-raw/icons/cursor.png new file mode 100644 index 0000000000..1025a08a9e Binary files /dev/null and b/core/assets-raw/icons/cursor.png differ diff --git a/core/assets-raw/icons/defense.png b/core/assets-raw/icons/defense.png new file mode 100644 index 0000000000..2ae509685e Binary files /dev/null and b/core/assets-raw/icons/defense.png differ diff --git a/core/assets-raw/icons/diagonal.png b/core/assets-raw/icons/diagonal.png new file mode 100644 index 0000000000..262be1cebc Binary files /dev/null and b/core/assets-raw/icons/diagonal.png differ diff --git a/core/assets-raw/icons/distribution.png b/core/assets-raw/icons/distribution.png new file mode 100644 index 0000000000..3a202b38e8 Binary files /dev/null and b/core/assets-raw/icons/distribution.png differ diff --git a/core/assets-raw/icons/donate.png b/core/assets-raw/icons/donate.png new file mode 100644 index 0000000000..cad39eb1ba Binary files /dev/null and b/core/assets-raw/icons/donate.png differ diff --git a/core/assets-raw/icons/dots.png b/core/assets-raw/icons/dots.png new file mode 100644 index 0000000000..a8d656d6cc Binary files /dev/null and b/core/assets-raw/icons/dots.png differ diff --git a/core/assets-raw/icons/editor.png b/core/assets-raw/icons/editor.png new file mode 100644 index 0000000000..6cb0a64f9f Binary files /dev/null and b/core/assets-raw/icons/editor.png differ diff --git a/core/assets-raw/icons/effect.png b/core/assets-raw/icons/effect.png new file mode 100644 index 0000000000..212034645b Binary files /dev/null and b/core/assets-raw/icons/effect.png differ diff --git a/core/assets-raw/icons/elevation.png b/core/assets-raw/icons/elevation.png new file mode 100644 index 0000000000..cbc30c8cc1 Binary files /dev/null and b/core/assets-raw/icons/elevation.png differ diff --git a/core/assets-raw/icons/eraser.png b/core/assets-raw/icons/eraser.png new file mode 100644 index 0000000000..fc72acc9f2 Binary files /dev/null and b/core/assets-raw/icons/eraser.png differ diff --git a/core/assets-raw/icons/exit.png b/core/assets-raw/icons/exit.png new file mode 100644 index 0000000000..e5cc257e39 Binary files /dev/null and b/core/assets-raw/icons/exit.png differ diff --git a/core/assets-raw/icons/fdroid.png b/core/assets-raw/icons/fdroid.png new file mode 100644 index 0000000000..24c7cb884d Binary files /dev/null and b/core/assets-raw/icons/fdroid.png differ diff --git a/core/assets-raw/icons/file-image.png b/core/assets-raw/icons/file-image.png new file mode 100644 index 0000000000..254ea95f3d Binary files /dev/null and b/core/assets-raw/icons/file-image.png differ diff --git a/core/assets-raw/icons/file-text.png b/core/assets-raw/icons/file-text.png new file mode 100644 index 0000000000..41b4fbc342 Binary files /dev/null and b/core/assets-raw/icons/file-text.png differ diff --git a/core/assets-raw/icons/file.png b/core/assets-raw/icons/file.png new file mode 100644 index 0000000000..0f41e17cbf Binary files /dev/null and b/core/assets-raw/icons/file.png differ diff --git a/core/assets-raw/icons/fill.png b/core/assets-raw/icons/fill.png new file mode 100644 index 0000000000..79bc8b2c39 Binary files /dev/null and b/core/assets-raw/icons/fill.png differ diff --git a/core/assets-raw/icons/flip.png b/core/assets-raw/icons/flip.png new file mode 100644 index 0000000000..d81d741434 Binary files /dev/null and b/core/assets-raw/icons/flip.png differ diff --git a/core/assets-raw/icons/folder-parent.png b/core/assets-raw/icons/folder-parent.png new file mode 100644 index 0000000000..160f2be902 Binary files /dev/null and b/core/assets-raw/icons/folder-parent.png differ diff --git a/core/assets-raw/icons/folder.png b/core/assets-raw/icons/folder.png new file mode 100644 index 0000000000..c55313ef32 Binary files /dev/null and b/core/assets-raw/icons/folder.png differ diff --git a/core/assets-raw/icons/grid.png b/core/assets-raw/icons/grid.png new file mode 100644 index 0000000000..5427571a16 Binary files /dev/null and b/core/assets-raw/icons/grid.png differ diff --git a/core/assets-raw/icons/hammer.png b/core/assets-raw/icons/hammer.png new file mode 100644 index 0000000000..1ee4a5c3bf Binary files /dev/null and b/core/assets-raw/icons/hammer.png differ diff --git a/core/assets-raw/icons/home.png b/core/assets-raw/icons/home.png new file mode 100644 index 0000000000..b97dba2a11 Binary files /dev/null and b/core/assets-raw/icons/home.png differ diff --git a/core/assets-raw/icons/host.png b/core/assets-raw/icons/host.png new file mode 100644 index 0000000000..6253c986bd Binary files /dev/null and b/core/assets-raw/icons/host.png differ diff --git a/core/assets-raw/icons/info.png b/core/assets-raw/icons/info.png new file mode 100644 index 0000000000..7e2bb40037 Binary files /dev/null and b/core/assets-raw/icons/info.png differ diff --git a/core/assets-raw/icons/itchio.png b/core/assets-raw/icons/itchio.png new file mode 100644 index 0000000000..ec92eb3725 Binary files /dev/null and b/core/assets-raw/icons/itchio.png differ diff --git a/core/assets-raw/icons/item.png b/core/assets-raw/icons/item.png new file mode 100644 index 0000000000..9dd6da2249 Binary files /dev/null and b/core/assets-raw/icons/item.png differ diff --git a/core/assets-raw/icons/line.png b/core/assets-raw/icons/line.png new file mode 100644 index 0000000000..5ce2cfdc78 Binary files /dev/null and b/core/assets-raw/icons/line.png differ diff --git a/core/assets-raw/icons/link.png b/core/assets-raw/icons/link.png new file mode 100644 index 0000000000..71446afcc0 Binary files /dev/null and b/core/assets-raw/icons/link.png differ diff --git a/core/assets-raw/icons/liquid-consume.png b/core/assets-raw/icons/liquid-consume.png new file mode 100644 index 0000000000..48c93ed9d2 Binary files /dev/null and b/core/assets-raw/icons/liquid-consume.png differ diff --git a/core/assets-raw/icons/liquid.png b/core/assets-raw/icons/liquid.png new file mode 100644 index 0000000000..1306834469 Binary files /dev/null and b/core/assets-raw/icons/liquid.png differ diff --git a/core/assets-raw/icons/load-image.png b/core/assets-raw/icons/load-image.png new file mode 100644 index 0000000000..88a162b628 Binary files /dev/null and b/core/assets-raw/icons/load-image.png differ diff --git a/core/assets-raw/icons/load-map.png b/core/assets-raw/icons/load-map.png new file mode 100644 index 0000000000..4aa244ab7c Binary files /dev/null and b/core/assets-raw/icons/load-map.png differ diff --git a/core/assets-raw/icons/load.png b/core/assets-raw/icons/load.png new file mode 100644 index 0000000000..ecbd0c08cf Binary files /dev/null and b/core/assets-raw/icons/load.png differ diff --git a/core/assets-raw/icons/loading.png b/core/assets-raw/icons/loading.png new file mode 100644 index 0000000000..0fd2d5265d Binary files /dev/null and b/core/assets-raw/icons/loading.png differ diff --git a/core/assets-raw/icons/lock-open.png b/core/assets-raw/icons/lock-open.png new file mode 100644 index 0000000000..36b637b0b9 Binary files /dev/null and b/core/assets-raw/icons/lock-open.png differ diff --git a/core/assets-raw/icons/lock.png b/core/assets-raw/icons/lock.png new file mode 100644 index 0000000000..cdf11fe658 Binary files /dev/null and b/core/assets-raw/icons/lock.png differ diff --git a/core/assets-raw/icons/map.png b/core/assets-raw/icons/map.png new file mode 100644 index 0000000000..92ff76d74f Binary files /dev/null and b/core/assets-raw/icons/map.png differ diff --git a/core/assets-raw/icons/menu.png b/core/assets-raw/icons/menu.png new file mode 100644 index 0000000000..0469f99721 Binary files /dev/null and b/core/assets-raw/icons/menu.png differ diff --git a/core/assets-raw/icons/missing.png b/core/assets-raw/icons/missing.png new file mode 100644 index 0000000000..6a9c5d9012 Binary files /dev/null and b/core/assets-raw/icons/missing.png differ diff --git a/core/assets-raw/icons/mode-attack.png b/core/assets-raw/icons/mode-attack.png new file mode 100644 index 0000000000..c6aac86259 Binary files /dev/null and b/core/assets-raw/icons/mode-attack.png differ diff --git a/core/assets-raw/icons/mode-pvp.png b/core/assets-raw/icons/mode-pvp.png new file mode 100644 index 0000000000..3a0c63ceb6 Binary files /dev/null and b/core/assets-raw/icons/mode-pvp.png differ diff --git a/core/assets-raw/icons/mode-survival.png b/core/assets-raw/icons/mode-survival.png new file mode 100644 index 0000000000..c88da7b3b6 Binary files /dev/null and b/core/assets-raw/icons/mode-survival.png differ diff --git a/core/assets-raw/icons/none.png b/core/assets-raw/icons/none.png new file mode 100644 index 0000000000..fcf22bc9da Binary files /dev/null and b/core/assets-raw/icons/none.png differ diff --git a/core/assets-raw/icons/paste.png b/core/assets-raw/icons/paste.png new file mode 100644 index 0000000000..606165ed34 Binary files /dev/null and b/core/assets-raw/icons/paste.png differ diff --git a/core/assets-raw/icons/pause.png b/core/assets-raw/icons/pause.png new file mode 100644 index 0000000000..7471836eaa Binary files /dev/null and b/core/assets-raw/icons/pause.png differ diff --git a/core/assets-raw/icons/pencil.png b/core/assets-raw/icons/pencil.png new file mode 100644 index 0000000000..053a283d08 Binary files /dev/null and b/core/assets-raw/icons/pencil.png differ diff --git a/core/assets-raw/icons/pick.png b/core/assets-raw/icons/pick.png new file mode 100644 index 0000000000..dfd7743030 Binary files /dev/null and b/core/assets-raw/icons/pick.png differ diff --git a/core/assets-raw/icons/play-2.png b/core/assets-raw/icons/play-2.png new file mode 100644 index 0000000000..c001e60b04 Binary files /dev/null and b/core/assets-raw/icons/play-2.png differ diff --git a/core/assets-raw/icons/play.png b/core/assets-raw/icons/play.png new file mode 100644 index 0000000000..8530e6b09d Binary files /dev/null and b/core/assets-raw/icons/play.png differ diff --git a/core/assets-raw/icons/players.png b/core/assets-raw/icons/players.png new file mode 100644 index 0000000000..be4746291f Binary files /dev/null and b/core/assets-raw/icons/players.png differ diff --git a/core/assets-raw/icons/power.png b/core/assets-raw/icons/power.png new file mode 100644 index 0000000000..57fbb2f2bd Binary files /dev/null and b/core/assets-raw/icons/power.png differ diff --git a/core/assets-raw/icons/production.png b/core/assets-raw/icons/production.png new file mode 100644 index 0000000000..fe6c3523c0 Binary files /dev/null and b/core/assets-raw/icons/production.png differ diff --git a/core/assets-raw/icons/quit.png b/core/assets-raw/icons/quit.png new file mode 100644 index 0000000000..26a9634945 Binary files /dev/null and b/core/assets-raw/icons/quit.png differ diff --git a/core/assets-raw/icons/redo.png b/core/assets-raw/icons/redo.png new file mode 100644 index 0000000000..4c53eb56ef Binary files /dev/null and b/core/assets-raw/icons/redo.png differ diff --git a/core/assets-raw/icons/refresh.png b/core/assets-raw/icons/refresh.png new file mode 100644 index 0000000000..cd1050f017 Binary files /dev/null and b/core/assets-raw/icons/refresh.png differ diff --git a/core/assets-raw/icons/rename.png b/core/assets-raw/icons/rename.png new file mode 100644 index 0000000000..4a6731a31b Binary files /dev/null and b/core/assets-raw/icons/rename.png differ diff --git a/core/assets-raw/icons/resize.png b/core/assets-raw/icons/resize.png new file mode 100644 index 0000000000..ee53c8470f Binary files /dev/null and b/core/assets-raw/icons/resize.png differ diff --git a/core/assets-raw/icons/rotate-arrow.png b/core/assets-raw/icons/rotate-arrow.png new file mode 100644 index 0000000000..22039f3020 Binary files /dev/null and b/core/assets-raw/icons/rotate-arrow.png differ diff --git a/core/assets-raw/icons/rotate-left.png b/core/assets-raw/icons/rotate-left.png new file mode 100644 index 0000000000..9b05efec5f Binary files /dev/null and b/core/assets-raw/icons/rotate-left.png differ diff --git a/core/assets-raw/icons/rotate-right.png b/core/assets-raw/icons/rotate-right.png new file mode 100644 index 0000000000..2009c9394d Binary files /dev/null and b/core/assets-raw/icons/rotate-right.png differ diff --git a/core/assets-raw/icons/rotate.png b/core/assets-raw/icons/rotate.png new file mode 100644 index 0000000000..3c989a555f Binary files /dev/null and b/core/assets-raw/icons/rotate.png differ diff --git a/core/assets-raw/icons/save-image.png b/core/assets-raw/icons/save-image.png new file mode 100644 index 0000000000..5234c4f2f4 Binary files /dev/null and b/core/assets-raw/icons/save-image.png differ diff --git a/core/assets-raw/icons/save-map.png b/core/assets-raw/icons/save-map.png new file mode 100644 index 0000000000..9066752d13 Binary files /dev/null and b/core/assets-raw/icons/save-map.png differ diff --git a/core/assets-raw/icons/save.png b/core/assets-raw/icons/save.png new file mode 100644 index 0000000000..e8ba657ab7 Binary files /dev/null and b/core/assets-raw/icons/save.png differ diff --git a/core/assets-raw/icons/settings.png b/core/assets-raw/icons/settings.png new file mode 100644 index 0000000000..51a969c401 Binary files /dev/null and b/core/assets-raw/icons/settings.png differ diff --git a/core/assets-raw/icons/spray.png b/core/assets-raw/icons/spray.png new file mode 100644 index 0000000000..17198d657b Binary files /dev/null and b/core/assets-raw/icons/spray.png differ diff --git a/core/assets-raw/icons/terrain.png b/core/assets-raw/icons/terrain.png new file mode 100644 index 0000000000..cc9c57380e Binary files /dev/null and b/core/assets-raw/icons/terrain.png differ diff --git a/core/assets-raw/icons/tools.png b/core/assets-raw/icons/tools.png new file mode 100644 index 0000000000..2ece1ae8f4 Binary files /dev/null and b/core/assets-raw/icons/tools.png differ diff --git a/core/assets-raw/icons/trash-16.png b/core/assets-raw/icons/trash-16.png new file mode 100644 index 0000000000..a1de49233b Binary files /dev/null and b/core/assets-raw/icons/trash-16.png differ diff --git a/core/assets-raw/icons/trash.png b/core/assets-raw/icons/trash.png new file mode 100644 index 0000000000..e0f419f2f3 Binary files /dev/null and b/core/assets-raw/icons/trash.png differ diff --git a/core/assets-raw/icons/tree.png b/core/assets-raw/icons/tree.png new file mode 100644 index 0000000000..0901a7a721 Binary files /dev/null and b/core/assets-raw/icons/tree.png differ diff --git a/core/assets-raw/icons/turret.png b/core/assets-raw/icons/turret.png new file mode 100644 index 0000000000..32fd01b464 Binary files /dev/null and b/core/assets-raw/icons/turret.png differ diff --git a/core/assets-raw/icons/tutorial.png b/core/assets-raw/icons/tutorial.png new file mode 100644 index 0000000000..40ba90a5e4 Binary files /dev/null and b/core/assets-raw/icons/tutorial.png differ diff --git a/core/assets-raw/icons/undo.png b/core/assets-raw/icons/undo.png new file mode 100644 index 0000000000..cf5dd4c154 Binary files /dev/null and b/core/assets-raw/icons/undo.png differ diff --git a/core/assets-raw/icons/units.png b/core/assets-raw/icons/units.png new file mode 100644 index 0000000000..1ee9cd9f55 Binary files /dev/null and b/core/assets-raw/icons/units.png differ diff --git a/core/src/mindustry/ui/fragments/ChatFragment.java b/core/src/mindustry/ui/fragments/ChatFragment.java index dd553b647f..1020a74af9 100644 --- a/core/src/mindustry/ui/fragments/ChatFragment.java +++ b/core/src/mindustry/ui/fragments/ChatFragment.java @@ -183,7 +183,7 @@ public class ChatFragment extends Table{ if(!shown){ scene.setKeyboardFocus(chatfield); - shown = !shown; + shown = true; if(mobile){ TextInput input = new TextInput(); input.maxLength = maxTextLength; @@ -199,10 +199,13 @@ public class ChatFragment extends Table{ chatfield.fireClick(); } }else{ - scene.setKeyboardFocus(null); - shown = !shown; - scrollPos = 0; - sendMessage(); + //sending chat has a delay; workaround for issue #1943 + Time.run(2f, () ->{ + scene.setKeyboardFocus(null); + shown = false; + scrollPos = 0; + sendMessage(); + }); } } diff --git a/gradle.properties b/gradle.properties index 5719c2429e..3976157a39 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=83cae56974fabfec535ae7d53a1f83a5f795d28b +archash=73b7d84c43621e935d0281160b4d3caed7d77222 diff --git a/tools/build.gradle b/tools/build.gradle index 42b27b3ccb..d00a04075b 100644 --- a/tools/build.gradle +++ b/tools/build.gradle @@ -421,3 +421,10 @@ task fontgen(dependsOn: classes, type: JavaExec){ standardInput = System.in workingDir = "../" } + +task icongen(dependsOn: classes, type: JavaExec){ + main = "mindustry.tools.IconConverter" + classpath = sourceSets.main.runtimeClasspath + standardInput = System.in + workingDir = "../core/assets-raw" +} \ No newline at end of file diff --git a/tools/src/mindustry/tools/FontGenerator.java b/tools/src/mindustry/tools/FontGenerator.java index 05f2715d29..ba9f76c007 100644 --- a/tools/src/mindustry/tools/FontGenerator.java +++ b/tools/src/mindustry/tools/FontGenerator.java @@ -24,12 +24,12 @@ public class FontGenerator{ Log.info("Session..."); - OS.exec("curl", "--fail", "--output", "core/assets-raw/fontgen/out/session", "--form", "config=@core/assets-raw/fontgen/config.json", "http://fontello.com"); + OS.exec("curl", "--fail", "--output", "core/assets-raw/fontgen/out/session", "--form", "config=@core/assets-raw/fontgen/config.json", "https://fontello.com"); Log.info("Zip..."); String session = folder.child("session").readString(); - net.httpGet("http://fontello.com/" + session + "/get", result -> { + net.httpGet("https://fontello.com/" + session + "/get", result -> { try{ Streams.copy(result.getResultAsStream(), folder.child("font.zip").write()); }catch(IOException e){ @@ -46,8 +46,7 @@ public class FontGenerator{ Log.info("Merge..."); - //don't merge since it breaks the font - //OS.exec("fontforge", "-script", "core/assets-raw/fontgen/merge.pe"); + OS.exec("fontforge", "-script", "core/assets-raw/fontgen/merge.pe"); Log.info("Done."); } diff --git a/tools/src/mindustry/tools/SquareMarcher.java b/tools/src/mindustry/tools/IconConverter.java similarity index 50% rename from tools/src/mindustry/tools/SquareMarcher.java rename to tools/src/mindustry/tools/IconConverter.java index 0caf7642ff..c672e2a119 100644 --- a/tools/src/mindustry/tools/SquareMarcher.java +++ b/tools/src/mindustry/tools/IconConverter.java @@ -1,40 +1,62 @@ package mindustry.tools; -import arc.*; import arc.files.*; import arc.graphics.*; -import arc.graphics.g2d.*; -import arc.graphics.gl.*; +import arc.struct.*; import arc.util.*; -public class SquareMarcher{ - final int resolution; - FrameBuffer buffer; +public class IconConverter{ + StringBuilder out = new StringBuilder(); + float width, height; - SquareMarcher(int resolution){ - this.resolution = resolution; - this.buffer = new FrameBuffer(resolution, resolution); + public static void main(String[] __){ + + Log.info("Converting icons..."); + Time.mark(); + Fi.get("fontgen/icons").deleteDirectory(); + Fi.get("fontgen/icon_parts").deleteDirectory(); + Fi[] list = new Fi("icons").list(); + + ArcNativesLoader.load(); + Seq files = new Seq<>(); + + for(Fi img : list){ + if(img.extension().equals("png")){ + Fi dst = new Fi("fontgen/icons").child(img.nameWithoutExtension().replace("icon-", "") + ".svg"); + new IconConverter().convert(new Pixmap(img), dst); + dst.copyTo(new Fi("fontgen/icon_parts/").child(dst.name())); + files.add(dst); + } + } + + Seq args = Seq.with("inkscape", "--batch-process", "--verb", "EditSelectAll;SelectionUnion;FitCanvasToSelectionOrDrawing;FileSave"); + args.addAll(files.map(Fi::absolutePath)); + + Fi.get("fontgen/extra").findAll().each(f -> f.copyTo(Fi.get("fontgen/icons").child(f.name()))); + + Log.info("Merging paths..."); + Log.info(OS.exec(args.toArray(String.class))); + + Log.info("Done converting icons in &lm@&lgs.", Time.elapsed()/1000f); + System.exit(0); } - void render(Pixmap pixmap, Fi file){ + void convert(Pixmap pixmap, Fi output){ boolean[][] grid = new boolean[pixmap.getWidth()][pixmap.getHeight()]; for(int x = 0; x < pixmap.getWidth(); x++){ for(int y = 0; y < pixmap.getHeight(); y++){ - Tmp.c1.set(pixmap.getPixel(x, y)); - grid[x][pixmap.getHeight() - 1 - y] = Tmp.c1.a > 0.01f; + grid[x][pixmap.getHeight() - 1 - y] = !Pixmaps.empty(pixmap.getPixel(x, y)); } } - float xscl = resolution / (float)pixmap.getWidth(), yscl = resolution / (float)pixmap.getHeight(); + float xscl = 1f, yscl = 1f;//resolution / (float)pixmap.getWidth(), yscl = resolution / (float)pixmap.getHeight(); float scl = xscl; - Draw.flush(); - Draw.proj().setOrtho(-xscl / 2f, -yscl / 2f, resolution, resolution); + width = pixmap.getWidth(); + height = pixmap.getHeight(); - buffer.begin(); - Core.graphics.clear(Color.clear); - Draw.color(Color.white); + out.append("\n"); for(int x = -1; x < pixmap.getWidth(); x++){ for(int y = -1; y < pixmap.getHeight(); y++){ @@ -47,24 +69,24 @@ public class SquareMarcher{ case 0: break; case 1: - Fill.tri( + tri( leftx, midy, leftx, topy, midx, topy ); break; case 2: - Fill.tri( + tri( midx, topy, rightx, topy, rightx, midy ); break; case 3: - Fill.crect(leftx, midy, scl, scl / 2f); + rect(leftx, midy, scl, scl / 2f); break; case 4: - Fill.tri( + tri( midx, boty, rightx, boty, rightx, midy @@ -74,125 +96,148 @@ public class SquareMarcher{ //ambiguous //7 - Fill.tri( + tri( leftx, midy, midx, midy, midx, boty ); //13 - Fill.tri( + tri( midx, topy, midx, midy, rightx, midy ); - Fill.crect(leftx, midy, scl / 2f, scl / 2f); - Fill.crect(midx, boty, scl / 2f, scl / 2f); + rect(leftx, midy, scl / 2f, scl / 2f); + rect(midx, boty, scl / 2f, scl / 2f); break; case 6: - Fill.crect(midx, boty, scl / 2f, scl); + rect(midx, boty, scl / 2f, scl); break; case 7: //invert triangle - Fill.tri( + tri( leftx, midy, midx, midy, midx, boty ); //3 - Fill.crect(leftx, midy, scl, scl / 2f); + rect(leftx, midy, scl, scl / 2f); - Fill.crect(midx, boty, scl / 2f, scl / 2f); + rect(midx, boty, scl / 2f, scl / 2f); break; case 8: - Fill.tri( + tri( leftx, boty, leftx, midy, midx, boty ); break; case 9: - Fill.crect(leftx, boty, scl / 2f, scl); + rect(leftx, boty, scl / 2f, scl); break; case 10: //ambiguous //11 - Fill.tri( + tri( midx, boty, midx, midy, rightx, midy ); //14 - Fill.tri( + tri( leftx, midy, midx, midy, midx, topy ); - Fill.crect(midx, midy, scl / 2f, scl / 2f); - Fill.crect(leftx, boty, scl / 2f, scl / 2f); + rect(midx, midy, scl / 2f, scl / 2f); + rect(leftx, boty, scl / 2f, scl / 2f); break; case 11: //invert triangle - Fill.tri( + tri( midx, boty, midx, midy, rightx, midy ); //3 - Fill.crect(leftx, midy, scl, scl / 2f); + rect(leftx, midy, scl, scl / 2f); - Fill.crect(leftx, boty, scl / 2f, scl / 2f); + rect(leftx, boty, scl / 2f, scl / 2f); break; case 12: - Fill.crect(leftx, boty, scl, scl / 2f); + rect(leftx, boty, scl, scl / 2f); break; case 13: //invert triangle - Fill.tri( + tri( midx, topy, midx, midy, rightx, midy ); //12 - Fill.crect(leftx, boty, scl, scl / 2f); + rect(leftx, boty, scl, scl / 2f); - Fill.crect(leftx, midy, scl / 2f, scl / 2f); + rect(leftx, midy, scl / 2f, scl / 2f); break; case 14: //invert triangle - Fill.tri( + tri( leftx, midy, midx, midy, midx, topy ); //12 - Fill.crect(leftx, boty, scl, scl / 2f); + rect(leftx, boty, scl, scl / 2f); - Fill.crect(midx, midy, scl / 2f, scl / 2f); + rect(midx, midy, scl / 2f, scl / 2f); break; case 15: - Fill.square(midx, midy, scl / 2f); + square(midx, midy, scl); break; } } } - Draw.flush(); - ScreenUtils.saveScreenshot(file, 0, 0, resolution, resolution); - buffer.end(); + out.append(""); + + output.writeString(out.toString()); + } + + void square(float x, float y, float size){ + rect(x - size/2f, y - size/2f, size, size); + } + + void tri(float x1, float y1, float x2, float y2, float x3, float y3){ + out.append("\n"); + } + + void rect(float x1, float y1, float width, float height){ + out.append("\n"); + } + + float flip(float y){ + return height - y; } int index(int x, int y, int w, int h, boolean[][] grid){ @@ -204,6 +249,6 @@ public class SquareMarcher{ } int sample(boolean[][] grid, int x, int y){ - return (x < 0 || y < 0 || x >= grid.length || y >= grid.length) ? 0 : grid[x][y] ? 1 : 0; + return (x < 0 || y < 0 || x >= grid.length || y >= grid[0].length) ? 0 : grid[x][y] ? 1 : 0; } }