|
@@ -172,12 +172,10 @@ export class UserDifficutyData {
|
|
|
}
|
|
|
|
|
|
constructor() {
|
|
|
- let defaultData = {
|
|
|
- difficutyCount: 10,
|
|
|
- scales: [1.18, 1.16, 1.14, 0.3976, 0.3690, 0.3029,
|
|
|
- 0.0667, 0.0766, 0.0531, 0.0716]
|
|
|
- }
|
|
|
- this._difficutyData = sys.localStorage.getItem("difficutyData") ? Object.assign(defaultData, JSON.parse(sys.localStorage.getItem("difficutyData"))) : defaultData
|
|
|
+ const saved = sys.localStorage.getItem("difficutyData");
|
|
|
+ this._difficutyData = saved
|
|
|
+ ? Object.assign({}, DEFAULT_DIFFICULTY_DATA, JSON.parse(saved))
|
|
|
+ : {...DEFAULT_DIFFICULTY_DATA};
|
|
|
}
|
|
|
|
|
|
get difficutyData(): DifficutyData {
|
|
@@ -205,17 +203,18 @@ export class UserDifficutyData {
|
|
|
sys.localStorage.setItem("difficutyData", JSON.stringify(this._difficutyData));
|
|
|
}
|
|
|
|
|
|
- setDataToDefault()
|
|
|
- {
|
|
|
- let defaultData = {
|
|
|
- difficutyCount: 10,
|
|
|
- scales: [1.18, 1.16, 1.14, 0.3976, 0.3690, 0.3029,
|
|
|
- 0.0667, 0.0766, 0.0531, 0.0716]
|
|
|
- }
|
|
|
- this._difficutyData = defaultData;
|
|
|
- this.saveDifficutyData();
|
|
|
+ setDataToDefault() {
|
|
|
+ this._difficutyData = {...DEFAULT_DIFFICULTY_DATA};
|
|
|
+
|
|
|
+ this.createOrDeleteOtherScale();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+const DEFAULT_DIFFICULTY_DATA: DifficutyData = {
|
|
|
+ difficutyCount: 10,
|
|
|
+ scales: [1.18, 1.16, 1.14, 0.3976, 0.3690, 0.3029,
|
|
|
+ 0.0667, 0.0766, 0.0531, 0.0716]
|
|
|
+};
|
|
|
export const Difficulty = new UserDifficutyData();
|
|
|
|
|
|
export interface SkinData {
|
|
@@ -388,6 +387,7 @@ export interface SuperFindData {
|
|
|
title:string
|
|
|
levelDesc:string
|
|
|
imgPath:string
|
|
|
+ currentBgId:number
|
|
|
}
|
|
|
|
|
|
export class UserSuperFindData {
|
|
@@ -398,7 +398,8 @@ export class UserSuperFindData {
|
|
|
let defaultData: SuperFindData = {
|
|
|
title: `找到${Difficulty.getDifficutyData().difficutyCount}个跳舞的小熊`,
|
|
|
levelDesc: `疯狂最强找茬-找小熊-第${1}关`,
|
|
|
- imgPath: `image/bg1`
|
|
|
+ imgPath: `image/bg1`,
|
|
|
+ currentBgId:1
|
|
|
}
|
|
|
this._superFindData = sys.localStorage.getItem("superFindData") ? Object.assign(defaultData, JSON.parse(sys.localStorage.getItem("superFindData"))) : defaultData
|
|
|
}
|
|
@@ -432,7 +433,8 @@ export class UserSuperFindData {
|
|
|
let defaultData: SuperFindData = {
|
|
|
title: `找到${Difficulty.getDifficutyData().difficutyCount}个跳舞的小熊`,
|
|
|
levelDesc: `疯狂最强找茬-找小熊-第${1}关`,
|
|
|
- imgPath: `image/bg1`
|
|
|
+ imgPath: `image/bg1`,
|
|
|
+ currentBgId:1
|
|
|
}
|
|
|
this._superFindData = defaultData
|
|
|
this.saveSuperFindData()
|
|
@@ -509,7 +511,7 @@ export const allSkinList: { [key: number]: string } = {
|
|
|
30: "prefab/spine/spine30",
|
|
|
};
|
|
|
|
|
|
-export const defaultSkin = "spine/hecha"
|
|
|
+export const defaultSkin = "prefab/spine/spine01"
|
|
|
|
|
|
export const canSelectMapList: { [key: number]: string } = {
|
|
|
// 背景图片资源
|