瀏覽代碼

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()