From: <lyn...@us...> - 2009-10-07 12:29:40
|
Revision: 7377 http://gemrb.svn.sourceforge.net/gemrb/?rev=7377&view=rev Author: lynxlupodian Date: 2009-10-07 12:29:28 +0000 (Wed, 07 Oct 2009) Log Message: ----------- show hp/maxhp over party members on tab Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-10-06 21:37:29 UTC (rev 7376) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-10-07 12:29:28 UTC (rev 7377) @@ -1972,7 +1972,10 @@ return; //don't accept keys in dialog } Region Viewport = core->GetVideoDriver()->GetViewport(); - Point mapsize = core->GetGame()->GetCurrentArea()->TMap->GetMapSize(); + Game *game = core->GetGame(); + Point mapsize = game->GetCurrentArea()->TMap->GetMapSize(); + int partysize = game->GetPartySize(false); + char tmpstr[10]; switch (Key) { case GEM_LEFT: if (Viewport.x > 63) @@ -2006,7 +2009,14 @@ DebugFlags |= DEBUG_SHOW_CONTAINERS; return; case GEM_TAB: - //no effect, i think + // show partymember hp/maxhp as overhead text + for (int pm=0; pm < partysize; pm++) { + Actor *pc = game->GetPC(pm, true); + if (!pc) continue; + memset(tmpstr, 0, 10); + snprintf(tmpstr, 10, "%d/%d", pc->Modified[IE_HITPOINTS], pc->Modified[IE_MAXHITPOINTS]); + pc->DisplayHeadText(strdup(tmpstr)); + } return; case GEM_MOUSEOUT: moveX = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |