moved code to separate function
authorHolger Schemel <info@artsoft.org>
Sat, 1 Apr 2023 10:07:33 +0000 (12:07 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 1 Apr 2023 10:07:33 +0000 (12:07 +0200)
src/editor.c

index 4f29f028a7bc245c1b3abb4222aae4095c0f6be2..edd8b12f224f50c3dc0f07097b0ccd34bd6d2c94 100644 (file)
@@ -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();