]> ruin.nu Git - hbs.git/blobdiff - bs/fleetview.cpp
A few more bugs killed.. still a few left before 0.1 release..
[hbs.git] / bs / fleetview.cpp
index 5cbed5377caa4797c794f8a3bba2f167779298fe..a261b934b21d3433f18e8ac6e9fdd6da325a8d86 100644 (file)
@@ -91,7 +91,7 @@ void FleetView::viewFleet(const Fleet* fleet, bool friendly)
        {
                m_Fleet = new Fleet(*fleet);
        }
-       m_Fleet->printFleet();
+       //m_Fleet->printFleet();
        fillTable();
 }
 
@@ -235,4 +235,32 @@ void FleetView::slotViewTickRange(int min = -1, int max = -1)
                int after = m_Fleet->fleet(i->latin1(), m_iMaxTick);
                m_UnitsLostSurvivedView[(*i)]->setText(QString("%1").arg(after - before));
        }
+
+       Planet* pl;
+       if ((pl = dynamic_cast<Planet*>(m_Fleet)))
+       {
+               int lost;
+               int before;
+               int after;
+
+               before = pl->roids(tr("metal").latin1(),m_iMinTick);
+               after = pl->roids(tr("metal").latin1(),m_iMaxTick);
+               lost = after - before;
+               m_RoidsEditView->slotSetLost(tr("metal"),lost);
+
+               before = pl->roids(tr("crystal").latin1(),m_iMinTick);
+               after = pl->roids(tr("crystal").latin1(),m_iMaxTick);
+               lost = after - before;
+               m_RoidsEditView->slotSetLost(tr("crystal"),lost);
+
+               before = pl->roids(tr("eonium").latin1(),m_iMinTick);
+               after = pl->roids(tr("eonium").latin1(),m_iMaxTick);
+               lost = after - before;
+               m_RoidsEditView->slotSetLost(tr("eonium"),lost);
+
+               before = pl->roids(tr("uninit").latin1(),m_iMinTick);
+               after = pl->roids(tr("uninit").latin1(),m_iMaxTick);
+               lost = after - before;
+               m_RoidsEditView->slotSetLost(tr("uninit"),lost);
+       }
 }