Add NewGRFClass helper method for whether any UI classes available

This commit is contained in:
Jonathan G Rennison
2023-01-03 03:31:09 +00:00
parent 5e76e6fb07
commit 417416d19b
4 changed files with 16 additions and 2 deletions

View File

@@ -755,7 +755,7 @@ static WindowDesc _build_object_desc(
Window *ShowBuildObjectPicker()
{
/* Don't show the place object button when there are no objects to place. */
if (ObjectClass::GetUIClassCount() > 0) {
if (ObjectClass::HasUIClass()) {
return AllocateWindowDescFront<BuildObjectWindow>(&_build_object_desc, 0);
}
return nullptr;