- bugfix for group key camera movement (respect different group keys being pressed)

This commit is contained in:
Mark Vejvoda
2011-06-10 16:59:19 +00:00
parent 6bb805978c
commit ba3071c15b
2 changed files with 7 additions and 1 deletions

View File

@@ -96,6 +96,7 @@ void SelectionQuad::disable(){
Gui::Gui(){ Gui::Gui(){
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] START\n",__FILE__,__FUNCTION__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] START\n",__FILE__,__FUNCTION__);
lastGroupRecall = -1;
posObjWorld= Vec2i(54, 14); posObjWorld= Vec2i(54, 14);
validPosObjWorld= false; validPosObjWorld= false;
activeCommandType= NULL; activeCommandType= NULL;
@@ -313,13 +314,16 @@ void Gui::groupKey(int groupIndex) {
Config &config = Config::getInstance(); Config &config = Config::getInstance();
int recallGroupCenterCameraTimeout = config.getInt("RecallGroupCenterCameraTimeoutMilliseconds","1500"); int recallGroupCenterCameraTimeout = config.getInt("RecallGroupCenterCameraTimeoutMilliseconds","1500");
if(lastGroupRecallTime.getMillis() > 0 && lastGroupRecallTime.getMillis() <= recallGroupCenterCameraTimeout) { if(lastGroupRecall == groupIndex &&
lastGroupRecallTime.getMillis() > 0 &&
lastGroupRecallTime.getMillis() <= recallGroupCenterCameraTimeout) {
centerCameraOnSelection(); centerCameraOnSelection();
} }
else { else {
selection.recallGroup(groupIndex); selection.recallGroup(groupIndex);
} }
lastGroupRecallTime.start(); lastGroupRecallTime.start();
lastGroupRecall = groupIndex;
} }
} }

View File

@@ -133,6 +133,8 @@ private:
int minQuadSize; int minQuadSize;
Chrono lastGroupRecallTime; Chrono lastGroupRecallTime;
int lastGroupRecall;
//states //states
bool selectingBuilding; bool selectingBuilding;
bool selectingPos; bool selectingPos;