Browse Source

技能长按tips

zhaoyang 2 năm trước cách đây
mục cha
commit
f5c10b07f8

+ 11 - 0
FGUIProject/assets/Main/ComSkillTips.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="512,239">
+  <controller name="c1" pages="0,,1," selected="1"/>
+  <displayList>
+    <image id="n49_v95q" name="n49" src="v95qid" fileName="imagesFight/zd_zdjnsm_1.png" xy="0,0" pivot="0.5,0">
+      <gearSize controller="c1" pages="0" values="512,239,-1,1" default="512,239,1,1"/>
+    </image>
+    <text id="n51_v95q" name="txtTitle" xy="30,20" size="79,52" fontSize="38" color="#a48568" autoClearText="true" text="断织"/>
+    <text id="n50_v95q" name="txtContent" xy="27,93" size="458,60" fontSize="22" color="#a48568" autoSize="height" autoClearText="true" text="收拾行囊出发游历,可获得随机地点的明信片概 率获得特殊奖励。"/>
+  </displayList>
+</component>

+ 3 - 0
FGUIProject/assets/Main/StoryFightTargetScoreUI.xml

@@ -76,5 +76,8 @@
       <relation target="n34_pcn0" sidePair="bottom-bottom"/>
     </graph>
     <group id="n46_t6aj" name="n46" xy="320,1132" size="431,297"/>
+    <component id="n49_v95q" name="comSkillTips" src="v95qie" fileName="ComSkillTips.xml" xy="246,1426">
+      <relation target="" sidePair="bottom-bottom"/>
+    </component>
   </displayList>
 </component>

BIN
FGUIProject/assets/Main/imagesFight/zd_zdjnsm_1.png


+ 2 - 0
FGUIProject/assets/Main/package.xml

@@ -434,6 +434,8 @@
     <image id="v95qia" name="zd_jz_2.png" path="/imagesStory/"/>
     <image id="v95qib" name="zd_jdbiao.png" path="/imagesStory/"/>
     <image id="v95qic" name="zjm_1.png" path="/images/" atlas="alone_npot"/>
+    <image id="v95qid" name="zd_zdjnsm_1.png" path="/imagesFight/"/>
+    <component id="v95qie" name="ComSkillTips.xml" path="/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Main" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 77 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_ComSkillTips.cs

@@ -0,0 +1,77 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Main
+{
+    public partial class UI_ComSkillTips
+    {
+        public GComponent target;
+        public Controller m_c1;
+        public GTextField m_txtTitle;
+        public GTextField m_txtContent;
+        public const string URL = "ui://mfvz4q8kv95qie";
+        public const string PACKAGE_NAME = "Main";
+        public const string RES_NAME = "ComSkillTips";
+        private static UI_ComSkillTips _proxy;
+
+        public static UI_ComSkillTips Create(GObject gObject = null)
+        {
+            var ui = new UI_ComSkillTips();
+            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_ComSkillTips Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComSkillTips();
+            }
+            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_c1 = comp.GetController("c1");
+            m_txtTitle = (GTextField)comp.GetChild("txtTitle");
+            m_txtContent = (GTextField)comp.GetChild("txtContent");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_c1 = null;
+            m_txtTitle = null;
+            m_txtContent = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_ComSkillTips.cs.meta

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

+ 4 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_StoryFightTargetScoreUI.cs

@@ -35,6 +35,7 @@ namespace UI.Main
         public GGraph m_holderPartScoreNpc;
         public GGraph m_holderAddScore;
         public GGraph m_holderAddScoreNpc;
+        public UI_ComSkillTips m_comSkillTips;
         public const string URL = "ui://mfvz4q8k8xpg3w";
         public const string PACKAGE_NAME = "Main";
         public const string RES_NAME = "StoryFightTargetScoreUI";
@@ -110,6 +111,7 @@ namespace UI.Main
             m_holderPartScoreNpc = (GGraph)comp.GetChild("holderPartScoreNpc");
             m_holderAddScore = (GGraph)comp.GetChild("holderAddScore");
             m_holderAddScoreNpc = (GGraph)comp.GetChild("holderAddScoreNpc");
+            m_comSkillTips = (UI_ComSkillTips)UI_ComSkillTips.Create(comp.GetChild("comSkillTips"));
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -160,6 +162,8 @@ namespace UI.Main
             m_holderPartScoreNpc = null;
             m_holderAddScore = null;
             m_holderAddScoreNpc = null;
+            m_comSkillTips.Dispose();
+            m_comSkillTips = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 42 - 6
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightTargetScoreView.cs

@@ -86,6 +86,7 @@ namespace GFGGame
 
         private List<GameObject> _gameObjects = new List<GameObject>();
         private List<GoWrapper> _wrappers = new List<GoWrapper>();
+        private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();
         // private GoWrapper _wrapper5;
         // private Dictionary<int, RoleSkillCfg> _npcSkillDic;
 
@@ -121,8 +122,14 @@ namespace GFGGame
             for (int i = 0; i < _gameObjects.Count; i++)
             {
                 SceneController.DestroyObjectFromView(_gameObjects[i], _wrappers[i]);
+            }
 
+            for (int i = 0; i < _listLongPress.Count; i++)
+            {
+                _listLongPress[i].Dispose();
             }
+            _listLongPress.Clear();
+
             if (_ui != null)
             {
                 _ui.Dispose();
@@ -199,6 +206,11 @@ namespace GFGGame
                 btnSkill.data = roleSkillCfgs[i];
                 GLoader icon = btnSkill.GetChild("icon").asLoader;
                 icon.onClick.Add(() => { OnBtnSkillClick(btnSkill); });
+                LongPressGesture longPressGesture = new LongPressGesture(btnSkill);
+                longPressGesture.once = true;
+                longPressGesture.onAction.Add(OnLongPress);
+                longPressGesture.onEnd.Add(OnLongEnd);
+                _listLongPress.Add(longPressGesture);
             }
             _ui.m_btnBack.onClick.Add(OnBtnBackClick);
 
@@ -213,7 +225,7 @@ namespace GFGGame
             });
             _ui.m_comMineCircle.target.onClick.Add(() =>
             {
-                _ui.m_btnSkill0.target.touchable = true;
+                _ui.m_btnSkill0.m_icon.touchable = true;
             });
 
             _ui.m_btnSkill0.target.onClick.Add(() =>
@@ -285,7 +297,7 @@ namespace GFGGame
             {
                 _speed = 1;
                 EquipDataCache.cacher.autoPlay = false;
-                _ui.m_btnSkill0.target.touchable = false;
+                _ui.m_btnSkill0.m_icon.touchable = false;
             }
 
             if (_levelCfg.type == ConstInstanceZonesType.Field || EquipDataCache.cacher.autoPlay)
@@ -299,14 +311,15 @@ namespace GFGGame
                 GComponent btnSkill = _ui.target.GetChild("btnSkill" + i).asCom;
                 UI_ComBtnSkill item = UI_ComBtnSkill.Proxy(btnSkill);
                 item.m_txtCount.text = roleSkillCfgs[i].limiteCount.ToString();
-                UI_ComBtnSkill.ProxyEnd();
-                btnSkill.touchable = true;
+                item.m_icon.touchable = true;
                 if (_isAutoPlay)
                 {
 
-                    btnSkill.touchable = !_isAutoPlay;
+                    item.m_icon.touchable = !_isAutoPlay;
                     OnBtnSkillClick(btnSkill);
                 }
+                UI_ComBtnSkill.ProxyEnd();
+
             }
             _ui.m_btnSpeedUp.visible = _isAutoPlay;
             _ui.m_btnSpeedUp.title = "x" + _speed;
@@ -650,6 +663,29 @@ namespace GFGGame
             _ui.m_btnSpeedUp.title = "x" + _speed;
         }
 
+        private void OnLongPress(EventContext context)
+        {
+            LongPressGesture gesture = (LongPressGesture)context.sender;
+            RoleSkillCfg skillCfg = gesture.host.data as RoleSkillCfg;
+            _ui.m_comSkillTips.target.visible = true;
+            if (skillCfg.skillId <= 2)
+            {
+                _ui.m_comSkillTips.m_c1.selectedIndex = 0;
+                _ui.m_comSkillTips.target.x = gesture.host.x + 90;
+            }
+            else
+            {
+                _ui.m_comSkillTips.m_c1.selectedIndex = 1;
+                _ui.m_comSkillTips.target.x = gesture.host.x - 240;
+            }
+            _ui.m_comSkillTips.m_txtTitle.text = skillCfg.name;
+            _ui.m_comSkillTips.m_txtContent.text = skillCfg.desc;
+        }
+        private void OnLongEnd()
+        {
+            _ui.m_comSkillTips.target.visible = false;
+        }
+
         private void OnBtnBackClick()
         {
             Reset();
@@ -685,6 +721,7 @@ namespace GFGGame
         }
         private void Reset()
         {
+            _ui.m_comSkillTips.target.visible = false;
 
             _ui.m_proScore.target.max = 100;
             _ui.m_proScore.target.value = 0;
@@ -726,7 +763,6 @@ namespace GFGGame
 
                 btnSkill.GetChild("icon").asLoader.data = 0;
                 btnSkill.GetController("c1").selectedIndex = 0;
-                // btnSkill.GetTransition("t0").Stop();
             }
             _isAutoPlay = false;
             Timers.inst.Remove(CircleScoreStart);

BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_1!a.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_1.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_3!a.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_3.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_5!a.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_5.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_fui.bytes