Extended multiplayer chat text box to 255 character max from 60

Prevented the game from stealing focus from the multi player chat box to ensure you do not auto end turn or pass priority due to typing in chat when you regain priority
This commit is contained in:
austinio7116
2018-02-23 21:20:25 +00:00
committed by maustin
parent 85adc466b3
commit 361443d845
2 changed files with 7 additions and 6 deletions

View File

@@ -72,7 +72,7 @@ public enum FNetOverlay implements IOnlineChatInterface {
} }
private final FTextArea txtLog = new FTextArea(); private final FTextArea txtLog = new FTextArea();
private final FTextField txtInput = new FTextField.Builder().maxLength(60).build(); private final FTextField txtInput = new FTextField.Builder().maxLength(255).build();
private final FLabel cmdSend = new FLabel.ButtonBuilder().text("Send").build(); private final FLabel cmdSend = new FLabel.ButtonBuilder().text("Send").build();
//private boolean minimized = false; //private boolean minimized = false;
@@ -98,6 +98,10 @@ public enum FNetOverlay implements IOnlineChatInterface {
} }
}; };
public FTextField getTxtInput(){
return txtInput;
}
/** /**
* Semi-transparent overlay panel. Should be used with layered panes. * Semi-transparent overlay panel. Should be used with layered panes.
*/ */

View File

@@ -59,10 +59,7 @@ import forge.game.player.IHasIcon;
import forge.game.player.PlayerView; import forge.game.player.PlayerView;
import forge.game.spellability.SpellAbilityView; import forge.game.spellability.SpellAbilityView;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
import forge.gui.GuiChoose; import forge.gui.*;
import forge.gui.GuiDialog;
import forge.gui.GuiUtils;
import forge.gui.SOverlayUtils;
import forge.gui.framework.DragCell; import forge.gui.framework.DragCell;
import forge.gui.framework.EDocID; import forge.gui.framework.EDocID;
import forge.gui.framework.FScreen; import forge.gui.framework.FScreen;
@@ -586,7 +583,7 @@ public final class CMatchUI
btn1.setFocusable(enable1 && focus1 ); btn1.setFocusable(enable1 && focus1 );
btn2.setFocusable(enable2 && !focus1); btn2.setFocusable(enable2 && !focus1);
// ensure we don't steal focus from an overlay // ensure we don't steal focus from an overlay
if (toFocus != null) { if (toFocus != null && !FNetOverlay.SINGLETON_INSTANCE.getTxtInput().hasFocus() ) {
toFocus.requestFocus(); // focus here even if another window has focus - shouldn't have to do it this way but some popups grab window focus toFocus.requestFocus(); // focus here even if another window has focus - shouldn't have to do it this way but some popups grab window focus
} }
} }