Added chat :emoji: support on desktop
This commit is contained in:
@@ -109,6 +109,10 @@ public class GameService{
|
|||||||
routerLanguage.complete();
|
routerLanguage.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!Planets.serpulo.sectors.contains(s -> !s.isCaptured())){
|
||||||
|
captureAllSectors.complete();
|
||||||
|
}
|
||||||
|
|
||||||
Events.on(UnitDestroyEvent.class, e -> {
|
Events.on(UnitDestroyEvent.class, e -> {
|
||||||
if(campaign()){
|
if(campaign()){
|
||||||
if(e.unit.team != Vars.player.team()){
|
if(e.unit.team != Vars.player.team()){
|
||||||
@@ -477,7 +481,9 @@ public class GameService{
|
|||||||
allPresetsErekir.complete();
|
allPresetsErekir.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
SStat.sectorsControlled.set(e.sector.planet.sectors.count(Sector::hasBase));
|
if(e.sector.planet == Planets.serpulo){
|
||||||
|
SStat.sectorsControlled.set(e.sector.planet.sectors.count(Sector::hasBase));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Events.on(PayloadDropEvent.class, e -> {
|
Events.on(PayloadDropEvent.class, e -> {
|
||||||
|
|||||||
@@ -140,6 +140,8 @@ public class Fonts{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stringIcons.put("alphachan", stringIcons.get("alphaaaa"));
|
||||||
|
|
||||||
iconTable = new TextureRegion[512];
|
iconTable = new TextureRegion[512];
|
||||||
iconTable[0] = Core.atlas.find("error");
|
iconTable[0] = Core.atlas.find("error");
|
||||||
lastCid = 1;
|
lastCid = 1;
|
||||||
|
|||||||
@@ -105,6 +105,8 @@ public class ChatFragment extends Table{
|
|||||||
chatfield.getStyle().fontColor = Color.white;
|
chatfield.getStyle().fontColor = Color.white;
|
||||||
chatfield.setStyle(chatfield.getStyle());
|
chatfield.setStyle(chatfield.getStyle());
|
||||||
|
|
||||||
|
chatfield.typed(this::handleType);
|
||||||
|
|
||||||
bottom().left().marginBottom(offsety).marginLeft(offsetx * 2).add(fieldlabel).padBottom(6f);
|
bottom().left().marginBottom(offsety).marginLeft(offsetx * 2).add(fieldlabel).padBottom(6f);
|
||||||
|
|
||||||
add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28);
|
add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28);
|
||||||
@@ -115,6 +117,22 @@ public class ChatFragment extends Table{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//no mobile support.
|
||||||
|
private void handleType(char c){
|
||||||
|
int cursor = chatfield.getCursorPosition();
|
||||||
|
if(c == ':'){
|
||||||
|
int index = chatfield.getText().lastIndexOf(':', cursor - 2);
|
||||||
|
if(index >= 0 && index < cursor){
|
||||||
|
String text = chatfield.getText().substring(index + 1, cursor - 1);
|
||||||
|
String uni = Fonts.getUnicodeStr(text);
|
||||||
|
if(uni != null && uni.length() > 0){
|
||||||
|
chatfield.setText(chatfield.getText().substring(0, index) + uni + chatfield.getText().substring(cursor));
|
||||||
|
chatfield.setCursorPosition(index + uni.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void rect(float x, float y, float w, float h){
|
protected void rect(float x, float y, float w, float h){
|
||||||
//prevents texture bindings; the string lookup is irrelevant as it is only called <10 times per frame, and maps are very fast anyway
|
//prevents texture bindings; the string lookup is irrelevant as it is only called <10 times per frame, and maps are very fast anyway
|
||||||
Draw.rect("whiteui", x + w/2f, y + h/2f, w, h);
|
Draw.rect("whiteui", x + w/2f, y + h/2f, w, h);
|
||||||
|
|||||||
@@ -25,4 +25,4 @@ org.gradle.caching=true
|
|||||||
#used for slow jitpack builds; TODO see if this actually works
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
archash=8793e01874
|
archash=5a1cbb8b59
|
||||||
|
|||||||
Reference in New Issue
Block a user