Gdiplus::Color CBottomBaseView::GetFontColorForSmallButton(void) { AssertBotE((CBotEDoc*)GetDocument()); CMajor* pPlayer = m_pPlayersRace; AssertBotE(pPlayer); Color color; color.SetFromCOLORREF(pPlayer->GetDesign()->m_clrSmallBtn); return color; }
void CIntelBottomView::OnDraw(CDC* dc) { CBotEDoc* pDoc = resources::pDoc; AssertBotE(pDoc); if (!pDoc->m_bDataReceived) return; CMajor* pMajor = m_pPlayersRace; AssertBotE(pMajor); if (!pMajor) return; // TODO: add draw code here // Doublebuffering wird initialisiert CMyMemDC pDC(dc); CRect client; GetClientRect(&client); // Graphicsobjekt, in welches gezeichnet wird anlegen Graphics g(pDC->GetSafeHdc()); g.Clear(static_cast<Gdiplus::ARGB>(Color::Black)); g.SetSmoothingMode(SmoothingModeHighSpeed); g.SetInterpolationMode(InterpolationModeLowQuality); g.SetPixelOffsetMode(PixelOffsetModeHighSpeed); g.SetCompositingQuality(CompositingQualityHighSpeed); g.ScaleTransform((REAL)client.Width() / (REAL)m_TotalSize.cx, (REAL)client.Height() / (REAL)m_TotalSize.cy); CString fontName = ""; Gdiplus::REAL fontSize = 0.0; StringFormat fontFormat; SolidBrush fontBrush(static_cast<Gdiplus::ARGB>(Color::White)); Color color; color.SetFromCOLORREF(pMajor->GetDesign()->m_clrGalaxySectorText); fontBrush.SetColor(color); Bitmap* graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Backgrounds\\" + pMajor->GetPrefix() + "diplomacyV3.boj"); // Grafik zeichnen if (graphic) { g.DrawImage(graphic, 0, 0, 1075, 249); graphic = NULL; } // Nur in bestimmten Submenüs werden in der View3 Berichte angezeigt BYTE curIntelSubMenu = resources::pMainFrame->GetSubMenu(RUNTIME_CLASS(CIntelMenuView)); if (curIntelSubMenu == 4 || curIntelSubMenu == 5) { CRect r; r.SetRect(0,0,m_TotalSize.cx,m_TotalSize.cy); short n = pMajor->GetEmpire()->GetIntelligence()->GetIntelReports()->GetActiveReport(); if (n != -1) { CFontLoader::CreateGDIFont(pMajor, 4, fontName, fontSize); fontFormat.SetAlignment(StringAlignmentNear); fontFormat.SetLineAlignment(StringAlignmentNear); fontFormat.SetFormatFlags(StringFormatFlagsNoWrap); CIntelObject* report = pMajor->GetEmpire()->GetIntelligence()->GetIntelReports()->GetReport(n); CString s; if (report->GetIsSpy()) s = CLoc::GetString("SPY"); else s = CLoc::GetString("SABOTAGE"); g.DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(40, 40, r.right-100, r.bottom-20), &fontFormat, &fontBrush); CFontLoader::CreateGDIFont(pMajor, 2, fontName, fontSize); fontBrush.SetColor(Color(200,200,250)); fontFormat.SetFormatFlags(!StringFormatFlagsNoWrap); if (report->GetOwner() == pMajor->GetRaceID()) s = *report->GetOwnerDesc(); else s = *report->GetEnemyDesc(); g.DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(40, 100, r.right-250, r.bottom-20), &fontFormat, &fontBrush); } } g.ReleaseHDC(pDC->GetSafeHdc()); }
void CResearchBottomView::OnDraw(CDC* dc) { CBotEDoc* pDoc = resources::pDoc; AssertBotE(pDoc); if (!pDoc->m_bDataReceived) return; CMajor* pMajor = m_pPlayersRace; AssertBotE(pMajor); if (!pMajor) return; // TODO: add draw code here // Doublebuffering wird initialisiert CMyMemDC pDC(dc); CRect client; GetClientRect(&client); // Graphicsobjekt, in welches gezeichnet wird anlegen Graphics g(pDC->GetSafeHdc()); g.Clear(static_cast<Gdiplus::ARGB>(Color::Black)); g.SetSmoothingMode(SmoothingModeHighSpeed); g.SetInterpolationMode(InterpolationModeLowQuality); g.SetPixelOffsetMode(PixelOffsetModeHighSpeed); g.SetCompositingQuality(CompositingQualityHighSpeed); g.ScaleTransform((REAL)client.Width() / (REAL)m_TotalSize.cx, (REAL)client.Height() / (REAL)m_TotalSize.cy); CString fontName = ""; Gdiplus::REAL fontSize = 0.0; StringFormat fontFormat; SolidBrush fontBrush(static_cast<Gdiplus::ARGB>(Color::White)); CRect rect; rect.SetRect(0,0,m_TotalSize.cx,m_TotalSize.cy); CString sPrefix = pMajor->GetPrefix(); Color color; color.SetFromCOLORREF(pMajor->GetDesign()->m_clrGalaxySectorText); fontBrush.SetColor(color); Bitmap* graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Backgrounds\\" + sPrefix + "researchV3.boj"); // gibt es keine Spezialforschung zur Auswahl, so wird auf Standardanzeige umgestellt if (m_nCurrentTech == 6 && pMajor->GetEmpire()->GetResearch()->GetUniqueReady() == TRUE) m_nCurrentTech = 0; // Grafik zeichnen if (graphic) { g.DrawImage(graphic, 0, 0, 1075, 249); graphic = NULL; } switch(m_nCurrentTech) { case 0: graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Research\\biotech.bop"); break; case 1: graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Research\\energytech.bop"); break; case 2: graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Research\\computertech.bop"); break; case 3: graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Research\\propulsiontech.bop"); break; case 4: graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Research\\constructiontech.bop"); break; case 5: graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Research\\weapontech.bop"); break; case 6: graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Research\\specialtech.bop"); break; } if (graphic) { g.DrawImage(graphic, 790, 25, 240, 200); graphic = NULL; } // Name und Beschreibung der Forschung anzeigen CFontLoader::CreateGDIFont(pMajor, 4, fontName, fontSize); fontFormat.SetAlignment(StringAlignmentNear); fontFormat.SetLineAlignment(StringAlignmentNear); fontFormat.SetFormatFlags(StringFormatFlagsNoWrap); CString s; if (m_nCurrentTech != 6) s = pMajor->GetEmpire()->GetResearch()->GetResearchInfo()->GetTechName(m_nCurrentTech); else s = pMajor->GetEmpire()->GetResearch()->GetResearchInfo()->GetCurrentResearchComplex()->GetComplexName(); g.DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(40, 30, rect.right-325, rect.bottom), &fontFormat, &fontBrush); CFontLoader::CreateGDIFont(pMajor, 2, fontName, fontSize); fontBrush.SetColor(Color(200,200,250)); fontFormat.SetFormatFlags(!StringFormatFlagsNoWrap); if (m_nCurrentTech != 6) s = pMajor->GetEmpire()->GetResearch()->GetResearchInfo()->GetTechDescription(m_nCurrentTech); else s = pMajor->GetEmpire()->GetResearch()->GetResearchInfo()->GetCurrentResearchComplex()->GetComplexDescription(); g.DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(40, 100, rect.right-325, rect.bottom), &fontFormat, &fontBrush); g.ReleaseHDC(pDC->GetSafeHdc()); }
void CDiplomacyBottomView::OnDraw(CDC* dc) { CBotEDoc* pDoc = resources::pDoc; AssertBotE(pDoc); if (!pDoc->m_bDataReceived) return; CMajor* pMajor = m_pPlayersRace; AssertBotE(pMajor); if (!pMajor) return; // TODO: add draw code here // Doublebuffering wird initialisiert CMyMemDC pDC(dc); CRect client; GetClientRect(&client); // Graphicsobjekt, in welches gezeichnet wird anlegen Graphics g(pDC->GetSafeHdc()); g.Clear(static_cast<Gdiplus::ARGB>(Color::Black)); g.SetSmoothingMode(SmoothingModeHighSpeed); g.SetInterpolationMode(InterpolationModeLowQuality); g.SetPixelOffsetMode(PixelOffsetModeHighSpeed); g.SetCompositingQuality(CompositingQualityHighSpeed); g.ScaleTransform((REAL)client.Width() / (REAL)m_TotalSize.cx, (REAL)client.Height() / (REAL)m_TotalSize.cy); CString fontName = ""; Gdiplus::REAL fontSize = 0.0; StringFormat fontFormat; SolidBrush fontBrush(static_cast<Gdiplus::ARGB>(Color::White)); // Soll was über die Diplomatie angezeigt werden CRect rect; rect.SetRect(0,0,m_TotalSize.cx,m_TotalSize.cy); CString sPrefix = pMajor->GetPrefix(); Color color; color.SetFromCOLORREF(pMajor->GetDesign()->m_clrGalaxySectorText); fontBrush.SetColor(color); Bitmap* graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Backgrounds\\" + sPrefix + "diplomacyV3.boj"); // Grafik zeichnen if (graphic) { g.DrawImage(graphic, 0, 0, 1075, 249); graphic = NULL; } CFontLoader::CreateGDIFont(pMajor, 4, fontName, fontSize); fontFormat.SetAlignment(StringAlignmentNear); fontFormat.SetLineAlignment(StringAlignmentNear); fontFormat.SetFormatFlags(StringFormatFlagsNoWrap); g.DrawString(CComBSTR(m_strHeadLine), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(40, 30, rect.right, rect.bottom), &fontFormat, &fontBrush); if (m_strText.IsEmpty()) g.DrawString(CComBSTR(CLoc::GetString("NO_DIPLOMATIC_NEWS")), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(40, 30, rect.right, rect.bottom), &fontFormat, &fontBrush); m_strHeadLine = ""; CFontLoader::CreateGDIFont(pMajor, 2, fontName, fontSize); fontBrush.SetColor(Color(200,200,250)); fontFormat.SetFormatFlags(!StringFormatFlagsNoWrap); g.DrawString(CComBSTR(m_strText), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(40, 100, rect.right-250, rect.bottom), &fontFormat, &fontBrush); g.ReleaseHDC(pDC->GetSafeHdc()); }
///////////////////////////////////////////////////////////////////////////////////////// // Hier die Funktion zum Zeichnen des Schiffsdesignmenüs ///////////////////////////////////////////////////////////////////////////////////////// void CShipDesignMenuView::DrawShipDesignMenue(Graphics* g) { CBotEDoc* pDoc = resources::pDoc; ASSERT(pDoc); CMajor* pMajor = m_pPlayersRace; ASSERT(pDoc); if (!pMajor) return; CString fontName = ""; Gdiplus::REAL fontSize = 0.0; // Rassenspezifische Schriftart auswählen CFontLoader::CreateGDIFont(pMajor, 2, fontName, fontSize); // Schriftfarbe wählen Gdiplus::Color normalColor; CFontLoader::GetGDIFontColor(pMajor, 3, normalColor); StringFormat fontFormat; fontFormat.SetAlignment(StringAlignmentNear); fontFormat.SetLineAlignment(StringAlignmentCenter); fontFormat.SetFormatFlags(StringFormatFlagsNoWrap); Color penColor; penColor.SetFromCOLORREF(pMajor->GetDesign()->m_clrListMarkPenColor); Color markColor; markColor.SetFromCOLORREF(pMajor->GetDesign()->m_clrListMarkTextColor); if (bg_designmenu) g->DrawImage(bg_designmenu, 0, 0, 1075, 750); SolidBrush fontBrush(normalColor); // Links im Bild die veränderbaren Schiffklassen zeichnen (bis jetzt darf man keine Stationen verändern, // weil deren Baukosten allein von den Industriekosten berechnet werden. Diese aber nicht steigen wenn // man die Hülle oder Schilde verbessert. Somit könnte man bessere Stationen für den gleichen Preis bauen. // Schiffsinfoarray durchgehen und nach zum Imperium gehörende baubare Schiffe suchen short j = 0; short counter = m_iClickedOnShip - 23 + m_iOldClickedOnShip; short oldClickedShip = m_iClickedOnShip; BYTE researchLevels[6] = { pMajor->GetEmpire()->GetResearch()->GetBioTech(), pMajor->GetEmpire()->GetResearch()->GetEnergyTech(), pMajor->GetEmpire()->GetResearch()->GetCompTech(), pMajor->GetEmpire()->GetResearch()->GetPropulsionTech(), pMajor->GetEmpire()->GetResearch()->GetConstructionTech(), pMajor->GetEmpire()->GetResearch()->GetWeaponTech() }; m_pShownShip = NULL; m_nSizeOfShipDesignList = 0; // Es gehen nur 21 Einträge auf die Seite, deshalb muss abgebrochen werden for (int i = 0; i < pDoc->m_ShipInfoArray.GetSize(); i++) if (pDoc->m_ShipInfoArray.GetAt(i).GetRace() == pMajor->GetRaceShipNumber()) if (!pDoc->m_ShipInfoArray.GetAt(i).IsStation()) if (pDoc->m_ShipInfoArray.GetAt(i).IsThisShipBuildableNow(researchLevels)) { // wurde dieses Schiff durch kein anderes jetzt baubares Schiff schon obsolet? BOOLEAN foundObsolet = FALSE; for (int m = 0; m < pDoc->m_ShipInfoArray.GetSize(); m++) if (pDoc->m_ShipInfoArray.GetAt(m).GetRace() == pMajor->GetRaceShipNumber()) if (pDoc->m_ShipInfoArray.GetAt(m).GetObsoleteShipClass() == pDoc->m_ShipInfoArray.GetAt(i).GetShipClass()) if (pDoc->m_ShipInfoArray.GetAt(m).IsThisShipBuildableNow(researchLevels)) { foundObsolet = TRUE; break; } if (foundObsolet) continue; m_nSizeOfShipDesignList++; if (counter > 0) { m_iClickedOnShip--; counter--; continue; } if (j < 24) { fontBrush.SetColor(normalColor); // Wenn wir ein Schiff gefunden haben, dann zeichnen wir dieses in die Liste (max. 21) // Wenn wir das Schiff markiert haben, dann die Markierung zeichnen, haben wir kein spezielles Schiff // angeklickt, so wird das 1. Schiff in der Liste markiert if (j == m_iClickedOnShip || m_iClickedOnShip == -1) { fontBrush.SetColor(markColor); // Wenn wir nix angeklickt haben und nur das erste Schiff markiert war, dann automatisch m_iClickedOnShip = j; if (oldClickedShip == -1) oldClickedShip = j; m_pShownShip = &pDoc->m_ShipInfoArray.GetAt(i); // Markierung worauf wir geklickt haben g->FillRectangle(&SolidBrush(Color(50,200,200,200)), RectF(15,120+j*25,183,25)); g->DrawLine(&Gdiplus::Pen(penColor), 15, 120+j*25, 198, 120+j*25); g->DrawLine(&Gdiplus::Pen(penColor), 15, 145+j*25, 198, 145+j*25); // Infos in unteren Schiffsdesignansicht aktualisieren if (CShipDesignBottomView* pView = dynamic_cast<CShipDesignBottomView*>(resources::pMainFrame->GetView(RUNTIME_CLASS(CShipDesignBottomView)))) { if (pView->GetCurrentShipInfo() != i) { pView->SetCurrentShipInfo(i); pView->Invalidate(FALSE); } } } CString s = pDoc->m_ShipInfoArray.GetAt(i).GetShipClass(); g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(25, 120 + j * 25, 175, 25), &fontFormat, &fontBrush); j++; } } m_iClickedOnShip = oldClickedShip; // Hier jetzt Informationen zum angeklickten Schiff anzeigen if (m_pShownShip) { // Bild des Schiffes zeichnen CString s; s.Format("Ships\\%s.bop",m_pShownShip->GetShipClass()); Bitmap* graphic = pDoc->GetGraphicPool()->GetGDIGraphic(s); if (graphic == NULL) graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Ships\\ImageMissing.bop"); if (graphic) { g->DrawImage(graphic, 388, 90, 200, 150); graphic = NULL; } // allgemeine Schiffsinformationen anzeigen m_pShownShip->DrawShipInformation(g, CRect(220,250,740,440), &Gdiplus::Font(CComBSTR(fontName), fontSize), normalColor, markColor, pMajor->GetEmpire()->GetResearch()); // Baukosten des Schiffes anzeigen fontBrush.SetColor(markColor); fontFormat.SetAlignment(StringAlignmentCenter); fontFormat.SetLineAlignment(StringAlignmentNear); g->DrawString(CComBSTR(CLoc::GetString("BUILDCOSTS")), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(190,440,580,25), &fontFormat, &fontBrush); fontBrush.SetColor(normalColor); s.Format("%s: %d %s: %d %s: %d",CLoc::GetString("INDUSTRY"),m_pShownShip->GetNeededIndustry(), CLoc::GetString("TITAN"),m_pShownShip->GetNeededTitan(), CLoc::GetString("DEUTERIUM"),m_pShownShip->GetNeededDeuterium()); g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(190,465,580,25), &fontFormat, &fontBrush); s.Format("%s: %d %s: %d %s: %d %s: %d",CLoc::GetString("DURANIUM"),m_pShownShip->GetNeededDuranium(), CLoc::GetString("CRYSTAL"),m_pShownShip->GetNeededCrystal(), CLoc::GetString("IRIDIUM"),m_pShownShip->GetNeededIridium(), CLoc::GetString("DERITIUM"),m_pShownShip->GetNeededDeritium()); g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(190,490,580,25), &fontFormat, &fontBrush); // Die Buttons zur Eigenschaftsänderung in der Rechten Seite der Ansicht anzeigen // zuerst überprüfen wir die Beamwaffen, wir können den Typ der Beamwaffe verändern, wenn wir mindst. ein anderes // Schiff des Imperiums finden, welches DIESE Beamwaffe mit einem höheren Typ oder einem niedrigeren Typ besitzt graphic = pDoc->GetGraphicPool()->GetGDIGraphic("Other\\" + pMajor->GetPrefix() + "button_small.bop"); Color btnColor; CFontLoader::GetGDIFontColor(pMajor, 1, btnColor); SolidBrush btnBrush(btnColor); fontFormat.SetAlignment(StringAlignmentCenter); fontFormat.SetLineAlignment(StringAlignmentCenter); // Nach Beamwaffen suchen if (m_pShownShip->GetBeamWeapons()->GetSize() > m_iBeamWeaponNumber) { // gibt es schon von dieser Beamwaffe hier auf dem Schiff einen höheren Typ? USHORT maxTyp = pMajor->GetWeaponObserver()->GetMaxBeamType(m_pShownShip->GetBeamWeapons()->GetAt(m_iBeamWeaponNumber).GetBeamName()); if (maxTyp > m_pShownShip->GetBeamWeapons()->GetAt(m_iBeamWeaponNumber).GetBeamType()) { // Dann können wir den Typ unserer Beamwaffe(n) verbessern if (graphic) g->DrawImage(graphic, 930, 120, 120, 30); g->DrawString(CComBSTR(CLoc::GetString("BTN_STRONGER")), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(930,120,120,30), &fontFormat, &btnBrush); m_bFoundBetterBeam = TRUE; } // Wenn wir einen größeren Typ als Typ 1 haben, dann können wir diesen verringern if (m_pShownShip->GetBeamWeapons()->GetAt(m_iBeamWeaponNumber).GetBeamType() > 1) { // Dann können wir den Typ unserer Beamwaffe(n) verkleinern if (graphic) g->DrawImage(graphic, 800, 120, 120, 30); g->DrawString(CComBSTR(CLoc::GetString("BTN_WEAKER")), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(800,120,120,30), &fontFormat, &btnBrush); m_bFoundWorseBeam = TRUE; } // Typ und Name der Beamwaffe zeichnen fontBrush.SetColor(normalColor); s.Format("%s %d %s",CLoc::GetString("TYPE"),m_pShownShip->GetBeamWeapons()->GetAt(m_iBeamWeaponNumber).GetBeamType(),m_pShownShip->GetBeamWeapons()->GetAt(m_iBeamWeaponNumber).GetBeamName()); fontFormat.SetTrimming(StringTrimmingEllipsisCharacter); g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(845,80,160,25), &fontFormat, &fontBrush); fontFormat.SetTrimming(StringTrimmingNone); } // Nach anderer Torpedowaffe suchen if (m_pShownShip->GetTorpedoWeapons()->GetSize() > m_iTorpedoWeaponNumber) { // den aktuellen Torpedotyp holen BYTE currentTorpType = m_pShownShip->GetTorpedoWeapons()->GetAt(m_iTorpedoWeaponNumber).GetTorpedoType(); // Torpedoname zeichnen fontBrush.SetColor(normalColor); s.Format("%s (%d°)",m_pShownShip->GetTorpedoWeapons()->GetAt(m_iTorpedoWeaponNumber).GetTupeName(), m_pShownShip->GetTorpedoWeapons()->GetAt(m_iTorpedoWeaponNumber).GetFirearc()->GetAngle()); g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(775,170,300,25), &fontFormat, &fontBrush); s.Format("%s (%d)", CTorpedoInfo::GetName(currentTorpType), CTorpedoInfo::GetPower(currentTorpType)); g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(775,195,300,25), &fontFormat, &fontBrush); if (graphic) g->DrawImage(graphic, 800, 230, 120, 30); g->DrawString(CComBSTR(CLoc::GetString("BTN_LAUNCHER")), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(800,230,120,30), &fontFormat, &btnBrush); if (graphic) g->DrawImage(graphic, 930, 230, 120, 30); g->DrawString(CComBSTR(CLoc::GetString("BTN_TORPEDO")), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(930,230,120,30), &fontFormat, &btnBrush); } // hier Möglichkeit anderes Hüllenmaterial anzubringen eingebaut CString material; switch (m_pShownShip->GetHull()->GetHullMaterial()) { case TITAN: material = CLoc::GetString("TITAN");; break; case DURANIUM: material = CLoc::GetString("DURANIUM");; break; case IRIDIUM: material = CLoc::GetString("IRIDIUM");; break; default: material = ""; } BOOLEAN bDoubleHull = m_pShownShip->GetHull()->GetDoubleHull(); if (bDoubleHull == TRUE) s.Format("%s%s",material, CLoc::GetString("DOUBLE_HULL_ARMOUR")); else s.Format("%s%s",material, CLoc::GetString("HULL_ARMOR")); g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(775,380,300,30), &fontFormat, &fontBrush); // Hier kann man den Schildtyp ändern // zuerst Anzeige der jetzt aktuellen Schilde. Beim Romulaner eine schwarze Schriftart wählen. Wenn dies // später auch bei der Föd heller unterlegt ist kann auch dort eine schwarze Schriftfarbe gewählt werden. s.Format("%s %d %s",CLoc::GetString("TYPE"),m_pShownShip->GetShield()->GetShieldType(),CLoc::GetString("SHIELDS")); g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(775,490,300,30), &fontFormat, &fontBrush); // Ab jetzt die Buttons zum Ändern der jeweiligen Komponenten if (graphic) g->DrawImage(graphic, 800, 420, 120, 30); g->DrawString(CComBSTR(CLoc::GetString("BTN_MATERIAL")), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(800,420,120,30), &fontFormat, &btnBrush); // wenn eine Doppelhülle draus gemacht werden soll dann darf die Manövrierbarkeit nicht schon "keine" oder nur 1 sein // wenn eine Einzelhülle draus gemacht werden soll, dann darf die Manövrierbarkeit nicht schon phänomenal sein if ((bDoubleHull == FALSE && m_pShownShip->GetManeuverability() > 1) || (bDoubleHull == TRUE && m_pShownShip->GetManeuverability() < 9)) { if (graphic) g->DrawImage(graphic, 930, 420, 120, 30); g->DrawString(CComBSTR(CLoc::GetString("BTN_HULLTYPE")), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(930,420,120,30), &fontFormat, &btnBrush); } // Schildtyp schwächer Button einblenden if (m_pShownShip->GetShield()->GetShieldType() > 0) { if (graphic) g->DrawImage(graphic, 800, 540, 120, 30); g->DrawString(CComBSTR(CLoc::GetString("BTN_WEAKER")), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(800,540,120,30), &fontFormat, &btnBrush); } // Schildtyp stärker Button einblenden if (m_pShownShip->GetShield()->GetShieldType() < pMajor->GetWeaponObserver()->GetMaxShieldType()) { if (graphic) g->DrawImage(graphic, 930, 540, 120, 30); g->DrawString(CComBSTR(CLoc::GetString("BTN_STRONGER")), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(930,540,120,30), &fontFormat, &btnBrush); } } // Wenn das Schiff in irgendeinem unserer Systeme gebaut wird, dann großen Text ausgeben, in welchem System das Schiff // gerade gebaut wird CString systemName = CheckIfShipIsBuilding(m_pShownShip); if (!systemName.IsEmpty()) { COverlayBanner *banner = new COverlayBanner(CPoint(200,300), CSize(580, 200), CLoc::GetString("NO_CHANGE_POSSIBLE", FALSE, systemName), RGB(220,0,0)); banner->Draw(g, &Gdiplus::Font(CComBSTR(fontName), fontSize)); delete banner; } // draw Button DisplayAllShips Bitmap* btnDisplayAllShips = pDoc->GetGraphicPool()->GetGDIGraphic("Other\\" + pMajor->GetPrefix() + "button_small.bop");//All-Button zeichnen if(btnDisplayAllShips) g->DrawImage(btnDisplayAllShips,40,750,80,30); CString s; //AfxMessageBox("m_bDisplayAllShips"); if (m_bDisplayAllShips) s=CLoc::GetString("BTN_ALL"); else s=CLoc::GetString("BTN_CURRENTS"); g->DrawString(CComBSTR(s), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(40,750,80,30), &fontFormat, &fontBrush); // "Schiffsdesign" in der Mitte zeichnen // Rassenspezifische Schriftart auswählen CFontLoader::CreateGDIFont(pMajor, 5, fontName, fontSize); // Schriftfarbe wählen CFontLoader::GetGDIFontColor(pMajor, 3, normalColor); fontBrush.SetColor(normalColor); g->DrawString(CComBSTR(CLoc::GetString("SHIPDESIGN")), -1, &Gdiplus::Font(CComBSTR(fontName), fontSize), RectF(188,10,600,50), &fontFormat, &fontBrush); }