35 C4GoalDisplay::GoalPicture::GoalPicture(
const C4Rect &rcBounds,
C4ID idGoal,
bool fFulfilled)
36 :
C4GUI::Window(), idGoal(idGoal), fFulfilled(fFulfilled)
64 pDrawDef->
Draw(Picture,
false, 0, pGoalObj);
68 Picture.Grayscale(30);
71 void C4GoalDisplay::GoalPicture::DrawElement(
C4TargetFacet &cgo)
77 Picture.Draw(cgoDraw);
92 int32_t iGoalSymbolAreaHeight = 2*iGoalSymbolMargin + iGoalSymbolHeight;
94 int32_t iGoalsPerRow = std::max<int32_t>(1, iGoalAreaWdt / iGoalSymbolAreaHeight);
96 int32_t iRowCount = (iGoalCount-1) / iGoalsPerRow + 1;
103 for (int32_t iRow=0; iRow<iRowCount; ++iRow)
105 int32_t iColCount = std::min<int32_t>(iGoalCount - iGoal, iGoalsPerRow);
107 for (int32_t iCol=0; iCol<iColCount; ++iCol,++iGoal)
110 bool fFulfilled = !!rFulfilledGoals.
GetIDCount(idGoal, 1);
111 AddElement(
new GoalPicture(caGoalArea.
GetGridCell(iCol, iColCount, iRow, iRowCount), idGoal, fFulfilled));
119 bool C4GameOverDlg::is_shown =
false;
129 int32_t iDefBtnHeight = 32;
130 int32_t iIndentX1=10;
131 int32_t iIndentY1=6, iIndentY2=0;
134 int32_t iMainTextWidth = caMain.
GetWidth() - 6*iIndentX1;
154 const char *szNetResult =
nullptr;
160 szNetResult =
LoadResStr(
"IDS_TEXT_LEAGUEWAITINGFOREVALUATIO");
172 if (szCustomEvaluationStrings && *szCustomEvaluationStrings)
178 if (rcCustomStringBounds.
Hgt > iMaxHgt)
181 delete pCustomStrings;
182 rcCustomStringBounds.
Hgt = iMaxHgt;
183 C4GUI::TextWindow *pCustomStringsWin =
new C4GUI::TextWindow(rcCustomStringBounds, 0,0,0, 0,0,
" ",
true,
nullptr,0,
true);
184 pCustomStringsWin->
SetDecoration(
false,
false,
nullptr,
false);
198 iPlrListCount = 1;
bool fSepTeamLists =
false;
203 fSepTeamLists =
true;
206 for (int32_t i=0; i<iPlrListCount; ++i)
210 ppPlayerLists[i]->
SetDecoration(
false,
nullptr,
true,
false);
229 fHasNextMissionButton =
true;
239 if (fIsQuitBtnVisible)
SetFocus(btnExit,
false);
245 delete[] ppPlayerLists;
249 void C4GameOverDlg::Update()
251 for (int32_t i=0; i<iPlrListCount; ++i) ppPlayerLists[i]->Update();
258 if (fBtnsVisible != fIsQuitBtnVisible)
260 fIsQuitBtnVisible = fBtnsVisible;
263 if (fIsQuitBtnVisible)
SetFocus(pBtnExit,
false);
267 void C4GameOverDlg::SetNetResult(
const char *szResultString,
C4RoundResults::NetResult eResultType,
size_t iPendingStreamingData,
bool fIsStreaming)
273 sResult.AppendChar(
'|');
274 sResult.AppendFormat(
"[!]Transmitting record to league server... (%d kb remaining)",
int(iPendingStreamingData/1024));
304 if (fHasNextMissionButton)
328 BaseClass::OnClosed(
fOK);
C4Application Application
C4GraphicsResource GraphicsResource
#define C4GUI_DefDlgSmallIndent
#define C4GUI_MessageFontClr
#define C4GUI_Caption2FontClr
const char * LoadResStr(const char *id)
void SetNextMission(const char *szMissionFilename)
void Draw(C4Facet &cgo, bool fSelected=false, DWORD iColor=0, C4Object *pObj=nullptr, int32_t iPhaseX=0, int32_t iPhaseY=0, C4DrawTransform *trans=nullptr, const char *graphicsName=nullptr)
void Set(C4Surface &rSfc)
void Draw(C4Facet &cgo, bool fAspect=true, int32_t iPhaseX=0, int32_t iPhaseY=0, bool fTransparent=true)
int32_t GetInnerHeight() const
int32_t GetInnerWidth() const
void ExpandTop(int32_t iByHgt)
bool GetFromTop(int32_t iHgt, int32_t iWdt, C4Rect &rcOut)
C4Rect & GetGridCell(int32_t iSectX, int32_t iSectXMax, int32_t iSectY, int32_t iSectYMax, int32_t iSectSizeX=-1, int32_t iSectSizeY=-1, bool fCenterPos=false, int32_t iSectNumX=1, int32_t iSectNumY=1)
void GetAll(C4Rect &rcOut)
bool GetFromBottom(int32_t iHgt, int32_t iWdt, C4Rect &rcOut)
void AddElement(Element *pChild)
void SetVisibility(bool fToValue) override
void SetFocus(Control *pCtrl, bool fByMouse)
void SetBounds(const C4Rect &rcNewBound)
void SetToolTip(const char *szNewTooltip, bool is_immediate=false)
static C4Facet GetIconFacet(Icons icoIconIndex)
void SetText(const char *szToText, bool fAllowHotkey=true)
void SetDecoration(bool fDrawBG, ScrollBarFacets *pToGfx, bool fAutoScroll, bool fDrawBorder=false)
void SetSelectionDiabled(bool fToVal=true)
void AddLine(const char *szLine, CStdFont *pFont, DWORD dwClr, bool fDoUpdate, bool fMakeReadableOnBlack, CStdFont *pCaptionFont)
void SetDecoration(bool fDrawBG, bool fDrawFrame, ScrollBarFacets *pToGfx, bool fAutoScroll)
void AddTextLine(const char *szText, CStdFont *pFont, DWORD dwClr, bool fDoUpdate, bool fMakeReadableOnBlack, CStdFont *pCaptionFont=nullptr)
virtual int32_t GetMarginTop()
void UpdateOwnPos() override
C4Rect & GetClientRect() override
virtual int32_t GetMarginBottom()
C4RoundResults & RoundResults
StdCopyStrBuf NextMissionText
StdCopyStrBuf NextMissionDesc
C4GameParameters & Parameters
StdCopyStrBuf NextMission
~C4GameOverDlg() override
void OnClosed(bool fOK) override
void SetGoals(const C4IDList &rAllGoals, const C4IDList &rFulfilledGoals, int32_t iGoalSymbolHeight)
C4ID GetID(size_t index, int32_t *ipCount=nullptr) const
int32_t GetNumberOfIDs() const
int32_t GetIDCount(C4ID c_id, int32_t iZeroDefVal=0) const
size_t getPendingStreamData() const
C4Object * Find(C4Def *def, int owner=ANY_OWNER, DWORD dwOCF=OCF_All)
@ PILBM_EvaluationNoWinners
const char * GetName() const override
const char * GetNetResultString() const
bool HasNetResult() const
const char * GetCustomEvaluationStrings() const
const C4IDList & GetFulfilledGoals() const
const C4IDList & GetGoals() const
NetResult GetNetResult() const
C4Team * GetTeamByIndex(int32_t iIndex) const
bool IsAutoGenerateTeams() const
int32_t GetTeamCount() const
int GetLineHeight() const
int32_t GetTextWidth(const char *szText, bool fCheckMarkup=true)
std::tuple< std::string, int > BreakMessage(const char *szMsg, int iWdt, bool fCheckMarkup, float fZoom=1.0f)
void Remove(StdSchedulerProc *pProc)
void Add(StdSchedulerProc *pProc)
const char * getData() const
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O