Browse Source

引导添加指引框

zhaoyang 3 years ago
parent
commit
2f090ce179

+ 3 - 1
FGUIProject/assets/Main/StoryFightResultUI.xml

@@ -5,7 +5,9 @@
     <component id="n2_8xpg" name="expBar" src="8xpg52" fileName="components/CompFightExpBar.xml" xy="33,1924">
       <relation target="" sidePair="center-center,bottom-bottom"/>
     </component>
-    <graph id="n1_8xpg" name="btnClose" xy="0,0" size="1080,1920" alpha="0" type="rect" fillColor="#ffff0000"/>
+    <graph id="n1_8xpg" name="btnClose" xy="0,0" size="1080,1920" alpha="0" type="rect" fillColor="#ffff0000">
+      <relation target="" sidePair="width-width,height-height"/>
+    </graph>
   </displayList>
   <transition name="t0">
     <item time="0" type="Alpha" target="n0_8xpg" tween="true" startValue="0" endValue="1" duration="6" ease="Quad.In"/>

+ 2 - 1
FGUIProject/assets/Main/StoryLevelInfoUI.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1160" designImageOffsetX="-750">
-  <controller name="ctrlNeed" pages="0,,1,,2," selected="0"/>
+  <controller name="ctrlNeed" pages="0,,1,,2," selected="1"/>
   <displayList>
     <loader id="n44_yoe2" name="btnBg" xy="0,-153" size="1080,1414" touchable="false" url="ui://mfvz4q8kj48o94" autoSize="true"/>
     <component id="n0_vxw5" name="btnStart" src="t8o13i" fileName="componentsLevel/ButtonStart.xml" xy="766,864">
@@ -51,5 +51,6 @@
       <item/>
     </list>
     <loader id="n37_d4iw" name="scoreType" xy="581,272" size="50,50" url="ui://eg2y0ldp842s6h" fill="scale"/>
+    <loader id="n46_kzvk" name="btnGuide" xy="480,1455" size="120,120"/>
   </displayList>
 </component>

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Controller/GuideController.cs

@@ -28,7 +28,7 @@ namespace GFGGame
             return isGuide;
         }
 
-        public static bool TryGuide(GObject target, string guideKey, int index, string guideStr = null, int listIndex = -1, bool checkPriorIndex = true, int yTxt = 0, float devWidth = 0, float devHeight = 0)
+        public static bool TryGuide(GObject target, string guideKey, int index, string guideStr = null, int listIndex = -1, bool checkPriorIndex = true, int yTxt = 0, float devWidth = 0, float devHeight = 0, bool showAni = true)
         {
 
             GuideCfg cfg = GuideCfgArray.Instance.GetCfg(guideKey);
@@ -64,7 +64,7 @@ namespace GFGGame
                         return false;
                     }
                 }
-                ShowGuideByIndex(target, guideStr, yTxt, cfg.optionalGuide == 1, devWidth, devHeight, GuideDataManager.currentGuideId, GuideDataManager.currentGuideIdIndex);
+                ShowGuideByIndex(target, guideStr, yTxt, cfg.optionalGuide == 1, devWidth, devHeight, GuideDataManager.currentGuideId, GuideDataManager.currentGuideIdIndex, showAni);
                 if (!checkPriorIndex)
                 {
                     for (int i = 1; i < index; i++)
@@ -76,7 +76,7 @@ namespace GFGGame
             }
             return false;
         }
-        private static void ShowGuideByIndex(GObject target, string guideStr = null, int yTxt = 0, bool isOptionalGuide = false, float devWidth = 0, float devHeight = 0, int guideId = 0, int index = 0)
+        private static void ShowGuideByIndex(GObject target, string guideStr = null, int yTxt = 0, bool isOptionalGuide = false, float devWidth = 0, float devHeight = 0, int guideId = 0, int index = 0, bool showAni = true)
         {
             HideGuide();
             if (GameGlobal.skipGuide)
@@ -84,7 +84,7 @@ namespace GFGGame
                 return;
             }
 
-            ViewManager.Show(ViewName.GUIDE_VIEW, new List<object> { target, guideStr, yTxt, isOptionalGuide, devWidth, devHeight, guideId, index });
+            ViewManager.Show(ViewName.GUIDE_VIEW, new List<object> { target, guideStr, yTxt, isOptionalGuide, devWidth, devHeight, guideId, index, showAni });
         }
         public static bool TryCompleteGuideIndex(int guideId, int index)
         {

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_StoryLevelInfoUI.cs

@@ -26,6 +26,7 @@ namespace UI.Main
         public UI_CompFlower1 m_flower;
         public GList m_listBonus;
         public GLoader m_scoreType;
+        public GLoader m_btnGuide;
         public const string URL = "ui://mfvz4q8kvxw538";
         public const string PACKAGE_NAME = "Main";
         public const string RES_NAME = "StoryLevelInfoUI";
@@ -92,6 +93,7 @@ namespace UI.Main
             m_flower = (UI_CompFlower1)UI_CompFlower1.Create(comp.GetChild("flower"));
             m_listBonus = (GList)comp.GetChild("listBonus");
             m_scoreType = (GLoader)comp.GetChild("scoreType");
+            m_btnGuide = (GLoader)comp.GetChild("btnGuide");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -115,6 +117,7 @@ namespace UI.Main
             m_flower = null;
             m_listBonus = null;
             m_scoreType = null;
+            m_btnGuide = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 4 - 0
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

@@ -380,6 +380,10 @@ namespace GFGGame
 
         protected override void UpdateToCheckGuide(object param)
         {
+            if (ViewManager.isViewOpen(typeof(GuideView).Name))
+            {
+                ViewManager.GetUIView(typeof(GuideView).Name).viewCom.visible = !ViewManager.isViewOpen(typeof(GetSuitItemVIew).Name);
+            }
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
 
             GuideController.TryGuide(_ui.m_listClothing, ConstGuideId.CLOTHING_SYNTHETIC, 8, "找到需要合成的物品", 0);

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -848,7 +848,7 @@ namespace GFGGame
                             if (dressUpMenuItemCfg1.type == ConstDressUpItemType.LIAN_YI_QUN)
                             {
                                 listTypeItem_SingleFight = item;
-                                _ui.m_comListType1.m_listType.ScrollToView(i);
+                                // _ui.m_comListType1.m_listType.ScrollToView(i);
                                 break;
                             }
                         }
@@ -863,7 +863,7 @@ namespace GFGGame
                             if (dressUpMenuItemCfg1.type == type)
                             {
                                 listTypeItem_BuyClothing = item;
-                                _ui.m_comListType1.m_listType.ScrollToView(i);
+                                // _ui.m_comListType1.m_listType.ScrollToView(i);
                                 break;
                             }
                         }

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

@@ -573,8 +573,8 @@ namespace GFGGame
         {
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
             GuideController.TryGuide(_ui.m_ComSelectRes.m_comBtnTab.m_btn2, ConstGuideId.PHOTOGRAPH, 4, "可以自由添加已有道具");
-            GuideController.TryGuide(_ui.m_loaGuide, ConstGuideId.PHOTOGRAPH, 5, "点击空白处查看整体效果", -1, true, (int)(_ui.m_loaGuide.y + _ui.m_loaGuide.height - 250));
-            GuideController.TryGuide(_ui.m_loaGuide1, ConstGuideId.PHOTOGRAPH, 6, "双指可控制放大缩小,或点击边框上的按键控制", -1, true, (int)(_ui.m_loaGuide1.y + _ui.m_loaGuide1.height - 250));
+            GuideController.TryGuide(_ui.m_loaGuide, ConstGuideId.PHOTOGRAPH, 5, "点击空白处查看整体效果", -1, true, (int)(_ui.m_loaGuide.y + _ui.m_loaGuide.height - 250), 0, 0, false);
+            GuideController.TryGuide(_ui.m_loaGuide1, ConstGuideId.PHOTOGRAPH, 6, "双指可控制放大缩小,或点击边框上的按键控制", -1, true, (int)(_ui.m_loaGuide1.y + _ui.m_loaGuide1.height - 250), 0, 0, false);
             GuideController.TryGuide(_ui.m_btnPhotograph, ConstGuideId.PHOTOGRAPH, 7, "点击拍照,可以记录和分享美照啦");
             GuideController.TryCompleteGuide(ConstGuideId.PHOTOGRAPH, 7);
         }

+ 43 - 10
GameClient/Assets/Game/HotUpdate/Views/Guide/GuideView.cs

@@ -7,7 +7,7 @@ using System;
 
 namespace GFGGame
 {
-    public class GuideView : BaseWindow
+    public class GuideView : BaseView
     {
         private UI_GuideUI _ui;
         private bool _needUpdate;
@@ -15,6 +15,7 @@ namespace GFGGame
         private float devWidth;
         private float devHeight;
         private int yTxt;
+        private bool showAni;
 
         private int guideId;
         private int guideIndex;
@@ -22,6 +23,8 @@ namespace GFGGame
 
         private GameObject _gameObject;
         private GoWrapper _wrapper;
+
+        private int sortingOrder;
         public override void Dispose()
         {
             base.Dispose();
@@ -34,8 +37,8 @@ namespace GFGGame
             packageName = UI_GuideUI.PACKAGE_NAME;
             _ui = UI_GuideUI.Create();
             this.viewCom = _ui.target;
-            this.clickBlankToClose = false;
-            // this.layer = ConstViewLayer.TOP;
+            // this.clickBlankToClose = false;
+            this.layer = ConstViewLayer.TOP;
             isfullScreen = true;
             _ui.m_rectFrameTemp.visible = false;
             _ui.m_rectFrame.target.visible = false;
@@ -64,6 +67,7 @@ namespace GFGGame
 
             guideId = (int)dataList[6];
             guideIndex = (int)dataList[7];
+            showAni = (bool)dataList[8];
 
             if (txtContent != null && txtContent.Length > 0)
             {
@@ -82,18 +86,18 @@ namespace GFGGame
             {
                 _ui.m_compTxt.target.visible = false;
             }
-
+            _ui.m_comHolder.target.visible = false;
             _ui.m_rectFrameTemp.width = _ui.m_mask.target.width;
             _ui.m_rectFrameTemp.height = _ui.m_mask.target.height;
             _ui.m_rectFrameTemp.x = 0;
             _ui.m_rectFrameTemp.y = 0;
             if (guideTarget != null)
             {
+
                 UpdateGuideRect();
                 Timers.inst.AddUpdate(UpdateGuideRect);
                 _ui.m_mask.target.visible = true;
-                _ui.m_comHolder.target.visible = true;
-
+                guideTarget.touchable = false;
                 guideTarget.onClick.Add(OnClickTarget);
                 if (guideTarget == null) OnClickTarget();
 
@@ -102,6 +106,8 @@ namespace GFGGame
             {
                 _ui.m_comHolder.target.visible = false;
                 _ui.m_mask.target.visible = false;
+                _ui.m_rectFrameTemp.visible = false;
+
             }
             _ui.m_compTxt.target.y = Math.Min(yTxt, GRoot.inst.height - _ui.m_compTxt.target.height - 3);
             // _ui.m_rectFrame.target.visible = true;
@@ -111,7 +117,7 @@ namespace GFGGame
         {
             Timers.inst.Remove(UpdateGuideRect);
             base.OnHide();
-            if (guideTarget == null)
+            if (isOptionalGuide || guideTarget == null)
             {
                 OnClickTarget();
             }
@@ -130,8 +136,9 @@ namespace GFGGame
                 _ui.m_mask.m_guideArea.size = new Vector2((int)rect.size.x, (int)rect.size.y);
                 _ui.m_mask.m_guideArea.position = new Vector2((int)rect.position.x, (int)rect.position.y);
 
-
+                Debug.Log("zoya000:" + _ui.m_mask.m_guideArea.position);
                 _ui.m_comHolder.target.position = _ui.m_mask.m_guideArea.position;
+                Debug.Log("zoya111:" + _ui.m_comHolder.target.position);
                 _ui.m_comHolder.target.size = _ui.m_mask.m_guideArea.size;
                 int padding = 90;
                 bool atBottom = _ui.m_mask.m_guideArea.y + _ui.m_mask.m_guideArea.height + padding + _ui.m_compTxt.target.height + padding > GRoot.inst.height;
@@ -145,11 +152,37 @@ namespace GFGGame
                     {
                         _ui.m_compTxt.target.y = _ui.m_mask.m_guideArea.y + _ui.m_mask.m_guideArea.height + padding;
                     }
+                    Debug.Log("zoya222:" + _ui.m_compTxt.target.y);
+
                 }
                 int targetWidth = 20;
-                if (Mathf.Abs(_ui.m_rectFrameTemp.width - _ui.m_rectFrame.target.width) <= targetWidth && Mathf.Abs(_ui.m_rectFrameTemp.height - _ui.m_rectFrame.target.height) <= targetWidth)
+
+                if (showAni)
+                {
+
+                    if (Mathf.Abs(_ui.m_rectFrameTemp.width - _ui.m_rectFrame.target.width) > targetWidth && Mathf.Abs(_ui.m_rectFrameTemp.height - _ui.m_rectFrame.target.height) > targetWidth)
+                    {
+                        _ui.m_rectFrameTemp.visible = true;
+                        float duration = 0.5f;
+                        _ui.m_rectFrameTemp.TweenResize(new Vector2(_ui.m_rectFrame.target.width, _ui.m_rectFrame.target.height), duration);
+                        _ui.m_rectFrameTemp.TweenMove(new Vector2(_ui.m_rectFrame.target.x, _ui.m_rectFrame.target.y), duration);
+                    }
+                    else
+                    {
+                        guideTarget.touchable = true;
+                        _ui.m_comHolder.target.visible = true;
+                        _ui.m_rectFrameTemp.visible = false;
+                    }
+                }
+                else
                 {
-                    Timers.inst.Remove(UpdateGuideRect);
+                    // if (Mathf.Abs(_ui.m_rectFrameTemp.width - _ui.m_rectFrame.target.width) <= targetWidth && Mathf.Abs(_ui.m_rectFrameTemp.height - _ui.m_rectFrame.target.height) <= targetWidth)
+                    // {
+                    //     Timers.inst.Remove(UpdateGuideRect);
+                    // }
+                    _ui.m_comHolder.target.visible = true;
+                    guideTarget.touchable = true;
+
                 }
             }
         }

+ 2 - 5
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryLevelInfoView.cs

@@ -32,10 +32,7 @@ namespace GFGGame
             _ui.m_btnFightOnce.onClick.Add(OnClickBtnFightOnce);
             _ui.m_btnFightTimes.onClick.Add(OnClickBtnFightTimes);
 
-            // _ui.m_btnClose.onClick.Add(() =>
-            // {
-            //     this.Hide();
-            // });
+            _ui.m_btnGuide.onClick.Add(this.Hide);
 
             _ui.m_listTag.itemRenderer = RenderListTagItem;
         }
@@ -254,7 +251,7 @@ namespace GFGGame
             {
                 _ui.m_btnStart.touchable = false;
             }
-            GuideController.TryGuide(null, ConstGuideId.CLOTHING_SYNTHETIC, 3, "点击空白处关闭", -1, true, (int)(this.viewCom.y + _ui.m_groupPass.y));
+            GuideController.TryGuide(null, ConstGuideId.CLOTHING_SYNTHETIC, 3, "点击空白处关闭", -1, true, (int)(this.viewCom.y + _ui.m_txtPowerDesc.y), 0, 0, false);
             GuideController.TryGuide(_ui.m_listTag, ConstGuideId.OPEN_TAGS, 1, "选择相应的关卡标签,可提高分数", -1, true, 0);
             GuideController.TryCompleteGuide(ConstGuideId.OPEN_TAGS, 1);
 

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -328,7 +328,7 @@ namespace GFGGame
             GuideController.TryCompleteGuide(ConstGuideId.FREEDOM_DRESS, 6);
             GuideController.TryGuide(_ui.m_btnHuanZhuang.target, ConstGuideId.FREEDOM_DRESS, 2, "在这里,可以自由搭配服饰和分享哦~", -1, false);
 
-            GuideController.TryGuide(_ui.m_btnXiuFang.target, ConstGuideId.CLOTHING_SYNTHETIC, 5, "绣坊里增添了新功能", -1, false);
+            GuideController.TryGuide(_ui.m_btnXiuFang.target, ConstGuideId.CLOTHING_SYNTHETIC, 5, "绣坊里增添了新功能", -1, true);
             GuideController.TryCompleteGuide(ConstGuideId.CLOTHING_SYNTHETIC, 11);
 
             GuideController.TryGuide(_ui.m_btnCiPai.target, ConstGuideId.UP_CARD_STAR, 2, "已经收集了足够的材料,可以给词牌升星了", -1, false);

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/ViewManager.cs

@@ -230,6 +230,16 @@ namespace GFGGame
             _goBackDatas.TryGetValue(name, out value);
             return value;
         }
+        public static UIView GetUIView(string viewName)
+        {
+            UIView obj = _viewDic[viewName];
+            if (obj != null && obj.isShowing)
+            {
+
+                return obj;
+            }
+            return null;
+        }
         public static void HideAllView(string excludeViewName = null)
         {
             foreach (string viewName in _viewDic.Keys)
@@ -263,6 +273,7 @@ namespace GFGGame
         }
         public static bool CheckIsTopView(GComponent viewCom)
         {
+            if (ViewManager.isViewOpen(typeof(GuideView).Name)) return false;
             if (viewCom.parent != null)
             {
                 int index = viewCom.parent.GetChildIndex(viewCom);

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