Skip to content

Commit

Permalink
Add gui state transitions to log
Browse files Browse the repository at this point in the history
src/gui/Gui.java
src/phoenix/Phoenix.java
  • Loading branch information
joulupunikki committed Jan 17, 2017
1 parent 59e799a commit 6abffce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gui/Gui.java
Expand Up @@ -2570,7 +2570,9 @@ public CombatWindow getCombatWindow() {
}

public void setCurrentState(State s) {
System.out.println("State -> " + s.getClass().getName());
String state_name = s.getClass().getName();
System.out.println("State -> " + state_name);
Phoenix.logGuiState(state_name);
state = s;
SU.setStateUpKeep(s);
// state_ref.setState(s);
Expand Down
9 changes: 9 additions & 0 deletions src/phoenix/Phoenix.java
Expand Up @@ -448,4 +448,13 @@ static void flushLogMessages() {
}
log_buffer.clear();
}

public static void logGuiState(String state) {
String STATE_PREFIX = "# s->";
if (is_real_time) {
log_buffer.addLast(STATE_PREFIX + state);
} else {
input_log_writer.println(STATE_PREFIX + state);
}
}
}

0 comments on commit 6abffce

Please sign in to comment.