New tutorial section on tunnels, fixed tutorial bugs
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package io.anuke.mindustry.ui;
|
||||
|
||||
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;
|
||||
@@ -9,22 +8,37 @@ import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public class MenuButton extends Button{
|
||||
private static boolean hasInvalid = false;
|
||||
private String text;
|
||||
private boolean added = false;
|
||||
|
||||
public MenuButton(String text, PressGroup group, Listenable clicked){
|
||||
super("menu");
|
||||
String style = "title";
|
||||
float scale = 4f;
|
||||
this.text = text;
|
||||
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);
|
||||
hasInvalid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
add(text, style, scale);
|
||||
clicked(clicked);
|
||||
group.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layout() {
|
||||
super.layout();
|
||||
if(added)
|
||||
return;
|
||||
added = true;
|
||||
String style = "title";
|
||||
float scale = 4f;
|
||||
BitmapFont font = Core.skin.getFont("title");
|
||||
if(hasInvalid){
|
||||
style = "default";
|
||||
scale = Unit.dp.scl(1f);
|
||||
}
|
||||
add(text, style, scale);
|
||||
}
|
||||
}
|
||||
|
||||
12
core/src/io/anuke/mindustry/ui/dialogs/LanguageDialog.java
Normal file
12
core/src/io/anuke/mindustry/ui/dialogs/LanguageDialog.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class LanguageDialog extends FloatingDialog{
|
||||
private Locale[] locales = {Locale.ENGLISH, Locale.FRENCH, new Locale("es", "LA"), new Locale("pt", "BR")};
|
||||
|
||||
public LanguageDialog(){
|
||||
super("$text.language");
|
||||
addCloseButton();
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,6 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
void addSettings(){
|
||||
sound.volumePrefs();
|
||||
|
||||
//game.sliderPref("difficulty", 1, 0, Difficulty.values().length-1, i -> Difficulty.values()[i].toString());
|
||||
game.screenshakePref();
|
||||
game.checkPref("smoothcam", true);
|
||||
game.checkPref("effects", true);
|
||||
|
||||
Reference in New Issue
Block a user