Bugfixes / Fixed #639
This commit is contained in:
@@ -14,7 +14,7 @@ linkfail = Failed to open link!\nThe URL has been copied to your clipboard.
|
|||||||
screenshot = Screenshot saved to {0}
|
screenshot = Screenshot saved to {0}
|
||||||
screenshot.invalid = Map too large, potentially not enough memory for screenshot.
|
screenshot.invalid = Map too large, potentially not enough memory for screenshot.
|
||||||
gameover = Game Over
|
gameover = Game Over
|
||||||
gameover.pvp = The[accent] {0}[] team is victorious!
|
gameover.pvp = The[accent] {0}[] team is victorious!f
|
||||||
highscore = [accent]New highscore!
|
highscore = [accent]New highscore!
|
||||||
|
|
||||||
load.sound = Sounds
|
load.sound = Sounds
|
||||||
@@ -353,6 +353,7 @@ launch.skip.confirm = If you skip now, you will not be able to launch until late
|
|||||||
uncover = Uncover
|
uncover = Uncover
|
||||||
configure = Configure Loadout
|
configure = Configure Loadout
|
||||||
configure.locked = [lightgray]Unlock configuring loadout: Wave {0}.
|
configure.locked = [lightgray]Unlock configuring loadout: Wave {0}.
|
||||||
|
configure.invalid = Amount must be a number between 0 and {0}.
|
||||||
zone.unlocked = [lightgray]{0} unlocked.
|
zone.unlocked = [lightgray]{0} unlocked.
|
||||||
zone.requirement.complete = Wave {0} reached:\n{1} zone requirements met.
|
zone.requirement.complete = Wave {0} reached:\n{1} zone requirements met.
|
||||||
zone.config.complete = Wave {0} reached:\nLoadout config unlocked.
|
zone.config.complete = Wave {0} reached:\nLoadout config unlocked.
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.core;
|
|||||||
import io.anuke.arc.*;
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.Graphics.*;
|
import io.anuke.arc.Graphics.*;
|
||||||
import io.anuke.arc.Graphics.Cursor.*;
|
import io.anuke.arc.Graphics.Cursor.*;
|
||||||
|
import io.anuke.arc.Input.*;
|
||||||
import io.anuke.arc.assets.*;
|
import io.anuke.arc.assets.*;
|
||||||
import io.anuke.arc.assets.loaders.*;
|
import io.anuke.arc.assets.loaders.*;
|
||||||
import io.anuke.arc.assets.loaders.resolvers.*;
|
import io.anuke.arc.assets.loaders.resolvers.*;
|
||||||
@@ -262,28 +263,37 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showTextInput(String titleText, String text, int textLength, String def, TextFieldFilter filter, Consumer<String> confirmed){
|
public void showTextInput(String titleText, String dtext, int textLength, String def, boolean inumeric, Consumer<String> confirmed){
|
||||||
new Dialog(titleText){{
|
if(mobile){
|
||||||
cont.margin(30).add(text).padRight(6f);
|
Core.input.getTextInput(new TextInput(){{
|
||||||
TextField field = cont.addField(def, t -> {
|
this.title = (titleText.startsWith("$") ? Core.bundle.get(titleText.substring(1)) : titleText);
|
||||||
}).size(170f, 50f).get();
|
this.text = def;
|
||||||
field.setFilter((f, c) -> field.getText().length() < textLength && filter.acceptChar(f, c));
|
this.numeric = inumeric;
|
||||||
platform.addDialog(field);
|
this.maxLength = textLength;
|
||||||
buttons.defaults().size(120, 54).pad(4);
|
this.accepted = confirmed;
|
||||||
buttons.addButton("$ok", () -> {
|
}});
|
||||||
confirmed.accept(field.getText());
|
}else{
|
||||||
hide();
|
new Dialog(titleText){{
|
||||||
}).disabled(b -> field.getText().isEmpty());
|
cont.margin(30).add(dtext).padRight(6f);
|
||||||
buttons.addButton("$cancel", this::hide);
|
TextFieldFilter filter = inumeric ? TextFieldFilter.digitsOnly : (f, c) -> true;
|
||||||
}}.show();
|
TextField field = cont.addField(def, t -> {}).size(170f, 50f).get();
|
||||||
|
field.setFilter((f, c) -> field.getText().length() < textLength && filter.acceptChar(f, c));
|
||||||
|
buttons.defaults().size(120, 54).pad(4);
|
||||||
|
buttons.addButton("$ok", () -> {
|
||||||
|
confirmed.accept(field.getText());
|
||||||
|
hide();
|
||||||
|
}).disabled(b -> field.getText().isEmpty());
|
||||||
|
buttons.addButton("$cancel", this::hide);
|
||||||
|
}}.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showTextInput(String title, String text, String def, Consumer<String> confirmed){
|
public void showTextInput(String title, String text, String def, Consumer<String> confirmed){
|
||||||
showTextInput(title, text, 12, def, (field, c) -> true, confirmed);
|
showTextInput(title, text, 24, def, confirmed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showTextInput(String title, String text, int textLength, String def, Consumer<String> confirmed){
|
public void showTextInput(String titleText, String text, int textLength, String def, Consumer<String> confirmed){
|
||||||
showTextInput(title, text, textLength < 0 ? 12 : textLength, def, (field, c) -> true, confirmed);
|
showTextInput(titleText, text, textLength, def, false, confirmed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showInfoFade(String info){
|
public void showInfoFade(String info){
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.anuke.mindustry.game;
|
package io.anuke.mindustry.game;
|
||||||
|
|
||||||
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.Files.*;
|
import io.anuke.arc.Files.*;
|
||||||
import io.anuke.arc.collection.*;
|
import io.anuke.arc.collection.*;
|
||||||
import io.anuke.arc.files.*;
|
import io.anuke.arc.files.*;
|
||||||
@@ -26,7 +27,7 @@ public class Version{
|
|||||||
if(!enabled) return;
|
if(!enabled) return;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
FileHandle file = new FileHandle("version.properties", FileType.Internal);
|
FileHandle file = OS.isAndroid || OS.isIos ? Core.files.internal("version.properties") : new FileHandle("version.properties", FileType.Internal);
|
||||||
|
|
||||||
ObjectMap<String, String> map = new ObjectMap<>();
|
ObjectMap<String, String> map = new ObjectMap<>();
|
||||||
PropertiesUtils.load(map, file.reader());
|
PropertiesUtils.load(map, file.reader());
|
||||||
|
|||||||
@@ -176,6 +176,11 @@ public class Styles{
|
|||||||
up = none;
|
up = none;
|
||||||
over = flatOver;
|
over = flatOver;
|
||||||
}},
|
}},
|
||||||
|
clearPartial2i = new ImageButtonStyle(){{
|
||||||
|
down = whiteui;
|
||||||
|
up = pane;
|
||||||
|
over = flatDown;
|
||||||
|
}},
|
||||||
clearTogglei = new ImageButtonStyle(){{
|
clearTogglei = new ImageButtonStyle(){{
|
||||||
down = flatDown;
|
down = flatDown;
|
||||||
checked = flatDown;
|
checked = flatDown;
|
||||||
@@ -266,6 +271,7 @@ public class Styles{
|
|||||||
messageFont = Fonts.def;
|
messageFont = Fonts.def;
|
||||||
messageFontColor = Color.gray;
|
messageFontColor = Color.gray;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
public static CheckBoxStyle
|
public static CheckBoxStyle
|
||||||
defaultCheck = new CheckBoxStyle(){{
|
defaultCheck = new CheckBoxStyle(){{
|
||||||
checkboxOn = checkOn;
|
checkboxOn = checkOn;
|
||||||
@@ -278,6 +284,7 @@ public class Styles{
|
|||||||
fontColor = Color.white;
|
fontColor = Color.white;
|
||||||
disabledFontColor = Color.gray;
|
disabledFontColor = Color.gray;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
public static DialogStyle
|
public static DialogStyle
|
||||||
defaultDialog = new DialogStyle(){{
|
defaultDialog = new DialogStyle(){{
|
||||||
stageBackground = black9;
|
stageBackground = black9;
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
stack.add(new Table(t -> t.margin(4f).add(new Image(node.zone.preview).setScaling(Scaling.stretch)).color(node.zone.unlocked() ? Color.darkGray : Color.fromGray(0.2f)).grow()));
|
stack.add(new Table(t -> t.margin(4f).add(new Image(node.zone.preview).setScaling(Scaling.stretch)).color(node.zone.unlocked() ? Color.darkGray : Color.fromGray(0.2f)).grow()));
|
||||||
stack.update(() -> stack.setPosition(node.x + panX + width / 2f, node.y + panY + height / 2f, Align.center));
|
stack.update(() -> stack.setPosition(node.x + panX + width / 2f, node.y + panY + height / 2f, Align.center));
|
||||||
|
|
||||||
Button button = new Button(Tex.buttonSquare);
|
Button button = new Button(Styles.squaret);
|
||||||
buildButton(node.zone, button);
|
buildButton(node.zone, button);
|
||||||
stack.add(button);
|
stack.add(button);
|
||||||
addChild(stack);
|
addChild(stack);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import io.anuke.arc.function.*;
|
|||||||
import io.anuke.arc.input.*;
|
import io.anuke.arc.input.*;
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.gen.*;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
@@ -99,11 +100,24 @@ public class LoadoutDialog extends FloatingDialog{
|
|||||||
stack.amount = Math.max(stack.amount - step, 0);
|
stack.amount = Math.max(stack.amount - step, 0);
|
||||||
updater.run();
|
updater.run();
|
||||||
}).size(bsize);
|
}).size(bsize);
|
||||||
|
|
||||||
items.addButton("+", Styles.clearPartialt, () -> {
|
items.addButton("+", Styles.clearPartialt, () -> {
|
||||||
stack.amount = Math.min(stack.amount + step, capacity);
|
stack.amount = Math.min(stack.amount + step, capacity);
|
||||||
updater.run();
|
updater.run();
|
||||||
}).size(bsize);
|
}).size(bsize);
|
||||||
|
|
||||||
|
items.addImageButton(Icon.pencilSmaller, Styles.clearPartial2i, () -> ui.showTextInput("$configure", stack.item.localizedName, 10, stack.amount + "", true, str -> {
|
||||||
|
if(Strings.canParsePostiveInt(str)){
|
||||||
|
int amount = Strings.parseInt(str);
|
||||||
|
if(amount >= 0 && amount <= capacity){
|
||||||
|
stack.amount = amount;
|
||||||
|
updater.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ui.showInfo(Core.bundle.format("configure.invalid", capacity));
|
||||||
|
})).size(bsize);
|
||||||
|
|
||||||
items.addImage(stack.item.icon(Item.Icon.medium)).size(8 * 3).padRight(4).padLeft(4);
|
items.addImage(stack.item.icon(Item.Icon.medium)).size(8 * 3).padRight(4).padLeft(4);
|
||||||
items.label(() -> stack.amount + "").left();
|
items.label(() -> stack.amount + "").left();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user