mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 12:17:22 +00:00
Add hat to save data
This commit is contained in:
11
dist/web/birb.embed.js
vendored
11
dist/web/birb.embed.js
vendored
@@ -1498,6 +1498,7 @@
|
||||
* @typedef {Object} BirbSaveData
|
||||
* @property {string[]} unlockedSpecies
|
||||
* @property {string} currentSpecies
|
||||
* @property {string} currentHat
|
||||
* @property {Partial<Settings>} settings
|
||||
* @property {SavedStickyNote[]} [stickyNotes]
|
||||
*/
|
||||
@@ -1912,6 +1913,7 @@
|
||||
const WARDROBE_ID = "birb-wardrobe";
|
||||
|
||||
const DEFAULT_BIRD = "bluebird";
|
||||
const DEFAULT_HAT = HAT.NONE;
|
||||
|
||||
// Birb movement
|
||||
const HOP_SPEED = 0.07;
|
||||
@@ -2064,7 +2066,7 @@
|
||||
let petStack = [];
|
||||
let currentSpecies = DEFAULT_BIRD;
|
||||
let unlockedSpecies = [DEFAULT_BIRD];
|
||||
let currentHat = HAT.TOP_HAT;
|
||||
let currentHat = DEFAULT_HAT;
|
||||
// let visible = true;
|
||||
let lastPetTimestamp = 0;
|
||||
/** @type {StickyNote[]} */
|
||||
@@ -2083,6 +2085,7 @@
|
||||
userSettings = saveData.settings ?? {};
|
||||
unlockedSpecies = saveData.unlockedSpecies ?? [DEFAULT_BIRD];
|
||||
currentSpecies = saveData.currentSpecies ?? DEFAULT_BIRD;
|
||||
currentHat = saveData.currentHat ?? DEFAULT_HAT;
|
||||
stickyNotes = [];
|
||||
|
||||
if (saveData.stickyNotes) {
|
||||
@@ -2095,13 +2098,15 @@
|
||||
|
||||
log(stickyNotes.length + " sticky notes loaded");
|
||||
switchSpecies(currentSpecies);
|
||||
switchHat(currentHat);
|
||||
}
|
||||
|
||||
function save() {
|
||||
/** @type {BirbSaveData} */
|
||||
const saveData = {
|
||||
unlockedSpecies,
|
||||
currentSpecies,
|
||||
unlockedSpecies: unlockedSpecies,
|
||||
currentSpecies: currentSpecies,
|
||||
currentHat: currentHat,
|
||||
settings: userSettings
|
||||
};
|
||||
|
||||
|
||||
11
dist/web/birb.js
vendored
11
dist/web/birb.js
vendored
@@ -1498,6 +1498,7 @@
|
||||
* @typedef {Object} BirbSaveData
|
||||
* @property {string[]} unlockedSpecies
|
||||
* @property {string} currentSpecies
|
||||
* @property {string} currentHat
|
||||
* @property {Partial<Settings>} settings
|
||||
* @property {SavedStickyNote[]} [stickyNotes]
|
||||
*/
|
||||
@@ -1912,6 +1913,7 @@
|
||||
const WARDROBE_ID = "birb-wardrobe";
|
||||
|
||||
const DEFAULT_BIRD = "bluebird";
|
||||
const DEFAULT_HAT = HAT.NONE;
|
||||
|
||||
// Birb movement
|
||||
const HOP_SPEED = 0.07;
|
||||
@@ -2064,7 +2066,7 @@
|
||||
let petStack = [];
|
||||
let currentSpecies = DEFAULT_BIRD;
|
||||
let unlockedSpecies = [DEFAULT_BIRD];
|
||||
let currentHat = HAT.TOP_HAT;
|
||||
let currentHat = DEFAULT_HAT;
|
||||
// let visible = true;
|
||||
let lastPetTimestamp = 0;
|
||||
/** @type {StickyNote[]} */
|
||||
@@ -2083,6 +2085,7 @@
|
||||
userSettings = saveData.settings ?? {};
|
||||
unlockedSpecies = saveData.unlockedSpecies ?? [DEFAULT_BIRD];
|
||||
currentSpecies = saveData.currentSpecies ?? DEFAULT_BIRD;
|
||||
currentHat = saveData.currentHat ?? DEFAULT_HAT;
|
||||
stickyNotes = [];
|
||||
|
||||
if (saveData.stickyNotes) {
|
||||
@@ -2095,13 +2098,15 @@
|
||||
|
||||
log(stickyNotes.length + " sticky notes loaded");
|
||||
switchSpecies(currentSpecies);
|
||||
switchHat(currentHat);
|
||||
}
|
||||
|
||||
function save() {
|
||||
/** @type {BirbSaveData} */
|
||||
const saveData = {
|
||||
unlockedSpecies,
|
||||
currentSpecies,
|
||||
unlockedSpecies: unlockedSpecies,
|
||||
currentSpecies: currentSpecies,
|
||||
currentHat: currentHat,
|
||||
settings: userSettings
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user