diff --git a/dist/extension.zip b/dist/extension.zip index ef7542e..218cf05 100644 Binary files a/dist/extension.zip and b/dist/extension.zip differ diff --git a/dist/extension/birb.js b/dist/extension/birb.js index 9ae9445..f8a2696 100644 --- a/dist/extension/birb.js +++ b/dist/extension/birb.js @@ -1513,6 +1513,7 @@ * @typedef {Object} BirbSaveData * @property {string[]} unlockedSpecies * @property {string} currentSpecies + * @property {string} currentHat * @property {Partial} 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 }; diff --git a/dist/obsidian/main.js b/dist/obsidian/main.js index ed55867..dd28a5f 100644 --- a/dist/obsidian/main.js +++ b/dist/obsidian/main.js @@ -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 * @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 }; diff --git a/dist/userscript/birb.user.js b/dist/userscript/birb.user.js index 443e645..e90a8b7 100644 --- a/dist/userscript/birb.user.js +++ b/dist/userscript/birb.user.js @@ -1518,6 +1518,7 @@ * @typedef {Object} BirbSaveData * @property {string[]} unlockedSpecies * @property {string} currentSpecies + * @property {string} currentHat * @property {Partial} 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 }; diff --git a/dist/web/birb.embed.js b/dist/web/birb.embed.js index 72b9f6d..768bce3 100644 --- a/dist/web/birb.embed.js +++ b/dist/web/birb.embed.js @@ -1498,6 +1498,7 @@ * @typedef {Object} BirbSaveData * @property {string[]} unlockedSpecies * @property {string} currentSpecies + * @property {string} currentHat * @property {Partial} 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 }; diff --git a/dist/web/birb.js b/dist/web/birb.js index 72b9f6d..768bce3 100644 --- a/dist/web/birb.js +++ b/dist/web/birb.js @@ -1498,6 +1498,7 @@ * @typedef {Object} BirbSaveData * @property {string[]} unlockedSpecies * @property {string} currentSpecies + * @property {string} currentHat * @property {Partial} 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 }; diff --git a/src/application.js b/src/application.js index 0081034..cb76bea 100644 --- a/src/application.js +++ b/src/application.js @@ -54,6 +54,7 @@ import { HAT, HAT_METADATA } from './hats.js'; * @typedef {Object} BirbSaveData * @property {string[]} unlockedSpecies * @property {string} currentSpecies + * @property {string} currentHat * @property {Partial} settings * @property {SavedStickyNote[]} [stickyNotes] */ @@ -87,6 +88,7 @@ const FEATHER_ID = "birb-feather"; const WARDROBE_ID = "birb-wardrobe"; const DEFAULT_BIRD = "bluebird"; +const DEFAULT_HAT = HAT.NONE; // Birb movement const HOP_SPEED = 0.07; @@ -239,7 +241,7 @@ function startApplication(birbPixels, featherPixels, hatsPixels) { 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[]} */ @@ -258,6 +260,7 @@ function startApplication(birbPixels, featherPixels, hatsPixels) { userSettings = saveData.settings ?? {}; unlockedSpecies = saveData.unlockedSpecies ?? [DEFAULT_BIRD]; currentSpecies = saveData.currentSpecies ?? DEFAULT_BIRD; + currentHat = saveData.currentHat ?? DEFAULT_HAT; stickyNotes = []; if (saveData.stickyNotes) { @@ -270,13 +273,15 @@ function startApplication(birbPixels, featherPixels, hatsPixels) { 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 };