mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
Improved russian glyphs, made menu buttons fallback
This commit is contained in:
parent
1e63236cc4
commit
6ba1f117bd
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
@ -1,19 +1,29 @@
|
||||
package io.anuke.mindustry.ui;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Colors;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.Scaling;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||
import io.anuke.ucore.UCore;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.function.Listenable;
|
||||
import io.anuke.ucore.scene.ui.Button;
|
||||
import io.anuke.ucore.scene.ui.Image;
|
||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public class MenuButton extends Button{
|
||||
|
||||
public MenuButton(String text, PressGroup group, Listenable clicked){
|
||||
super("menu");
|
||||
add(text, "title", 4);
|
||||
String style = "title";
|
||||
float scale = 4f;
|
||||
BitmapFont font = Core.skin.getFont("title");
|
||||
for(char c : Bundles.get(text.substring(1)).toCharArray()){
|
||||
if(!font.getData().hasGlyph(c)){
|
||||
UCore.log("No glyph found: " + c);
|
||||
style = "default";
|
||||
scale = Unit.dp.scl(1f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
add(text, style, scale);
|
||||
clicked(clicked);
|
||||
group.add(this);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class HostDialog extends FloatingDialog{
|
||||
|
||||
content().row();
|
||||
|
||||
content().addButton("Host", () -> {
|
||||
content().addButton("$text.host", () -> {
|
||||
Vars.ui.loadfrag.show("$text.hosting");
|
||||
Timers.runTask(5f, () -> {
|
||||
try{
|
||||
|
Loading…
Reference in New Issue
Block a user