Fixed markup crash / setsector command fixed / Drone crash fixed

This commit is contained in:
Anuken
2018-08-15 21:00:40 -04:00
parent c569232e74
commit 4f72011cf7
4 changed files with 19 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ allprojects {
appName = 'Mindustry' appName = 'Mindustry'
gdxVersion = '1.9.8' gdxVersion = '1.9.8'
roboVMVersion = '2.3.0' roboVMVersion = '2.3.0'
uCoreVersion = '76dc741b49' uCoreVersion = '2f18f69ffb'
getVersionString = { getVersionString = {
String buildVersion = getBuildVersion() String buildVersion = getBuildVersion()

View File

@@ -190,7 +190,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
public void update(){ public void update(){
ItemDrop item = (ItemDrop) target; ItemDrop item = (ItemDrop) target;
if(inventory.isFull() || !inventory.canAcceptItem(item.getItem(), 1)){ if(item == null || inventory.isFull() || !inventory.canAcceptItem(item.getItem(), 1)){
setState(drop); setState(drop);
return; return;
} }
@@ -329,7 +329,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
public void update(){ public void update(){
super.update(); super.update();
if(target != null && target.getTeam() != team){ if(state.is(repair) && target != null && target.getTeam() != team){
target = null; target = null;
} }

View File

@@ -61,9 +61,14 @@ public class ChatFragment extends Table{
visible(() -> !state.is(State.menu) && Net.active()); visible(() -> !state.is(State.menu) && Net.active());
update(() -> { update(() -> {
if(!Net.active() && chatOpen){ if(!Net.active()){
clearMessages();
if(chatOpen){
hide(); hide();
} }
}
if(Net.active() && Inputs.keyTap("chat")){ if(Net.active() && Inputs.keyTap("chat")){
toggle(); toggle();
@@ -109,9 +114,17 @@ public class ChatFragment extends Table{
super.draw(batch, parentAlpha); super.draw(batch, parentAlpha);
getStyle().font.getData().markupEnabled = true; getStyle().font.getData().markupEnabled = true;
} }
@Override
protected void updateDisplayText(){
getStyle().font.getData().markupEnabled = false;
super.updateDisplayText();
getStyle().font.getData().markupEnabled = true;
}
}; };
chatfield.setTextFieldFilter((field, c) -> field.getText().length() < Vars.maxTextLength); chatfield.setTextFieldFilter((field, c) -> field.getText().length() < Vars.maxTextLength);
chatfield.getStyle().background = null; chatfield.getStyle().background = null;
chatfield.getStyle().messageFont = null;
chatfield.getStyle().fontColor = Color.WHITE; chatfield.getStyle().fontColor = Color.WHITE;
chatfield.setStyle(chatfield.getStyle()); chatfield.setStyle(chatfield.getStyle());
chatfield.update(() -> { chatfield.update(() -> {

View File

@@ -269,7 +269,7 @@ public class ServerControl extends Module{
} }
}); });
handler.register("setsector <x> <y>", "Sets the next sector to be played. Does not affect current game.", arg -> { handler.register("setsector", "<x> <y>", "Sets the next sector to be played. Does not affect current game.", arg -> {
try{ try{
Settings.putInt("sector_x", Integer.parseInt(arg[0])); Settings.putInt("sector_x", Integer.parseInt(arg[0]));
Settings.putInt("sector_y", Integer.parseInt(arg[1])); Settings.putInt("sector_y", Integer.parseInt(arg[1]));