Better server colors
This commit is contained in:
@@ -89,7 +89,7 @@ public class Vars implements Loadable{
|
||||
/** duration of time between turns in ticks */
|
||||
public static final float turnDuration = 2 * Time.toMinutes;
|
||||
/** chance of an invasion per turn, 1 = 100% */
|
||||
public static final float baseInvasionChance = 1f / 25f;
|
||||
public static final float baseInvasionChance = 1f / 30f;
|
||||
/** how many turns have to pass before invasions start */
|
||||
public static final int invasionGracePeriod = 20;
|
||||
/** min armor fraction damage; e.g. 0.05 = at least 5% damage */
|
||||
@@ -285,10 +285,10 @@ public class Vars implements Loadable{
|
||||
if(loadedLogger) return;
|
||||
|
||||
String[] tags = {"[green][D][]", "[royal][I][]", "[yellow][W][]", "[scarlet][E][]", ""};
|
||||
String[] stags = {"&lc&fb[D]", "&lg&fb[I]", "&ly&fb[W]", "&lr&fb[E]", ""};
|
||||
String[] stags = {"&lc&fb[D]", "&lb&fb[I]", "&ly&fb[W]", "&lr&fb[E]", ""};
|
||||
|
||||
Seq<String> logBuffer = new Seq<>();
|
||||
Log.setLogger((level, text) -> {
|
||||
Log.logger = (level, text) -> {
|
||||
String result = text;
|
||||
String rawText = Log.format(stags[level.ordinal()] + "&fr " + text);
|
||||
System.out.println(rawText);
|
||||
@@ -304,9 +304,9 @@ public class Vars implements Loadable{
|
||||
}
|
||||
}
|
||||
|
||||
ui.scriptfrag.addMessage(Log.removeCodes(result));
|
||||
ui.scriptfrag.addMessage(Log.removeColors(result));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Events.on(ClientLoadEvent.class, e -> logBuffer.each(ui.scriptfrag::addMessage));
|
||||
|
||||
@@ -319,18 +319,19 @@ public class Vars implements Loadable{
|
||||
settings.setAppName(appName);
|
||||
|
||||
Writer writer = settings.getDataDirectory().child("last_log.txt").writer(false);
|
||||
LogHandler log = Log.getLogger();
|
||||
Log.setLogger((level, text) -> {
|
||||
LogHandler log = Log.logger;
|
||||
//ignore it
|
||||
Log.logger = (level, text) -> {
|
||||
log.log(level, text);
|
||||
|
||||
try{
|
||||
writer.write("[" + Character.toUpperCase(level.name().charAt(0)) +"] " + Log.removeCodes(text) + "\n");
|
||||
writer.write("[" + Character.toUpperCase(level.name().charAt(0)) +"] " + Log.removeColors(text) + "\n");
|
||||
writer.flush();
|
||||
}catch(IOException e){
|
||||
e.printStackTrace();
|
||||
//ignore it
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
loadedFileLogger = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user