Преглед на файлове

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 години
родител
ревизия
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()