Forráskód Böngészése

套装月卡位置

zhaoyang 2 éve
szülő
commit
3afe565cc5

+ 1 - 1
FGUIProject/assets/DressUp/components/ComboBoxSuit_item.xml

@@ -2,7 +2,7 @@
 <component size="322,60" extention="Button">
   <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
   <displayList>
-    <text id="n1_q08x" name="title" xy="103,0" size="116,39" fontSize="28" color="#b79155" align="center" vAlign="middle" singleLine="true" text="我的套装">
+    <text id="n1_q08x" name="title" xy="103,0" pivot="0.5,0" size="116,39" fontSize="28" color="#b79155" align="center" vAlign="middle" singleLine="true" text="我的套装">
       <relation target="" sidePair="width-width,height-height"/>
     </text>
     <image id="n0_q08x" name="n0" src="q08xp" fileName="imagesExport/hz_tzkuang.png" pkg="eg2y0ldp" xy="21,53" color="#e1cca3">

+ 45 - 15
GameClient/Assets/Game/HotUpdate/Data/CustomSuitDataManager.cs

@@ -4,14 +4,10 @@ using ET;
 
 namespace GFGGame
 {
-    public class CustomSuitDataManager
+    public class CustomSuitDataManager : Singleton<CustomSuitDataManager>
     {
         private static int _currentIndex;
         public static int currentIndex { get; set; }
-        private const int _defaultPosCount = 3;
-        private static MonthlyCardPrivilegeCfg privilegeCfg = MonthlyCardPrivilegeCfgArray.Instance.GetCfg(MonthCardPrivilegeType.Privilege3);
-
-        // private string[] posItems = new string[_defaultPosCount + privilegeCfg.value1Arr[0] + privilegeCfg.value2Arr[1]];
 
         private static Dictionary<int, CustomSuitData> _dataDic = new Dictionary<int, CustomSuitData>();
         public static void SaveSuit(int index, DressUpData dressUpData)
@@ -85,19 +81,53 @@ namespace GFGGame
             }
         }
 
-        //检测是否是月卡位置,0默认位置
-        public static bool CheckIsCardPos(int cardType, int pos)
+        public static string[] GetSuitPosItems()
+        {
+            MonthlyCardPrivilegeCfg privilegeCfg = MonthlyCardPrivilegeCfgArray.Instance.GetCfg(MonthCardPrivilegeType.Privilege3);
+            string[] posItems = new string[GlobalCfgArray.globalCfg.freeSuitNum + privilegeCfg.value1Arr[0] + privilegeCfg.value2Arr[0]];
+            for (int i = 0; i < posItems.Length; i++)
+            {
+                if (GetPosType(i) == 0)
+                {
+                    posItems[i] = string.Format("我的套装{0}", NumberUtil.GetChiniseNumberText(i + 1));
+                }
+                else if (GetPosType(i) == MonthCardType.Gold)
+                {
+                    if (RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold))
+                    {
+                        posItems[i] = string.Format("我的套装{0}", NumberUtil.GetChiniseNumberText(i + 1));
+                    }
+                    else
+                    {
+                        posItems[i] = "金卡开启";
+                    }
+                }
+                else if (GetPosType(i) == MonthCardType.BlackGold)
+                {
+                    if (RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold))
+                    {
+                        posItems[i] = string.Format("我的套装{0}", NumberUtil.GetChiniseNumberText(i + 1));
+                    }
+                    else
+                    {
+                        posItems[i] = "黑金卡开启";
+                    }
+                }
+            }
+            return posItems;
+        }
+
+
+        //获取指定位置月卡类型
+        public static int GetPosType(int pos)
         {
-            // if (pos < _defaultPosCount) return false;
+            if (pos < GlobalCfgArray.globalCfg.freeSuitNum) return 0;
 
-            // for (int i = _defaultPosCount; i < posItems.Length; i++)
-            // {
-            //     if (cardType == MonthCardType.Gold && pos <)
-            //     {
+            MonthlyCardPrivilegeCfg privilegeCfg = MonthlyCardPrivilegeCfgArray.Instance.GetCfg(MonthCardPrivilegeType.Privilege3);
+            if (pos < GlobalCfgArray.globalCfg.freeSuitNum + privilegeCfg.value1Arr[0]) return MonthCardType.Gold;
+            if (pos >= GlobalCfgArray.globalCfg.freeSuitNum + privilegeCfg.value1Arr[0]) return MonthCardType.BlackGold;
 
-            //     }
-            // }
-            return false;
+            return 0;
         }
     }
 }

+ 16 - 14
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpView.cs

@@ -75,20 +75,7 @@ namespace GFGGame
             _ui.m_btnPhoto.visible = true;
             _ui.m_btnAction.visible = false;
 
-            // MonthlyCardPrivilegeCfg privilegeCfg = MonthlyCardPrivilegeCfgArray.Instance.GetCfg(MonthCardPrivilegeType.Privilege3);
-            // string[] items = new string[3 + privilegeCfg.value1Arr[0] + privilegeCfg.value2Arr[0]];
-            // for (int i = 0; i < items.Length; i++)
-            // {
-            //     if (i <= 3)
-            //     {
-
-            //     }else if(i<=(3+privilegeCfg.value1Arr[0])){
-
-
-            //     }else if()
-            // }
-
-            _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
+            // _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
             _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
 
             InitLists();
@@ -148,6 +135,8 @@ namespace GFGGame
                 _sceneObject = GameObject.Instantiate(_scenePrefab);
             }
             MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);
+
+            _ui.m_comboBox.items = CustomSuitDataManager.GetSuitPosItems();
             _ui.m_comboBox.selectedIndex = CustomSuitDataManager.currentIndex;
             MyDressUpHelper.PutOnSuitSavedByPos(CustomSuitDataManager.currentIndex);
             // UpdateStepBtn();
@@ -216,6 +205,19 @@ namespace GFGGame
         }
         private void OnComboBoxChanged()
         {
+            if (_ui.m_comboBox.selectedIndex == CustomSuitDataManager.currentIndex) return;
+            if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.Gold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold))
+            {
+                PromptController.Instance.ShowFloatTextPrompt("开通金卡开启");
+                _ui.m_comboBox.selectedIndex = CustomSuitDataManager.currentIndex;
+                return;
+            }
+            if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.BlackGold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold))
+            {
+                PromptController.Instance.ShowFloatTextPrompt("开通黑金卡开启");
+                _ui.m_comboBox.selectedIndex = CustomSuitDataManager.currentIndex;
+                return;
+            }
             MyDressUpHelper.PutOnSuitSavedByPos(_ui.m_comboBox.selectedIndex);
         }
 

BIN
GameClient/Assets/ResIn/UI/DressUp/DressUp_fui.bytes