diff --git a/core/assets-raw/fontgen/config.json b/core/assets-raw/fontgen/config.json
index d571bc5760..4f1803a429 100644
--- a/core/assets-raw/fontgen/config.json
+++ b/core/assets-raw/fontgen/config.json
@@ -404,12 +404,6 @@
"code": 61741,
"src": "fontawesome"
},
- {
- "uid": "9396b2d8849e0213a0f11c5fd7fcc522",
- "css": "host",
- "code": 61614,
- "src": "fontawesome"
- },
{
"uid": "51727ca007aa35ceabcaffc28934faee",
"css": "book-open",
@@ -779,6 +773,20 @@
"search": [
"book"
]
+ },
+ {
+ "uid": "ceb9cde822ac23f35c3bd67a8d0c4fac",
+ "css": "host",
+ "code": 59437,
+ "src": "custom_icons",
+ "selected": true,
+ "svg": {
+ "path": "M11.4 56.8Q22.7 22.7 56.8 11.4 90.9 0 136.4 0 181.8 0 227.3 0 272.7 0 318.2 0 363.6 0 409.1 0 454.5 0 500 0 545.5 0 590.9 0 636.4 0 681.8 0 727.3 0 772.7 0 818.2 0 863.6 0 909.1 0 954.5 0 1000 0 1034.1 11.4 1068.2 22.7 1079.5 56.8 1090.9 90.9 1090.9 136.4 1090.9 181.8 1079.5 215.9 1068.2 250 1034.1 261.4 1000 272.7 954.5 272.7 909.1 272.7 863.6 272.7 818.2 272.7 772.7 272.7 727.3 272.7 681.8 272.7 636.4 272.7 590.9 272.7 545.5 272.7 500 272.7 454.5 272.7 409.1 272.7 363.6 272.7 318.2 272.7 272.7 272.7 227.3 272.7 181.8 272.7 136.4 272.7 90.9 272.7 56.8 261.4 22.7 250 11.4 215.9 0 181.8 0 136.4 0 90.9 11.4 56.8M409.1 181.8Q454.5 181.8 488.6 170.5 522.7 159.1 522.7 136.4 522.7 113.6 488.6 102.3 454.5 90.9 409.1 90.9 363.6 90.9 318.2 90.9 272.7 90.9 227.3 90.9 181.8 90.9 147.7 102.3 113.6 113.6 113.6 136.4 113.6 159.1 147.7 170.5 181.8 181.8 227.3 181.8 272.7 181.8 318.2 181.8 363.6 181.8 409.1 181.8M840.9 136.4Q840.9 159.1 863.6 159.1 886.4 159.1 886.4 136.4 886.4 113.6 863.6 113.6 840.9 113.6 840.9 136.4M11.4 420.5Q22.7 386.4 56.8 375 90.9 363.6 136.4 363.6 181.8 363.6 227.3 363.6 272.7 363.6 318.2 363.6 363.6 363.6 409.1 363.6 454.5 363.6 500 363.6 545.5 363.6 590.9 363.6 636.4 363.6 681.8 363.6 727.3 363.6 772.7 363.6 818.2 363.6 863.6 363.6 909.1 363.6 954.5 363.6 1000 363.6 1034.1 375 1068.2 386.4 1079.5 420.5 1090.9 454.5 1090.9 500 1090.9 545.5 1079.5 579.5 1068.2 613.6 1034.1 625 1000 636.4 954.5 636.4 909.1 636.4 863.6 636.4 818.2 636.4 772.7 636.4 727.3 636.4 681.8 636.4 636.4 636.4 590.9 636.4 545.5 636.4 500 636.4 454.5 636.4 409.1 636.4 363.6 636.4 318.2 636.4 272.7 636.4 227.3 636.4 181.8 636.4 136.4 636.4 90.9 636.4 56.8 625 22.7 613.6 11.4 579.5 0 545.5 0 500 0 454.5 11.4 420.5M409.1 545.5Q454.5 545.5 488.6 534.1 522.7 522.7 522.7 500 522.7 477.3 488.6 465.9 454.5 454.5 409.1 454.5 363.6 454.5 318.2 454.5 272.7 454.5 227.3 454.5 181.8 454.5 147.7 465.9 113.6 477.3 113.6 500 113.6 522.7 147.7 534.1 181.8 545.5 227.3 545.5 272.7 545.5 318.2 545.5 363.6 545.5 409.1 545.5M840.9 500Q840.9 522.7 863.6 522.7 886.4 522.7 886.4 500 886.4 477.3 863.6 477.3 840.9 477.3 840.9 500M11.4 784.1Q22.7 750 56.8 738.6 90.9 727.3 136.4 727.3 181.8 727.3 227.3 727.3 272.7 727.3 318.2 727.3 363.6 727.3 409.1 727.3 454.5 727.3 500 727.3 545.5 727.3 590.9 727.3 636.4 727.3 681.8 727.3 727.3 727.3 772.7 727.3 818.2 727.3 863.6 727.3 909.1 727.3 954.5 727.3 1000 727.3 1034.1 738.6 1068.2 750 1079.5 784.1 1090.9 818.2 1090.9 863.6 1090.9 909.1 1079.5 943.2 1068.2 977.3 1034.1 988.6 1000 1000 954.5 1000 909.1 1000 863.6 1000 818.2 1000 772.7 1000 727.3 1000 681.8 1000 636.4 1000 590.9 1000 545.5 1000 500 1000 454.5 1000 409.1 1000 363.6 1000 318.2 1000 272.7 1000 227.3 1000 181.8 1000 136.4 1000 90.9 1000 56.8 988.6 22.7 977.3 11.4 943.2 0 909.1 0 863.6 0 818.2 11.4 784.1M409.1 909.1Q454.5 909.1 488.6 897.7 522.7 886.4 522.7 863.6 522.7 840.9 488.6 829.5 454.5 818.2 409.1 818.2 363.6 818.2 318.2 818.2 272.7 818.2 227.3 818.2 181.8 818.2 147.7 829.5 113.6 840.9 113.6 863.6 113.6 886.4 147.7 897.7 181.8 909.1 227.3 909.1 272.7 909.1 318.2 909.1 363.6 909.1 409.1 909.1M840.9 863.6Q840.9 886.4 863.6 886.4 886.4 886.4 886.4 863.6 886.4 840.9 863.6 840.9 840.9 840.9 840.9 863.6",
+ "width": 1091
+ },
+ "search": [
+ "host"
+ ]
}
]
}
\ No newline at end of file
diff --git a/core/assets-raw/fontgen/icons/host.svg b/core/assets-raw/fontgen/icons/host.svg
new file mode 100644
index 0000000000..e927c7af2f
--- /dev/null
+++ b/core/assets-raw/fontgen/icons/host.svg
@@ -0,0 +1,72 @@
+
+
+
+
diff --git a/core/assets/fonts/icon.ttf b/core/assets/fonts/icon.ttf
index e7773351b9..80724dac88 100644
Binary files a/core/assets/fonts/icon.ttf and b/core/assets/fonts/icon.ttf differ
diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java
index a1b508916d..0e15f79cc6 100644
--- a/core/src/mindustry/Vars.java
+++ b/core/src/mindustry/Vars.java
@@ -88,7 +88,7 @@ public class Vars implements Loadable{
public static final Color[] playerColors = {
Color.valueOf("82759a"),
Color.valueOf("c0c1c5"),
- Color.valueOf("fff0e7"),
+ Color.valueOf("ffffff"),
Color.valueOf("7d2953"),
Color.valueOf("ff074e"),
Color.valueOf("ff072a"),
diff --git a/core/src/mindustry/ui/Fonts.java b/core/src/mindustry/ui/Fonts.java
index b17c8ed1a2..1c4cfe7d56 100644
--- a/core/src/mindustry/ui/Fonts.java
+++ b/core/src/mindustry/ui/Fonts.java
@@ -26,11 +26,17 @@ import mindustry.core.*;
import java.util.*;
public class Fonts{
+ private static ObjectIntMap unicodeIcons = new ObjectIntMap<>();
+
public static BitmapFont def;
public static BitmapFont outline;
public static BitmapFont chat;
public static BitmapFont icon;
+ public static int getUnicode(String content){
+ return unicodeIcons.get(content, 0);
+ }
+
/** Called from a static context to make the cursor appear immediately upon startup.*/
public static void loadSystemCursors(){
SystemCursor.arrow.set(Core.graphics.newCursor("cursor"));
@@ -62,12 +68,15 @@ public class Fonts{
while(scan.hasNextLine()){
String line = scan.nextLine();
String[] split = line.split("=");
- String character = split[0], texture = split[1].split("\\|")[1];
+ String[] nametex = split[1].split("\\|");
+ String character = split[0], texture = nametex[1];
int ch = Integer.parseInt(character);
TextureRegion region = Core.atlas.find(texture);
if(region.getTexture() != uitex) throw new IllegalArgumentException("Font icon '" + texture + "' is not in the UI texture.");
+ unicodeIcons.put(nametex[0], ch);
+
Glyph glyph = new Glyph();
glyph.id = ch;
glyph.srcX = 0;
diff --git a/core/src/mindustry/ui/dialogs/DatabaseDialog.java b/core/src/mindustry/ui/dialogs/DatabaseDialog.java
index 5d4c0806bc..f6bb5bb8f1 100644
--- a/core/src/mindustry/ui/dialogs/DatabaseDialog.java
+++ b/core/src/mindustry/ui/dialogs/DatabaseDialog.java
@@ -1,6 +1,7 @@
package mindustry.ui.dialogs;
import arc.*;
+import arc.input.*;
import arc.struct.*;
import arc.graphics.*;
import arc.scene.event.*;
@@ -65,7 +66,12 @@ public class DatabaseDialog extends FloatingDialog{
}
if(unlocked(unlock)){
- image.clicked(() -> Vars.ui.content.show(unlock));
+ image.clicked(() -> {
+ if(Core.input.keyDown(KeyCode.SHIFT_LEFT) && Fonts.getUnicode(unlock.name) != 0){
+ Core.app.setClipboardText((char)Fonts.getUnicode(unlock.name) + "");
+ }
+ Vars.ui.content.show(unlock);
+ });
image.addListener(new Tooltip(t -> t.background(Tex.button).add(unlock.localizedName)));
}
diff --git a/core/src/mindustry/ui/dialogs/PausedDialog.java b/core/src/mindustry/ui/dialogs/PausedDialog.java
index 7bb9153d2a..60abddc270 100644
--- a/core/src/mindustry/ui/dialogs/PausedDialog.java
+++ b/core/src/mindustry/ui/dialogs/PausedDialog.java
@@ -35,29 +35,29 @@ public class PausedDialog extends FloatingDialog{
});
if(!mobile){
- float dw = 210f;
- cont.defaults().width(dw).height(50).pad(5f);
+ float dw = 220f;
+ cont.defaults().width(dw).height(55).pad(5f);
- cont.addButton("$back", this::hide).colspan(2).width(dw * 2 + 20f);
+ cont.addImageTextButton("$back", Icon.left, this::hide).colspan(2).width(dw * 2 + 20f);
cont.row();
if(world.isZone()){
- cont.addButton("$techtree", ui.tech::show);
+ cont.addImageTextButton("$techtree", Icon.tree, ui.tech::show);
}else{
- cont.addButton("$database", ui.database::show);
+ cont.addImageTextButton("$database", Icon.book, ui.database::show);
}
- cont.addButton("$settings", ui.settings::show);
+ cont.addImageTextButton("$settings", Icon.settings, ui.settings::show);
if(!state.rules.tutorial){
if(!world.isZone() && !state.isEditor()){
cont.row();
- cont.addButton("$savegame", save::show);
- cont.addButton("$loadgame", load::show).disabled(b -> net.active());
+ cont.addImageTextButton("$savegame", Icon.save, save::show);
+ cont.addImageTextButton("$loadgame", Icon.upload, load::show).disabled(b -> net.active());
}
cont.row();
- cont.addButton("$hostserver", () -> {
+ cont.addImageTextButton("$hostserver", Icon.host, () -> {
if(net.server() && steam){
platform.inviteFriends();
}else{
@@ -72,7 +72,7 @@ public class PausedDialog extends FloatingDialog{
cont.row();
- cont.addButton("$quit", this::showQuitConfirm).colspan(2).width(dw + 10f).update(s -> s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "$save.quit" : "$quit"));
+ cont.addImageTextButton("$quit", Icon.exit, this::showQuitConfirm).colspan(2).width(dw + 20f).update(s -> s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "$save.quit" : "$quit"));
}else{
cont.defaults().size(130f).pad(5);
diff --git a/core/src/mindustry/ui/fragments/PlacementFragment.java b/core/src/mindustry/ui/fragments/PlacementFragment.java
index d77ad977da..c7bf62ec3e 100644
--- a/core/src/mindustry/ui/fragments/PlacementFragment.java
+++ b/core/src/mindustry/ui/fragments/PlacementFragment.java
@@ -1,14 +1,15 @@
package mindustry.ui.fragments;
import arc.*;
-import arc.struct.*;
import arc.graphics.*;
+import arc.input.*;
import arc.math.geom.*;
import arc.scene.*;
import arc.scene.event.*;
import arc.scene.style.*;
import arc.scene.ui.*;
import arc.scene.ui.layout.*;
+import arc.struct.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.entities.traits.BuilderTrait.*;
@@ -19,7 +20,6 @@ import mindustry.graphics.*;
import mindustry.input.*;
import mindustry.type.*;
import mindustry.ui.*;
-import mindustry.ui.Cicon;
import mindustry.world.*;
import static mindustry.Vars.*;
@@ -206,6 +206,10 @@ public class PlacementFragment extends Fragment{
if(unlocked(block)){
control.input.block = control.input.block == block ? null : block;
selectedBlocks.put(currentCategory, control.input.block);
+
+ if(Core.input.keyDown(KeyCode.SHIFT_LEFT) && Fonts.getUnicode(block.name) != 0){
+ Core.app.setClipboardText((char)Fonts.getUnicode(block.name) + "");
+ }
}
}).size(46f).group(group).name("block-" + block.name).get();
diff --git a/gradle.properties b/gradle.properties
index 61a1990c17..8c9218035a 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
-archash=1d6a93973f44e4ef310cd959168ed611f2dbfef9
+archash=2f9e4392cd2a2db1d0af4f191d2799ac0b71ed10