Skip to content

Commit

Permalink
Vastly sped up game with a log of turns by only copying full turn's g…
Browse files Browse the repository at this point in the history
…enerated log entries into the main log at the end of the turn (Fidgit::TextArea takes a long time to re-calculate everything).
  • Loading branch information
bil-bas committed Feb 26, 2012
1 parent 347d105 commit a838e8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ruby_armor/states/play.rb
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ def play_turn

end

# Add the full turn's text into the main log at once, to save on re-calculations.
@log_contents["full log"].text += @log_contents["current turn"].text
@log_tab_windows["full log"].offset_y = Float::INFINITY

self.puts
end

Expand Down Expand Up @@ -508,10 +512,6 @@ def print(message)
else
@turn_logs[turn] << message
@log_contents["current turn"].text = replace_log @turn_logs[turn]

#$stdout.puts message
@log_contents["full log"].text += replace_log message
@log_tab_windows["full log"].offset_y = Float::INFINITY
end
end

Expand Down

0 comments on commit a838e8b

Please sign in to comment.