Просмотр исходного кода

Merge branch 'master' of http://git.mokasz.com/zouyong/tower_sanguo

薛鸿潇 5 лет назад
Родитель
Сommit
7dfc423261

+ 8 - 6
tower_sanguo/assets/resources/module/gm/gm.prefab

@@ -3967,8 +3967,8 @@
       }
     ],
     "_useOriginalSize": false,
-    "_string": "button",
-    "_N$string": "button",
+    "_string": "增加属性值",
+    "_N$string": "增加属性值",
     "_fontSize": 20,
     "_lineHeight": 40,
     "_enableWrapText": false,
@@ -4154,11 +4154,13 @@
   },
   {
     "__type__": "cc.ClickEvent",
-    "target": null,
+    "target": {
+      "__id__": 1
+    },
     "component": "",
-    "_componentId": "",
-    "handler": "",
-    "customEventData": ""
+    "_componentId": "03d84HbqihI1Ihyl7k79bNs",
+    "handler": "clickBtn",
+    "customEventData": "updateprop"
   },
   {
     "__type__": "cc.PrefabInfo",

+ 8 - 0
tower_sanguo/assets/scripts/module/gm/GmUI.ts

@@ -50,6 +50,9 @@ export default class GmUI extends BaseUI {
             case 'setmission':
                 this.setmission();
                 break;
+            case 'updateprop':
+                this.updatePlayerProp();
+                break;
         }
     }
 
@@ -61,6 +64,11 @@ export default class GmUI extends BaseUI {
         }
     }
 
+    private updatePlayerProp(){
+        let arr = this.lbl_input.string.split(":");
+        GameController.http.updateKeyValueDemo(null,arr[0],arr[1]);
+    }
+
     private addGeneral() {
         let id = parseInt(this.lbl_input.string);
         if(GameController.useLocalServer){

+ 11 - 1
tower_sanguo/assets/scripts/net/HttpCommand.ts

@@ -48,6 +48,7 @@ export default class HttpCommand {
     connectTest(callback) {
         GameController.commonData.ranKey = Utils.randomString()
         let data = {
+            "mac": "c1:65:e2:1c:b0:26,f6:60:e4:1a:b7:27",
             "mac": "a5:65:e2:1c:b0:26,f6:60:e4:1a:b7:27",
             "psk": GameController.commonData.ranKey,
             "appId": GameController.commonData.appid
@@ -170,6 +171,13 @@ export default class HttpCommand {
         };
         this.sendData(HTTPTYPE.getInitGeneralDemo, data, callback);
     }
+    updateKeyValueDemo(callback, key, value) {
+        let data = {
+            key: key,
+            value: value
+        };
+        this.sendData(HTTPTYPE.updateKeyValueDemo, data, callback);
+    }
     /** 获取任务数据 */
     getTaskInfo(callback) {
         this.sendData(HTTPTYPE.task_data, 'POST', callback);
@@ -311,7 +319,7 @@ export default class HttpCommand {
     /** 武将许愿
      * @param callback 回调
     */
-    prayGeneral(callback,data) {
+    prayGeneral(callback, data) {
         this.sendData(HTTPTYPE.prayGeneral, data, callback);
     }
 
@@ -430,6 +438,8 @@ export enum HTTPTYPE {
     // ZNH
     /** 武将许愿*/
     prayGeneral = 'general/prayGeneral',
+
+    updateKeyValueDemo = 'general/updateKeyValueDemo',
 }