From eae60e81cc2d93d5f01b01e1ca8d4f6e32e9ffaf Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sat, 24 Aug 2024 23:23:48 +0800 Subject: [PATCH] [saco] Implement/match `CScoreBoard::ResetDialogControls(...)` * Update CScoreBoard constructor --- saco/scoreboard.cpp | 29 ++++++++++++++++++++++++++--- saco/scoreboard.h | 5 +++-- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/saco/scoreboard.cpp b/saco/scoreboard.cpp index 6a10ef3..f482891 100644 --- a/saco/scoreboard.cpp +++ b/saco/scoreboard.cpp @@ -6,8 +6,8 @@ extern CGame* pGame; CScoreBoard::CScoreBoard(IDirect3DDevice9 *pD3DDevice) { m_pD3DDevice = pD3DDevice; - field_34 = 0; - field_38 = 0; + m_pDialog = NULL; + m_pListBox = NULL; field_3C = 0; field_40 = 0; field_4 = 0; @@ -33,7 +33,6 @@ CScoreBoard::CScoreBoard(IDirect3DDevice9 *pD3DDevice) field_0 = 0; } -// MATCH void CScoreBoard::FUNC_1006E930() { RECT rect; @@ -44,3 +43,27 @@ void CScoreBoard::FUNC_1006E930() field_8 = rect.right * 0.5f - field_14 * 0.5f; field_C = rect.bottom * 0.5f - field_18 * 0.5f; } + +void CScoreBoard::ResetDialogControls(CDXUTDialog *pDialog) +{ + m_pDialog = pDialog; + + if(pDialog) { + pDialog->SetSize(field_14, field_18); + + m_pListBox = new CDXUTListBox(m_pDialog); + m_pDialog->AddControl(m_pListBox); + m_pListBox->SetLocation(0, field_1C); + m_pListBox->SetSize(field_14, field_18 - field_1C); + m_pListBox->OnInit(); + m_pListBox->GetElement(0)->TextureColor.Init(D3DCOLOR_ARGB( 200, 255, 255, 255 )); + m_pListBox->field_4D = 3; + m_pListBox->field_51 = field_24 * field_14; + m_pListBox->field_59 = field_28 * field_14; + m_pListBox->field_55 = field_2C * field_14; + m_pListBox->SetEnabled(false); + m_pListBox->SetVisible(false); + + FUNC_1006E930(); + } +} diff --git a/saco/scoreboard.h b/saco/scoreboard.h index aecac91..33b6745 100644 --- a/saco/scoreboard.h +++ b/saco/scoreboard.h @@ -17,8 +17,8 @@ private: float field_28; float field_2C; IDirect3DDevice9 *m_pD3DDevice; - int field_34; - int field_38; + CDXUTDialog *m_pDialog; + CDXUTListBox *m_pListBox; int field_3C; int field_40; @@ -26,4 +26,5 @@ public: CScoreBoard(IDirect3DDevice9 *pD3DDevice); void FUNC_1006E930(); + void ResetDialogControls(CDXUTDialog *pDialog); };