|
|
@@ -14,8 +14,12 @@ export default class LoadingUI extends BaseUI {
|
|
|
|
|
|
@property(cc.EditBox)
|
|
|
lbl_usename: cc.EditBox = null;
|
|
|
+ @property(cc.EditBox)
|
|
|
+ lbl_server: cc.EditBox = null;
|
|
|
@property(cc.Button)
|
|
|
btn_login: cc.Button = null;
|
|
|
+ @property(cc.ToggleContainer)
|
|
|
+ toogle: cc.ToggleContainer = null;
|
|
|
|
|
|
onLoad() {
|
|
|
this.ui = this.node.addComponent(LoadingNode);
|
|
|
@@ -29,10 +33,20 @@ export default class LoadingUI extends BaseUI {
|
|
|
|
|
|
clickLogin() {
|
|
|
GameController.http.mac = this.lbl_usename.string;
|
|
|
+ GameController.http.serverUrl = this.lbl_server.string;
|
|
|
GameController.storageData.setStorage("testmac", GameController.http.mac, 1);
|
|
|
GameController.login();
|
|
|
}
|
|
|
|
|
|
+ clickServer(){
|
|
|
+ if(this.toogle.toggleItems[0].isChecked){
|
|
|
+ this.lbl_server.string = 'https://tafang-test.duiweize.com/';
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.lbl_server.string = 'http://172.16.15.167:9092/';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
start() {
|
|
|
|
|
|
}
|