Fix warnings on the charts tab of summary screen

Engine.GetTextWidth has been deprecated since e845da025a

Idea:
If you look at a dropdown as just a text field (its header) that can
change caption like any other, then getPreferredHeaderTextSize is the
equivalent to getPreferredTextSize (present on buttons and text fields).

Fixes #8493
This commit is contained in:
Vantha
2025-12-18 16:43:31 +01:00
parent fbb6052c30
commit 670f1e5d42
5 changed files with 27 additions and 2 deletions
@@ -22,6 +22,7 @@
#include "gui/ObjectBases/IGUIObject.h"
#include "gui/ObjectTypes/CButton.h"
#include "gui/ObjectTypes/CDropDown.h"
#include "gui/ObjectTypes/CList.h"
#include "gui/ObjectTypes/CMiniMap.h"
#include "gui/ObjectTypes/CScrollPanel.h"
@@ -69,6 +70,13 @@ template<> void JSI_GUIProxy<CList>::CreateFunctions(const ScriptRequest& rq, GU
}
DECLARE_GUIPROXY(CList);
// CDropDown
template<> void JSI_GUIProxy<CDropDown>::CreateFunctions(const ScriptRequest& rq, GUIProxyProps* cache)
{
CreateFunction<&CDropDown::GetPreferredHeaderTextSize>(rq, cache, "getPreferredHeaderTextSize");
}
DECLARE_GUIPROXY(CDropDown);
// CMiniMap
template<> void JSI_GUIProxy<CMiniMap>::CreateFunctions(const ScriptRequest& rq, GUIProxyProps* cache)
{