v0.8.0: added functionality for forced newlines in game log

This commit is contained in:
Evan Debenham 2020-03-29 17:13:00 -04:00
parent 01946d4c66
commit 70d6476fd2
12 changed files with 12 additions and 9 deletions

View File

@ -347,7 +347,6 @@ public class DwarfKing extends Mob {
yell(Messages.get(this, "notice"));
for (Char ch : Actor.chars()){
if (ch instanceof DriedRose.GhostHero){
GLog.n("\n");
((DriedRose.GhostHero) ch).sayBoss();
}
}

View File

@ -267,7 +267,6 @@ public class Goo extends Mob {
yell(Messages.get(this, "notice"));
for (Char ch : Actor.chars()){
if (ch instanceof DriedRose.GhostHero){
GLog.n("\n");
((DriedRose.GhostHero) ch).sayBoss();
}
}

View File

@ -232,7 +232,6 @@ public class King extends Mob {
yell(Messages.get(this, "notice"));
for (Char ch : Actor.chars()){
if (ch instanceof DriedRose.GhostHero){
GLog.n("\n");
((DriedRose.GhostHero) ch).sayBoss();
}
}

View File

@ -720,6 +720,7 @@ public abstract class Mob extends Char {
}
public void yell( String str ) {
GLog.newLine();
GLog.n( "%s: \"%s\" ", Messages.titleCase(name()), str );
}

View File

@ -321,7 +321,6 @@ public class NewDM300 extends Mob {
yell(Messages.get(this, "notice"));
for (Char ch : Actor.chars()){
if (ch instanceof DriedRose.GhostHero){
GLog.n("\n");
((DriedRose.GhostHero) ch).sayBoss();
}
}

View File

@ -305,7 +305,6 @@ public class NewTengu extends Mob {
yell(Messages.get(this, "notice_gotcha", Dungeon.hero.name()));
for (Char ch : Actor.chars()){
if (ch instanceof DriedRose.GhostHero){
GLog.n("\n");
((DriedRose.GhostHero) ch).sayBoss();
}
}

View File

@ -174,7 +174,6 @@ public class OldDM300 extends Mob {
yell(Messages.get(this, "notice"));
for (Char ch : Actor.chars()){
if (ch instanceof DriedRose.GhostHero){
GLog.n("\n");
((DriedRose.GhostHero) ch).sayBoss();
}
}

View File

@ -251,7 +251,6 @@ public class OldTengu extends Mob {
yell(Messages.get(this, "notice_mine", Dungeon.hero.name()));
for (Char ch : Actor.chars()){
if (ch instanceof DriedRose.GhostHero){
GLog.n("\n");
((DriedRose.GhostHero) ch).sayBoss();
}
}

View File

@ -181,7 +181,6 @@ public class Yog extends Mob {
yell(Messages.get(this, "notice"));
for (Char ch : Actor.chars()){
if (ch instanceof DriedRose.GhostHero){
GLog.n("\n");
((DriedRose.GhostHero) ch).sayBoss();
}
}

View File

@ -369,7 +369,6 @@ public class YogDzewa extends Mob {
yell(Messages.get(this, "notice"));
for (Char ch : Actor.chars()){
if (ch instanceof DriedRose.GhostHero){
GLog.n("\n");
((DriedRose.GhostHero) ch).sayBoss();
}
}

View File

@ -57,6 +57,11 @@ public class GameLog extends Component implements Signal.Listener<String> {
clear();
recreateLines();
}
if (text.equals( GLog.NEW_LINE )){
lastEntry = null;
continue;
}
int color = CharSprite.DEFAULT;
if (text.startsWith( GLog.POSITIVE )) {

View File

@ -33,8 +33,14 @@ public class GLog {
public static final String NEGATIVE = "-- ";
public static final String WARNING = "** ";
public static final String HIGHLIGHT = "@@ ";
public static final String NEW_LINE = "\n";
public static Signal<String> update = new Signal<>();
public static void newLine(){
update.dispatch( NEW_LINE );
}
public static void i( String text, Object... args ) {