Explorar o código

添加首次登录游戏前置剧情

zhaoyang %!s(int64=3) %!d(string=hai) anos
pai
achega
1bd4fa4200

+ 5 - 1
FGUIProject/assets/Main/StoryDialogUI.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
+  <controller name="c1" pages="0,,1," selected="0"/>
   <displayList>
     <graph id="n17_t8o1" name="btnNext" xy="0,0" size="1080,1920" alpha="0" type="rect" fillColor="#ffff0000">
       <relation target="" sidePair="center-center,middle-middle"/>
@@ -24,8 +25,11 @@
     <component id="n4_nmnb" name="btnSkip" src="nmnb2x" fileName="componentsDialog/ButtonSkip.xml" xy="759,1716" group="n8_nmnb"/>
     <component id="n5_nmnb" name="btnSpeedUp" src="nmnb2y" fileName="componentsDialog/ButtonSpeedUp.xml" xy="917,1716" group="n8_nmnb"/>
     <group id="n8_nmnb" name="n8" xy="443,1716" size="604,140" advanced="true" layout="hz" colGap="40">
+      <gearDisplay controller="c1" pages="0"/>
       <relation target="" sidePair="right-right,bottom-bottom"/>
     </group>
-    <component id="n16_qsvd" name="btnBack" src="9xlo8" fileName="components/ButtonBack1.xml" pkg="eg2y0ldp" xy="35,80"/>
+    <component id="n16_qsvd" name="btnBack" src="9xlo8" fileName="components/ButtonBack1.xml" pkg="eg2y0ldp" xy="35,80">
+      <gearDisplay controller="c1" pages="0"/>
+    </component>
   </displayList>
 </component>

+ 9 - 9
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -225,15 +225,15 @@ namespace GFGGame
             else
             {
                 StoryDataManager.currentChapter = 1;
-                // if (!StoryDataManager.CheckLevelPass(1, 1))
-                // {
-                //     ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter, new object[] { ViewName.STORY_CHAPTER_LIST_VIEW, });
-                //     StoryController.ShowLevelView(StoryDataManager.currentChapter, 1);
-                // }
-                // else
-                // {
-                ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter, new object[] { ViewName.STORY_CHAPTER_LIST_VIEW });
-                // }
+                if (GameGlobal.isFirstEntry == true)
+                {
+                    // ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter, new object[] { ViewName.STORY_CHAPTER_LIST_VIEW, });
+                    StoryController.ShowPriorStoryDialog();
+                }
+                else
+                {
+                    ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter, new object[] { ViewName.STORY_CHAPTER_LIST_VIEW });
+                }
             }
             AfterEnterGame();
         }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/StoryDataManager.cs

@@ -7,7 +7,7 @@ namespace GFGGame
 {
     public class StoryDataManager
     {
-
+        public static string priorId = "prior";//首次登录前置剧情id
         public static int currentChapter = 0;
         public static int currentLevel = 0;
         public static string currentLevelID;

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

@@ -7,6 +7,7 @@ namespace UI.Main
     public partial class UI_StoryDialogUI
     {
         public GComponent target;
+        public Controller m_c1;
         public GGraph m_btnNext;
         public UI_CompDialogText m_dialogText;
         public UI_CompDialogName m_dialogName;
@@ -64,6 +65,7 @@ namespace UI.Main
 
         private void Init(GComponent comp)
         {
+            m_c1 = comp.GetController("c1");
             m_btnNext = (GGraph)comp.GetChild("btnNext");
             m_dialogText = (UI_CompDialogText)UI_CompDialogText.Create(comp.GetChild("dialogText"));
             m_dialogName = (UI_CompDialogName)UI_CompDialogName.Create(comp.GetChild("dialogName"));
@@ -77,6 +79,7 @@ namespace UI.Main
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_c1 = null;
             m_btnNext = null;
             m_dialogText.Dispose();
             m_dialogText = null;

+ 2 - 0
GameClient/Assets/Game/HotUpdate/GameGlobal.cs

@@ -10,6 +10,8 @@ namespace GFGGame
     {
         public static bool isOfflineVisitor = false;
         public static bool isVisitor = false;
+        public static bool isFirstEntry = false;
+
         //防沉迷开关
         public static bool antiAddiction = true;
         public static long userId = 0;

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Net/Proxy/GameProxy.cs

@@ -36,6 +36,7 @@ namespace GFGGame
                 if (result == null || result.code == 0)
                 {
                     ViewManager.Hide(ViewName.CREATE_ROLE_VIEW);
+                    GameGlobal.isFirstEntry = true;
                     GameController.PreEnterGame(result);
                     if (GameGlobal.isOfflineVisitor)
                     {

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryController.cs

@@ -26,6 +26,12 @@ namespace GFGGame
         {
             ViewManager.Show(ViewName.STORY_DIALOG_VIEW, new object[] { cardStoryCfg.storyStartID, true, new OnCompleteStoryDialogCall(OnCompleteCardStoryDialog), cardData }, null, true);
         }
+        public static void ShowPriorStoryDialog()
+        {
+            StoryDataManager.currentChapter = 1;
+            StoryDataManager.currentLevelID = "1_1";
+            ViewManager.Show(ViewName.STORY_DIALOG_VIEW, new object[] { StoryDataManager.priorId, false, new OnCompleteStoryDialogCall(OnCompleteChapterStoryDialog) }, null, true);
+        }
 
         private static void OnCompleteChapterStoryDialog(bool isSkip, object param)
         {

+ 10 - 0
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

@@ -103,10 +103,20 @@ namespace GFGGame
             //{
 
             //}
+
             //临时设置都可以跳过对话
             skipable = true;
             _ui.m_btnSkip.enabled = skipable;
             ShowNextStep(stroyStartID);
+
+            _ui.m_c1.selectedIndex = 0;
+            _ui.m_btnAutoPlay.selected = false;
+            if (stroyStartID == StoryDataManager.priorId)
+            {
+                _ui.m_c1.selectedIndex = 1;
+                _ui.m_btnAutoPlay.selected = true;
+                OnClickBtnAutoPlay();
+            }
         }
 
         protected override void OnHide()

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


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