Skip to content

Commit

Permalink
Add build speed bonuses to industry output display
Browse files Browse the repository at this point in the history
http://www.forum.birth-of-the-empires.de./viewtopic.php?p=31979#p31979

Add BuildingBuildSpeed, UpdateBuildSpeed, ShipBuildSpeed and
TroopBuildSpeed to the calculation of the industry production display
on the system buildings, yard and barracks screens.
  • Loading branch information
Vuto-BotE committed Oct 7, 2013
1 parent 77f2396 commit 986a539
Showing 1 changed file with 39 additions and 7 deletions.
46 changes: 39 additions & 7 deletions BotE Game/trunk/Source/GUI/SystemMenuView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2009,19 +2009,31 @@ void CSystemMenuView::DrawSystemProduction(Graphics* g)
rect = RectF(870,80,60,25);
if (m_iWhichSubMenu == 0) // Wenn wir im normalen Baumenü sind
{
s.Format("%i",pDoc->GetSystem(p.x,p.y).GetProduction()->GetIndustryProd());
g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), rect, &fontFormat, &fontBrush);
if (pDoc->GetSystem(p.x,p.y).GetProduction()->GetUpdateBuildSpeed() ==
pDoc->GetSystem(p.x,p.y).GetProduction()->GetBuildingBuildSpeed())
{
s.Format("%i",(short)(pDoc->GetSystem(p.x,p.y).GetProduction()->GetIndustryProd() *
(100 + pDoc->GetSystem(p.x, p.y).GetProduction()->GetBuildingBuildSpeed()) / 100));
g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), rect, &fontFormat, &fontBrush);
}
else
{
s.Format("%i",(pDoc->GetSystem(p.x,p.y).GetProduction()->GetIndustryProd()));
g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), rect, &fontFormat, &fontBrush);
}
}
else if (m_iWhichSubMenu == 1) // Wenn wir im Werftuntermenü sind
{
s.Format("%i",(int)(pDoc->GetSystem(p.x,p.y).GetProduction()->GetIndustryProd() *
pDoc->GetSystem(p.x,p.y).GetProduction()->GetShipYardEfficiency() / 100));
pDoc->GetSystem(p.x,p.y).GetProduction()->GetShipYardEfficiency() / 100 *
(100 + pDoc->GetSystem(p.x, p.y).GetProduction()->GetShipBuildSpeed()) / 100));
g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), rect, &fontFormat, &fontBrush);
}
else // Wenn wir im Kasernenuntermenü sind
{
s.Format("%i",(short)(pDoc->GetSystem(p.x,p.y).GetProduction()->GetIndustryProd() *
pDoc->GetSystem(p.x,p.y).GetProduction()->GetBarrackEfficiency() / 100));
pDoc->GetSystem(p.x,p.y).GetProduction()->GetBarrackEfficiency() / 100 *
(100 + pDoc->GetSystem(p.x, p.y).GetProduction()->GetTroopBuildSpeed()) / 100));
g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), rect, &fontFormat, &fontBrush);
}

Expand Down Expand Up @@ -2065,14 +2077,34 @@ void CSystemMenuView::DrawSystemProduction(Graphics* g)
s.Format("%i",pDoc->GetSystem(p.x,p.y).GetFoodStore());
g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), rect, &fontFormat, &fontBrush);
rect.Y += 25;
if (m_iWhichSubMenu == 1) // Wenn wir im Werftuntermenü sind
// Wenn wir im normalen Baumenü sind
if (m_iWhichSubMenu == 0 &&
(pDoc->GetSystem(p.x,p.y).GetProduction()->GetBuildingBuildSpeed() > 0 ||
pDoc->GetSystem(p.x, p.y).GetProduction()->GetUpdateBuildSpeed() > 0))
{
if (pDoc->GetSystem(p.x,p.y).GetProduction()->GetBuildingBuildSpeed() ==
pDoc->GetSystem(p.x,p.y).GetProduction()->GetUpdateBuildSpeed())
{
s.Format("%i%%",(short)(100 + pDoc->GetSystem(p.x,p.y).GetProduction()->GetBuildingBuildSpeed()));
g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), rect, &fontFormat, &fontBrush);
}
else
{
s.Format("%i%% %i%%",(short)(100 + pDoc->GetSystem(p.x,p.y).GetProduction()->GetBuildingBuildSpeed()),
(short)(100 + pDoc->GetSystem(p.x,p.y).GetProduction()->GetUpdateBuildSpeed()));
g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), rect, &fontFormat, &fontBrush);
}
}
else if (m_iWhichSubMenu == 1) // Wenn wir im Werftuntermenü sind
{
s.Format("%i%%",pDoc->GetSystem(p.x,p.y).GetProduction()->GetShipYardEfficiency());
s.Format("%i%%",(short)(pDoc->GetSystem(p.x,p.y).GetProduction()->GetShipYardEfficiency() *
(100 + pDoc->GetSystem(p.x,p.y).GetProduction()->GetShipBuildSpeed()) / 100));
g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), rect, &fontFormat, &fontBrush);
}
else if (m_iWhichSubMenu == 2) // Wenn wir im Kasernenuntermenü sind
{
s.Format("%i%%",pDoc->GetSystem(p.x,p.y).GetProduction()->GetBarrackEfficiency());
s.Format("%i%%",(short)(pDoc->GetSystem(p.x,p.y).GetProduction()->GetBarrackEfficiency() *
(100 + pDoc->GetSystem(p.x,p.y).GetProduction()->GetTroopBuildSpeed()) / 100));
g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), rect, &fontFormat, &fontBrush);
}

Expand Down

0 comments on commit 986a539

Please sign in to comment.