added dynamic default screen position for button to show level set info
authorHolger Schemel <info@artsoft.org>
Wed, 14 Dec 2022 11:18:47 +0000 (12:18 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 14 Dec 2022 11:18:47 +0000 (12:18 +0100)
src/screens.c

index 8a471ecb4050795009cfef99b7dfa6e5447e998f..d986f8d96a164c12258cb1f6532278d95fa9f490 100644 (file)
@@ -9770,6 +9770,16 @@ static void CreateScreenMenubuttons(void)
             id == SCREEN_CTRL_ID_NEXT_LEVEL2 ? mSY + MENU_TITLE1_YPOS : 0);
     }
 
+    if (id == SCREEN_CTRL_ID_LEVELSET_INFO)
+    {
+      if (pos->x == -1 && pos->y == -1)
+      {
+       // use "SX" here to place button (ignore draw offsets)
+       x = SX + SXSIZE - 2 * TILESIZE;
+       y = SY + SYSIZE - 2 * TILESIZE;
+      }
+    }
+
     gi = CreateGadget(GDI_CUSTOM_ID, id,
                      GDI_CUSTOM_TYPE_ID, i,
                      GDI_IMAGE_ID, gfx_unpressed,