mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 04:07:23 +00:00
Add hat to save data
This commit is contained in:
BIN
dist/extension.zip
vendored
BIN
dist/extension.zip
vendored
Binary file not shown.
11
dist/extension/birb.js
vendored
11
dist/extension/birb.js
vendored
@@ -1513,6 +1513,7 @@
|
||||
* @typedef {Object} BirbSaveData
|
||||
* @property {string[]} unlockedSpecies
|
||||
* @property {string} currentSpecies
|
||||
* @property {string} currentHat
|
||||
* @property {Partial<Settings>} settings
|
||||
* @property {SavedStickyNote[]} [stickyNotes]
|
||||
*/
|
||||
@@ -1927,6 +1928,7 @@
|
||||
const WARDROBE_ID = "birb-wardrobe";
|
||||
|
||||
const DEFAULT_BIRD = "bluebird";
|
||||
const DEFAULT_HAT = HAT.NONE;
|
||||
|
||||
// Birb movement
|
||||
const HOP_SPEED = 0.07;
|
||||
@@ -2079,7 +2081,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[]} */
|
||||
@@ -2098,6 +2100,7 @@
|
||||
userSettings = saveData.settings ?? {};
|
||||
unlockedSpecies = saveData.unlockedSpecies ?? [DEFAULT_BIRD];
|
||||
currentSpecies = saveData.currentSpecies ?? DEFAULT_BIRD;
|
||||
currentHat = saveData.currentHat ?? DEFAULT_HAT;
|
||||
stickyNotes = [];
|
||||
|
||||
if (saveData.stickyNotes) {
|
||||
@@ -2110,13 +2113,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/obsidian/main.js
vendored
11
dist/obsidian/main.js
vendored
@@ -1556,6 +1556,7 @@ module.exports = class PocketBird extends Plugin {
|
||||
* @typedef {Object} BirbSaveData
|
||||
* @property {string[]} unlockedSpecies
|
||||
* @property {string} currentSpecies
|
||||
* @property {string} currentHat
|
||||
* @property {Partial<Settings>} settings
|
||||
* @property {SavedStickyNote[]} [stickyNotes]
|
||||
*/
|
||||
@@ -1970,6 +1971,7 @@ module.exports = class PocketBird extends Plugin {
|
||||
const WARDROBE_ID = "birb-wardrobe";
|
||||
|
||||
const DEFAULT_BIRD = "bluebird";
|
||||
const DEFAULT_HAT = HAT.NONE;
|
||||
|
||||
// Birb movement
|
||||
const HOP_SPEED = 0.07;
|
||||
@@ -2122,7 +2124,7 @@ module.exports = class PocketBird extends Plugin {
|
||||
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[]} */
|
||||
@@ -2141,6 +2143,7 @@ module.exports = class PocketBird extends Plugin {
|
||||
userSettings = saveData.settings ?? {};
|
||||
unlockedSpecies = saveData.unlockedSpecies ?? [DEFAULT_BIRD];
|
||||
currentSpecies = saveData.currentSpecies ?? DEFAULT_BIRD;
|
||||
currentHat = saveData.currentHat ?? DEFAULT_HAT;
|
||||
stickyNotes = [];
|
||||
|
||||
if (saveData.stickyNotes) {
|
||||
@@ -2153,13 +2156,15 @@ module.exports = class PocketBird extends Plugin {
|
||||
|
||||
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/userscript/birb.user.js
vendored
11
dist/userscript/birb.user.js
vendored
@@ -1518,6 +1518,7 @@
|
||||
* @typedef {Object} BirbSaveData
|
||||
* @property {string[]} unlockedSpecies
|
||||
* @property {string} currentSpecies
|
||||
* @property {string} currentHat
|
||||
* @property {Partial<Settings>} settings
|
||||
* @property {SavedStickyNote[]} [stickyNotes]
|
||||
*/
|
||||
@@ -1932,6 +1933,7 @@
|
||||
const WARDROBE_ID = "birb-wardrobe";
|
||||
|
||||
const DEFAULT_BIRD = "bluebird";
|
||||
const DEFAULT_HAT = HAT.NONE;
|
||||
|
||||
// Birb movement
|
||||
const HOP_SPEED = 0.07;
|
||||
@@ -2084,7 +2086,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[]} */
|
||||
@@ -2103,6 +2105,7 @@
|
||||
userSettings = saveData.settings ?? {};
|
||||
unlockedSpecies = saveData.unlockedSpecies ?? [DEFAULT_BIRD];
|
||||
currentSpecies = saveData.currentSpecies ?? DEFAULT_BIRD;
|
||||
currentHat = saveData.currentHat ?? DEFAULT_HAT;
|
||||
stickyNotes = [];
|
||||
|
||||
if (saveData.stickyNotes) {
|
||||
@@ -2115,13 +2118,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.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