Browse Source

自选礼包

何晓捷 2 years ago
parent
commit
2632be37b4
23 changed files with 398 additions and 74 deletions
  1. 8 9
      FGUIProject/assets/Bag/GiftBoxSelectorUI.xml
  2. 13 0
      FGUIProject/assets/Bag/components/BtnCancel.xml
  3. 0 0
      FGUIProject/assets/Bag/components/ComItemNumBag.xml
  4. 3 3
      FGUIProject/assets/Bag/components/ListSelectorItem.xml
  5. 3 2
      FGUIProject/assets/Bag/package.xml
  6. 13 0
      GameClient/.idea/.idea.GameClient/.idea/.gitignore
  7. 4 0
      GameClient/.idea/.idea.GameClient/.idea/encodings.xml
  8. 8 0
      GameClient/.idea/.idea.GameClient/.idea/indexLayout.xml
  9. 6 0
      GameClient/.idea/.idea.GameClient/.idea/vcs.xml
  10. 3 1
      GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs
  11. 71 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_ComItemNumBag.cs
  12. 11 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_ComItemNumBag.cs.meta
  13. 89 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_GiftBoxSelectorUI.cs
  14. 11 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_GiftBoxSelectorUI.cs.meta
  15. 81 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_ListSelectorItem.cs
  16. 11 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_ListSelectorItem.cs.meta
  17. 19 5
      GameClient/Assets/Game/HotUpdate/Views/Bag/BagView.cs
  18. 39 54
      GameClient/Assets/Game/HotUpdate/Views/Bag/GiftBoxSelectorView.cs
  19. 3 0
      GameClient/Assets/Game/HotUpdate/Views/Bag/GiftBoxSelectorView.cs.meta
  20. BIN
      GameClient/Assets/ResIn/UI/Bag/Bag_atlas0!a.png
  21. BIN
      GameClient/Assets/ResIn/UI/Bag/Bag_atlas0.png
  22. BIN
      GameClient/Assets/ResIn/UI/Bag/Bag_fui.bytes
  23. 2 0
      GameClient/GameClient.sln.DotSettings.user

+ 8 - 9
FGUIProject/assets/Bag/GiftBoxSelectorUI.xml

@@ -2,7 +2,7 @@
 <component size="962,970">
   <displayList>
     <image id="n0_v5no" name="n0" src="v5notm5" fileName="images/tanchuang_2.png" xy="-61,-37" size="1023,1026"/>
-    <image id="n4_v5no" name="n4" src="v5notly" fileName="images/back.png" xy="849,-29"/>
+    <component id="n31_cu9w" name="btnCancel" src="cu9wtmj" fileName="components/BtnCancel.xml" xy="849,-29" group="n11_v5no"/>
     <image id="n14_v5no" name="n14" src="v5notm0" fileName="images/lm_db_3.png" xy="331,135" size="575,274" group="n11_v5no"/>
     <image id="n1_v5no" name="n1" src="v5notm1" fileName="images/lm_dt_zsx1.png" xy="254,72" group="n11_v5no"/>
     <image id="n2_v5no" name="n2" src="v5notm2" fileName="images/lm_dt_zsx2.png" xy="576,71" group="n11_v5no"/>
@@ -11,16 +11,15 @@
     <text id="n3_v5no" name="txtName" xy="393,53" size="181,54" group="n11_v5no" fontSize="40" color="#8d6f45" align="center" leading="1" autoSize="shrink" text="苏合香"/>
     <text id="n5_v5no" name="txtTotalNum" xy="725,86" size="206,41" group="n11_v5no" fontSize="28" color="#b08d5c" align="center" leading="1" autoSize="shrink" text="已拥有:1940"/>
     <loader id="n7_v5no" name="loaIcon" xy="171,252" pivot="0.5,0.5" anchor="true" size="164,164" group="n11_v5no" aspect="true" autoSize="true"/>
-    <group id="n11_v5no" name="n11" xy="-9,53" size="940,374"/>
+    <group id="n11_v5no" name="n11" xy="-9,-29" size="946,456"/>
     <image id="n18_v5no" name="n18" src="v5notm4" fileName="images/lm_zsx0.png" xy="117,423" group="n21_v5no"/>
     <text id="n19_v5no" name="n19" xy="378,422" size="206,44" group="n21_v5no" fontSize="32" color="#b69566" align="center" leading="1" autoSize="none" text="自选道具"/>
-    <list id="n20_v5no" name="list" xy="43,494" size="875,241" group="n21_v5no" layout="flow_vt" overflow="scroll" scroll="horizontal" colGap="20" align="center">
-      <item url="ui://2bsz6nelv5notmb"/>
-      <item url="ui://2bsz6nelv5notmb"/>
-      <item url="ui://2bsz6nelv5notmb"/>
-      <item url="ui://2bsz6nelv5notmb"/>
-      <item url="ui://2bsz6nelv5notmb"/>
-      <item url="ui://2bsz6nelv5notmb"/>
+    <list id="n20_v5no" name="list" xy="43,494" size="875,241" group="n21_v5no" layout="flow_vt" overflow="scroll" scroll="horizontal" colGap="20" defaultItem="ui://2bsz6nelv5notmb" align="center">
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
     </list>
     <group id="n21_v5no" name="n21" xy="43,422" size="875,313"/>
     <image id="n22_v5no" name="n22" src="v5notm3" fileName="images/lm_zhuangshixian_duan.png" xy="73,766" group="n27_v5no"/>

+ 13 - 0
FGUIProject/assets/Bag/components/BtnCancel.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="88,82" extention="Button">
+  <Button/>
+  <controller name="button" pages="0,up,1,down,2,over,3,selectedOver"/>
+  <displayList>
+    <image id="n0_cu9w" src="v5notly" name="n0" xy="0,0">
+      <relation target="" sidePair="width,height"/>
+    </image>
+    <text id="n1_cu9w" name="title" xy="0,0" size="88,82" fontSize="30" autoSize="none" align="center" vAlign="middle" singleLine="true">
+      <relation target="" sidePair="width,height"/>
+    </text>
+  </displayList>
+</component>

+ 0 - 0
FGUIProject/assets/Bag/components/ItemNumBag.xml → FGUIProject/assets/Bag/components/ComItemNumBag.xml


+ 3 - 3
FGUIProject/assets/Bag/components/SelectorListItem.xml → FGUIProject/assets/Bag/components/ListSelectorItem.xml

@@ -4,8 +4,8 @@
     <image id="n0_v5no" name="n0" src="v5notm7" fileName="images/wpk_db_1_da.png" xy="0,1"/>
     <image id="n2_v5no" name="n2" src="v5notmc" fileName="images/db_jiajian_1.png" xy="23,189"/>
     <loader id="n11_v5no" name="loaIcon" xy="87,84" pivot="0.5,0.5" anchor="true" size="100,88" fill="scale"/>
-    <component id="n12_v5no" name="n12" src="v5notmd" fileName="components/ItemNumBag.xml" xy="8,120" size="155,45"/>
-    <component id="n15_cu9w" name="n15" src="cu9wtmf" fileName="components/BtnReduce.xml" xy="-1,188"/>
-    <component id="n16_cu9w" name="n16" src="cu9wtmg" fileName="components/BtnAdd.xml" xy="121,189"/>
+    <component id="n12_v5no" name="comItemNumBag" src="v5notmd" fileName="components/ComItemNumBag.xml" xy="8,120" size="155,45"/>
+    <component id="n15_cu9w" name="btnReduce" src="cu9wtmf" fileName="components/BtnReduce.xml" xy="-1,188"/>
+    <component id="n16_cu9w" name="btnAdd" src="cu9wtmg" fileName="components/BtnAdd.xml" xy="121,189"/>
   </displayList>
 </component>

+ 3 - 2
FGUIProject/assets/Bag/package.xml

@@ -21,12 +21,13 @@
     <image id="v5notm7" name="wpk_db_1_da.png" path="/images/"/>
     <image id="v5notm8" name="wpk_sz_db_1.png" path="/images/"/>
     <image id="v5notm9" name="wplb_db.png" path="/images/"/>
-    <component id="v5notmb" name="SelectorListItem.xml" path="/components/" exported="true"/>
+    <component id="v5notmb" name="ListSelectorItem.xml" path="/components/" exported="true"/>
     <image id="v5notmc" name="db_jiajian_1.png" path="/images/"/>
-    <component id="v5notmd" name="ItemNumBag.xml" path="/components/" exported="true"/>
+    <component id="v5notmd" name="ComItemNumBag.xml" path="/components/" exported="true"/>
     <component id="cu9wtme" name="BtnSub.xml" path="/components/" exported="true"/>
     <component id="cu9wtmf" name="BtnReduce.xml" path="/components/" exported="true"/>
     <component id="cu9wtmg" name="BtnAdd.xml" path="/components/" exported="true"/>
+    <component id="cu9wtmj" name="BtnCancel.xml" path="/components/" exported="true"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Bag" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 13 - 0
GameClient/.idea/.idea.GameClient/.idea/.gitignore

@@ -0,0 +1,13 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# Rider 忽略的文件
+/modules.xml
+/contentModel.xml
+/.idea.GameClient.iml
+/projectSettingsUpdater.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 4 - 0
GameClient/.idea/.idea.GameClient/.idea/encodings.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
+</project>

+ 8 - 0
GameClient/.idea/.idea.GameClient/.idea/indexLayout.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="UserContentModel">
+    <attachedFolders />
+    <explicitIncludes />
+    <explicitExcludes />
+  </component>
+</project>

+ 6 - 0
GameClient/.idea/.idea.GameClient/.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
+  </component>
+</project>

+ 3 - 1
GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs

@@ -57,7 +57,9 @@ namespace GFGGame
                     FunctionOpenDataManager.Instance.CheckHasSpecialFunOpen();
                 }
             }
-            if (itemCfg.itemType == ConstItemType.ITEM && itemData.num > 0)
+            
+            if (itemCfg.itemType == ConstItemType.ITEM ||
+                itemCfg.itemType == ConstItemType.GIFT_BAG && itemData.num > 0)
             {
                 BagDataManager.Instance.Add(itemData);
             }

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_ComItemNumBag.cs

@@ -0,0 +1,71 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Bag
+{
+    public partial class UI_ComItemNumBag
+    {
+        public GComponent target;
+        public GTextField m_txtNum;
+        public const string URL = "ui://2bsz6nelv5notmd";
+        public const string PACKAGE_NAME = "Bag";
+        public const string RES_NAME = "ComItemNumBag";
+        private static UI_ComItemNumBag _proxy;
+
+        public static UI_ComItemNumBag Create(GObject gObject = null)
+        {
+            var ui = new UI_ComItemNumBag();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ComItemNumBag Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComItemNumBag();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_txtNum = (GTextField)comp.GetChild("txtNum");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_txtNum = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_ComItemNumBag.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a4b3b2ccc0ac44d49a8ef825c1dddeeb
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 89 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_GiftBoxSelectorUI.cs

@@ -0,0 +1,89 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Bag
+{
+    public partial class UI_GiftBoxSelectorUI
+    {
+        public GComponent target;
+        public GButton m_btnCancel;
+        public GTextField m_txtItemDes;
+        public GTextField m_txtName;
+        public GTextField m_txtTotalNum;
+        public GLoader m_loaIcon;
+        public GList m_list;
+        public GTextField m_txtSelRewardStr;
+        public const string URL = "ui://2bsz6nelu85qtlv";
+        public const string PACKAGE_NAME = "Bag";
+        public const string RES_NAME = "GiftBoxSelectorUI";
+        private static UI_GiftBoxSelectorUI _proxy;
+
+        public static UI_GiftBoxSelectorUI Create(GObject gObject = null)
+        {
+            var ui = new UI_GiftBoxSelectorUI();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_GiftBoxSelectorUI Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_GiftBoxSelectorUI();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_btnCancel = (GButton)comp.GetChild("btnCancel");
+            m_txtItemDes = (GTextField)comp.GetChild("txtItemDes");
+            m_txtName = (GTextField)comp.GetChild("txtName");
+            m_txtTotalNum = (GTextField)comp.GetChild("txtTotalNum");
+            m_loaIcon = (GLoader)comp.GetChild("loaIcon");
+            m_list = (GList)comp.GetChild("list");
+            m_txtSelRewardStr = (GTextField)comp.GetChild("txtSelRewardStr");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_btnCancel = null;
+            m_txtItemDes = null;
+            m_txtName = null;
+            m_txtTotalNum = null;
+            m_loaIcon = null;
+            m_list = null;
+            m_txtSelRewardStr = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_GiftBoxSelectorUI.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 052c3cec4642fc341a8d374c15451f1d
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 81 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_ListSelectorItem.cs

@@ -0,0 +1,81 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Bag
+{
+    public partial class UI_ListSelectorItem
+    {
+        public GComponent target;
+        public GLoader m_loaIcon;
+        public UI_ComItemNumBag m_comItemNumBag;
+        public GButton m_btnReduce;
+        public GButton m_btnAdd;
+        public const string URL = "ui://2bsz6nelv5notmb";
+        public const string PACKAGE_NAME = "Bag";
+        public const string RES_NAME = "ListSelectorItem";
+        private static UI_ListSelectorItem _proxy;
+
+        public static UI_ListSelectorItem Create(GObject gObject = null)
+        {
+            var ui = new UI_ListSelectorItem();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ListSelectorItem Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ListSelectorItem();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_loaIcon = (GLoader)comp.GetChild("loaIcon");
+            m_comItemNumBag = (UI_ComItemNumBag)UI_ComItemNumBag.Create(comp.GetChild("comItemNumBag"));
+            m_btnReduce = (GButton)comp.GetChild("btnReduce");
+            m_btnAdd = (GButton)comp.GetChild("btnAdd");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_loaIcon = null;
+            m_comItemNumBag.Dispose();
+            m_comItemNumBag = null;
+            m_btnReduce = null;
+            m_btnAdd = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Bag/UI_ListSelectorItem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 06ccbfe075e911b4196fc4250b4d263d
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 19 - 5
GameClient/Assets/Game/HotUpdate/Views/Bag/BagView.cs

@@ -58,6 +58,7 @@ namespace GFGGame
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdateList);
         }
+        
         protected override void OnShown()
         {
             base.OnShown();
@@ -101,14 +102,27 @@ namespace GFGGame
         {
             GComponent comItem = (context.data as GComponent);
             ItemCfg itemCfg = comItem.data as ItemCfg;
-            if (itemCfg.subType == 0)
+
+            //区分一下道具跟礼包
+            if (itemCfg.itemType == ConstItemType.ITEM)
             {
-                object[] sourceDatas = new object[] { itemCfg.id, new object[] { typeof(BagView).FullName, this.viewData } };
-                GoodsItemTipsController.ShowItemTips(itemCfg.id, sourceDatas);
+                if (itemCfg.subType == 0)
+                {
+                    object[] sourceDatas = new object[]
+                        { itemCfg.id, new object[] { typeof(BagView).FullName, this.viewData } };
+                    GoodsItemTipsController.ShowItemTips(itemCfg.id, sourceDatas);
+                }
+                else if (itemCfg.subType == 1)
+                {
+                    ViewManager.Show<BagExchangeView>(itemCfg.id);
+                }
             }
-            else if (itemCfg.subType == 1)
+            else
             {
-                ViewManager.Show<BagExchangeView>(itemCfg.id);
+                //ConstItemType.GIFT_BAG 礼包
+                //随机礼包--还未有该需求,但是配置表有了,先不管,之后有随机礼包需求可以在这里加判断处理
+                //自选礼包
+                ViewManager.Show<GiftBoxSelectorView>(itemCfg.id);
             }
         }
 

+ 39 - 54
GameClient/Assets/Game/HotUpdate/Views/Bag/GiftBoxSelectorView.cs

@@ -1,5 +1,4 @@
-
-using System;
+using System;
 using System.Collections.Generic;
 using ET;
 using FairyGUI;
@@ -13,7 +12,8 @@ namespace GFGGame
     {
         private UI_GiftBoxSelectorUI _ui;
         private int _itemId;
-        private long _count;
+        private int _count;
+
         public override void Dispose()
         {
             base.Dispose();
@@ -35,93 +35,78 @@ namespace GFGGame
             this.viewCom.Center();
             this.modal = true;
 
-            _ui.m_.target.onClick.Add(OnBtnAddClick);
-            _ui.m_btnMinus.target.onClick.Add(OnBtnMinusClick);
-            _ui.m_btnMax.target.onClick.Add(OnBtnMaxClick);
-            _ui.m_btnConfirm.onClick.Add(OnBtnConfirmClick);
-            _ui.m_btnCancle.onClick.Add(OnBtnCancleClick);
-
+            _ui.m_btnCancel.onClick.Add(OnBtnCancelClick);
+            _ui.m_list.SetVirtual();
+            _ui.m_list.itemRenderer = ListItemRender;
+            _ui.m_list.onClickItem.Add(OnListSelectorItemClick);
         }
+
         protected override void AddEventListener()
         {
             base.AddEventListener();
-
         }
+
         protected override void OnShown()
         {
             base.OnShown();
             _itemId = (int)this.viewData;
-            _count = 1;
+            _count = (int)ItemDataManager.GetItemNum(_itemId);
 
             UpdateView();
-            UpdateUseView();
+            UpdateList();
         }
 
         protected override void OnHide()
         {
+            if (_ui.m_list.numItems > 0)
+            {
+                _ui.m_list.ScrollToView(0);
+            }
 
+            _ui.m_list.numItems = 0;
             base.OnHide();
         }
+
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
-            // EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, UpdateList);
         }
 
         private void UpdateView()
         {
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemId);
-            _ui.m_txtName.text = itemCfg.name;
-            _ui.m_txtOwned.SetVar("count", "" + ItemDataManager.GetItemNum(itemCfg.id)).FlushVars();
-            _ui.m_txtDesc.text = string.IsNullOrEmpty(itemCfg.desc) ? "暂无描述" : itemCfg.desc;
             _ui.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
-            RarityIconController.UpdateRarityIcon(_ui.m_loaRarity, itemCfg.id, false);
-            _ui.m_loaRarity.visible = itemCfg.itemType == ConstItemType.DRESS_UP;
-            _ui.m_txtExchangeCount.visible = false;
-            _ui.m_comCost.target.visible = false;
-
+            _ui.m_txtName.text = itemCfg.name;
+            _ui.m_txtTotalNum.text = $"已拥有:{_count}";
+            _ui.m_txtItemDes.text = string.IsNullOrEmpty(itemCfg.desc) ? "暂无描述" : itemCfg.desc;
         }
 
-        private void UpdateUseView()
+        private void UpdateList()
         {
-            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemId);
-            _ui.m_txtCostCount.text = _count.ToString();
-            _ui.m_btnMinus.m_c1.selectedIndex = _count == 1 ? 1 : 0;
-            _ui.m_btnMinus.target.touchable = _count == 1 ? false : true;
-            long hasCount = ItemDataManager.GetItemNum(_itemId);
-            _ui.m_btnAdd.m_c1.selectedIndex = _count == hasCount ? 1 : 0;
-            _ui.m_btnAdd.target.touchable = _count == hasCount ? false : true;
-            _ui.m_btnMax.m_c1.selectedIndex = _count == hasCount ? 1 : 0;
-            _ui.m_btnMax.target.touchable = _count == hasCount ? false : true;
-
-            _ui.m_txtShow.text = "选择使用数量";
-            _ui.m_txtTips.text = string.Format("是否使用{0}个{1}?", _count, itemCfg.name);
+            _ui.m_list.numItems = _count;
         }
 
-        private void OnBtnAddClick()
-        {
-            _count++;
-            long hasCount = ItemDataManager.GetItemNum(_itemId);
-            _count = Math.Min(hasCount, _count);
-            UpdateUseView();
-        }
-        private void OnBtnMinusClick()
+        private void ListItemRender(int index, GObject obj)
         {
-            _count--;
-            _count = Math.Max(1, _count);
-            UpdateUseView();
-        }
-        private void OnBtnMaxClick()
-        {
-            _count = ItemDataManager.GetItemNum(_itemId);
-            UpdateUseView();
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemId);
+            UI_ListSelectorItem uiItemChild = UI_ListSelectorItem.Proxy(obj);
+
+            int[] itemChildArr = itemCfg.itemsArr[index];
+            ItemCfg itemCfgChild = ItemCfgArray.Instance.GetCfg(itemChildArr[0]);
+            uiItemChild.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfgChild);
+            uiItemChild.m_comItemNumBag.m_txtNum.text = itemChildArr[1].ToString();
+            uiItemChild.target.data = itemCfgChild;
         }
-        private void OnBtnConfirmClick()
+
+        private void OnListSelectorItemClick(EventContext context)
         {
-            ItemProxy.ReqUseItem(_itemId, _count).Coroutine();
-            this.Hide();
+            GComponent comItem = (context.data as GComponent);
+            ItemCfg itemCfg = comItem.data as ItemCfg;
+
+            //弹出物品详细描述框
         }
-        private void OnBtnCancleClick()
+
+        private void OnBtnCancelClick()
         {
             this.Hide();
         }

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Views/Bag/GiftBoxSelectorView.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 15bb239d0a5943518d3663bbfa6263be
+timeCreated: 1684752621

BIN
GameClient/Assets/ResIn/UI/Bag/Bag_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/Bag/Bag_atlas0.png


BIN
GameClient/Assets/ResIn/UI/Bag/Bag_fui.bytes


+ 2 - 0
GameClient/GameClient.sln.DotSettings.user

@@ -0,0 +1,2 @@
+<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
+	<s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">SOLUTION</s:String></wpf:ResourceDictionary>