Skip to content

Commit

Permalink
added ctrl+e shortcut to reverse the party order (for 10pp)
Browse files Browse the repository at this point in the history
  • Loading branch information
lynxlynxlynx committed Mar 7, 2015
1 parent a1e90d0 commit 26be343
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gemrb/core/GUI/GameControl.cpp
Expand Up @@ -810,7 +810,10 @@ bool GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod)
overDoor->DetectTrap(256, lastActorID);
}
break;
// e, f
case 'e':// reverses pc order (useful for parties bigger than 6)
game->ReversePCs();
break;
// f
case 'g'://shows loaded areas and other game information
game->dump();
break;
Expand Down
8 changes: 8 additions & 0 deletions gemrb/core/Game.cpp
Expand Up @@ -235,6 +235,14 @@ static bool IsAlive(Actor *pc)
return true;
}

void Game::ReversePCs()
{
for (unsigned int slot=0; slot<PCs.size(); slot++) {
PCs[slot]->InParty = PCs.size() - PCs[slot]->InParty + 1;
}
core->SetEventFlag(EF_PORTRAIT|EF_SELECTION);
}

int Game::FindPlayer(unsigned int partyID)
{
for (unsigned int slot=0; slot<PCs.size(); slot++) {
Expand Down
1 change: 1 addition & 0 deletions gemrb/core/Game.h
Expand Up @@ -502,6 +502,7 @@ class GEM_EXPORT Game : public Scriptable {
bool RandomEncounter(ieResRef &BaseArea);
/** Resets the area and bored comment timers of the whole party */
void ResetPartyCommentTimes();
void ReversePCs();
private:
bool DetermineStartPosType(const TableMgr *strta);
ieResRef *GetDream(Map *area);
Expand Down

0 comments on commit 26be343

Please sign in to comment.