added updating BD cave colors when redrawing editor screen
authorHolger Schemel <holger.schemel@virtion.de>
Thu, 3 Oct 2024 14:02:16 +0000 (16:02 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Thu, 3 Oct 2024 14:02:30 +0000 (16:02 +0200)
src/editor.c
src/editor.h

index 8523c97ec394f8c354bf962283ba6a1e1aa0bd73..88fdbccc183e016b24204f8f4fb95fc7d697405a 100644 (file)
@@ -10086,6 +10086,8 @@ static void DrawEditModeWindowExt(boolean remap_toolbox_gadgets)
 {
   if (remap_toolbox_gadgets)
   {
+    SetCurrentLevelColors_BD();
+
     ModifyEditorElementList();
     RedrawDrawingElements();
   }
@@ -11767,6 +11769,20 @@ void SetDefaultLevelColors_BD(void)
     bd_color_default[i] = *bd_color[i];
 }
 
+void SetCurrentLevelColors_BD(void)
+{
+  struct LevelInfo_BD *level_bd = level.native_bd_level;
+  GdCave *cave = level_bd->cave;
+
+  cave->colorb = level.bd_color_b;
+  cave->color0 = level.bd_color_0;
+  cave->color1 = level.bd_color_1;
+  cave->color2 = level.bd_color_2;
+  cave->color3 = level.bd_color_3;
+  cave->color4 = level.bd_color_4;
+  cave->color5 = level.bd_color_5;
+}
+
 void SetRandomLevelColors_BD(int bd_color_type)
 {
   struct LevelInfo_BD *level_bd = level.native_bd_level;
index 8dd3e390a46648c4408f6be943e7354b5e9db05d..a05f14b7c6cd21096888cefc14f453b688edc414 100644 (file)
@@ -38,6 +38,7 @@ void RedoLevelEditorOperation(void);
 
 void SetDefaultLevelColorType_BD(void);
 void SetDefaultLevelColors_BD(void);
+void SetCurrentLevelColors_BD(void);
 void SetRandomLevelColors_BD(int);
 
 #endif