From 214b5bdefc90566db81807048157b8a08e743bdf Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 25 Aug 2024 23:01:16 +0800 Subject: [PATCH] [saco] Implement `CUnkClass4::ResetDialogControls(...)` * Update CUnkClass4 constructor * Match `CDXUTSlider::SetColor(...)` --- saco/d3d9/common/DXUTgui.cpp | 8 -------- saco/d3d9/common/DXUTgui.h | 2 +- saco/unkclass4.cpp | 21 ++++++++++++++++++++- saco/unkclass4.h | 3 ++- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/saco/d3d9/common/DXUTgui.cpp b/saco/d3d9/common/DXUTgui.cpp index 251aca7..ecfb1c7 100644 --- a/saco/d3d9/common/DXUTgui.cpp +++ b/saco/d3d9/common/DXUTgui.cpp @@ -3847,14 +3847,6 @@ void CDXUTSlider::Render( IDirect3DDevice9* pd3dDevice, float fElapsedTime ) } -//-------------------------------------------------------------------------------------- -void CDXUTSlider::SetColor(D3DXCOLOR c) -{ - field_76 = true; - field_77 = c; -} - - //-------------------------------------------------------------------------------------- // CDXUTScrollBar class //-------------------------------------------------------------------------------------- diff --git a/saco/d3d9/common/DXUTgui.h b/saco/d3d9/common/DXUTgui.h index e74cb74..a43a99f 100644 --- a/saco/d3d9/common/DXUTgui.h +++ b/saco/d3d9/common/DXUTgui.h @@ -769,7 +769,7 @@ protected: D3DXCOLOR field_77; public: - void SetColor(D3DXCOLOR c); + void SetColor(D3DXCOLOR c) { field_76 = true; field_77 = c; }; }; diff --git a/saco/unkclass4.cpp b/saco/unkclass4.cpp index 380f9b7..5eb3e41 100644 --- a/saco/unkclass4.cpp +++ b/saco/unkclass4.cpp @@ -4,7 +4,7 @@ CUnkClass4::CUnkClass4(IDirect3DDevice9 *pD3DDevice) { m_pD3DDevice = pD3DDevice; - field_20 = 0; + m_pDialog = NULL; field_24 = 0; field_C = 280; field_10 = 150; @@ -12,3 +12,22 @@ CUnkClass4::CUnkClass4(IDirect3DDevice9 *pD3DDevice) field_18 = 30; field_1C = 38; } + +void CUnkClass4::ResetDialogControls(CDXUTDialog *pDialog) +{ + D3DXCOLOR Color; + + m_pDialog = pDialog; + + if(pDialog) { + pDialog->AddSlider(30,50,10,field_14,field_18,-100,100,0); + m_pDialog->GetSlider(30)->SetColor(D3DXCOLOR(0.6f,0.6f,0.8f,1.0f)); + + int y = field_1C + 10; + m_pDialog->AddSlider(32,50,y,field_14,field_18,-100,100,0); + m_pDialog->GetSlider(32)->SetColor(D3DXCOLOR(0.8f,0.6f,0.6f,1.0f)); + + m_pDialog->AddSlider(34,50,y+field_1C,field_14,field_18,-100,100,0); + m_pDialog->GetSlider(34)->SetColor(D3DXCOLOR(0.6f,0.8f,0.6f,1.0f)); + } +} diff --git a/saco/unkclass4.h b/saco/unkclass4.h index a74e8e0..612cfd3 100644 --- a/saco/unkclass4.h +++ b/saco/unkclass4.h @@ -11,10 +11,11 @@ private: int field_14; int field_18; int field_1C; - int field_20; + CDXUTDialog *m_pDialog; int field_24; public: CUnkClass4(IDirect3DDevice9 *pD3DDevice); + void ResetDialogControls(CDXUTDialog *pDialog); };