Added teamchat
This commit is contained in:
@@ -14,6 +14,7 @@ import io.anuke.arc.util.*;
|
||||
import io.anuke.arc.util.pooling.Pools;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.content.*;
|
||||
import io.anuke.mindustry.core.*;
|
||||
import io.anuke.mindustry.entities.*;
|
||||
import io.anuke.mindustry.entities.traits.*;
|
||||
import io.anuke.mindustry.game.*;
|
||||
@@ -775,7 +776,28 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
||||
//region utility methods
|
||||
|
||||
public void sendMessage(String text){
|
||||
Call.sendMessage(con.id, text, null, null);
|
||||
if(isLocal){
|
||||
if(Vars.ui != null){
|
||||
Log.info("add " + text);
|
||||
Vars.ui.chatfrag.addMessage(text, null);
|
||||
}
|
||||
}else{
|
||||
Call.sendMessage(con.id, text, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendMessage(String text, Player from){
|
||||
sendMessage(text, from, NetClient.colorizeName(from.id, from.name));
|
||||
}
|
||||
|
||||
public void sendMessage(String text, Player from, String fromName){
|
||||
if(isLocal){
|
||||
if(Vars.ui != null){
|
||||
Vars.ui.chatfrag.addMessage(text, fromName);
|
||||
}
|
||||
}else{
|
||||
Call.sendMessage(con.id, text, fromName, from);
|
||||
}
|
||||
}
|
||||
|
||||
/** Resets all values of the player. */
|
||||
|
||||
Reference in New Issue
Block a user