mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-13 03:20:32 +07:00
Font improvements
This commit is contained in:
parent
8d61ddbbd4
commit
ca519a94af
@ -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"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
72
core/assets-raw/fontgen/icons/host.svg
Normal file
72
core/assets-raw/fontgen/icons/host.svg
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
width="12"
|
||||
height="11"
|
||||
viewBox="0 0 12 11"
|
||||
sodipodi:docname="host.svg"
|
||||
inkscape:version="0.92.4 (f8dce91, 2019-08-02)">
|
||||
<metadata
|
||||
id="metadata8">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs6" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#000000"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1318"
|
||||
id="namedview4"
|
||||
showgrid="false"
|
||||
inkscape:zoom="16.857143"
|
||||
inkscape:cx="-19.567797"
|
||||
inkscape:cy="4.1610169"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" />
|
||||
<g
|
||||
id="g32"
|
||||
transform="translate(-1,-2)">
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1"
|
||||
d="M 1.125,2.625 Q 1.25,2.25 1.625,2.125 2,2 2.5,2 q 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 0.875,0.125 0.375,0.125 0.5,0.5 Q 13,3 13,3.5 13,4 12.875,4.375 12.75,4.75 12.375,4.875 12,5 11.5,5 11,5 10.5,5 10,5 9.5,5 9,5 8.5,5 8,5 7.5,5 7,5 6.5,5 6,5 5.5,5 5,5 4.5,5 4,5 3.5,5 3,5 2.5,5 2,5 1.625,4.875 1.25,4.75 1.125,4.375 1,4 1,3.5 1,3 1.125,2.625 M 5.5,4 Q 6,4 6.375,3.875 6.75,3.75 6.75,3.5 6.75,3.25 6.375,3.125 6,3 5.5,3 5,3 4.5,3 4,3 3.5,3 3,3 2.625,3.125 2.25,3.25 2.25,3.5 2.25,3.75 2.625,3.875 3,4 3.5,4 4,4 4.5,4 5,4 5.5,4 m 4.75,-0.5 q 0,0.25 0.25,0.25 0.25,0 0.25,-0.25 0,-0.25 -0.25,-0.25 -0.25,0 -0.25,0.25"
|
||||
id="path14"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1"
|
||||
d="M 1.125,6.625 Q 1.25,6.25 1.625,6.125 2,6 2.5,6 q 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 0.875,0.125 0.375,0.125 0.5,0.5 Q 13,7 13,7.5 13,8 12.875,8.375 12.75,8.75 12.375,8.875 12,9 11.5,9 11,9 10.5,9 10,9 9.5,9 9,9 8.5,9 8,9 7.5,9 7,9 6.5,9 6,9 5.5,9 5,9 4.5,9 4,9 3.5,9 3,9 2.5,9 2,9 1.625,8.875 1.25,8.75 1.125,8.375 1,8 1,7.5 1,7 1.125,6.625 M 5.5,8 Q 6,8 6.375,7.875 6.75,7.75 6.75,7.5 6.75,7.25 6.375,7.125 6,7 5.5,7 5,7 4.5,7 4,7 3.5,7 3,7 2.625,7.125 2.25,7.25 2.25,7.5 2.25,7.75 2.625,7.875 3,8 3.5,8 4,8 4.5,8 5,8 5.5,8 m 4.75,-0.5 q 0,0.25 0.25,0.25 0.25,0 0.25,-0.25 0,-0.25 -0.25,-0.25 -0.25,0 -0.25,0.25"
|
||||
id="path20"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1"
|
||||
d="M 1.125,10.625 Q 1.25,10.25 1.625,10.125 2,10 2.5,10 q 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 1,0 0.5,0 0.875,0.125 0.375,0.125 0.5,0.5 Q 13,11 13,11.5 q 0,0.5 -0.125,0.875 -0.125,0.375 -0.5,0.5 Q 12,13 11.5,13 11,13 10.5,13 10,13 9.5,13 9,13 8.5,13 8,13 7.5,13 7,13 6.5,13 6,13 5.5,13 5,13 4.5,13 4,13 3.5,13 3,13 2.5,13 2,13 1.625,12.875 1.25,12.75 1.125,12.375 1,12 1,11.5 1,11 1.125,10.625 M 5.5,12 Q 6,12 6.375,11.875 6.75,11.75 6.75,11.5 6.75,11.25 6.375,11.125 6,11 5.5,11 5,11 4.5,11 4,11 3.5,11 3,11 2.625,11.125 2.25,11.25 2.25,11.5 q 0,0.25 0.375,0.375 Q 3,12 3.5,12 q 0.5,0 1,0 0.5,0 1,0 m 4.75,-0.5 q 0,0.25 0.25,0.25 0.25,0 0.25,-0.25 0,-0.25 -0.25,-0.25 -0.25,0 -0.25,0.25"
|
||||
id="path26"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
@ -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"),
|
||||
|
@ -26,11 +26,17 @@ import mindustry.core.*;
|
||||
import java.util.*;
|
||||
|
||||
public class Fonts{
|
||||
private static ObjectIntMap<String> 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;
|
||||
|
@ -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)));
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=1d6a93973f44e4ef310cd959168ed611f2dbfef9
|
||||
archash=2f9e4392cd2a2db1d0af4f191d2799ac0b71ed10
|
||||
|
Loading…
Reference in New Issue
Block a user