Permalink
Browse files

fixed percentage thing in logs

  • Loading branch information...
1 parent f4eb364 commit 092720dd9f7c78bee5e7f95eed12c7cbab02dc46 @coyotte508 committed Jan 10, 2012
Showing with 7 additions and 8 deletions.
  1. +1 −0 .gitignore
  2. +6 −8 src/BattleManager/battleclientlog.cpp
View
@@ -39,3 +39,4 @@ bin/Chain Breeding
bin/MoveMachine
bin/BattleManager
bin/scripts.js
+ui_*.h
@@ -29,14 +29,8 @@ BattleClientLog::BattleClientLog(battledata *dat, BattleDefaultTheme *theme, boo
void BattleClientLog::emitAll()
{
- QRegExp r("<div class=\"([A-z]+)\">(.*)</div>");
-
foreach(QString s, getLog()) {
- if (r.indexIn(s) != -1) {
- emit lineToBePrinted(r.cap(2) + "<br />");
- } else {
- emit lineToBePrinted(s);
- }
+ emit lineToBePrinted(s);
}
}
@@ -153,7 +147,11 @@ void BattleClientLog::onBeginTurn(int turn)
void BattleClientLog::onHpChange(int spot, int newHp)
{
- printSilent(tr("%1's new HP is %2%.").arg(nick(spot)).arg(newHp));
+ if (data()->isPlayer(spot)) {
+ printSilent(tr("%1's new HP is %2/%3.").arg(nick(spot)).arg(newHp).arg(data()->poke(spot).totalLife()));
+ } else {
+ printSilent(tr("%1's new HP is %2%.").arg(nick(spot)).arg(newHp));
+ }
}
void BattleClientLog::onHitCount(int, int count)

0 comments on commit 092720d

Please sign in to comment.