Commit 87ebc38a authored by huoshizhe's avatar huoshizhe

feat: 自动保存上一次的输入值

parent 5d613c4c
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {
"android": "default",
"ios": "default"
},
"optimizeHotUpdate": {
"android": false,
"ios": false
},
"inlineSpriteFrames": {
"android": false,
"ios": false
},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
{"ver":"1.1.2","uuid":"c35bb2f6-f24a-4850-ae44-643f2fdc7541","isBundle":false,"bundleName":"","priority":1,"compressionType":{"android":"default","ios":"default"},"optimizeHotUpdate":{"android":false,"ios":false},"inlineSpriteFrames":{"android":false,"ios":false},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
......@@ -363,7 +363,7 @@
"__id__": 7
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 9
......@@ -2600,7 +2600,7 @@
"_enabled": true,
"_string": "",
"returnType": 0,
"maxLength": 8,
"maxLength": 50,
"_tabIndex": 0,
"editingDidBegan": [],
"textChanged": [],
......
......@@ -52,6 +52,20 @@ cc.Class({
cc.game.addPersistRootNode(this.node);
this.initListener();
const addressText = cc.find('middleLayer/ui/address');
const str = cc.sys.localStorage.getItem('ip');
console.log('str = ' + str);
if (str) {
addressText.getComponent(cc.EditBox).string = str;
}
const nameText = cc.find('middleLayer/ui/bundleName');
const bundleName = cc.sys.localStorage.getItem('bundleName');
if (bundleName) {
nameText.getComponent(cc.EditBox).string = bundleName;
}
},
asyncDelayLog(str) {
......@@ -93,7 +107,7 @@ cc.Class({
.call(() => {
cc.game.removePersistRootNode(this.node);
cc.director.loadScene("middleLayer_for_debug", () => {
exitBtn.active = false;
});
})
.start();
......@@ -103,12 +117,14 @@ cc.Class({
BtnStartLocal.on('click', () => {
const addressText = cc.find('middleLayer/ui/address');
const str = addressText.getComponent(cc.EditBox).string;
cc.sys.localStorage.setItem('ip', str);
const address = str.split(':')[0];
const port = str.split(':')[0] | 8081;
this.localMode = true;
this.loadLocalBundle(address, port);
this.showWaitingLetters();
this.hideUI();
exitBtn.active = true;
});
const BtnStartOnline = cc.find('middleLayer/ui/BtnStartOnline');
......@@ -117,7 +133,9 @@ cc.Class({
this.hideUI();
const nameText = cc.find('middleLayer/ui/bundleName');
const bundleName = nameText.getComponent(cc.EditBox).string;
cc.sys.localStorage.setItem('bundleName', bundleName);
this.loadOnlineBundle(bundleName);
exitBtn.active = true;
});
},
......
......@@ -3,6 +3,6 @@
"packages": "packages",
"name": "play",
"id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231",
"version": "2.4.0",
"version": "2.4.4",
"isNew": false
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment