Frontend:
authorsmaxx
Fri, 17 Sep 2010 15:27:04 +0200
changeset 3871 c91aefe1dca2
parent 3870 e3f778c95d1c
child 3872 110121efe3d2
Frontend: * Disabled frontend's hog count for now to fix issue #44 - doesn't have to be limited to 48 anyway (but a limit based on active map would be nice)
QTfrontend/hedgehogerWidget.cpp
--- a/QTfrontend/hedgehogerWidget.cpp	Tue Sep 14 22:13:59 2010 +0200
+++ b/QTfrontend/hedgehogerWidget.cpp	Fri Sep 17 15:27:04 2010 +0200
@@ -23,34 +23,36 @@
 CHedgehogerWidget::CHedgehogerWidget(const QImage& im, QWidget * parent) :
     ItemNum(im, parent, 1)
 {
-  if(parent) {
+  // TODO: maxHedgehogsPerGame doesn't reset properly and won't match map limits for now
+  /*if(parent) {
     pOurFrameTeams = dynamic_cast<FrameTeams*>(parent->parentWidget());
   }
   if(pOurFrameTeams->overallHedgehogs + 4 > pOurFrameTeams->maxHedgehogsPerGame) {
     numItems = pOurFrameTeams->maxHedgehogsPerGame - pOurFrameTeams->overallHedgehogs;
   } else numItems = 4;
-  pOurFrameTeams->overallHedgehogs += numItems;
+  pOurFrameTeams->overallHedgehogs += numItems;*/
 }
 
 void CHedgehogerWidget::incItems()
 {
-  if (pOurFrameTeams->overallHedgehogs < pOurFrameTeams->maxHedgehogsPerGame) {
+  //if (pOurFrameTeams->overallHedgehogs < pOurFrameTeams->maxHedgehogsPerGame) {
     numItems++;
-    pOurFrameTeams->overallHedgehogs++;
+    //pOurFrameTeams->overallHedgehogs++;
     emit hedgehogsNumChanged();
-  }
+  //}
 }
 
 void CHedgehogerWidget::decItems()
 {
   numItems--;
-  pOurFrameTeams->overallHedgehogs--;
+  //pOurFrameTeams->overallHedgehogs--;
   emit hedgehogsNumChanged();
 }
 
 CHedgehogerWidget::~CHedgehogerWidget()
 {
-  pOurFrameTeams->overallHedgehogs-=numItems;
+  // TODO: not called?
+  //pOurFrameTeams->overallHedgehogs-=numItems;
 }
 
 void CHedgehogerWidget::setNonInteractive()
@@ -60,9 +62,10 @@
 
 void CHedgehogerWidget::setHHNum(unsigned int num)
 {
-  unsigned int diff = num - numItems;
+  /*unsigned int diff = num - numItems;
   numItems += diff;
-  pOurFrameTeams->overallHedgehogs += diff;
+  pOurFrameTeams->overallHedgehogs += diff;*/
+  numItems = num;
   repaint();
 }