From d6b207ac3c258af1fbaf4c79a147c7a5d04a0a1e Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 26 Aug 2024 22:35:43 +0800 Subject: [PATCH] [saco] Implement/match `CUnkClass3::ResetDialogControls(...)` --- saco/unkclass3.cpp | 37 +++++++++++++++++++++++++++++++++++-- saco/unkclass3.h | 6 ++++-- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/saco/unkclass3.cpp b/saco/unkclass3.cpp index 9a141b2..85c13af 100644 --- a/saco/unkclass3.cpp +++ b/saco/unkclass3.cpp @@ -1,10 +1,12 @@ #include "main.h" +extern CConfig *pConfig; + CUnkClass3::CUnkClass3(IDirect3DDevice9 *pD3DDevice) { m_pD3DDevice = pD3DDevice; - field_1C = 0; + m_pDialog = NULL; field_28 = 0; field_34 = 0; field_30 = 0; @@ -13,6 +15,37 @@ CUnkClass3::CUnkClass3(IDirect3DDevice9 *pD3DDevice) field_10 = 300; field_14 = 100; field_18 = 30; - memset(field_89, 0, sizeof(field_89)); } + +void CUnkClass3::ResetDialogControls(CDXUTDialog *pDialog) +{ + m_pDialog = pDialog; + + if(pDialog) { + m_pListBox = new CDXUTListBox(m_pDialog); + m_pDialog->AddControl(m_pListBox); + m_pListBox->SetLocation(10,10); + m_pListBox->SetSize(field_C,field_10-100); + m_pListBox->OnInit(); + m_pListBox->GetElement(0)->TextureColor.Init(D3DCOLOR_ARGB( 200, 255, 255, 255 )); + m_pListBox->field_4D = 0; + m_pListBox->SetEnabled(false); + m_pListBox->SetVisible(false); + m_pDialog->AddButton(20,"BUTTON1",10,5,field_14,field_18); + m_pDialog->AddButton(21,"BUTTON2",110,5,field_14,field_18); + + m_pDialog->AddIMEEditBox(19,"",10,175,570,40,true,&m_pEditControl); + if(pConfig->GetIntVariable("ime")) { + CDXUTIMEEditBox::EnableImeSystem(true); + CDXUTIMEEditBox::StaticOnCreateDevice(); + } + m_pEditControl->GetElement(0)->TextureColor.Init(D3DCOLOR_ARGB( 240, 5, 5, 5 )); + m_pEditControl->SetTextColor(D3DCOLOR_ARGB( 255, 255, 255, 255 )); + m_pEditControl->SetCaretColor(D3DCOLOR_ARGB( 255, 150, 150, 150 )); + m_pEditControl->SetSelectedBackColor(D3DCOLOR_ARGB( 255, 185, 34, 40 )); + m_pEditControl->SetSelectedTextColor(D3DCOLOR_ARGB( 255, 10, 10, 15 )); + m_pEditControl->SetEnabled(false); + m_pEditControl->SetVisible(false); + } +} diff --git a/saco/unkclass3.h b/saco/unkclass3.h index 5fc716e..1a644ec 100644 --- a/saco/unkclass3.h +++ b/saco/unkclass3.h @@ -10,8 +10,9 @@ private: int field_10; int field_14; int field_18; - int field_1C; - char _gap20[8]; + CDXUTDialog *m_pDialog; + CDXUTListBox *m_pListBox; + CDXUTIMEEditBox *m_pEditControl; int field_28; int field_2C; int field_30; @@ -23,4 +24,5 @@ private: public: CUnkClass3(IDirect3DDevice9 *pD3DDevice); + void ResetDialogControls(CDXUTDialog *pDialog); };