From d668550942df64daff7c134bc4b4a69c27adeff2 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Thu, 9 Jun 2011 22:37:37 +0000 Subject: [PATCH] - exclusive feature for Coldfusionstorm! Press the group key a second time within 1.5 seconds and the camera centers on the group --- source/glest_game/gui/gui.cpp | 8 +++++++- source/glest_game/gui/gui.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index 71e11c9fe..33662bd9c 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -311,7 +311,13 @@ void Gui::groupKey(int groupIndex) { else{ if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] groupIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,groupIndex); - selection.recallGroup(groupIndex); + if(lastGroupRecallTime.getMillis() > 0 && lastGroupRecallTime.getMillis() <= 1500) { + centerCameraOnSelection(); + } + else { + selection.recallGroup(groupIndex); + } + lastGroupRecallTime.start(); } } diff --git a/source/glest_game/gui/gui.h b/source/glest_game/gui/gui.h index 90ae6439b..a8cab308c 100644 --- a/source/glest_game/gui/gui.h +++ b/source/glest_game/gui/gui.h @@ -21,6 +21,7 @@ #include "randomgen.h" #include #include "object.h" +#include "platform_common.h" #include "leak_dumper.h" using Shared::Util::RandomGen; @@ -131,6 +132,7 @@ private: int selectionCalculationFrameSkip; int minQuadSize; + Chrono lastGroupRecallTime; //states bool selectingBuilding; bool selectingPos;