Bläddra i källkod

Clean up stuff

habeebweeb 4 år sedan
förälder
incheckning
3a8207e246

+ 4 - 5
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Constants.cs

@@ -237,11 +237,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             InitializeOtherDogu();
             InitializeHandItems();
 
-            foreach (KeyValuePair<string, UnityEngine.Object> keyValuePair in PhotoBGObjectData.popup_category_list)
+            foreach (string category in PhotoBGObjectData.popup_category_list.Select(kvp => kvp.Key))
             {
-                string category = keyValuePair.Key;
                 if (category == "マイオブジェクト") continue;
-                DoguCategories.Add(keyValuePair.Key);
+                DoguCategories.Add(category);
             }
 
             foreach (DoguCategory category in Enum.GetValues(typeof(DoguCategory)))
@@ -271,9 +270,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             doguHashSet.UnionWith(BGList);
             doguHashSet.UnionWith(ignoreList);
-            foreach (KeyValuePair<string, List<string>> keyValuePair in DoguDict)
+            foreach (List<string> doguList in DoguDict.Values)
             {
-                doguHashSet.UnionWith(keyValuePair.Value);
+                doguHashSet.UnionWith(doguList);
             }
 
             string[] com3d2BgList = GameUty.FileSystem.GetList("bg", AFileSystemBase.ListType.AllFile);

+ 1 - 2
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindow2Panes/AttachPropPane.cs

@@ -155,9 +155,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private void SetAttachPointToggle(AttachPoint point, bool value)
         {
             this.updating = true;
-            foreach (KeyValuePair<AttachPoint, Toggle> kvp in Toggles)
+            foreach (Toggle toggle in Toggles.Values)
             {
-                Toggle toggle = kvp.Value;
                 toggle.Value = false;
             }
             if (point != AttachPoint.None) Toggles[point].Value = value;

+ 8 - 6
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindow2Panes/ModPropsPane.cs

@@ -59,12 +59,14 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 ChangePropCategory();
             };
 
-            this.modFilterToggle = new Toggle(Translation.Get("background2Window", "modsToggle"));
-            this.modFilterToggle.ControlEvent += (s, a) => ChangeFilter(FilterType.Mod);
-
+            if (!isModsOnly)
+            {
+                this.modFilterToggle = new Toggle(Translation.Get("background2Window", "modsToggle"));
+                this.modFilterToggle.ControlEvent += (s, a) => ChangeFilter(FilterType.Mod);
 
-            this.baseFilterToggle = new Toggle(Translation.Get("background2Window", "baseToggle"));
-            this.baseFilterToggle.ControlEvent += (s, a) => ChangeFilter(FilterType.Base);
+                this.baseFilterToggle = new Toggle(Translation.Get("background2Window", "baseToggle"));
+                this.baseFilterToggle.ControlEvent += (s, a) => ChangeFilter(FilterType.Base);
+            }
         }
 
         protected override void ReloadTranslation()
@@ -184,7 +186,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         private void SetListCount()
         {
-            if (modFilter || isModsOnly) currentListCount = modPropList.Count(mod => mod.IsMod);
+            if (modFilter) currentListCount = modPropList.Count(mod => mod.IsMod);
             else if (baseFilter) currentListCount = modPropList.Count(mod => !mod.IsMod);
             else currentListCount = modPropList.Count;
         }

+ 3 - 8
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/BackgroundSelectorPane.cs

@@ -1,4 +1,5 @@
 using UnityEngine;
+using System.Linq;
 using System.Collections.Generic;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin
@@ -19,10 +20,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             List<string> bgList = new List<string>(Translation.GetList("bgNames", Constants.BGList));
             if (Constants.MyRoomCustomBGIndex >= 0)
             {
-                foreach (KeyValuePair<string, string> kvp in Constants.MyRoomCustomBGList)
-                {
-                    bgList.Add(kvp.Value);
-                }
+                bgList.AddRange(Constants.MyRoomCustomBGList.Select(kvp => kvp.Value));
             }
 
             this.bgDropdown = new Dropdown(bgList.ToArray(), theaterIndex);
@@ -50,10 +48,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             List<string> bgList = new List<string>(Translation.GetList("bgNames", Constants.BGList));
             if (Constants.MyRoomCustomBGIndex >= 0)
             {
-                foreach (KeyValuePair<string, string> kvp in Constants.MyRoomCustomBGList)
-                {
-                    bgList.Add(kvp.Value);
-                }
+                bgList.AddRange(Constants.MyRoomCustomBGList.Select(kvp => kvp.Value));
             }
 
             updating = true;

+ 0 - 3
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/PoseWindowPane.cs

@@ -18,9 +18,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             this.meidoManager = meidoManager;
             this.maidSwitcherPane = maidSwitcherPane;
 
-            // this.meidoManager.UpdateMeido += UpdateMeido;
-            // this.meidoManager.FreeLookChange += UpdateMeido;
-
             this.maidPosePane = new MaidPoseSelectorPane(meidoManager);
             this.maidFaceLookPane = new MaidFaceLookPane(meidoManager);
             this.maidFaceLookPane.Enabled = false;

+ 1 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/MenuFileCache.cs

@@ -3,7 +3,7 @@ using System.IO;
 using System.Collections.Generic;
 
 /*
-    All of this is pretty much stolen from COM3D2.CacheEditMenu. Thanks Mr. Hosrington.
+    All of this is pretty much stolen from COM3D2.CacheEditMenu. Thanks Mr. Horsington.
     https://git.coder.horse/ghorsington/COM3D2.CacheEditMenu
 */
 namespace COM3D2.MeidoPhotoStudio.Plugin

+ 0 - 5
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Translation.cs

@@ -112,10 +112,5 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             return list.Select(uiName => Get(category, uiName));
         }
-
-        public static string[] GetList(string category, IEnumerable<KeyValuePair<string, string>> list)
-        {
-            return list.Select(kvp => Get(category, kvp.Key)).ToArray();
-        }
     }
 }