zhaoyang преди 2 години
родител
ревизия
83aa8467b4

+ 12 - 7
FGUIProject/assets/CreateRole/CreateRoleUI.xml

@@ -1,12 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="962,476" bgColor="#000000">
+<component size="1080,1920" bgColor="#000000">
   <displayList>
-    <component id="n4_xt5s" name="bg" src="si5ztih" fileName="components/ComBg.xml" pkg="mk0fwx0x" xy="0,0" size="962,476"/>
-    <image id="n11_hpgr" name="n11" src="hpgr5" fileName="images/mc_jlkuang_1.png" xy="114,112"/>
-    <component id="n5_xt5s" name="btnSure" src="wonody" fileName="components/Button19.xml" pkg="mk0fwx0x" xy="309,304">
-      <Button title="确认" titleColor="#ffffff" titleFontSize="42"/>
+    <loader id="n12_o4m7" name="loaBg" xy="0,-240" size="1080,2400" url="ui://5al8chbdo4m76" fill="scaleMatchWidth">
+      <relation target="" sidePair="width-width,center-center,middle-middle"/>
+    </loader>
+    <image id="n11_hpgr" name="n11" src="hpgr5" fileName="images/mc_jlkuang_1.png" xy="360,884" group="n14_o4m7"/>
+    <text id="n10_xt5s" name="inputName" xy="383,889" size="237,44" group="n14_o4m7" fontSize="32" color="#9a7849" autoSize="none" autoClearText="true" text="啦啦啦啦啦啦啦" input="true" prompt="[color=#C1A187]请输入角色名称[/color]" maxLength="7"/>
+    <component id="n5_xt5s" name="btnSure" src="o4m78" fileName="components/Button1.xml" xy="623,825" group="n14_o4m7">
+      <Button title="确认" titleColor="#ffffff" titleFontSize="42" icon="ui://5al8chbdo4m77"/>
     </component>
-    <component id="n8_xt5s" name="btnDice" src="xt5s4" fileName="components/ButtonDice.xml" xy="719,84"/>
-    <text id="n10_xt5s" name="inputName" xy="168,125" size="560,56" fontSize="42" color="#9e8056" autoSize="none" text="" input="true" prompt="[color=#B6A688]请输入角色名称[/color]" maxLength="7"/>
+    <component id="n8_xt5s" name="btnDice" src="xt5s4" fileName="components/ButtonDice.xml" xy="278,873" size="81,71" group="n14_o4m7" aspect="true"/>
+    <group id="n14_o4m7" name="n14" xy="278,825" size="526,179" advanced="true">
+      <relation target="" sidePair="center-center,middle-middle"/>
+    </group>
   </displayList>
 </component>

+ 10 - 0
FGUIProject/assets/CreateRole/components/Button1.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="181,179" extention="Button">
+  <Button/>
+  <controller name="button" pages="0,up,1,down,2,over,3,selectedOver"/>
+  <displayList>
+    <image id="n0_o4m7" src="o4m77" name="n0" xy="0,0">
+      <relation target="" sidePair="width,height"/>
+    </image>
+  </displayList>
+</component>

+ 1 - 1
FGUIProject/assets/CreateRole/components/ButtonDice.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="128,128" extention="Button">
+<component size="59,52" extention="Button">
   <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
   <displayList>
     <image id="n0_xt5s" name="n0" src="xt5s1" fileName="images/jianlinicheng.png" xy="0,0">

BIN
FGUIProject/assets/CreateRole/images/an_queren.png


BIN
FGUIProject/assets/CreateRole/images/jianlinicheng.png


BIN
FGUIProject/assets/CreateRole/images/mc_jlkuang_1.png


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

@@ -5,6 +5,8 @@
     <image id="xt5s1" name="jianlinicheng.png" path="/images/"/>
     <component id="xt5s4" name="ButtonDice.xml" path="/components/"/>
     <image id="hpgr5" name="mc_jlkuang_1.png" path="/images/"/>
+    <image id="o4m77" name="an_queren.png" path="/images/"/>
+    <component id="o4m78" name="Button1.xml" path="/components/"/>
   </resources>
   <publish name="" path="../GameClient/Assets/ResIn/UI/CreateRole" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

BIN
FGUIProject/assets/FieldGuide/images/chapter_3.png


+ 1 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstStorageId.cs

@@ -14,6 +14,7 @@ namespace GFGGame
         public const int LAST_LOGIN_TIME = 20006;//上次登录时间
         public const int STUDIO_FILING_CHAPTERID = 20007;//当前选择的副本id
         public const int ARENA_QUICK_FIGHT = 20008;//竞技场快速挑战,0不快速挑战,1快速挑战
+        public const int CHANGE_NAME = 20009;//是否创建过名称,0没有,1已创建
 
     }
 }

+ 6 - 6
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CreateRole/UI_CreateRoleUI.cs

@@ -7,10 +7,10 @@ namespace UI.CreateRole
     public partial class UI_CreateRoleUI
     {
         public GComponent target;
-        public GComponent m_bg;
+        public GLoader m_loaBg;
+        public GTextInput m_inputName;
         public GButton m_btnSure;
         public GButton m_btnDice;
-        public GTextInput m_inputName;
         public const string URL = "ui://5al8chbdxt5s0";
         public const string PACKAGE_NAME = "CreateRole";
         public const string RES_NAME = "CreateRoleUI";
@@ -58,17 +58,17 @@ namespace UI.CreateRole
 
         private void Init(GComponent comp)
         {
-            m_bg = (GComponent)comp.GetChild("bg");
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
+            m_inputName = (GTextInput)comp.GetChild("inputName");
             m_btnSure = (GButton)comp.GetChild("btnSure");
             m_btnDice = (GButton)comp.GetChild("btnDice");
-            m_inputName = (GTextInput)comp.GetChild("inputName");
         }
         public void Dispose(bool disposeTarget = false)
         {
-            m_bg = null;
+            m_loaBg = null;
+            m_inputName = null;
             m_btnSure = null;
             m_btnDice = null;
-            m_inputName = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 10 - 4
GameClient/Assets/Game/HotUpdate/Views/CreateRole/CreateRoleView.cs

@@ -26,10 +26,11 @@ namespace GFGGame
             packageName = UI_CreateRoleUI.PACKAGE_NAME;
             _ui = UI_CreateRoleUI.Create();
             this.viewCom = _ui.target;
-            this.viewCom.Center();
+            // this.viewCom.Center();
+            this.isfullScreen = true;
             this.clickBlankToClose = false;
             this.modal = true;
-
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("bg_yaoqinghan");
             _ui.m_btnSure.onClick.Add(OnClickBtnSure);
             _ui.m_btnDice.onClick.Add(() =>
             {
@@ -49,7 +50,7 @@ namespace GFGGame
             base.OnHide();
         }
 
-        private void OnClickBtnSure()
+        private async void OnClickBtnSure()
         {
             string roleName = _ui.m_inputName.text;
             if (string.IsNullOrEmpty(roleName))
@@ -69,7 +70,12 @@ namespace GFGGame
                 PromptController.Instance.ShowFloatTextPrompt("角色名仅允许汉字、数字、下划线");
                 return;
             }
-            LoginController.ReqCreateRole(roleName).Coroutine();
+            bool result = await RoleInfoSProxy.ReqModifyRoleName(roleName);
+            if (result)
+            {
+                StorageSProxy.ReqSetClientValue(ConstStorageId.CHANGE_NAME, 1).Coroutine();
+                this.Hide();
+            }
         }
 
         private async void RandomRoleName()

+ 1 - 10
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterView.cs

@@ -199,16 +199,7 @@ namespace GFGGame
                 UI_CompStoryLevelItem.ProxyEnd();
             }
             _ui.m_chapter.m_compChapterScroll.target.y = 0;// _ui.m_chapter.target.height - _ui.m_chapter.m_compChapterScroll.target.height;
-            if (_endLevelItem != null)
-            {
-                // float tx = _endLevelItem.x + _endLevelItem.width / 2;
-                // float ty = _endLevelItem.y + _endLevelItem.height / 2;
-                // tx = tx - _ui.m_chapter.target.width / 2;
-                // ty = ty - _ui.m_chapter.target.height / 2;
-                // _ui.m_chapter.target.scrollPane.SetPosX(tx, false);
-                // _ui.m_chapter.target.scrollPane.SetPosY(ty, false);
-                // _ui.m_chapter.target.scrollPane.ScrollTop();
-            }
+
         }
 
         private void OnClickLevelItem(EventContext context)

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

@@ -366,6 +366,10 @@ namespace GFGGame
 
         private void ShowDialog(StoryDialogCfg storyDialogCfg)
         {
+            if (storyDialogCfg.showChangeName == 1 && StorageDataManager.Instance.GetStorageValue(ConstStorageId.CHANGE_NAME) == 0)
+            {
+                GameController.ShowCreateRole();
+            }
             _ui.m_loaMask.url = ResPathUtil.GetBgImgPath(storyDialogCfg.maskRes);
             _ui.m_btnAutoPlay.enabled = true;
             _ui.m_list.visible = false;

BIN
GameClient/Assets/ResIn/UI/CreateRole/CreateRole_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/CreateRole/CreateRole_atlas0.png


BIN
GameClient/Assets/ResIn/UI/CreateRole/CreateRole_fui.bytes