Added mobile copy/paste
This commit is contained in:
@@ -25,7 +25,7 @@ allprojects {
|
||||
appName = 'Mindustry'
|
||||
gdxVersion = '1.9.9'
|
||||
roboVMVersion = '2.3.0'
|
||||
uCoreVersion = '7eb80a9765557d025d589f28fa1910dffa3fc8ed'
|
||||
uCoreVersion = '3dfb820142a0fc583ad19413a24fc5038aa29d89'
|
||||
|
||||
getVersionString = {
|
||||
String buildVersion = getBuildVersion()
|
||||
|
||||
BIN
core/assets-raw/sprites/ui/icons/icon-copy.png
Normal file
BIN
core/assets-raw/sprites/ui/icons/icon-copy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 195 B |
BIN
core/assets-raw/sprites/ui/icons/icon-paste.png
Normal file
BIN
core/assets-raw/sprites/ui/icons/icon-paste.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 200 B |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 103 KiB |
@@ -24,7 +24,6 @@ ButtonStyle: {
|
||||
},
|
||||
TextButtonStyle: {
|
||||
default: {over: button-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: gray, down: button-down, up: button},
|
||||
left: {over: button-left-over, font: default-font, fontColor: white, disabledFontColor: gray, down: button-left-down, up: button-left},
|
||||
right: {over: button-right-over, font: default-font, fontColor: white, disabledFontColor: gray, down: button-right-down, up: button-right},
|
||||
wave: {font: default-font, fontColor: white, disabledFontColor: gray, up: button-edge-4},
|
||||
clear: {over: flat-over, font: default-font, fontColor: white, disabledFontColor: gray, down: pane, up: flat},
|
||||
|
||||
@@ -32,9 +32,22 @@ public abstract class Platform {
|
||||
dialog.setFillParent(true);
|
||||
dialog.content().top();
|
||||
dialog.content().defaults().height(65f);
|
||||
|
||||
TextField[] use = {null};
|
||||
|
||||
dialog.content().addImageButton("icon-copy", "clear", 16*3, () -> use[0].copy())
|
||||
.visible(() -> !use[0].getSelection().isEmpty()).width(65f);
|
||||
|
||||
dialog.content().addImageButton("icon-paste", "clear", 16*3, () ->
|
||||
use[0].paste(Gdx.app.getClipboard().getContents(), false))
|
||||
.visible(() -> !Gdx.app.getClipboard().getContents().isEmpty()).width(65f);
|
||||
|
||||
TextField to = dialog.content().addField(field.getText(), t-> {}).pad(15).width(250f).get();
|
||||
to.setMaxLength(maxLength);
|
||||
to.keyDown(Keys.ENTER, () -> dialog.content().find("okb").fireClick());
|
||||
|
||||
use[0] = to;
|
||||
|
||||
dialog.content().addButton("$text.ok", () -> {
|
||||
field.clearText();
|
||||
field.appendText(to.getText());
|
||||
|
||||
Reference in New Issue
Block a user