From ce7a1e6952d05d6eecdae03ea3110f8ca6807cb3 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 1 Apr 2023 12:07:33 +0200 Subject: [PATCH] moved code to separate function --- src/editor.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/editor.c b/src/editor.c index 4f29f028..edd8b12f 100644 --- a/src/editor.c +++ b/src/editor.c @@ -7759,6 +7759,14 @@ static void MapLevelEditorToolboxCustomGadgets(void) MapOrUnmapLevelEditorToolboxCustomGadgets(TRUE); } +static void MapLevelEditorToolboxCustomGadgetsIfNeeded(void) +{ + if (IS_CUSTOM_ELEMENT(properties_element) || + IS_GROUP_ELEMENT(properties_element) || + IS_EMPTY_ELEMENT(properties_element)) + MapLevelEditorToolboxCustomGadgets(); +} + static void UnmapLevelEditorToolboxCustomGadgets(void) { MapOrUnmapLevelEditorToolboxCustomGadgets(FALSE); @@ -10682,10 +10690,7 @@ static void DrawPropertiesWindow(void) UnmapLevelEditorToolboxDrawingGadgets(); UnmapLevelEditorToolboxCustomGadgets(); - if (IS_CUSTOM_ELEMENT(properties_element) || - IS_GROUP_ELEMENT(properties_element) || - IS_EMPTY_ELEMENT(properties_element)) - MapLevelEditorToolboxCustomGadgets(); + MapLevelEditorToolboxCustomGadgetsIfNeeded(); SetMainBackgroundImage(IMG_BACKGROUND_EDITOR); ClearField(); -- 2.34.1