Commit 19162932 authored by liujiangnan's avatar liujiangnan

feat: 自由模式开关

parent 611a0e4b
...@@ -609,7 +609,7 @@ export default class NewClass extends middleLayerBase { ...@@ -609,7 +609,7 @@ export default class NewClass extends middleLayerBase {
} }
await this.playGetParterAnim(); await this.playGetParterAnim();
if (this.isLogin == true) { if (this.isLogin == true && this.gameModel != 'free') {
this.unlockNextForder(); this.unlockNextForder();
} }
} }
...@@ -725,6 +725,7 @@ export default class NewClass extends middleLayerBase { ...@@ -725,6 +725,7 @@ export default class NewClass extends middleLayerBase {
cc.find('middleLayer/BtnLeft').active = false; cc.find('middleLayer/BtnLeft').active = false;
cc.find('middleLayer/ExitBtn').active = false; cc.find('middleLayer/ExitBtn').active = false;
cc.find('middleLayer/ram').active = (bundleName == 'NJ_YouLeChang' && this.type == 'aixuebao'); cc.find('middleLayer/ram').active = (bundleName == 'NJ_YouLeChang' && this.type == 'aixuebao');
cc.find('middleLayer/change').active = (bundleName == 'NJ_YouLeChang');
if (bundleName == 'NJ_login') { if (bundleName == 'NJ_login') {
// 如果跳到登录页,则清理一些缓存的使用数据 // 如果跳到登录页,则清理一些缓存的使用数据
this.data = {}; this.data = {};
...@@ -915,6 +916,7 @@ export default class NewClass extends middleLayerBase { ...@@ -915,6 +916,7 @@ export default class NewClass extends middleLayerBase {
cc.find('middleLayer/BtnLeft').active = false; cc.find('middleLayer/BtnLeft').active = false;
cc.find('middleLayer/ExitBtn').active = false; cc.find('middleLayer/ExitBtn').active = false;
cc.find('middleLayer/ram').active = false; cc.find('middleLayer/ram').active = false;
cc.find('middleLayer/change').active = false;
if (this.type == "aixuebao") { if (this.type == "aixuebao") {
await this.asyncCallNetworkApiGet(`/api/aixuebao/v1/engine/active`, { await this.asyncCallNetworkApiGet(`/api/aixuebao/v1/engine/active`, {
...@@ -1337,6 +1339,14 @@ export default class NewClass extends middleLayerBase { ...@@ -1337,6 +1339,14 @@ export default class NewClass extends middleLayerBase {
}, ()=>{}); }, ()=>{});
}); });
buttonOnClick(cc.find('middleLayer/change'), () => {
this.showConfirm(`确定要切换为${this.gameModel==='cross'?'自由':'闯关'}模式吗?`, ()=>{
this.gameModel = this.gameModel==='cross'?'free':'cross';
cc.sys.localStorage.setItem('gameModel', this.gameModel);
this.showTips(`已切换为${this.gameModel==='cross'?'闯关':'自由'}模式`);
}, ()=>{});
});
buttonOnClick(cc.find('middleLayer/activeLayer/close'), () => { buttonOnClick(cc.find('middleLayer/activeLayer/close'), () => {
cc.find('middleLayer/activeLayer').active = false; cc.find('middleLayer/activeLayer').active = false;
}); });
...@@ -1410,7 +1420,9 @@ export default class NewClass extends middleLayerBase { ...@@ -1410,7 +1420,9 @@ export default class NewClass extends middleLayerBase {
} }
role = 'student'; role = 'student';
gameModel; // free: 自由模式;cross: 闯关模式;
protected onLoad(): void { protected onLoad(): void {
this.gameModel = cc.sys.localStorage.getItem('gameModel') || 'cross';
initAir(this); initAir(this);
this.reWriteAir(); this.reWriteAir();
this.reportErrorLog(); this.reportErrorLog();
......
...@@ -303,6 +303,7 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -303,6 +303,7 @@ export abstract class middleLayerBase extends cc.Component {
this.showWaitingLetters(); this.showWaitingLetters();
cc.find('middleLayer/ram').active = false; cc.find('middleLayer/ram').active = false;
cc.find('middleLayer/change').active = false;
let api = `/api/courseware/v2/${courseId}/list`; let api = `/api/courseware/v2/${courseId}/list`;
if (linkFlag === true) { if (linkFlag === true) {
......
{
"ver": "2.3.5",
"uuid": "5e2dd88a-37b4-4d5c-bd1a-2ffe933486f3",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 200,
"height": 200,
"platformSettings": {},
"subMetas": {
"change": {
"ver": "1.0.4",
"uuid": "3734b163-7953-4c6b-9b5d-c25d19e52ec9",
"rawTextureUuid": "5e2dd88a-37b4-4d5c-bd1a-2ffe933486f3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 12,
"trimY": 12,
"width": 176,
"height": 176,
"rawWidth": 200,
"rawHeight": 200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ 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