何晓捷 пре 2 година
родитељ
комит
74fe7786bf

+ 31 - 0
FGUIProject/assets/Bag/GiftBoxSelectorUI.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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"/>
+    <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"/>
+    <image id="n6_v5no" name="n6" src="v5notm9" fileName="images/wplb_db.png" xy="-9,76" group="n11_v5no"/>
+    <text id="n15_v5no" name="txtItemDes" xy="390,165" size="462,217" group="n11_v5no" fontSize="32" color="#b08d5c" leading="1" autoSize="ellipsis" text="摘星道具摘星道具摘星道具摘星道 具摘星道具摘星道具摘星道具"/>
+    <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"/>
+    <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>
+    <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"/>
+    <text id="n24_v5no" name="txtSelRewardStr" xy="357,783" size="247,44" group="n27_v5no" fontSize="28" color="#915e15" align="center" leading="1" autoSize="none" text="已选奖励:0/8"/>
+    <component id="n30_cu9w" name="n30" src="cu9wtme" fileName="components/BtnSub.xml" xy="348,845" group="n27_v5no"/>
+    <group id="n27_v5no" name="n27" xy="73,766" size="816,161"/>
+  </displayList>
+</component>

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

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

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

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

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

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="265,82" extention="Button">
+  <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
+  <displayList>
+    <image id="n0_cu9w" name="n0" src="v5notlz" fileName="images/lm_an__xuanzhong_1.png" xy="0,0">
+      <relation target="" sidePair="width-width,height-height"/>
+    </image>
+    <text id="n1_cu9w" name="title" xy="0,0" size="265,82" font="SourceHanSerifCN-Regular" fontSize="32" color="#683c28" align="center" vAlign="middle" autoSize="none" singleLine="true" text="使用">
+      <relation target="" sidePair="width-width,height-height"/>
+    </text>
+  </displayList>
+  <Button/>
+</component>

+ 7 - 0
FGUIProject/assets/Bag/components/ItemNumBag.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="166,45" overflow="hidden">
+  <displayList>
+    <image id="n1_v5no" name="n1" src="v5notm8" fileName="images/wpk_sz_db_1.png" xy="-21,0" size="208,45"/>
+    <text id="n2_v5no" name="txtNum" xy="29,3" size="107,42" fontSize="30" color="#ffffff" align="center" vAlign="middle" autoSize="none" text="120"/>
+  </displayList>
+</component>

+ 11 - 0
FGUIProject/assets/Bag/components/SelectorListItem.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="172,241" overflow="hidden">
+  <displayList>
+    <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"/>
+  </displayList>
+</component>

BIN
FGUIProject/assets/Bag/images/an_jia.png


BIN
FGUIProject/assets/Bag/images/an_jian.png


BIN
FGUIProject/assets/Bag/images/back.png


BIN
FGUIProject/assets/Bag/images/db_jiajian_1.png


BIN
FGUIProject/assets/Bag/images/lm_an__xuanzhong_1.png


BIN
FGUIProject/assets/Bag/images/lm_db_3.png


BIN
FGUIProject/assets/Bag/images/lm_dt_zsx1.png


BIN
FGUIProject/assets/Bag/images/lm_dt_zsx2.png


BIN
FGUIProject/assets/Bag/images/lm_zhuangshixian_duan.png


BIN
FGUIProject/assets/Bag/images/lm_zsx0.png


BIN
FGUIProject/assets/Bag/images/tanchuang_2.png


BIN
FGUIProject/assets/Bag/images/tc_wp_zz.png


BIN
FGUIProject/assets/Bag/images/wpk_db_1_da.png


BIN
FGUIProject/assets/Bag/images/wpk_sz_db_1.png


BIN
FGUIProject/assets/Bag/images/wplb_db.png


+ 22 - 1
FGUIProject/assets/Bag/package.xml

@@ -5,7 +5,28 @@
     <image id="si5zti3" name="wpbb_zi.png" path="/images/"/>
     <image id="si5zti4" name="wpbb_di.png" path="/images/"/>
     <image id="si5zti6" name="wpbb_xtxt.png" path="/images/"/>
-    <component id="si5zti7" name="ListItem.xml" path="/components/"/>
+    <component id="si5zti7" name="ListItem.xml" path="/components/" exported="true"/>
+    <component id="u85qtlv" name="GiftBoxSelectorUI.xml" path="/" exported="true"/>
+    <image id="v5notlw" name="an_jia.png" path="/images/"/>
+    <image id="v5notlx" name="an_jian.png" path="/images/"/>
+    <image id="v5notly" name="back.png" path="/images/"/>
+    <image id="v5notlz" name="lm_an__xuanzhong_1.png" path="/images/"/>
+    <image id="v5notm0" name="lm_db_3.png" path="/images/"/>
+    <image id="v5notm1" name="lm_dt_zsx1.png" path="/images/"/>
+    <image id="v5notm2" name="lm_dt_zsx2.png" path="/images/"/>
+    <image id="v5notm3" name="lm_zhuangshixian_duan.png" path="/images/"/>
+    <image id="v5notm4" name="lm_zsx0.png" path="/images/"/>
+    <image id="v5notm5" name="tanchuang_2.png" path="/images/"/>
+    <image id="v5notm6" name="tc_wp_zz.png" path="/images/"/>
+    <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"/>
+    <image id="v5notmc" name="db_jiajian_1.png" path="/images/"/>
+    <component id="v5notmd" name="ItemNumBag.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"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Bag" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

BIN
FGUIProject/assets/CommonGame/images/db_jiajian_1.png


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

@@ -0,0 +1,129 @@
+
+using System;
+using System.Collections.Generic;
+using ET;
+using FairyGUI;
+using UI.Bag;
+using UI.CommonGame;
+using UnityEngine;
+
+namespace GFGGame
+{
+    public class GiftBoxSelectorView : BaseWindow
+    {
+        private UI_GiftBoxSelectorUI _ui;
+        private int _itemId;
+        private long _count;
+        public override void Dispose()
+        {
+            base.Dispose();
+
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+
+            packageName = UI_GiftBoxSelectorUI.PACKAGE_NAME;
+            _ui = UI_GiftBoxSelectorUI.Create();
+            this.viewCom = _ui.target;
+            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);
+
+        }
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+
+        }
+        protected override void OnShown()
+        {
+            base.OnShown();
+            _itemId = (int)this.viewData;
+            _count = 1;
+
+            UpdateView();
+            UpdateUseView();
+        }
+
+        protected override void OnHide()
+        {
+
+            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;
+
+        }
+
+        private void UpdateUseView()
+        {
+            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);
+        }
+
+        private void OnBtnAddClick()
+        {
+            _count++;
+            long hasCount = ItemDataManager.GetItemNum(_itemId);
+            _count = Math.Min(hasCount, _count);
+            UpdateUseView();
+        }
+        private void OnBtnMinusClick()
+        {
+            _count--;
+            _count = Math.Max(1, _count);
+            UpdateUseView();
+        }
+        private void OnBtnMaxClick()
+        {
+            _count = ItemDataManager.GetItemNum(_itemId);
+            UpdateUseView();
+        }
+        private void OnBtnConfirmClick()
+        {
+            ItemProxy.ReqUseItem(_itemId, _count).Coroutine();
+            this.Hide();
+        }
+        private void OnBtnCancleClick()
+        {
+            this.Hide();
+        }
+    }
+}