浏览代码

添加升级、过关Gm

zhaoyang 3 年之前
父节点
当前提交
ee672a6bbd

+ 1 - 6
FGUIProject/assets/Main/GMPanelUI.xml

@@ -2,12 +2,7 @@
 <component size="600,600">
   <displayList>
     <loader id="n0_d4iw" name="bg" xy="0,0" size="600,600" url="ui://mk0fwx0xq08x4" fill="scaleFree"/>
-    <component id="n11_c5sc" name="btnGetAllDressUpItem" src="c5sc8h" fileName="components/ButtonGM.xml" xy="45,51" size="332,46">
-      <Button title="获取所有换装部件" titleFontSize="30"/>
-    </component>
-    <component id="n13_c5sc" name="btnGetAllCardItem" src="c5sc8h" fileName="components/ButtonGM.xml" xy="45,108" size="330,46">
-      <Button title="获取所有卡牌" titleFontSize="30"/>
-    </component>
+    <component id="n11_c5sc" name="ComBtn" src="lqp0dm" fileName="components/ComBtn.xml" xy="45,51"/>
     <richtext id="n3_c5sc" name="n3" xy="70,456" size="132,36" group="n14_g926" fontSize="26" color="#999999" text="添加物品:"/>
     <graph id="n5_c5sc" name="n5" xy="249,451" size="219,42" group="n14_g926" type="rect" lineSize="0" fillColor="#ffd0cfdb">
       <relation target="n4_c5sc" sidePair="width-width,height-height,center-center,middle-middle"/>

+ 23 - 0
FGUIProject/assets/Main/components/ComBtn.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="500,400" overflow="scroll">
+  <displayList>
+    <component id="n11_c5sc" name="btnGetAllDressUpItem" src="c5sc8h" fileName="components/ButtonGM.xml" xy="0,0" size="332,46">
+      <Button title="获取所有换装部件" titleFontSize="30"/>
+    </component>
+    <component id="n13_c5sc" name="btnGetAllCardItem" src="c5sc8h" fileName="components/ButtonGM.xml" xy="0,66" size="330,46">
+      <Button title="获取所有卡牌" titleFontSize="30"/>
+    </component>
+    <component id="n14_lqp0" name="btnSetLv" src="c5sc8h" fileName="components/ButtonGM.xml" xy="1,132" size="330,46">
+      <Button title="设置玩家等级" titleFontSize="30"/>
+    </component>
+    <text id="n17_lqp0" name="txtRoleLv" xy="332,134" size="119,42" fontSize="30" autoSize="none" text="" input="true" prompt="[color=#B6A688]99[/color]" maxLength="3"/>
+    <component id="n15_lqp0" name="btnSetChapter" src="c5sc8h" fileName="components/ButtonGM.xml" xy="1,198" size="330,46">
+      <Button title="设置玩家章节" titleFontSize="30"/>
+    </component>
+    <text id="n18_lqp0" name="txtChapter" xy="333,199" size="61,42" fontSize="30" autoSize="none" text="" input="true" prompt="[color=#B6A688]章[/color]"/>
+    <text id="n19_lqp0" name="txtChapterLv" xy="395,199" size="54,42" fontSize="30" autoSize="none" text="" input="true" prompt="[color=#B6A688]关[/color]"/>
+    <component id="n20_lqp0" name="btnAll" src="c5sc8h" fileName="components/ButtonGM.xml" xy="1,267" size="330,46">
+      <Button title="666账号" titleFontSize="30"/>
+    </component>
+  </displayList>
+</component>

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

@@ -371,6 +371,7 @@
     <image id="jj0mdf" name="zd_jsjs_2.png" path="/images/"/>
     <image id="jj0mdg" name="zd_jsjs_1.png" path="/images/"/>
     <component id="jj0mdl" name="ButtonSpeedUp1.xml" path="/componentsDialog/"/>
+    <component id="lqp0dm" name="ComBtn.xml" path="/components/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Main" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit e4b87c8989f3f9e64b397864a6bbf212bc9d5346
+Subproject commit b9b0da5e82c17a17428b4d7f0fc8f29092c2407c

+ 92 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_ComBtn.cs

@@ -0,0 +1,92 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Main
+{
+    public partial class UI_ComBtn
+    {
+        public GComponent target;
+        public GButton m_btnGetAllDressUpItem;
+        public GButton m_btnGetAllCardItem;
+        public GButton m_btnSetLv;
+        public GTextInput m_txtRoleLv;
+        public GButton m_btnSetChapter;
+        public GTextInput m_txtChapter;
+        public GTextInput m_txtChapterLv;
+        public GButton m_btnAll;
+        public const string URL = "ui://mfvz4q8klqp0dm";
+        public const string PACKAGE_NAME = "Main";
+        public const string RES_NAME = "ComBtn";
+        private static UI_ComBtn _proxy;
+
+        public static UI_ComBtn Create(GObject gObject = null)
+        {
+            var ui = new UI_ComBtn();
+            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_ComBtn Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComBtn();
+            }
+            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_btnGetAllDressUpItem = (GButton)comp.GetChild("btnGetAllDressUpItem");
+            m_btnGetAllCardItem = (GButton)comp.GetChild("btnGetAllCardItem");
+            m_btnSetLv = (GButton)comp.GetChild("btnSetLv");
+            m_txtRoleLv = (GTextInput)comp.GetChild("txtRoleLv");
+            m_btnSetChapter = (GButton)comp.GetChild("btnSetChapter");
+            m_txtChapter = (GTextInput)comp.GetChild("txtChapter");
+            m_txtChapterLv = (GTextInput)comp.GetChild("txtChapterLv");
+            m_btnAll = (GButton)comp.GetChild("btnAll");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_btnGetAllDressUpItem = null;
+            m_btnGetAllCardItem = null;
+            m_btnSetLv = null;
+            m_txtRoleLv = null;
+            m_btnSetChapter = null;
+            m_txtChapter = null;
+            m_txtChapterLv = null;
+            m_btnAll = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

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

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

+ 4 - 6
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_GMPanelUI.cs

@@ -8,8 +8,7 @@ namespace UI.Main
     {
         public GComponent target;
         public GLoader m_bg;
-        public GButton m_btnGetAllDressUpItem;
-        public GButton m_btnGetAllCardItem;
+        public UI_ComBtn m_ComBtn;
         public GTextInput m_inputItem;
         public GButton m_btnAddItem;
         public GTextInput m_inputGM;
@@ -62,8 +61,7 @@ namespace UI.Main
         private void Init(GComponent comp)
         {
             m_bg = (GLoader)comp.GetChild("bg");
-            m_btnGetAllDressUpItem = (GButton)comp.GetChild("btnGetAllDressUpItem");
-            m_btnGetAllCardItem = (GButton)comp.GetChild("btnGetAllCardItem");
+            m_ComBtn = (UI_ComBtn)UI_ComBtn.Create(comp.GetChild("ComBtn"));
             m_inputItem = (GTextInput)comp.GetChild("inputItem");
             m_btnAddItem = (GButton)comp.GetChild("btnAddItem");
             m_inputGM = (GTextInput)comp.GetChild("inputGM");
@@ -72,8 +70,8 @@ namespace UI.Main
         public void Dispose(bool disposeTarget = false)
         {
             m_bg = null;
-            m_btnGetAllDressUpItem = null;
-            m_btnGetAllCardItem = null;
+            m_ComBtn.Dispose();
+            m_ComBtn = null;
             m_inputItem = null;
             m_btnAddItem = null;
             m_inputGM = null;

+ 50 - 9
GameClient/Assets/Game/HotUpdate/Views/MainUI/GMPanelView.cs

@@ -11,7 +11,7 @@ namespace GFGGame
 
         public override void Dispose()
         {
-            if(_ui != null)
+            if (_ui != null)
             {
                 _ui.Dispose();
             }
@@ -27,8 +27,11 @@ namespace GFGGame
             this.viewCom.Center();
             this.modal = true;
 
-            _ui.m_btnGetAllDressUpItem.onClick.Add(OnClickBtnGetAllDressUpItem);
-            _ui.m_btnGetAllCardItem.onClick.Add(OnClickBtnGetAllCardItem);
+            _ui.m_ComBtn.m_btnGetAllDressUpItem.onClick.Add(OnClickBtnGetAllDressUpItem);
+            _ui.m_ComBtn.m_btnGetAllCardItem.onClick.Add(OnClickBtnGetAllCardItem);
+            _ui.m_ComBtn.m_btnSetLv.onClick.Add(OnClickBtnSetLv);
+            _ui.m_ComBtn.m_btnSetChapter.onClick.Add(OnClickBtnSetChapter);
+            _ui.m_ComBtn.m_btnAll.onClick.Add(OnClickBtnAll);
             _ui.m_btnAddItem.onClick.Add(OnClickBtnAddItem);
             _ui.m_btnGM.onClick.Add(OnClickBtnGM);
         }
@@ -57,15 +60,15 @@ namespace GFGGame
         {
             string content = _ui.m_inputItem.text;
             string[] infos = Regex.Split(content, " ");
-            if(infos.Length < 2)
+            if (infos.Length < 2)
             {
                 PromptController.Instance.ShowFloatTextPrompt("请按照指定格式输入物品信息", MessageType.ERR);
                 return;
             }
-            
+
             int itemId = int.Parse(infos[0]);
             int itemNum = int.Parse(infos[1]);
-            if(itemId > 0 && itemNum > 0)
+            if (itemId > 0 && itemNum > 0)
             {
                 string messageSuc = "已获得物品" + itemId + "*" + itemNum;
                 GMController.SendGMCommand("getItem " + content, messageSuc).Coroutine();
@@ -75,6 +78,43 @@ namespace GFGGame
                 PromptController.Instance.ShowFloatTextPrompt("请按照指定格式输入物品信息", MessageType.ERR);
             }
         }
+        private void OnClickBtnSetLv()
+        {
+            int tmp;
+            if (!int.TryParse(_ui.m_ComBtn.m_txtRoleLv.text, out tmp))
+            {
+                PromptController.Instance.ShowFloatTextPrompt("请输入数字");
+                return;
+            }
+            string lv = _ui.m_ComBtn.m_txtRoleLv.text;
+            string messageSuc = "等级提升至" + lv;
+
+            GMController.SendGMCommand("lv " + lv, messageSuc).Coroutine();
+        }
+        private void OnClickBtnSetChapter()
+        {
+            int tmp;
+            int tmp1;
+            if (!int.TryParse(_ui.m_ComBtn.m_txtChapter.text, out tmp) || !int.TryParse(_ui.m_ComBtn.m_txtChapterLv.text, out tmp1))
+            {
+                PromptController.Instance.ShowFloatTextPrompt("请输入数字");
+                return;
+            }
+            string content = _ui.m_ComBtn.m_txtChapter.text + " " + _ui.m_ComBtn.m_txtChapterLv.text;
+            string messageSuc = string.Format("当前关卡第{0}章第{1}关", _ui.m_ComBtn.m_txtChapter.text, _ui.m_ComBtn.m_txtChapterLv.text);
+            GMController.SendGMCommand("chapter " + content, messageSuc).Coroutine();
+        }
+
+        private void OnClickBtnAll()
+        {
+            OnClickBtnGetAllDressUpItem();
+            OnClickBtnGetAllCardItem();
+            _ui.m_ComBtn.m_txtRoleLv.text = "99";
+            OnClickBtnSetLv();
+            _ui.m_ComBtn.m_txtChapter.text = "2";
+            _ui.m_ComBtn.m_txtChapterLv.text = "10";
+            OnClickBtnSetChapter();
+        }
 
         private void OnClickBtnGM(EventContext context)
         {
@@ -85,7 +125,8 @@ namespace GFGGame
                 PromptController.Instance.ShowFloatTextPrompt("请按照指定格式输入物品信息", MessageType.ERR);
                 return;
             }
-            switch (infos[0]) {
+            switch (infos[0])
+            {
                 case "log":
                     if (infos[1] == "1")//开启日志按钮
                     {
@@ -98,7 +139,7 @@ namespace GFGGame
                     }
                     else
                     {
-                        PromptController.Instance.ShowFloatTextPrompt(string.Format("log指令没有{0}这个状态",infos[1]));
+                        PromptController.Instance.ShowFloatTextPrompt(string.Format("log指令没有{0}这个状态", infos[1]));
                     }
                     break;
                 case "cjstime":
@@ -107,7 +148,7 @@ namespace GFGGame
                         PromptController.Instance.ShowFloatTextPrompt("请输入以秒为单位的正确的时间戳");
                         return;
                     }
-                    LuckyBoxDataManager.Instance.startTime = int .Parse(infos[1]);
+                    LuckyBoxDataManager.Instance.startTime = int.Parse(infos[1]);
                     PromptController.Instance.ShowFloatTextPrompt("设置成功");
 
                     break;

二进制
GameClient/Assets/ResIn/UI/Main/Main_fui.bytes