Browse Source

千山万水

zhaoyang 2 years ago
parent
commit
6d57f43bb7

+ 8 - 1
FGUIProject/assets/Travel/TravelDressupUI.xml

@@ -6,6 +6,13 @@
     </loader>
     </loader>
     <component id="n1_wono" name="comDress0" src="wonof" fileName="components/ComDress.xml" xy="88,335"/>
     <component id="n1_wono" name="comDress0" src="wonof" fileName="components/ComDress.xml" xy="88,335"/>
     <component id="n2_wono" name="comDress1" src="wonof" fileName="components/ComDress.xml" xy="442,406"/>
     <component id="n2_wono" name="comDress1" src="wonof" fileName="components/ComDress.xml" xy="442,406"/>
-    <component id="n3_wono" name="comDress2" src="wonof" fileName="components/ComDress.xml" xy="442,406"/>
+    <component id="n3_wono" name="comDress2" src="wonof" fileName="components/ComDress.xml" xy="772,357"/>
+    <component id="n5_wono" name="btnCancle" src="wonoh" fileName="components/Button4.xml" xy="250,1590" size="129,103">
+      <Button title="暂不出发"/>
+    </component>
+    <component id="n6_wono" name="btnGo" src="wonoi" fileName="components/Button5.xml" xy="661,1595" size="145,98">
+      <Button title="塞进行囊"/>
+    </component>
+    <list id="n7_wono" name="list" xy="163,1138" size="753,300" overflow="scroll" defaultItem="ui://jitclg1gwonoj"/>
   </displayList>
   </displayList>
 </component>
 </component>

+ 22 - 0
FGUIProject/assets/Travel/components/Button4.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="100,20" extention="Button">
+  <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
+  <displayList>
+    <graph id="n0_wono" name="n0" xy="0,0" size="100,20" touchable="false" type="rect" lineSize="0" fillColor="#fff0f0f0">
+      <gearDisplay controller="button" pages="0"/>
+      <relation target="" sidePair="width-width,height-height"/>
+    </graph>
+    <graph id="n1_wono" name="n1" xy="0,0" size="100,20" touchable="false" type="rect" lineSize="0" fillColor="#fffafafa">
+      <gearDisplay controller="button" pages="2"/>
+      <relation target="" sidePair="width-width,height-height"/>
+    </graph>
+    <graph id="n2_wono" name="n2" xy="0,0" size="100,20" touchable="false" type="rect" lineSize="0" fillColor="#ffcccccc">
+      <gearDisplay controller="button" pages="1,3"/>
+      <relation target="" sidePair="width-width,height-height"/>
+    </graph>
+    <text id="n3_wono" name="title" xy="45,-11" pivot="0.5,0.5" size="10,42" fontSize="30" text="">
+      <relation target="" sidePair="center-center,middle-middle"/>
+    </text>
+  </displayList>
+  <Button/>
+</component>

+ 22 - 0
FGUIProject/assets/Travel/components/Button5.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="100,20" extention="Button">
+  <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
+  <displayList>
+    <graph id="n0_wono" name="n0" xy="0,0" size="100,20" touchable="false" type="rect" lineSize="0" fillColor="#fff0f0f0">
+      <gearDisplay controller="button" pages="0"/>
+      <relation target="" sidePair="width-width,height-height"/>
+    </graph>
+    <graph id="n1_wono" name="n1" xy="0,0" size="100,20" touchable="false" type="rect" lineSize="0" fillColor="#fffafafa">
+      <gearDisplay controller="button" pages="2"/>
+      <relation target="" sidePair="width-width,height-height"/>
+    </graph>
+    <graph id="n2_wono" name="n2" xy="0,0" size="100,20" touchable="false" type="rect" lineSize="0" fillColor="#ffcccccc">
+      <gearDisplay controller="button" pages="1,3"/>
+      <relation target="" sidePair="width-width,height-height"/>
+    </graph>
+    <text id="n3_wono" name="title" xy="45,-11" pivot="0.5,0.5" size="10,42" fontSize="30" text="">
+      <relation target="" sidePair="center-center,middle-middle"/>
+    </text>
+  </displayList>
+  <Button/>
+</component>

+ 6 - 0
FGUIProject/assets/Travel/components/ListDressItem.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="148,146">
+  <displayList>
+    <component id="n8_wono" name="ListDressItem" src="wonof" fileName="components/ComDress.xml" xy="0,0"/>
+  </displayList>
+</component>

+ 3 - 0
FGUIProject/assets/Travel/package.xml

@@ -18,6 +18,9 @@
     <image id="wonod" name="dayanta.png" path="/images/"/>
     <image id="wonod" name="dayanta.png" path="/images/"/>
     <image id="wonoe" name="mogaoku_baitian .png" path="/images/"/>
     <image id="wonoe" name="mogaoku_baitian .png" path="/images/"/>
     <component id="wonof" name="ComDress.xml" path="/components/"/>
     <component id="wonof" name="ComDress.xml" path="/components/"/>
+    <component id="wonoh" name="Button4.xml" path="/components/"/>
+    <component id="wonoi" name="Button5.xml" path="/components/"/>
+    <component id="wonoj" name="ListDressItem.xml" path="/components/"/>
   </resources>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Travel" packageCount="2" genCode="true"/>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Travel" packageCount="2" genCode="true"/>
 </packageDescription>
 </packageDescription>

+ 21 - 0
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuSuitDataManager.cs

@@ -8,6 +8,14 @@ namespace GFGGame
     public class DressUpMenuSuitDataManager
     public class DressUpMenuSuitDataManager
     {
     {
         private static List<int> _suitIDList = new List<int>();
         private static List<int> _suitIDList = new List<int>();
+        private static List<int> _travelSuitIDList = new List<int>();//拥有的游历套装列表
+        public static List<int> TravelSuitIDList
+        {
+            get
+            {
+                return _travelSuitIDList;
+            }
+        }
         //获得这件装备时套装的进度,用于展示
         //获得这件装备时套装的进度,用于展示
         private static Dictionary<int, int> _progressByItemIdDic = new Dictionary<int, int>();
         private static Dictionary<int, int> _progressByItemIdDic = new Dictionary<int, int>();
         //套装当前的进度
         //套装当前的进度
@@ -20,6 +28,7 @@ namespace GFGGame
         public static void InitData()
         public static void InitData()
         {
         {
             _suitIDList.Clear();
             _suitIDList.Clear();
+            _travelSuitIDList.Clear();
             _progressBySuitIdDic.Clear();
             _progressBySuitIdDic.Clear();
             _progressByItemIdDic.Clear();
             _progressByItemIdDic.Clear();
         }
         }
@@ -55,6 +64,12 @@ namespace GFGGame
             if (!_suitIDList.Contains(value))
             if (!_suitIDList.Contains(value))
             {
             {
                 _suitIDList.Add(value);
                 _suitIDList.Add(value);
+
+                TravelSuitCfg travelSuitCfg = TravelSuitCfgArray.Instance.GetCfgBysuitId(value);
+                if (travelSuitCfg != null)
+                {
+                    _travelSuitIDList.Add(travelSuitCfg.id);
+                }
             }
             }
         }
         }
 
 
@@ -63,6 +78,11 @@ namespace GFGGame
             if (_suitIDList.Contains(value))
             if (_suitIDList.Contains(value))
             {
             {
                 _suitIDList.Remove(value);
                 _suitIDList.Remove(value);
+                TravelSuitCfg travelSuitCfg = TravelSuitCfgArray.Instance.GetCfgBysuitId(value);
+                if (travelSuitCfg != null && _travelSuitIDList.Contains(travelSuitCfg.id))
+                {
+                    _travelSuitIDList.Remove(travelSuitCfg.id);
+                }
             }
             }
         }
         }
 
 
@@ -201,6 +221,7 @@ namespace GFGGame
             return (List<int>)_suitIDList.GetRange(0, _suitIDList.Count);
             return (List<int>)_suitIDList.GetRange(0, _suitIDList.Count);
         }
         }
 
 
+
         public static int GetSuitGuideBonusStatus(int suitId)
         public static int GetSuitGuideBonusStatus(int suitId)
         {
         {
             int status = ConstBonusStatus.CAN_NOT_GET;
             int status = ConstBonusStatus.CAN_NOT_GET;

+ 72 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Travel/UI_ListDressItem.cs

@@ -0,0 +1,72 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Travel
+{
+    public partial class UI_ListDressItem
+    {
+        public GComponent target;
+        public UI_ComDress m_ListDressItem;
+        public const string URL = "ui://jitclg1gwonoj";
+        public const string PACKAGE_NAME = "Travel";
+        public const string RES_NAME = "ListDressItem";
+        private static UI_ListDressItem _proxy;
+
+        public static UI_ListDressItem Create(GObject gObject = null)
+        {
+            var ui = new UI_ListDressItem();
+            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_ListDressItem Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ListDressItem();
+            }
+            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_ListDressItem = (UI_ComDress)UI_ComDress.Create(comp.GetChild("ListDressItem"));
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_ListDressItem.Dispose();
+            m_ListDressItem = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Travel/UI_ListDressItem.cs.meta

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

+ 9 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Travel/UI_TravelDressupUI.cs

@@ -11,6 +11,9 @@ namespace UI.Travel
         public UI_ComDress m_comDress0;
         public UI_ComDress m_comDress0;
         public UI_ComDress m_comDress1;
         public UI_ComDress m_comDress1;
         public UI_ComDress m_comDress2;
         public UI_ComDress m_comDress2;
+        public GButton m_btnCancle;
+        public GButton m_btnGo;
+        public GList m_list;
         public const string URL = "ui://jitclg1gwono1";
         public const string URL = "ui://jitclg1gwono1";
         public const string PACKAGE_NAME = "Travel";
         public const string PACKAGE_NAME = "Travel";
         public const string RES_NAME = "TravelDressupUI";
         public const string RES_NAME = "TravelDressupUI";
@@ -62,6 +65,9 @@ namespace UI.Travel
             m_comDress0 = (UI_ComDress)UI_ComDress.Create(comp.GetChild("comDress0"));
             m_comDress0 = (UI_ComDress)UI_ComDress.Create(comp.GetChild("comDress0"));
             m_comDress1 = (UI_ComDress)UI_ComDress.Create(comp.GetChild("comDress1"));
             m_comDress1 = (UI_ComDress)UI_ComDress.Create(comp.GetChild("comDress1"));
             m_comDress2 = (UI_ComDress)UI_ComDress.Create(comp.GetChild("comDress2"));
             m_comDress2 = (UI_ComDress)UI_ComDress.Create(comp.GetChild("comDress2"));
+            m_btnCancle = (GButton)comp.GetChild("btnCancle");
+            m_btnGo = (GButton)comp.GetChild("btnGo");
+            m_list = (GList)comp.GetChild("list");
         }
         }
         public void Dispose(bool disposeTarget = false)
         public void Dispose(bool disposeTarget = false)
         {
         {
@@ -72,6 +78,9 @@ namespace UI.Travel
             m_comDress1 = null;
             m_comDress1 = null;
             m_comDress2.Dispose();
             m_comDress2.Dispose();
             m_comDress2 = null;
             m_comDress2 = null;
+            m_btnCancle = null;
+            m_btnGo = null;
+            m_list = null;
             if(disposeTarget && target != null)
             if(disposeTarget && target != null)
             {
             {
                 target.RemoveFromParent();
                 target.RemoveFromParent();

+ 76 - 2
GameClient/Assets/Game/HotUpdate/Views/Travel/TravelDressupView.cs

@@ -1,3 +1,4 @@
+using System.Collections.Generic;
 using ET;
 using ET;
 using FairyGUI;
 using FairyGUI;
 using UI.Travel;
 using UI.Travel;
@@ -8,6 +9,8 @@ namespace GFGGame
     public class TravelDressupView : BaseWindow
     public class TravelDressupView : BaseWindow
     {
     {
         private UI_TravelDressupUI _ui;
         private UI_TravelDressupUI _ui;
+        private List<int> _selectTravelSuitIds = new List<int>();
+        private List<int> _travelSuitIds = new List<int>();
 
 
         public override void Dispose()
         public override void Dispose()
         {
         {
@@ -26,6 +29,11 @@ namespace GFGGame
             _ui = UI_TravelDressupUI.Create();
             _ui = UI_TravelDressupUI.Create();
             this.viewCom = _ui.target;
             this.viewCom = _ui.target;
             isfullScreen = true;
             isfullScreen = true;
+            _ui.m_btnCancle.onClick.Add(Hide);
+            _ui.m_btnGo.onClick.Add(OnBtnGoClick);
+            _ui.m_comDress0.target.onClick.Add(OnComDressClick0);
+            _ui.m_comDress1.target.onClick.Add(OnComDressClick);
+            _ui.m_comDress2.target.onClick.Add(OnComDressClick);
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gzs_bjbj");
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gzs_bjbj");
         }
         }
         protected override void AddEventListener()
         protected override void AddEventListener()
@@ -36,13 +44,15 @@ namespace GFGGame
         protected override void OnShown()
         protected override void OnShown()
         {
         {
             base.OnShown();
             base.OnShown();
-
+            UpdateView();
         }
         }
 
 
         protected override void OnHide()
         protected override void OnHide()
         {
         {
             base.OnHide();
             base.OnHide();
-
+            _selectTravelSuitIds.Clear();
+            _travelSuitIds.Clear();
+            if (_ui.m_list.numItems > 0) _ui.m_list.ScrollToView(0);
         }
         }
 
 
         protected override void RemoveEventListener()
         protected override void RemoveEventListener()
@@ -50,5 +60,69 @@ namespace GFGGame
             base.RemoveEventListener();
             base.RemoveEventListener();
 
 
         }
         }
+
+        private void UpdateView()
+        {
+            _travelSuitIds = new List<int>(DressUpMenuSuitDataManager.TravelSuitIDList.ToArray());
+            for (int i = 0; i < _selectTravelSuitIds.Count; i++)
+            {
+                if (_travelSuitIds.IndexOf(_selectTravelSuitIds[i]) >= 0)
+                {
+                    _travelSuitIds.Remove(_selectTravelSuitIds[i]);
+                }
+            }
+            _ui.m_list.numItems = _travelSuitIds.Count;
+        }
+
+
+        private void RenderListItem(int index, GObject obj)
+        {
+            TravelSuitCfg travelSuitCfg = TravelSuitCfgArray.Instance.GetCfg(_travelSuitIds[index]);
+            UI_ListDressItem item = UI_ListDressItem.Proxy(obj);
+
+            item.target.data = _travelSuitIds[index];
+            UI_ListDressItem.ProxyEnd();
+        }
+
+        private void OnListItemClick(EventContext context)
+        {
+            if (_selectTravelSuitIds.Count >= 2)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("行囊已满");
+                return;
+            }
+            int travelSuitId = (int)(context.data as GObject).data;
+            _selectTravelSuitIds.Add(travelSuitId);
+
+            UpdateView();
+        }
+
+        private void OnComDressClick0()
+        {
+            PromptController.Instance.ShowFloatTextPrompt("必带服装不能取消");
+        }
+
+        private void OnComDressClick(EventContext context)
+        {
+
+            int travelSuitId = (int)(context.sender as GObject).data;
+            _selectTravelSuitIds.Remove(travelSuitId);
+
+            UpdateView();
+        }
+
+        private async void OnBtnGoClick()
+        {
+            if (_selectTravelSuitIds.Count < 2)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("需带齐服装才能出发");
+                return;
+            }
+            bool result = await TravelSProxy.ReqGoTravel(_selectTravelSuitIds);
+            if (result)
+            {
+                this.Hide();
+            }
+        }
     }
     }
 }
 }

+ 1 - 2
GameClient/Assets/Game/HotUpdate/Views/Travel/TravelRewardView.cs

@@ -10,7 +10,6 @@ namespace GFGGame
     {
     {
         private UI_TravelRewardUI _ui;
         private UI_TravelRewardUI _ui;
 
 
-        private List<int> _travelSuitIds = new List<int>();
 
 
         public override void Dispose()
         public override void Dispose()
         {
         {
@@ -45,7 +44,6 @@ namespace GFGGame
         protected override void OnHide()
         protected override void OnHide()
         {
         {
             base.OnHide();
             base.OnHide();
-            _travelSuitIds.Clear();
         }
         }
 
 
         protected override void RemoveEventListener()
         protected override void RemoveEventListener()
@@ -53,5 +51,6 @@ namespace GFGGame
             base.RemoveEventListener();
             base.RemoveEventListener();
 
 
         }
         }
+
     }
     }
 }
 }

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes


BIN
GameClient/Assets/ResIn/UI/Travel/Travel_fui.bytes