Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 11, 2014
@lynxlynxlynx lynxlynxlynx GameControl::OnKeyRelease: reordered case statements for easier lookup
3 lowercase keys are still free
7557fe0
@lynxlynxlynx lynxlynxlynx GameControl::OnKeyRelease: promote area actor dump to lowercase shortcut
initially it was on ctrl-M, but then got overwritten without care
89923da
Showing with 91 additions and 93 deletions.
  1. +91 −93 gemrb/core/GUI/GameControl.cpp
View
184 gemrb/core/GUI/GameControl.cpp
@@ -774,25 +774,26 @@ bool GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod)
Point p(lastMouseX, lastMouseY);
core->GetVideoDriver()->ConvertToGame( p.x, p.y );
switch (Key) {
- case 'd': //detect a trap or door
- if (overInfoPoint) {
- overInfoPoint->DetectTrap(256, lastActorID);
- }
- if (overContainer) {
- overContainer->DetectTrap(256, lastActorID);
- }
- if (overDoor) {
- overDoor->TryDetectSecret(256, lastActorID);
- overDoor->DetectTrap(256, lastActorID);
+ case 'a': //switches through the avatar animations
+ if (lastActor) {
+ lastActor->GetNextAnimation();
}
break;
- case 'l': //play an animation (vvc/bam) over an actor
- //the original engine was able to swap through all animations
- if (lastActor) {
- lastActor->AddAnimation("S056ICBL", 0, 0, 0);
+ case 'b': //draw a path to the target (pathfinder debug)
+ //You need to select an origin with ctrl-o first
+ if (drawPath) {
+ PathNode* nextNode = drawPath->Next;
+ PathNode* thisNode = drawPath;
+ while (true) {
+ delete( thisNode );
+ thisNode = nextNode;
+ if (!thisNode)
+ break;
+ nextNode = thisNode->Next;
+ }
}
+ drawPath = core->GetGame()->GetCurrentArea()->FindPath( pfs, p, lastActor?lastActor->size:1 );
break;
-
case 'c': //force cast a hardcoded spell
//caster is the last selected actor
//target is the door/actor currently under the pointer
@@ -813,38 +814,44 @@ bool GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod)
}
}
break;
-
- case 'b': //draw a path to the target (pathfinder debug)
- //You need to select an origin with ctrl-o first
- if (drawPath) {
- PathNode* nextNode = drawPath->Next;
- PathNode* thisNode = drawPath;
- while (true) {
- delete( thisNode );
- thisNode = nextNode;
- if (!thisNode)
- break;
- nextNode = thisNode->Next;
- }
+ case 'd': //detect a trap or door
+ if (overInfoPoint) {
+ overInfoPoint->DetectTrap(256, lastActorID);
+ }
+ if (overContainer) {
+ overContainer->DetectTrap(256, lastActorID);
+ }
+ if (overDoor) {
+ overDoor->TryDetectSecret(256, lastActorID);
+ overDoor->DetectTrap(256, lastActorID);
}
- drawPath = core->GetGame()->GetCurrentArea()->FindPath( pfs, p, lastActor?lastActor->size:1 );
-
break;
-
- case 'o': //set up the origin for the pathfinder
- // origin
- pfs.x = lastMouseX;
- pfs.y = lastMouseY;
- core->GetVideoDriver()->ConvertToGame( pfs.x, pfs.y );
+ // e, f
+ case 'g'://shows loaded areas and other game information
+ game->dump();
break;
- case 'a': //switches through the avatar animations
- if (lastActor) {
- lastActor->GetNextAnimation();
+ // h
+ case 'i'://interact trigger (from the original game)
+ if (!lastActor) {
+ lastActor = area->GetActor( p, GA_DEFAULT);
}
- break;
- case 's': //switches through the stance animations
- if (lastActor) {
- lastActor->GetNextStance();
+ if (lastActor && !(lastActor->GetStat(IE_MC_FLAGS)&MC_EXPORTABLE)) {
+ Actor *target;
+ int i = game->GetPartySize(true);
+ if(i<2) break;
+ i=rand()%i;
+ do
+ {
+ target = game->GetPC(i, true);
+ if(target==lastActor) continue;
+ if(target->GetStat(IE_MC_FLAGS)&MC_EXPORTABLE) continue;
+
+ char Tmp[40];
+ snprintf(Tmp,sizeof(Tmp),"Interact(\"%s\")",target->GetScriptName() );
+ lastActor->AddAction(GenerateAction(Tmp));
+ break;
+ }
+ while(i--);
}
break;
case 'j': //teleports the selected actors
@@ -854,7 +861,18 @@ bool GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod)
MoveBetweenAreasCore(actor, core->GetGame()->CurrentArea, p, -1, true);
}
break;
-
+ case 'k': //kicks out actor
+ if (lastActor && lastActor->InParty) {
+ lastActor->Stop();
+ lastActor->AddAction( GenerateAction("LeaveParty()") );
+ }
+ break;
+ case 'l': //play an animation (vvc/bam) over an actor
+ //the original engine was able to swap through all animations
+ if (lastActor) {
+ lastActor->AddAnimation("S056ICBL", 0, 0, 0);
+ }
+ break;
case 'M':
if (!lastActor) {
lastActor = area->GetActor( p, GA_DEFAULT);
@@ -908,45 +926,23 @@ bool GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod)
}
core->GetGame()->GetCurrentArea()->dump(false);
break;
- case 'N': //prints a list of all the live actors in the area
+ case 'n': //prints a list of all the live actors in the area
core->GetGame()->GetCurrentArea()->dump(true);
break;
- case 'v': //marks some of the map visited (random vision distance)
- area->ExploreMapChunk( p, rand()%30, 1 );
- break;
- case 'V': //
- core->GetDictionary()->DebugDump();
- break;
- case 'w': // consolidates found ground piles under the pointed pc
- area->MoveVisibleGroundPiles(p);
- break;
- case 'x': // shows coordinates on the map
- Log(MESSAGE, "GameControl", "Position: %s [%d.%d]", area->GetScriptName(), p.x, p.y );
+ case 'o': //set up the origin for the pathfinder
+ // origin
+ pfs.x = lastMouseX;
+ pfs.y = lastMouseY;
+ core->GetVideoDriver()->ConvertToGame( pfs.x, pfs.y );
break;
- case 'g'://shows loaded areas and other game information
- game->dump();
+ case 'p': //center on actor
+ ScreenFlags|=SF_CENTERONACTOR;
+ ScreenFlags^=SF_ALWAYSCENTER;
break;
- case 'i'://interact trigger (from the original game)
- if (!lastActor) {
- lastActor = area->GetActor( p, GA_DEFAULT);
- }
- if (lastActor && !(lastActor->GetStat(IE_MC_FLAGS)&MC_EXPORTABLE)) {
- Actor *target;
- int i = game->GetPartySize(true);
- if(i<2) break;
- i=rand()%i;
- do
- {
- target = game->GetPC(i, true);
- if(target==lastActor) continue;
- if(target->GetStat(IE_MC_FLAGS)&MC_EXPORTABLE) continue;
-
- char Tmp[40];
- snprintf(Tmp,sizeof(Tmp),"Interact(\"%s\")",target->GetScriptName() );
- lastActor->AddAction(GenerateAction(Tmp));
- break;
- }
- while(i--);
+ case 'q': //joins actor to the party
+ if (lastActor && !lastActor->InParty) {
+ lastActor->Stop();
+ lastActor->AddAction( GenerateAction("JoinParty()") );
}
break;
case 'r'://resurrects actor
@@ -961,27 +957,28 @@ bool GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod)
delete fx;
}
break;
+ case 's': //switches through the stance animations
+ if (lastActor) {
+ lastActor->GetNextStance();
+ }
+ break;
case 't'://advances time
// 7200 (one day) /24 (hours) == 300
game->AdvanceTime(300*AI_UPDATE_TIME);
//refresh gui here once we got it
break;
-
- case 'q': //joins actor to the party
- if (lastActor && !lastActor->InParty) {
- lastActor->Stop();
- lastActor->AddAction( GenerateAction("JoinParty()") );
- }
+ // u
+ case 'V': //
+ core->GetDictionary()->DebugDump();
break;
- case 'p': //center on actor
- ScreenFlags|=SF_CENTERONACTOR;
- ScreenFlags^=SF_ALWAYSCENTER;
+ case 'v': //marks some of the map visited (random vision distance)
+ area->ExploreMapChunk( p, rand()%30, 1 );
break;
- case 'k': //kicks out actor
- if (lastActor && lastActor->InParty) {
- lastActor->Stop();
- lastActor->AddAction( GenerateAction("LeaveParty()") );
- }
+ case 'w': // consolidates found ground piles under the pointed pc
+ area->MoveVisibleGroundPiles(p);
+ break;
+ case 'x': // shows coordinates on the map
+ Log(MESSAGE, "GameControl", "Position: %s [%d.%d]", area->GetScriptName(), p.x, p.y );
break;
case 'Y': // damages all enemies by 300 (resistances apply)
// mwahaha!
@@ -996,6 +993,7 @@ bool GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod)
}
}
delete newfx;
+ // fallthrough
case 'y': //kills actor
if (lastActor) {
//using action so the actor is killed

No commit comments for this range

Something went wrong with that request. Please try again.