Bugfixes
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
package io.anuke.mindustry.ui.fragments;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.Input.TextInput;
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.BitmapFont;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.graphics.g2d.Fill;
|
||||
import io.anuke.arc.graphics.g2d.GlyphLayout;
|
||||
import io.anuke.arc.input.KeyCode;
|
||||
import io.anuke.arc.graphics.g2d.*;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.arc.scene.Group;
|
||||
import io.anuke.arc.scene.ui.Dialog;
|
||||
import io.anuke.arc.scene.ui.Label;
|
||||
import io.anuke.arc.scene.ui.Label.LabelStyle;
|
||||
import io.anuke.arc.scene.ui.TextField;
|
||||
@@ -115,35 +111,6 @@ public class ChatFragment extends Table{
|
||||
chatfield.getStyle().fontColor = Color.WHITE;
|
||||
chatfield.setStyle(chatfield.getStyle());
|
||||
|
||||
if(mobile){
|
||||
chatfield.tapped(() -> {
|
||||
Dialog dialog = new Dialog("", "dialog");
|
||||
dialog.setFillParent(true);
|
||||
dialog.cont.top();
|
||||
dialog.cont.defaults().height(65f);
|
||||
TextField to = dialog.cont.addField("", t-> {}).pad(15).width(250f).get();
|
||||
to.setMaxLength(maxTextLength);
|
||||
to.keyDown(KeyCode.ENTER, () -> {
|
||||
dialog.cont.find("okb").fireClick();
|
||||
});
|
||||
dialog.cont.addButton("$ok", () -> {
|
||||
chatfield.clearText();
|
||||
chatfield.appendText(to.getText());
|
||||
chatfield.change();
|
||||
dialog.hide();
|
||||
Core.input.setOnscreenKeyboardVisible(false);
|
||||
toggle();
|
||||
}).width(90f).name("okb");
|
||||
|
||||
dialog.show();
|
||||
Time.runTask(1f, () -> {
|
||||
to.setCursorPosition(to.getText().length());
|
||||
Core.scene.setKeyboardFocus(to);
|
||||
Core.input.setOnscreenKeyboardVisible(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
bottom().left().marginBottom(offsety).marginLeft(offsetx * 2).add(fieldlabel).padBottom(6f);
|
||||
|
||||
add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28);
|
||||
@@ -214,8 +181,21 @@ public class ChatFragment extends Table{
|
||||
|
||||
if(!chatOpen){
|
||||
scene.setKeyboardFocus(chatfield);
|
||||
chatfield.fireClick();
|
||||
chatOpen = !chatOpen;
|
||||
if(mobile){
|
||||
TextInput input = new TextInput();
|
||||
input.maxLength = maxTextLength;
|
||||
input.accepted = text -> {
|
||||
chatfield.setText(text);
|
||||
sendMessage();
|
||||
hide();
|
||||
Core.input.setOnscreenKeyboardVisible(false);
|
||||
};
|
||||
input.canceled = this::hide;
|
||||
Core.input.getTextInput(input);
|
||||
}else{
|
||||
chatfield.fireClick();
|
||||
}
|
||||
}else{
|
||||
scene.setKeyboardFocus(null);
|
||||
chatOpen = !chatOpen;
|
||||
|
||||
@@ -202,6 +202,7 @@ public class HudFragment extends Fragment{
|
||||
|
||||
//'core is under attack' table
|
||||
parent.fill(t -> {
|
||||
t.touchable(Touchable.disabled);
|
||||
float notifDuration = 240f;
|
||||
|
||||
Events.on(StateChangeEvent.class, event -> {
|
||||
@@ -236,7 +237,7 @@ public class HudFragment extends Fragment{
|
||||
return coreAttackOpacity > 0;
|
||||
});
|
||||
t.table("button", top -> top.add("$coreattack").pad(2)
|
||||
.update(label -> label.getColor().set(Color.ORANGE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 2f, 1f))));
|
||||
.update(label -> label.getColor().set(Color.ORANGE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled);
|
||||
});
|
||||
|
||||
//launch button
|
||||
|
||||
Reference in New Issue
Block a user