فهرست منبع

Remove ActiveMeidoNameList property

Property is only used in one place
habeebweeb 4 سال پیش
والد
کامیت
9827aeac50

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

@@ -1,4 +1,5 @@
 using System;
+using System.Linq;
 using System.Collections.Generic;
 using UnityEngine;
 
@@ -221,8 +222,13 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             }
             int index = Mathf.Clamp(this.meidoDropdown.SelectedItemIndex, 0, this.meidoManager.ActiveMeidoList.Count);
 
+            string[] dropdownList = this.meidoManager.ActiveMeidoList.Count == 0
+                ? new[] { Translation.Get("systemMessage", "noMaids") }
+                : this.meidoManager.ActiveMeidoList.Select(
+                    meido => $"{meido.ActiveSlot + 1}: {meido.FirstName} {meido.LastName}"
+                ).ToArray();
             this.updating = true;
-            this.meidoDropdown.SetDropdownItems(this.meidoManager.ActiveMeidoNameList, index);
+            this.meidoDropdown.SetDropdownItems(dropdownList, index);
             this.updating = false;
 
             meidoDropdownActive = this.meidoManager.HasActiveMeido;

+ 1 - 10
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/MeidoManager.cs

@@ -9,25 +9,16 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
     {
         private static CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
         private int undress = 0;
+        private int numberOfMeidos;
         public Meido[] meidos { get; private set; }
         public List<int> SelectMeidoList { get; private set; } = new List<int>();
         public List<Meido> ActiveMeidoList { get; private set; } = new List<Meido>();
         public Meido ActiveMeido => ActiveMeidoList.Count > 0 ? ActiveMeidoList[SelectedMeido] : null;
         public bool HasActiveMeido => ActiveMeido != null;
-        public int numberOfMeidos;
         public event EventHandler<MeidoUpdateEventArgs> UpdateMeido;
         public event EventHandler EndCallMeidos;
         public event EventHandler BeginCallMeidos;
         private int selectedMeido = 0;
-        public string[] ActiveMeidoNameList
-        {
-            get
-            {
-                return ActiveMeidoList.Count == 0
-                    ? new[] { Translation.Get("systemMessage", "noMaids") }
-                    : ActiveMeidoList.Select(meido => $"{meido.FirstName} {meido.LastName}").ToArray();
-            }
-        }
         public int SelectedMeido
         {
             get => selectedMeido;