Просмотр исходного кода

Fix nonexistent MyRoom folder breaking BG selector

When MyRoom folder is missing, CreativeRoomManager.GetSaveDataDic()
returns null. Since the dictionary is null, the MyRoomCustomBGIndex is
always -1. This implies that every BG that's selected is a MyRoom BG
which fails to load.

This change sets the myRoomCustom index to the BGList count regardless
of there being MyRoom BGs.
habeebweeb 3 лет назад
Родитель
Сommit
2d48ca454d
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      src/MeidoPhotoStudio.Plugin/Constants.cs

+ 3 - 3
src/MeidoPhotoStudio.Plugin/Constants.cs

@@ -542,13 +542,13 @@ namespace MeidoPhotoStudio.Plugin
                 }
             }
 
+            // Set index regardless of there being myRoom bgs or not
+            MyRoomCustomBGIndex = BGList.Count;
+
             Dictionary<string, string> saveDataDict = CreativeRoomManager.GetSaveDataDic();
 
             if (saveDataDict != null)
-            {
-                MyRoomCustomBGIndex = BGList.Count;
                 MyRoomCustomBGList.AddRange(saveDataDict);
-            }
         }
 
         public static void InitializeDogu()