mousehunt-improved 0.97.1 → 0.98.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -16
- package/dist/mousehunt-improved.min.js +33 -0
- package/package.json +19 -15
- package/.editorconfig +0 -15
- package/.eslintignore +0 -2
- package/.eslintrc.json +0 -153
- package/.eslintrc.markdown.json +0 -11
- package/.gitattributes +0 -7
- package/.github/dependabot.yml +0 -18
- package/.github/workflows/ci.yml +0 -29
- package/.github/workflows/lint.yml +0 -24
- package/.github/workflows/publish.yml +0 -215
- package/.stylelintrc.json +0 -51
- package/.vscode/tasks.json +0 -37
- package/CHANGELOG.md +0 -3853
- package/CONTRIBUTING.md +0 -317
- package/bun.lock +0 -2298
- package/docs/adblock.md +0 -3
- package/docs/better-gifts.md +0 -15
- package/docs/better-inventory.md +0 -19
- package/docs/better-items.md +0 -13
- package/docs/better-journal.md +0 -26
- package/docs/better-kings-reward.md +0 -5
- package/docs/better-maps.md +0 -35
- package/docs/better-marketplace.md +0 -16
- package/docs/better-mice.md +0 -19
- package/docs/better-quests.md +0 -14
- package/docs/better-send-supplies.md +0 -15
- package/docs/better-shops.md +0 -15
- package/docs/better-tournaments.md +0 -13
- package/docs/better-travel.md +0 -20
- package/docs/better-ui.md +0 -30
- package/docs/big-timer.md +0 -3
- package/docs/catch-rate-estimator-and-minlucks.md +0 -9
- package/docs/codex-at-bottom.md +0 -3
- package/docs/copy-id-button.md +0 -7
- package/docs/custom-background.md +0 -71
- package/docs/custom-camp-background.md +0 -73
- package/docs/custom-horn.md +0 -28
- package/docs/custom-hud.md +0 -67
- package/docs/custom-shield.md +0 -77
- package/docs/custom-styles.md +0 -3
- package/docs/dark-mode-updates-and-tweaks.md +0 -3
- package/docs/dark-mode.md +0 -3
- package/docs/data-exporters.md +0 -21
- package/docs/debug-logging.md +0 -49
- package/docs/delayed-menus.md +0 -3
- package/docs/delayed-tooltips.md +0 -3
- package/docs/emotes.md +0 -111
- package/docs/experiments.md +0 -14
- package/docs/favorite-setups.md +0 -10
- package/docs/feature-flags.md +0 -90
- package/docs/fixes.md +0 -32
- package/docs/flrt-helper.md +0 -8
- package/docs/hide-codices.md +0 -3
- package/docs/hide-daily-draw.md +0 -3
- package/docs/hide-daily-reward-popup.md +0 -3
- package/docs/hide-footer.md +0 -3
- package/docs/hide-news-ticker.md +0 -3
- package/docs/hide-share-buttons.md +0 -3
- package/docs/hide-sidebar.md +0 -3
- package/docs/hover-profiles.md +0 -3
- package/docs/image-upscaling-and-transparency.md +0 -5
- package/docs/inline-wiki.md +0 -3
- package/docs/inventory-lock-and-hide.md +0 -9
- package/docs/inventory-only-open-multiple.md +0 -9
- package/docs/inventory-open-all-but-one.md +0 -8
- package/docs/inventory-open-all.md +0 -8
- package/docs/journal-privacy.md +0 -8
- package/docs/journal-theme-changer.md +0 -13
- package/docs/keyboard-shortcuts.md +0 -42
- package/docs/larger-codices.md +0 -3
- package/docs/larger-skin-images.md +0 -3
- package/docs/legacy-hud.md +0 -9
- package/docs/location-catch-stats.md +0 -3
- package/docs/location-dashboard.md +0 -89
- package/docs/lucky-golden-shield-duration-and-reminder.md +0 -8
- package/docs/metric-units.md +0 -3
- package/docs/paste-hunter-id.md +0 -5
- package/docs/prestige-base-stats.md +0 -3
- package/docs/printing-press-paper-counter.md +0 -3
- package/docs/quick-filters-and-sort.md +0 -8
- package/docs/quick-send-supplies.md +0 -8
- package/docs/replace-favicon.md +0 -3
- package/docs/scoreboard-search-on-profiles.md +0 -3
- package/docs/shield-goes-to-camp.md +0 -3
- package/docs/show-adventure-book.md +0 -7
- package/docs/show-auras.md +0 -13
- package/docs/ssdb-toothlet-counter.md +0 -3
- package/docs/taller-windows.md +0 -3
- package/docs/tem-crowns.md +0 -3
- package/docs/trap-selector-special-effects.md +0 -8
- package/docs/ultimate-checkmark.md +0 -9
- package/docs/unique-loot-count.md +0 -7
- package/docs/wisdom-in-stat-bar.md +0 -12
- package/jsconfig.json +0 -17
- package/scripts/build-extension.mjs +0 -119
- package/scripts/build-userscript.mjs +0 -73
- package/scripts/build.mjs +0 -106
- package/scripts/fetch-external-files.mjs +0 -26
- package/scripts/fix-map-groups.mjs +0 -146
- package/scripts/get-changelog.mjs +0 -10
- package/scripts/get-version.mjs +0 -2
- package/scripts/release +0 -29
- package/scripts/shared.mjs +0 -135
- package/src/data/backgrounds.json +0 -47
- package/src/data/crafting-recipe-mapping.json +0 -87
- package/src/data/cre-mice-groups.json +0 -148
- package/src/data/journal-item-colors.json +0 -110
- package/src/data/journals-environment-mapping.json +0 -24
- package/src/data/journals-events.json +0 -58
- package/src/data/magic-essence-potions.json +0 -28
- package/src/data/map-groups.json +0 -3737
- package/src/data/ultimate-checkmark.json +0 -407
- package/src/data/update-summary.json +0 -48
- package/src/extension/content.js +0 -29
- package/src/extension/icon-128.png +0 -0
- package/src/extension/icon-16.png +0 -0
- package/src/extension/icon-32.png +0 -0
- package/src/extension/icon-48.png +0 -0
- package/src/extension/icon-64.png +0 -0
- package/src/extension/manifest.json +0 -55
- package/src/extension/popup.html +0 -50
- package/src/extension/screenshots/dashboard.png +0 -0
- package/src/extension/screenshots/journal.png +0 -0
- package/src/extension/screenshots/map-highlighting.png +0 -0
- package/src/extension/screenshots/shop.png +0 -0
- package/src/index.js +0 -266
- package/src/modules/adblock/index.js +0 -22
- package/src/modules/adblock/styles.css +0 -31
- package/src/modules/better-gifts/index.js +0 -568
- package/src/modules/better-gifts/settings/index.js +0 -80
- package/src/modules/better-gifts/styles.css +0 -593
- package/src/modules/better-inventory/index.js +0 -522
- package/src/modules/better-inventory/modules/recipes/index.js +0 -318
- package/src/modules/better-inventory/modules/recipes/styles.css +0 -30
- package/src/modules/better-inventory/settings/index.js +0 -24
- package/src/modules/better-inventory/styles/double-width-item.css +0 -21
- package/src/modules/better-inventory/styles/full-width-item.css +0 -27
- package/src/modules/better-inventory/styles/larger-images.css +0 -17
- package/src/modules/better-inventory/styles/styles.css +0 -704
- package/src/modules/better-inventory/styles/tiny-group.css +0 -83
- package/src/modules/better-item-view/index.js +0 -454
- package/src/modules/better-item-view/modules/hover-item/index.js +0 -211
- package/src/modules/better-item-view/modules/hover-item/styles.css +0 -57
- package/src/modules/better-item-view/settings/index.js +0 -19
- package/src/modules/better-item-view/styles.css +0 -406
- package/src/modules/better-journal/index.js +0 -81
- package/src/modules/better-journal/modules/journal-full-mice-images/index.js +0 -64
- package/src/modules/better-journal/modules/journal-full-mice-images/styles.css +0 -99
- package/src/modules/better-journal/modules/journal-gold-and-points/index.js +0 -57
- package/src/modules/better-journal/modules/journal-gold-and-points/styles.css +0 -21
- package/src/modules/better-journal/modules/journal-highlight-rare-mice/index.js +0 -10
- package/src/modules/better-journal/modules/journal-highlight-rare-mice/styles.css +0 -5
- package/src/modules/better-journal/modules/journal-history/index.js +0 -396
- package/src/modules/better-journal/modules/journal-history/styles.css +0 -36
- package/src/modules/better-journal/modules/journal-icons/index.js +0 -17
- package/src/modules/better-journal/modules/journal-icons/styles.css +0 -58
- package/src/modules/better-journal/modules/journal-icons-minimal/index.js +0 -10
- package/src/modules/better-journal/modules/journal-icons-minimal/styles.css +0 -78
- package/src/modules/better-journal/modules/journal-item-colors/index.js +0 -19
- package/src/modules/better-journal/modules/journal-list/index.js +0 -407
- package/src/modules/better-journal/modules/journal-list/styles.css +0 -29
- package/src/modules/better-journal/modules/journal-replacements/index.js +0 -430
- package/src/modules/better-journal/modules/journal-replacements/styles.css +0 -15
- package/src/modules/better-journal/modules/journal-styles/index.js +0 -89
- package/src/modules/better-journal/modules/journal-styles/styles/backgrounds.css +0 -71
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/aura.css +0 -15
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/badge.css +0 -85
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/base/alchemist-cookbook.css +0 -8
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/base/gem.css +0 -30
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/base/paper.css +0 -3
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/base/ssdb.css +0 -3
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/catch/bonus.css +0 -22
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/catch/catch.css +0 -4
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/catch/failure.css +0 -6
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/catch/lucky.css +0 -4
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/catch/prize.css +0 -8
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/charm/gilded.css +0 -9
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/charm/rift-vacuum.css +0 -8
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/charm/torch.css +0 -18
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/charm/ultimate.css +0 -21
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/charm/unstable.css +0 -28
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/draw-winner.css +0 -19
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/events.css +0 -41
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/gwh.css +0 -3
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/kga.css +0 -16
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/larry-gift.css +0 -25
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/birthday.css +0 -48
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/brift.css +0 -6
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/bwrift.css +0 -13
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/floating-islands.css +0 -12
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/folklore-forest.css +0 -57
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/frift.css +0 -46
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/frox.css +0 -5
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/garden.css +0 -14
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/halloween.css +0 -7
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/harbour.css +0 -11
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/iceberg.css +0 -38
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/labyrinth.css +0 -34
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/mousoleum.css +0 -5
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/queso.css +0 -28
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/school.css +0 -18
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/toxic-spill.css +0 -13
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/vrift.css +0 -12
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/location/wwrift.css +0 -33
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/maps.css +0 -8
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/mouse/glazy.css +0 -10
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/mouse/stuck-snowball.css +0 -3
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/mouse/valentines.css +0 -10
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/other.css +0 -34
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/popup.css +0 -10
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/rank-up.css +0 -57
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/social-gift.css +0 -27
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/tournaments.css +0 -14
- package/src/modules/better-journal/modules/journal-styles/styles/custom-entries/ultimate.css +0 -7
- package/src/modules/better-journal/modules/journal-styles/styles/date-hiding.css +0 -74
- package/src/modules/better-journal/modules/journal-styles/styles/fullstop.css +0 -101
- package/src/modules/better-journal/modules/journal-styles/styles/general.css +0 -321
- package/src/modules/better-journal/modules/journal-styles/styles/progress-log.css +0 -217
- package/src/modules/better-journal/modules/journal-tags/index.js +0 -10
- package/src/modules/better-journal/modules/journal-tags/styles.css +0 -100
- package/src/modules/better-journal/settings/index.js +0 -56
- package/src/modules/better-journal/styles/list-and-icons.css +0 -3
- package/src/modules/better-journal/styles/styles.css +0 -15
- package/src/modules/better-kings-reward/index.js +0 -69
- package/src/modules/better-kings-reward/styles.css +0 -33
- package/src/modules/better-maps/index.js +0 -557
- package/src/modules/better-maps/modules/catch-dates.js +0 -78
- package/src/modules/better-maps/modules/community.js +0 -167
- package/src/modules/better-maps/modules/consolation-prizes.js +0 -30
- package/src/modules/better-maps/modules/draggable-highlight.js +0 -80
- package/src/modules/better-maps/modules/floating-islands.js +0 -209
- package/src/modules/better-maps/modules/highlighting.js +0 -277
- package/src/modules/better-maps/modules/preview.js +0 -66
- package/src/modules/better-maps/modules/scrolls.js +0 -183
- package/src/modules/better-maps/modules/shops.js +0 -170
- package/src/modules/better-maps/modules/sidebar.js +0 -203
- package/src/modules/better-maps/modules/tab-goals.js +0 -816
- package/src/modules/better-maps/modules/tab-hunters.js +0 -323
- package/src/modules/better-maps/modules/tab-invites.js +0 -66
- package/src/modules/better-maps/modules/tab-sorted.js +0 -818
- package/src/modules/better-maps/modules/toggle-ar.js +0 -237
- package/src/modules/better-maps/settings/index.js +0 -32
- package/src/modules/better-maps/styles/catch-dates.css +0 -23
- package/src/modules/better-maps/styles/draggable.css +0 -12
- package/src/modules/better-maps/styles/general.css +0 -1092
- package/src/modules/better-maps/styles/helper.css +0 -29
- package/src/modules/better-maps/styles/highlight-for-map.css +0 -19
- package/src/modules/better-maps/styles/hunters.css +0 -191
- package/src/modules/better-maps/styles/invites.css +0 -50
- package/src/modules/better-maps/styles/map-ar.css +0 -95
- package/src/modules/better-maps/styles/mhct.css +0 -145
- package/src/modules/better-maps/styles/overlays.css +0 -15
- package/src/modules/better-maps/styles/rewards.css +0 -206
- package/src/modules/better-maps/styles/scroll-shop.css +0 -241
- package/src/modules/better-maps/styles/sidebar.css +0 -105
- package/src/modules/better-maps/styles/sorted-map.css +0 -11
- package/src/modules/better-maps/styles/sorted.css +0 -351
- package/src/modules/better-maps/styles/userscripts.css +0 -70
- package/src/modules/better-maps/utils.js +0 -82
- package/src/modules/better-marketplace/index.js +0 -669
- package/src/modules/better-marketplace/settings/index.js +0 -29
- package/src/modules/better-marketplace/styles/quick-sell.css +0 -27
- package/src/modules/better-marketplace/styles/small-images.css +0 -5
- package/src/modules/better-marketplace/styles/styles.css +0 -261
- package/src/modules/better-marketplace/styles/trend-numbers.css +0 -37
- package/src/modules/better-mice/index.js +0 -692
- package/src/modules/better-mice/modules/hover-mice/index.js +0 -236
- package/src/modules/better-mice/modules/hover-mice/styles.css +0 -101
- package/src/modules/better-mice/modules/mouse-page/index.js +0 -559
- package/src/modules/better-mice/modules/sidebar/index.js +0 -110
- package/src/modules/better-mice/modules/sidebar/styles.css +0 -43
- package/src/modules/better-mice/settings/index.js +0 -24
- package/src/modules/better-mice/styles.css +0 -409
- package/src/modules/better-quests/index.js +0 -519
- package/src/modules/better-quests/modules/m400/index.js +0 -139
- package/src/modules/better-quests/settings/index.js +0 -13
- package/src/modules/better-quests/styles.css +0 -223
- package/src/modules/better-send-supplies/index.js +0 -361
- package/src/modules/better-send-supplies/settings/index.js +0 -45
- package/src/modules/better-send-supplies/styles.css +0 -316
- package/src/modules/better-shops/index.js +0 -234
- package/src/modules/better-shops/modules/hide-max-owned/styles.css +0 -10
- package/src/modules/better-shops/modules/quantity-buttons/index.js +0 -56
- package/src/modules/better-shops/modules/quantity-buttons/styles.css +0 -38
- package/src/modules/better-shops/settings/index.js +0 -19
- package/src/modules/better-shops/styles/cost.css +0 -135
- package/src/modules/better-shops/styles/general.css +0 -701
- package/src/modules/better-shops/styles/order.css +0 -21
- package/src/modules/better-shops/styles/retired.css +0 -11
- package/src/modules/better-shops/styles/riftstalker.css +0 -48
- package/src/modules/better-shops/styles/stats.css +0 -71
- package/src/modules/better-tournaments/index.js +0 -282
- package/src/modules/better-tournaments/settings/index.js +0 -12
- package/src/modules/better-tournaments/styles.css +0 -773
- package/src/modules/better-travel/index.js +0 -868
- package/src/modules/better-travel/modules/reminders/index.js +0 -169
- package/src/modules/better-travel/modules/travel-window/index.js +0 -380
- package/src/modules/better-travel/modules/travel-window/styles.css +0 -142
- package/src/modules/better-travel/settings/index.js +0 -34
- package/src/modules/better-travel/styles/explore-map.css +0 -66
- package/src/modules/better-travel/styles/styles.css +0 -421
- package/src/modules/better-travel/styles/travel-menu-hiding.css +0 -4
- package/src/modules/better-travel/utils.js +0 -28
- package/src/modules/better-ui/index.js +0 -71
- package/src/modules/better-ui/modules/adventure-book/index.js +0 -28
- package/src/modules/better-ui/modules/codex-at-bottom/index.js +0 -24
- package/src/modules/better-ui/modules/egg-master/index.js +0 -51
- package/src/modules/better-ui/modules/friends/index.js +0 -141
- package/src/modules/better-ui/modules/hud/index.js +0 -108
- package/src/modules/better-ui/modules/kings-promo/index.js +0 -15
- package/src/modules/better-ui/modules/larger-codices/index.js +0 -10
- package/src/modules/better-ui/modules/larger-codices/styles.css +0 -57
- package/src/modules/better-ui/modules/larger-skin-images/index.js +0 -148
- package/src/modules/better-ui/modules/larger-skin-images/styles.css +0 -21
- package/src/modules/better-ui/modules/legacy-styles/index.js +0 -9
- package/src/modules/better-ui/modules/legacy-styles/styles.css +0 -20
- package/src/modules/better-ui/modules/maintenance/index.js +0 -49
- package/src/modules/better-ui/modules/random-skin-button/index.js +0 -58
- package/src/modules/better-ui/modules/random-skin-button/styles.css +0 -16
- package/src/modules/better-ui/modules/show-unowned-skins/index.js +0 -109
- package/src/modules/better-ui/modules/show-unowned-skins/styles.css +0 -7
- package/src/modules/better-ui/modules/skin-preview-base/index.js +0 -24
- package/src/modules/better-ui/modules/trap-gradient-background/index.js +0 -10
- package/src/modules/better-ui/modules/trap-gradient-background/styles.css +0 -10
- package/src/modules/better-ui/modules/userscripts-styles/index.js +0 -40
- package/src/modules/better-ui/modules/userscripts-styles/styles/any-trap-any-skin.css +0 -52
- package/src/modules/better-ui/modules/userscripts-styles/styles/favorite-setups.css +0 -4
- package/src/modules/better-ui/modules/userscripts-styles/styles/journal-historian.css +0 -14
- package/src/modules/better-ui/modules/userscripts-styles/styles/lgs-reminder.css +0 -16
- package/src/modules/better-ui/modules/userscripts-styles/styles/profile-plus.css +0 -172
- package/src/modules/better-ui/modules/userscripts-styles/styles/spring-egg-hunt-helper.css +0 -5
- package/src/modules/better-ui/modules/userscripts-styles/styles/tsitu-autoloader.css +0 -91
- package/src/modules/better-ui/modules/userscripts-styles/styles/tsitu-location-catch-stats.css +0 -166
- package/src/modules/better-ui/modules/userscripts-styles/styles/tsitu-qol.css +0 -21
- package/src/modules/better-ui/modules/userscripts-styles/styles/tsitu-supply-search.css +0 -33
- package/src/modules/better-ui/settings/index.js +0 -50
- package/src/modules/better-ui/styles/adventure.css +0 -380
- package/src/modules/better-ui/styles/buttons.css +0 -91
- package/src/modules/better-ui/styles/corkboard.css +0 -184
- package/src/modules/better-ui/styles/daily-draw.css +0 -203
- package/src/modules/better-ui/styles/events.css +0 -233
- package/src/modules/better-ui/styles/footer.css +0 -121
- package/src/modules/better-ui/styles/friends.css +0 -232
- package/src/modules/better-ui/styles/general.css +0 -525
- package/src/modules/better-ui/styles/gifts.css +0 -108
- package/src/modules/better-ui/styles/horn.css +0 -51
- package/src/modules/better-ui/styles/hud.css +0 -131
- package/src/modules/better-ui/styles/inbox.css +0 -278
- package/src/modules/better-ui/styles/le.css +0 -28
- package/src/modules/better-ui/styles/legacy.css +0 -25
- package/src/modules/better-ui/styles/login.css +0 -51
- package/src/modules/better-ui/styles/maintence.css +0 -49
- package/src/modules/better-ui/styles/mobile-camp.css +0 -36
- package/src/modules/better-ui/styles/news.css +0 -126
- package/src/modules/better-ui/styles/overlays.css +0 -274
- package/src/modules/better-ui/styles/profile.css +0 -795
- package/src/modules/better-ui/styles/ronza.css +0 -25
- package/src/modules/better-ui/styles/scoreboards.css +0 -50
- package/src/modules/better-ui/styles/scrambles.css +0 -84
- package/src/modules/better-ui/styles/select2.css +0 -47
- package/src/modules/better-ui/styles/settings.css +0 -22
- package/src/modules/better-ui/styles/sidebar.css +0 -15
- package/src/modules/better-ui/styles/skins.css +0 -4
- package/src/modules/better-ui/styles/tabs.css +0 -235
- package/src/modules/better-ui/styles/team.css +0 -177
- package/src/modules/better-ui/styles/timer.css +0 -14
- package/src/modules/better-ui/styles/trap-selector.css +0 -124
- package/src/modules/better-ui/styles/traps.css +0 -643
- package/src/modules/better-ui/styles/tutorial.css +0 -63
- package/src/modules/better-ui/styles/ui-page.css +0 -178
- package/src/modules/big-timer/index.js +0 -42
- package/src/modules/big-timer/legacy-styles.css +0 -19
- package/src/modules/big-timer/styles.css +0 -18
- package/src/modules/catch-rate-estimate/data.js +0 -458
- package/src/modules/catch-rate-estimate/index.js +0 -413
- package/src/modules/catch-rate-estimate/settings/index.js +0 -12
- package/src/modules/catch-rate-estimate/styles.css +0 -213
- package/src/modules/copy-id/index.js +0 -91
- package/src/modules/copy-id/settings/index.js +0 -13
- package/src/modules/copy-id/styles.css +0 -26
- package/src/modules/custom-background/index.js +0 -179
- package/src/modules/custom-background/settings/index.js +0 -60
- package/src/modules/custom-background/styles.css +0 -135
- package/src/modules/custom-camp-background/index.js +0 -83
- package/src/modules/custom-camp-background/settings/index.js +0 -52
- package/src/modules/custom-camp-background/styles.css +0 -57
- package/src/modules/custom-css/index.js +0 -50
- package/src/modules/custom-css/settings/index.js +0 -16
- package/src/modules/custom-horn/index.js +0 -244
- package/src/modules/custom-horn/settings/index.js +0 -60
- package/src/modules/custom-horn/styles.css +0 -107
- package/src/modules/custom-hud/index.js +0 -130
- package/src/modules/custom-hud/settings/index.js +0 -49
- package/src/modules/custom-hud/styles/blueprint.css +0 -13
- package/src/modules/custom-hud/styles/groovy-green.css +0 -6
- package/src/modules/custom-hud/styles/midnight.css +0 -23
- package/src/modules/custom-hud/styles/suede.css +0 -10
- package/src/modules/custom-shield/cotton-candy.css +0 -38
- package/src/modules/custom-shield/index.js +0 -267
- package/src/modules/custom-shield/settings/index.js +0 -156
- package/src/modules/custom-shield/styles.css +0 -423
- package/src/modules/dark-mode-tweaks/index.js +0 -69
- package/src/modules/dark-mode-tweaks/journal-entries.css +0 -17
- package/src/modules/dark-mode-tweaks/styles.css +0 -401
- package/src/modules/data-exporters/exporters/export-favorite-setups-userscript.js +0 -78
- package/src/modules/data-exporters/exporters/export-favorite-setups.js +0 -63
- package/src/modules/data-exporters/exporters/export-inventory.js +0 -115
- package/src/modules/data-exporters/exporters/export-journal-entries.js +0 -61
- package/src/modules/data-exporters/exporters/export-kings-crowns.js +0 -71
- package/src/modules/data-exporters/exporters/export-marketplace.js +0 -112
- package/src/modules/data-exporters/exporters/export-mice.js +0 -287
- package/src/modules/data-exporters/exporters/export-rankup-forecaster.js +0 -51
- package/src/modules/data-exporters/exporters/export-scoreboards.js +0 -100
- package/src/modules/data-exporters/index.js +0 -147
- package/src/modules/data-exporters/styles.css +0 -113
- package/src/modules/data-exporters/utils.js +0 -355
- package/src/modules/debug/index.js +0 -172
- package/src/modules/debug/settings/index.js +0 -53
- package/src/modules/delayed-menus/index.js +0 -19
- package/src/modules/delayed-menus/styles.css +0 -4
- package/src/modules/delayed-tooltips/index.js +0 -36
- package/src/modules/delayed-tooltips/styles.css +0 -12
- package/src/modules/emotes/emotes.json +0 -107
- package/src/modules/emotes/index.js +0 -53
- package/src/modules/emotes/styles.css +0 -3
- package/src/modules/error-reporting/index.js +0 -12
- package/src/modules/experiments/index.js +0 -134
- package/src/modules/experiments/modules/fabled-custom-title/index.js +0 -143
- package/src/modules/experiments/modules/fabled-max-title-progress-bar/index.js +0 -18
- package/src/modules/experiments/modules/fabled-max-title-progress-bar/styles.css +0 -8
- package/src/modules/experiments/modules/fabled-random-title/index.js +0 -814
- package/src/modules/experiments/modules/fabled-random-title/styles.css +0 -9
- package/src/modules/experiments/modules/full-mice-images-no-border/index.js +0 -22
- package/src/modules/experiments/modules/full-mice-images-no-border/styles.css +0 -26
- package/src/modules/experiments/modules/gift-button-opens-gift-selector/index.js +0 -31
- package/src/modules/experiments/modules/memory-game/index.js +0 -100
- package/src/modules/experiments/modules/real-base-stats/index.js +0 -100
- package/src/modules/experiments/modules/settings-options.css +0 -31
- package/src/modules/experiments/modules/sort-daily-draw-reverse/index.js +0 -68
- package/src/modules/experiments/modules/square-profile-pics/index.js +0 -17
- package/src/modules/experiments/modules/square-profile-pics/styles.css +0 -13
- package/src/modules/favorite-setups/index.js +0 -1431
- package/src/modules/favorite-setups/settings/index.js +0 -25
- package/src/modules/favorite-setups/styles.css +0 -471
- package/src/modules/feature-flags/index.js +0 -36
- package/src/modules/feature-flags/modules/fake-fabled.js +0 -7
- package/src/modules/feature-flags/modules/rank-up-forecaster.js +0 -198
- package/src/modules/feature-flags/modules/social.js +0 -37
- package/src/modules/feature-flags/settings/index.js +0 -16
- package/src/modules/fixes/index.js +0 -33
- package/src/modules/fixes/modules/item-page.js +0 -115
- package/src/modules/fixes/modules/marketplace-buy-button.js +0 -17
- package/src/modules/fixes/modules/passing-parcel.js +0 -84
- package/src/modules/fixes/modules/rift-tooltip-quantities.js +0 -30
- package/src/modules/fixes/styles/accessibility.css +0 -20
- package/src/modules/fixes/styles/backgrounds.css +0 -89
- package/src/modules/fixes/styles/bountiful-beanstalk.css +0 -4
- package/src/modules/fixes/styles/buttons.css +0 -3
- package/src/modules/fixes/styles/claim-gift.css +0 -4
- package/src/modules/fixes/styles/colors.css +0 -69
- package/src/modules/fixes/styles/convertibles.css +0 -9
- package/src/modules/fixes/styles/discord.css +0 -4
- package/src/modules/fixes/styles/dropdown.css +0 -23
- package/src/modules/fixes/styles/events.css +0 -3
- package/src/modules/fixes/styles/fb-img-size.css +0 -10
- package/src/modules/fixes/styles/font-sizes.css +0 -8
- package/src/modules/fixes/styles/footer.css +0 -5
- package/src/modules/fixes/styles/hud-shadow.css +0 -8
- package/src/modules/fixes/styles/hunter-title.css +0 -11
- package/src/modules/fixes/styles/image.css +0 -4
- package/src/modules/fixes/styles/labyrinth.css +0 -10
- package/src/modules/fixes/styles/location-names-overflow.css +0 -14
- package/src/modules/fixes/styles/maps.css +0 -15
- package/src/modules/fixes/styles/menu.css +0 -11
- package/src/modules/fixes/styles/news-back.css +0 -17
- package/src/modules/fixes/styles/other.css +0 -14
- package/src/modules/fixes/styles/preferences.css +0 -16
- package/src/modules/fixes/styles/queso.css +0 -4
- package/src/modules/fixes/styles/ronza.css +0 -5
- package/src/modules/fixes/styles/scoreboard.css +0 -5
- package/src/modules/fixes/styles/tabs.css +0 -38
- package/src/modules/fixes/styles/tem.css +0 -10
- package/src/modules/fixes/styles/tooltips.css +0 -24
- package/src/modules/fixes/styles/tutorial-overlay.css +0 -16
- package/src/modules/flrt-helper/index.js +0 -230
- package/src/modules/flrt-helper/styles.css +0 -235
- package/src/modules/global-styles/index.js +0 -21
- package/src/modules/global-styles/styles/animations.css +0 -194
- package/src/modules/global-styles/styles/blueprint.css +0 -11
- package/src/modules/global-styles/styles/buttons.css +0 -88
- package/src/modules/global-styles/styles/favorite-button.css +0 -30
- package/src/modules/global-styles/styles/game-info-bar.css +0 -11
- package/src/modules/global-styles/styles/general.css +0 -55
- package/src/modules/global-styles/styles/horn-message.css +0 -61
- package/src/modules/global-styles/styles/messages.css +0 -49
- package/src/modules/global-styles/styles/settings.css +0 -84
- package/src/modules/global-styles/styles/tooltips.css +0 -22
- package/src/modules/global-styles/styles/trap-qty.css +0 -45
- package/src/modules/global-styles/styles/utility.css +0 -39
- package/src/modules/hide-codices/index.js +0 -22
- package/src/modules/hide-codices/styles.css +0 -4
- package/src/modules/hide-daily-draw/index.js +0 -146
- package/src/modules/hide-daily-draw/styles.css +0 -3
- package/src/modules/hide-daily-reward-popup/index.js +0 -57
- package/src/modules/hide-footer/index.js +0 -37
- package/src/modules/hide-footer/styles.css +0 -10
- package/src/modules/hide-news-ticker/index.js +0 -21
- package/src/modules/hide-news-ticker/styles.css +0 -3
- package/src/modules/hide-share/index.js +0 -26
- package/src/modules/hide-share/styles.css +0 -29
- package/src/modules/hide-sidebar/index.js +0 -106
- package/src/modules/hide-sidebar/styles.css +0 -102
- package/src/modules/hover-profiles/index.js +0 -402
- package/src/modules/hover-profiles/styles.css +0 -247
- package/src/modules/image-upscaling/index.js +0 -375
- package/src/modules/image-upscaling/styles.css +0 -265
- package/src/modules/image-upscaling/views.css +0 -270
- package/src/modules/inline-wiki/index.js +0 -111
- package/src/modules/inline-wiki/styles.css +0 -9
- package/src/modules/inventory-buttons/index.js +0 -163
- package/src/modules/inventory-buttons/settings/index.js +0 -29
- package/src/modules/inventory-buttons/styles/only-open-multiple.css +0 -20
- package/src/modules/inventory-lock-and-hide/index.js +0 -641
- package/src/modules/inventory-lock-and-hide/styles.css +0 -139
- package/src/modules/journal-changer/index.js +0 -321
- package/src/modules/journal-changer/settings/index.js +0 -19
- package/src/modules/journal-changer/styles.css +0 -21
- package/src/modules/journal-privacy/index.js +0 -219
- package/src/modules/journal-privacy/settings/index.js +0 -19
- package/src/modules/journal-privacy/styles/icon.css +0 -31
- package/src/modules/journal-privacy/styles/styles.css +0 -30
- package/src/modules/journal-privacy/styles/transparent.css +0 -30
- package/src/modules/keyboard-shortcuts/actions.js +0 -213
- package/src/modules/keyboard-shortcuts/index.js +0 -521
- package/src/modules/keyboard-shortcuts/styles.css +0 -110
- package/src/modules/legacy-hud/index.js +0 -314
- package/src/modules/legacy-hud/settings/index.js +0 -24
- package/src/modules/legacy-hud/styles/menu.css +0 -19
- package/src/modules/legacy-hud/styles/stats.css +0 -18
- package/src/modules/legacy-hud/styles/styles.css +0 -3
- package/src/modules/legacy-hud/styles/tweaks.css +0 -60
- package/src/modules/lgs-reminder/index.js +0 -229
- package/src/modules/lgs-reminder/settings/index.js +0 -17
- package/src/modules/lgs-reminder/styles.css +0 -85
- package/src/modules/links/index.js +0 -69
- package/src/modules/location-catch-stats/crown-colored-rows.css +0 -47
- package/src/modules/location-catch-stats/index.js +0 -234
- package/src/modules/location-catch-stats/settings/index.js +0 -17
- package/src/modules/location-catch-stats/styles.css +0 -125
- package/src/modules/location-dashboard/index.js +0 -536
- package/src/modules/location-dashboard/locations/afterword-acres.js +0 -18
- package/src/modules/location-dashboard/locations/ancient-city.js +0 -23
- package/src/modules/location-dashboard/locations/bountiful-beanstalk.js +0 -51
- package/src/modules/location-dashboard/locations/desert-oasis.js +0 -22
- package/src/modules/location-dashboard/locations/desert-warpath.js +0 -58
- package/src/modules/location-dashboard/locations/draconic-depths.js +0 -52
- package/src/modules/location-dashboard/locations/epilogue-falls.js +0 -40
- package/src/modules/location-dashboard/locations/floating-islands.js +0 -74
- package/src/modules/location-dashboard/locations/foreword-farm.js +0 -45
- package/src/modules/location-dashboard/locations/fort-rox.js +0 -39
- package/src/modules/location-dashboard/locations/iceberg.js +0 -16
- package/src/modules/location-dashboard/locations/labyrinth.js +0 -38
- package/src/modules/location-dashboard/locations/lost-city.js +0 -28
- package/src/modules/location-dashboard/locations/mousoleum.js +0 -20
- package/src/modules/location-dashboard/locations/moussu-picchu.js +0 -29
- package/src/modules/location-dashboard/locations/pollution-outbreak.js +0 -18
- package/src/modules/location-dashboard/locations/queso-geyser.js +0 -16
- package/src/modules/location-dashboard/locations/rift-bristle-woods.js +0 -28
- package/src/modules/location-dashboard/locations/rift-burroughs.js +0 -14
- package/src/modules/location-dashboard/locations/rift-furoma.js +0 -50
- package/src/modules/location-dashboard/locations/rift-valour.js +0 -30
- package/src/modules/location-dashboard/locations/sand-dunes.js +0 -21
- package/src/modules/location-dashboard/locations/school-of-sorcery.js +0 -29
- package/src/modules/location-dashboard/locations/seasonal-garden.js +0 -46
- package/src/modules/location-dashboard/locations/sunken-city.js +0 -25
- package/src/modules/location-dashboard/locations/table-of-contents.js +0 -20
- package/src/modules/location-dashboard/locations/whisker-woods-rift.js +0 -15
- package/src/modules/location-dashboard/locations/zugzwang-tower.js +0 -81
- package/src/modules/location-dashboard/styles.css +0 -389
- package/src/modules/location-huds/index.js +0 -261
- package/src/modules/location-huds/locations/acolyte-realm/index.js +0 -13
- package/src/modules/location-huds/locations/afterword-acres/index.js +0 -14
- package/src/modules/location-huds/locations/afterword-acres/styles.css +0 -21
- package/src/modules/location-huds/locations/ancient-city/index.js +0 -197
- package/src/modules/location-huds/locations/ancient-city/styles.css +0 -251
- package/src/modules/location-huds/locations/balacks-cove/index.js +0 -81
- package/src/modules/location-huds/locations/balacks-cove/styles.css +0 -12
- package/src/modules/location-huds/locations/bazaar/index.js +0 -8
- package/src/modules/location-huds/locations/bountiful-beanstalk/index.js +0 -309
- package/src/modules/location-huds/locations/bountiful-beanstalk/small-inv.css +0 -34
- package/src/modules/location-huds/locations/bountiful-beanstalk/styles.css +0 -608
- package/src/modules/location-huds/locations/calm-clearing/index.js +0 -8
- package/src/modules/location-huds/locations/cape-clawed/index.js +0 -12
- package/src/modules/location-huds/locations/catacombs/index.js +0 -17
- package/src/modules/location-huds/locations/claw-shot-city/index.js +0 -10
- package/src/modules/location-huds/locations/claw-shot-city/styles.css +0 -5
- package/src/modules/location-huds/locations/conclusion-cliffs/index.js +0 -14
- package/src/modules/location-huds/locations/conclusion-cliffs/styles.css +0 -114
- package/src/modules/location-huds/locations/derr-dunes/index.js +0 -8
- package/src/modules/location-huds/locations/desert-city/index.js +0 -10
- package/src/modules/location-huds/locations/desert-city/styles.css +0 -13
- package/src/modules/location-huds/locations/desert-warpath/index.js +0 -212
- package/src/modules/location-huds/locations/desert-warpath/styles.css +0 -273
- package/src/modules/location-huds/locations/dojo/index.js +0 -8
- package/src/modules/location-huds/locations/dracano/index.js +0 -8
- package/src/modules/location-huds/locations/draconic-depths/index.js +0 -143
- package/src/modules/location-huds/locations/draconic-depths/styles.css +0 -222
- package/src/modules/location-huds/locations/elub-shore/index.js +0 -8
- package/src/modules/location-huds/locations/epilogue-falls/index.js +0 -101
- package/src/modules/location-huds/locations/epilogue-falls/styles.css +0 -312
- package/src/modules/location-huds/locations/event-locations/birthday/index.js +0 -88
- package/src/modules/location-huds/locations/event-locations/birthday/styles.css +0 -341
- package/src/modules/location-huds/locations/event-locations/great-winter-hunt/global.css +0 -251
- package/src/modules/location-huds/locations/event-locations/great-winter-hunt/index.js +0 -425
- package/src/modules/location-huds/locations/event-locations/great-winter-hunt/styles.css +0 -887
- package/src/modules/location-huds/locations/event-locations/halloween/index.js +0 -45
- package/src/modules/location-huds/locations/event-locations/halloween/spooky-shuffle-tracker/index.js +0 -118
- package/src/modules/location-huds/locations/event-locations/halloween/spooky-shuffle-tracker/styles.css +0 -33
- package/src/modules/location-huds/locations/event-locations/halloween/styles.css +0 -605
- package/src/modules/location-huds/locations/event-locations/index.js +0 -54
- package/src/modules/location-huds/locations/event-locations/lunar-new-year/index.js +0 -176
- package/src/modules/location-huds/locations/event-locations/lunar-new-year/styles.css +0 -263
- package/src/modules/location-huds/locations/event-locations/ronza/index.js +0 -111
- package/src/modules/location-huds/locations/event-locations/ronza/styles.css +0 -144
- package/src/modules/location-huds/locations/event-locations/shared.js +0 -67
- package/src/modules/location-huds/locations/event-locations/spring-egg-hunt/index.js +0 -128
- package/src/modules/location-huds/locations/event-locations/spring-egg-hunt/styles.css +0 -196
- package/src/modules/location-huds/locations/floating-islands/index.js +0 -552
- package/src/modules/location-huds/locations/floating-islands/styles.css +0 -792
- package/src/modules/location-huds/locations/forbidden-grove/index.js +0 -75
- package/src/modules/location-huds/locations/forbidden-grove/styles.css +0 -16
- package/src/modules/location-huds/locations/foreword-farm/index.js +0 -84
- package/src/modules/location-huds/locations/foreword-farm/styles.css +0 -376
- package/src/modules/location-huds/locations/fort-rox/index.js +0 -249
- package/src/modules/location-huds/locations/fort-rox/styles.css +0 -257
- package/src/modules/location-huds/locations/fungal-cavern/index.js +0 -10
- package/src/modules/location-huds/locations/fungal-cavern/styles.css +0 -77
- package/src/modules/location-huds/locations/great-gnarled-tree/index.js +0 -8
- package/src/modules/location-huds/locations/harbour/index.js +0 -10
- package/src/modules/location-huds/locations/harbour/styles.css +0 -32
- package/src/modules/location-huds/locations/iceberg/index.js +0 -469
- package/src/modules/location-huds/locations/iceberg/styles/bob-iceberg.css +0 -57
- package/src/modules/location-huds/locations/iceberg/styles/styles.css +0 -329
- package/src/modules/location-huds/locations/jungle-of-dread/index.js +0 -17
- package/src/modules/location-huds/locations/kings-arms/index.js +0 -8
- package/src/modules/location-huds/locations/kings-gauntlet/index.js +0 -17
- package/src/modules/location-huds/locations/laboratory/index.js +0 -10
- package/src/modules/location-huds/locations/laboratory/styles.css +0 -41
- package/src/modules/location-huds/locations/labyrinth/index.js +0 -315
- package/src/modules/location-huds/locations/labyrinth/styles.css +0 -547
- package/src/modules/location-huds/locations/lagoon/index.js +0 -8
- package/src/modules/location-huds/locations/meditation-room/index.js +0 -12
- package/src/modules/location-huds/locations/mountain/index.js +0 -10
- package/src/modules/location-huds/locations/mountain/styles.css +0 -259
- package/src/modules/location-huds/locations/mousoleum/index.js +0 -17
- package/src/modules/location-huds/locations/mousoleum/styles.css +0 -21
- package/src/modules/location-huds/locations/moussu-picchu/index.js +0 -10
- package/src/modules/location-huds/locations/moussu-picchu/styles.css +0 -243
- package/src/modules/location-huds/locations/nerg-plains/index.js +0 -8
- package/src/modules/location-huds/locations/pinnacle-chamber/index.js +0 -11
- package/src/modules/location-huds/locations/pollution-outbreak/index.js +0 -32
- package/src/modules/location-huds/locations/pollution-outbreak/styles.css +0 -516
- package/src/modules/location-huds/locations/prologue-pond/index.js +0 -64
- package/src/modules/location-huds/locations/prologue-pond/styles.css +0 -138
- package/src/modules/location-huds/locations/region-living-garden/index.js +0 -36
- package/src/modules/location-huds/locations/region-living-garden/styles.css +0 -316
- package/src/modules/location-huds/locations/region-queso/index.js +0 -10
- package/src/modules/location-huds/locations/region-queso/styles.css +0 -366
- package/src/modules/location-huds/locations/rift-bristle-woods/index.js +0 -29
- package/src/modules/location-huds/locations/rift-bristle-woods/styles.css +0 -268
- package/src/modules/location-huds/locations/rift-burroughs/index.js +0 -157
- package/src/modules/location-huds/locations/rift-burroughs/styles.css +0 -272
- package/src/modules/location-huds/locations/rift-furoma/index.js +0 -79
- package/src/modules/location-huds/locations/rift-furoma/styles.css +0 -233
- package/src/modules/location-huds/locations/rift-gnawnia/index.js +0 -10
- package/src/modules/location-huds/locations/rift-gnawnia/styles.css +0 -83
- package/src/modules/location-huds/locations/rift-valour/flipped-avatar.css +0 -15
- package/src/modules/location-huds/locations/rift-valour/index.js +0 -271
- package/src/modules/location-huds/locations/rift-valour/simulator.js +0 -559
- package/src/modules/location-huds/locations/rift-valour/styles.css +0 -644
- package/src/modules/location-huds/locations/rift-whisker-woods/index.js +0 -86
- package/src/modules/location-huds/locations/rift-whisker-woods/styles.css +0 -214
- package/src/modules/location-huds/locations/school-of-sorcery/clean-chalkboard.css +0 -11
- package/src/modules/location-huds/locations/school-of-sorcery/index.js +0 -109
- package/src/modules/location-huds/locations/school-of-sorcery/styles.css +0 -460
- package/src/modules/location-huds/locations/seasonal-garden/index.js +0 -71
- package/src/modules/location-huds/locations/seasonal-garden/styles.css +0 -132
- package/src/modules/location-huds/locations/slushy-shoreline/index.js +0 -8
- package/src/modules/location-huds/locations/ss-huntington-ii/index.js +0 -8
- package/src/modules/location-huds/locations/sunken-city/index.js +0 -177
- package/src/modules/location-huds/locations/sunken-city/styles.css +0 -196
- package/src/modules/location-huds/locations/table-of-contents/index.js +0 -389
- package/src/modules/location-huds/locations/table-of-contents/simulator-styles.css +0 -240
- package/src/modules/location-huds/locations/table-of-contents/simulator.js +0 -276
- package/src/modules/location-huds/locations/table-of-contents/styles.css +0 -403
- package/src/modules/location-huds/locations/tournament-hall/index.js +0 -8
- package/src/modules/location-huds/locations/town-of-digby/index.js +0 -8
- package/src/modules/location-huds/locations/town-of-gnawnia/index.js +0 -10
- package/src/modules/location-huds/locations/town-of-gnawnia/styles.css +0 -48
- package/src/modules/location-huds/locations/train-station/index.js +0 -10
- package/src/modules/location-huds/locations/train-station/styles.css +0 -31
- package/src/modules/location-huds/locations/windmill/index.js +0 -53
- package/src/modules/location-huds/locations/windmill/styles.css +0 -73
- package/src/modules/location-huds/locations/zugzwang-tower/index.js +0 -10
- package/src/modules/location-huds/locations/zugzwang-tower/styles.css +0 -54
- package/src/modules/location-huds/settings.js +0 -124
- package/src/modules/location-huds/shared/cheese-selectors/index.js +0 -143
- package/src/modules/location-huds/shared/crafting-buttons/index.js +0 -133
- package/src/modules/location-huds/shared/crafting-buttons/styles.css +0 -51
- package/src/modules/location-huds/shared/folklore-forest/index.js +0 -261
- package/src/modules/location-huds/shared/folklore-forest/keep-inventory-open.js +0 -77
- package/src/modules/location-huds/shared/folklore-forest/styles.css +0 -394
- package/src/modules/location-huds/styles.css +0 -61
- package/src/modules/location-huds/toggle-icon.js +0 -74
- package/src/modules/metric/index.js +0 -114
- package/src/modules/native-dark-mode/index.js +0 -79
- package/src/modules/native-dark-mode/settings/index.js +0 -15
- package/src/modules/native-dark-mode/styles/_root.css +0 -42
- package/src/modules/native-dark-mode/styles/adventure.css +0 -95
- package/src/modules/native-dark-mode/styles/camp-tabs.css +0 -113
- package/src/modules/native-dark-mode/styles/camp-trap.css +0 -420
- package/src/modules/native-dark-mode/styles/conflict-popup.css +0 -39
- package/src/modules/native-dark-mode/styles/events.css +0 -7
- package/src/modules/native-dark-mode/styles/favorite-setups.css +0 -12
- package/src/modules/native-dark-mode/styles/friends.css +0 -210
- package/src/modules/native-dark-mode/styles/general.css +0 -231
- package/src/modules/native-dark-mode/styles/gifts.css +0 -243
- package/src/modules/native-dark-mode/styles/header-dropdown.css +0 -62
- package/src/modules/native-dark-mode/styles/header.css +0 -100
- package/src/modules/native-dark-mode/styles/hover-items.css +0 -30
- package/src/modules/native-dark-mode/styles/inbox.css +0 -85
- package/src/modules/native-dark-mode/styles/inventory.css +0 -271
- package/src/modules/native-dark-mode/styles/item-view.css +0 -42
- package/src/modules/native-dark-mode/styles/journal-main.css +0 -115
- package/src/modules/native-dark-mode/styles/journal-misc-entries.css +0 -118
- package/src/modules/native-dark-mode/styles/journal-preview.css +0 -37
- package/src/modules/native-dark-mode/styles/kings-calibrator.css +0 -53
- package/src/modules/native-dark-mode/styles/loading.css +0 -58
- package/src/modules/native-dark-mode/styles/location-catch-stats.css +0 -31
- package/src/modules/native-dark-mode/styles/maps.css +0 -597
- package/src/modules/native-dark-mode/styles/markethunt.css +0 -41
- package/src/modules/native-dark-mode/styles/marketplace.css +0 -278
- package/src/modules/native-dark-mode/styles/mice-images.css +0 -10
- package/src/modules/native-dark-mode/styles/mice.css +0 -262
- package/src/modules/native-dark-mode/styles/mouse-view.css +0 -44
- package/src/modules/native-dark-mode/styles/news.css +0 -40
- package/src/modules/native-dark-mode/styles/overlays.css +0 -227
- package/src/modules/native-dark-mode/styles/page.css +0 -13
- package/src/modules/native-dark-mode/styles/premium.css +0 -7
- package/src/modules/native-dark-mode/styles/profile.css +0 -243
- package/src/modules/native-dark-mode/styles/progress-log.css +0 -25
- package/src/modules/native-dark-mode/styles/quests.css +0 -29
- package/src/modules/native-dark-mode/styles/scoreboards.css +0 -66
- package/src/modules/native-dark-mode/styles/select2.css +0 -65
- package/src/modules/native-dark-mode/styles/send-supplies.css +0 -88
- package/src/modules/native-dark-mode/styles/settings.css +0 -172
- package/src/modules/native-dark-mode/styles/shops.css +0 -114
- package/src/modules/native-dark-mode/styles/sidebar.css +0 -56
- package/src/modules/native-dark-mode/styles/tabs.css +0 -17
- package/src/modules/native-dark-mode/styles/team.css +0 -58
- package/src/modules/native-dark-mode/styles/travel.css +0 -102
- package/src/modules/native-dark-mode/styles/userscripts.css +0 -38
- package/src/modules/onboarding/index.js +0 -44
- package/src/modules/onboarding/styles.css +0 -13
- package/src/modules/paste-hunter-id/index.js +0 -82
- package/src/modules/prestige-base-stats/index.js +0 -242
- package/src/modules/printing-press-paper-counter/index.js +0 -24
- package/src/modules/quick-filters-and-sort/index.js +0 -280
- package/src/modules/quick-filters-and-sort/styles.css +0 -146
- package/src/modules/quick-send-supplies/index.js +0 -358
- package/src/modules/quick-send-supplies/settings/index.js +0 -40
- package/src/modules/quick-send-supplies/styles.css +0 -185
- package/src/modules/replace-favicon/index.js +0 -51
- package/src/modules/required/global-utils.js +0 -9
- package/src/modules/required/index.js +0 -251
- package/src/modules/scoreboard-search-on-profiles/index.js +0 -161
- package/src/modules/scoreboard-search-on-profiles/styles.css +0 -25
- package/src/modules/settings/icons.css +0 -233
- package/src/modules/settings/index.js +0 -653
- package/src/modules/settings/settings/index.js +0 -16
- package/src/modules/settings/styles.css +0 -635
- package/src/modules/shield-goes-to-camp/index.js +0 -31
- package/src/modules/show-adventure-book/index.js +0 -31
- package/src/modules/show-adventure-book/styles.css +0 -6
- package/src/modules/show-auras/index.js +0 -252
- package/src/modules/show-auras/settings/index.js +0 -19
- package/src/modules/show-auras/styles/grid.css +0 -48
- package/src/modules/show-auras/styles/icons.css +0 -22
- package/src/modules/show-auras/styles/list.css +0 -49
- package/src/modules/show-auras/styles/styles.css +0 -23
- package/src/modules/ssdb-toothlet-counter/index.js +0 -24
- package/src/modules/taller-windows/index.js +0 -22
- package/src/modules/taller-windows/styles.css +0 -137
- package/src/modules/tem-crowns/index.js +0 -127
- package/src/modules/tem-crowns/styles.css +0 -106
- package/src/modules/trap-selector-special-effects/index.js +0 -75
- package/src/modules/ultimate-checkmark/index.js +0 -391
- package/src/modules/ultimate-checkmark/settings/index.js +0 -40
- package/src/modules/ultimate-checkmark/styles.css +0 -12
- package/src/modules/unique-loot-count/index.js +0 -59
- package/src/modules/unique-loot-count/styles.css +0 -3
- package/src/modules/update-notifications/index.js +0 -95
- package/src/modules/update-notifications/styles.css +0 -181
- package/src/modules/user-highlighting/index.js +0 -130
- package/src/modules/user-highlighting/profile.css +0 -374
- package/src/modules/user-highlighting/styles.css +0 -34
- package/src/modules/wisdom-in-stat-bar/index.js +0 -170
- package/src/modules/wisdom-in-stat-bar/settings/index.js +0 -12
- package/src/modules/wisdom-in-stat-bar/styles.css +0 -3
- package/src/updates/index.js +0 -168
- package/src/updates/versions/.gitkeep +0 -0
- package/src/updates/versions/0.93.0.js +0 -39
- package/src/updates/versions/0.93.3.js +0 -8
- package/src/updates/versions/0.94.0.js +0 -8
- package/src/utils/blueprint.js +0 -74
- package/src/utils/data.js +0 -559
- package/src/utils/db.js +0 -206
- package/src/utils/debug.js +0 -72
- package/src/utils/draggable.js +0 -141
- package/src/utils/elements.js +0 -650
- package/src/utils/event-registry.js +0 -102
- package/src/utils/events.js +0 -698
- package/src/utils/flags.js +0 -39
- package/src/utils/global.js +0 -37
- package/src/utils/horn.js +0 -187
- package/src/utils/humanizer.js +0 -62
- package/src/utils/index.js +0 -28
- package/src/utils/journal.js +0 -222
- package/src/utils/json.js +0 -32
- package/src/utils/links.js +0 -343
- package/src/utils/location-current.js +0 -23
- package/src/utils/location.js +0 -70
- package/src/utils/maps.js +0 -699
- package/src/utils/messages.js +0 -255
- package/src/utils/onboarding.js +0 -102
- package/src/utils/page-current.js +0 -26
- package/src/utils/page.js +0 -155
- package/src/utils/settings-markup.js +0 -907
- package/src/utils/settings.js +0 -260
- package/src/utils/shared/fiery-warpath.js +0 -88
- package/src/utils/shared/memory-game.js +0 -231
- package/src/utils/shared/trap-quantity.js +0 -232
- package/src/utils/styles/errors.css +0 -50
- package/src/utils/styles/memory-game.css +0 -227
- package/src/utils/styles/page-error.css +0 -145
- package/src/utils/styles/page-maintenance.css +0 -150
- package/src/utils/styles.js +0 -209
- package/src/utils/templates.js +0 -170
- package/src/utils/user.js +0 -375
- package/src/utils/utils.js +0 -534
|
@@ -1,1431 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
addIconToMenu,
|
|
3
|
-
addStyles,
|
|
4
|
-
cacheGet,
|
|
5
|
-
cacheSet,
|
|
6
|
-
createPopup,
|
|
7
|
-
debuglog,
|
|
8
|
-
doRequest,
|
|
9
|
-
getCurrentLocation,
|
|
10
|
-
getCurrentPage,
|
|
11
|
-
getData,
|
|
12
|
-
getFlag,
|
|
13
|
-
getHeaders,
|
|
14
|
-
getSetting,
|
|
15
|
-
getUserData,
|
|
16
|
-
makeElement,
|
|
17
|
-
makeMhButton,
|
|
18
|
-
onEvent,
|
|
19
|
-
onNavigation,
|
|
20
|
-
saveSetting,
|
|
21
|
-
sessionGet,
|
|
22
|
-
sessionSet,
|
|
23
|
-
toggleBlueprint
|
|
24
|
-
} from '@utils';
|
|
25
|
-
|
|
26
|
-
import styles from './styles.css';
|
|
27
|
-
|
|
28
|
-
import settings from './settings';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @typedef {Object} FavoriteSetup
|
|
32
|
-
* @property {string} id The setup ID.
|
|
33
|
-
* @property {string | null} name The name of the setup.
|
|
34
|
-
* @property {string | null} bait_id The bait item ID.
|
|
35
|
-
* @property {string | null} base_id The base item ID.
|
|
36
|
-
* @property {string | null} weapon_id The weapon item ID.
|
|
37
|
-
* @property {string | null} trinket_id The trinket item ID.
|
|
38
|
-
* @property {string | null} power_type The power type of the setup.
|
|
39
|
-
* @property {string | undefined} location The location of the setup.
|
|
40
|
-
* @property {boolean | undefined} is_mobile Whether the setup is a mobile setup.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Get the favorite setups.
|
|
45
|
-
*
|
|
46
|
-
* @param {boolean} makeRequest Whether to make a request to get the favorite setups.
|
|
47
|
-
*
|
|
48
|
-
* @return {Promise<FavoriteSetup[]>} The favorite setups.
|
|
49
|
-
*/
|
|
50
|
-
const getFavoriteSetups = async (makeRequest = true) => {
|
|
51
|
-
/** @type {FavoriteSetup[]} */
|
|
52
|
-
let faves = getSetting('favorite-setups.setups', []);
|
|
53
|
-
|
|
54
|
-
if (getSetting('favorite-setups.show-mobile-favorites', false)) {
|
|
55
|
-
let mobileFavorites = await cacheGet('mobile-trap-favorites');
|
|
56
|
-
if (! mobileFavorites && makeRequest) {
|
|
57
|
-
const userData = await getUserData(['trap_favourite']);
|
|
58
|
-
mobileFavorites = userData?.trap_favourite?.favourite_traps || [];
|
|
59
|
-
|
|
60
|
-
await cacheSet('mobile-trap-favorites', mobileFavorites, 24 * 60 * 60 * 1000); // Cache for 1 day.
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (mobileFavorites?.length) {
|
|
64
|
-
/** @type {FavoriteSetup[]} */
|
|
65
|
-
const newFaves = [];
|
|
66
|
-
for (const [slot, favorite] of mobileFavorites.entries()) {
|
|
67
|
-
/** @type {FavoriteSetup} */
|
|
68
|
-
const newFavorite = {
|
|
69
|
-
id: `mobile-${slot}`,
|
|
70
|
-
name: favorite?.name,
|
|
71
|
-
bait_id: favorite?.bait_id,
|
|
72
|
-
base_id: favorite?.base_id,
|
|
73
|
-
weapon_id: favorite?.weapon_id,
|
|
74
|
-
trinket_id: favorite?.trinket_id,
|
|
75
|
-
power_type: null, // TODO: add this.
|
|
76
|
-
is_mobile: true,
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// Remove any existing mobile setups.
|
|
80
|
-
faves = faves.filter((s) => ! s?.is_mobile || (s?.is_mobile && ! s.id.startsWith('mobile-')));
|
|
81
|
-
|
|
82
|
-
// Check if the setup already exists.
|
|
83
|
-
const existingSetup = faves.find((s) => {
|
|
84
|
-
return s?.id === newFavorite.id;
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
if (! existingSetup) {
|
|
88
|
-
newFaves.push(newFavorite);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
faves = [...faves, ...newFaves];
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (! faves || ! Array.isArray(faves) || ! faves.length) {
|
|
97
|
-
return [];
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// remove any that are just null.
|
|
101
|
-
return faves.filter(Boolean);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Generate a name for the setup.
|
|
106
|
-
*
|
|
107
|
-
* @param {Object} setup The setup to generate a name for.
|
|
108
|
-
*
|
|
109
|
-
* @return {Promise<string>} The generated name.
|
|
110
|
-
*/
|
|
111
|
-
const getGeneratedName = async (setup) => {
|
|
112
|
-
if (! getSetting('favorite-setups.use-generated-names', true)) {
|
|
113
|
-
return {
|
|
114
|
-
name: user.environment_name || 'Unnamed Setup',
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const response = await fetch('https://setup-namer.mouse.rip', {
|
|
119
|
-
method: 'POST',
|
|
120
|
-
headers: getHeaders(),
|
|
121
|
-
body: JSON.stringify({
|
|
122
|
-
location: setup.location || getCurrentLocation(),
|
|
123
|
-
power_type: getPowerTypeId(setup.power_type || user.trap_power_type_name.toLowerCase()),
|
|
124
|
-
id: setup.id,
|
|
125
|
-
bait: setup.bait_id,
|
|
126
|
-
base: setup.base_id,
|
|
127
|
-
weapon: setup.weapon_id,
|
|
128
|
-
trinket: setup.trinket_id,
|
|
129
|
-
}),
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
return await response.json();
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Save a favorite setup.
|
|
137
|
-
*
|
|
138
|
-
* @param {FavoriteSetup} setup The setup to save.
|
|
139
|
-
* @param {boolean} useGeneratedName Whether to use a generated name for the setup.
|
|
140
|
-
*
|
|
141
|
-
* @return {Promise<FavoriteSetup>} The saved setup.
|
|
142
|
-
*/
|
|
143
|
-
const saveFavoriteSetup = async (setup, useGeneratedName = true) => {
|
|
144
|
-
let setups = await getFavoriteSetups();
|
|
145
|
-
|
|
146
|
-
if (! setups.length) {
|
|
147
|
-
setups = [];
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const normalizedSetup = normalizeSetup(setup);
|
|
151
|
-
|
|
152
|
-
// Set a temporary name first
|
|
153
|
-
if (getSetting('favorite-setups.use-generated-names', true) && useGeneratedName) {
|
|
154
|
-
normalizedSetup.name = useGeneratedName ? 'Generating name...' : user.environment_name;
|
|
155
|
-
} else {
|
|
156
|
-
normalizedSetup.name = user.environment_name;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if (setup.id) {
|
|
160
|
-
normalizedSetup.id = setup.id;
|
|
161
|
-
// replace the setup in the list.
|
|
162
|
-
const index = setups.findIndex((s) => s?.id && (s.id === setup.id));
|
|
163
|
-
if (-1 === index) {
|
|
164
|
-
setups.push(normalizedSetup);
|
|
165
|
-
} else {
|
|
166
|
-
setups[index] = normalizedSetup;
|
|
167
|
-
}
|
|
168
|
-
} else {
|
|
169
|
-
try {
|
|
170
|
-
setups.push(normalizedSetup);
|
|
171
|
-
} catch {
|
|
172
|
-
setups = [normalizedSetup];
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
setups = removeMobileSetups(setups);
|
|
177
|
-
|
|
178
|
-
saveSetting('favorite-setups.setups', setups);
|
|
179
|
-
|
|
180
|
-
// Generate name asynchronously if requested
|
|
181
|
-
if (useGeneratedName) {
|
|
182
|
-
getGeneratedName(normalizedSetup).then((setupNameData) => {
|
|
183
|
-
if (setupNameData && setupNameData.name) {
|
|
184
|
-
// Update the setup with the generated name
|
|
185
|
-
normalizedSetup.name = setupNameData.name;
|
|
186
|
-
|
|
187
|
-
// Update the saved setups
|
|
188
|
-
const updatedSetups = getSetting('favorite-setups.setups', []);
|
|
189
|
-
const setupIndex = updatedSetups.findIndex((s) => s?.id === normalizedSetup.id);
|
|
190
|
-
if (setupIndex !== -1) {
|
|
191
|
-
updatedSetups[setupIndex] = normalizedSetup;
|
|
192
|
-
saveSetting('favorite-setups.setups', updatedSetups);
|
|
193
|
-
|
|
194
|
-
// Update the UI if the container is visible
|
|
195
|
-
const container = document.querySelector('.mh-improved-favorite-setups-blueprint-container');
|
|
196
|
-
if (container) {
|
|
197
|
-
// Find and update the specific setup row
|
|
198
|
-
const setupRow = container.querySelector(`[data-setup-id="${normalizedSetup.id}"]`);
|
|
199
|
-
if (setupRow) {
|
|
200
|
-
const label = setupRow.querySelector('.label');
|
|
201
|
-
if (label && ! setupRow.classList.contains('editing')) {
|
|
202
|
-
label.textContent = normalizedSetup.name;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
updateFavoriteSetupName();
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}).catch(() => {
|
|
211
|
-
// Fallback to location name if generation fails
|
|
212
|
-
normalizedSetup.name = setup.location || getCurrentLocation() || 'Unnamed Setup';
|
|
213
|
-
|
|
214
|
-
const updatedSetups = getSetting('favorite-setups.setups', []);
|
|
215
|
-
const setupIndex = updatedSetups.findIndex((s) => s?.id === normalizedSetup.id);
|
|
216
|
-
if (setupIndex !== -1) {
|
|
217
|
-
updatedSetups[setupIndex] = normalizedSetup;
|
|
218
|
-
saveSetting('favorite-setups.setups', updatedSetups);
|
|
219
|
-
|
|
220
|
-
// Update the UI
|
|
221
|
-
const container = document.querySelector('.mh-improved-favorite-setups-blueprint-container');
|
|
222
|
-
if (container) {
|
|
223
|
-
const setupRow = container.querySelector(`[data-setup-id="${normalizedSetup.id}"]`);
|
|
224
|
-
if (setupRow) {
|
|
225
|
-
const label = setupRow.querySelector('.label');
|
|
226
|
-
if (label && ! setupRow.classList.contains('editing')) {
|
|
227
|
-
label.textContent = normalizedSetup.name;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
return normalizedSetup;
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Filters out mobile setups from the array.
|
|
240
|
-
* @param {FavoriteSetup[]} setups The setups to filter.
|
|
241
|
-
* @return {FavoriteSetup[]} The setups without mobile setups.
|
|
242
|
-
*/
|
|
243
|
-
const removeMobileSetups = (setups) => {
|
|
244
|
-
return setups.filter((s) => ! s ||
|
|
245
|
-
! s?.is_mobile ||
|
|
246
|
-
(s?.is_mobile && ! s.id.startsWith('mobile-')));
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Normalize the setup by forcing everything to be a string.
|
|
251
|
-
*
|
|
252
|
-
* @param {Object} setup The setup to normalize.
|
|
253
|
-
*
|
|
254
|
-
* @return {Object} The normalized setup.
|
|
255
|
-
*/
|
|
256
|
-
const normalizeSetup = (setup) => {
|
|
257
|
-
return Object.keys(setup).reduce((acc, key) => {
|
|
258
|
-
acc[key] = setup[key] ? setup[key].toString() : '';
|
|
259
|
-
return acc;
|
|
260
|
-
}, {});
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Get the current setup.
|
|
265
|
-
*
|
|
266
|
-
* @return {FavoriteSetup} The current setup.
|
|
267
|
-
*/
|
|
268
|
-
const getCurrentSetup = () => {
|
|
269
|
-
return normalizeSetup({
|
|
270
|
-
id: 'current',
|
|
271
|
-
name: 'Current Setup',
|
|
272
|
-
bait_id: user.bait_item_id,
|
|
273
|
-
base_id: user.base_item_id,
|
|
274
|
-
weapon_id: user.weapon_item_id,
|
|
275
|
-
trinket_id: user.trinket_item_id,
|
|
276
|
-
power_type: user?.trap_power_type_name.toLowerCase(),
|
|
277
|
-
location: getCurrentLocation(),
|
|
278
|
-
});
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
let itemThumbs;
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Add an image to the favorite setups list.
|
|
285
|
-
*
|
|
286
|
-
* @param {string} type The type of item.
|
|
287
|
-
* @param {string} id The item ID.
|
|
288
|
-
* @param {Element} appendTo The element to append the image to.
|
|
289
|
-
*/
|
|
290
|
-
const addImage = async (type, id, appendTo) => {
|
|
291
|
-
const wrapper = makeElement('div', 'campPage-trap-itemBrowser-favorite-item');
|
|
292
|
-
wrapper.setAttribute('data-item-id', id);
|
|
293
|
-
wrapper.setAttribute('data-item-type', type);
|
|
294
|
-
|
|
295
|
-
wrapper.setAttribute('title', `Click to change ${type}`);
|
|
296
|
-
|
|
297
|
-
const item = makeElement('div', ['campPage-trap-itemBrowser-favorite-item-image']);
|
|
298
|
-
|
|
299
|
-
if (! itemThumbs) {
|
|
300
|
-
itemThumbs = await getData('item-thumbnails');
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
if (itemThumbs) {
|
|
304
|
-
item.style.backgroundImage = `url(${itemThumbs.find((thumb) => thumb.id == id)?.thumb || ''})`; // eslint-disable-line eqeqeq
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
makeElement('div', 'campPage-trap-itemBrowser-favorite-item-frame', '', item);
|
|
308
|
-
|
|
309
|
-
wrapper.append(item);
|
|
310
|
-
appendTo.append(wrapper);
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Map the cheese effect to a number.
|
|
315
|
-
*
|
|
316
|
-
* @param {string} textValue The text value to map.
|
|
317
|
-
*
|
|
318
|
-
* @return {number} The mapped value.
|
|
319
|
-
*/
|
|
320
|
-
const getCheeseEffect = (textValue) => {
|
|
321
|
-
const data = {
|
|
322
|
-
'Uber Fresh': 13,
|
|
323
|
-
'Ultimately Fresh': 12,
|
|
324
|
-
'Insanely Fresh': 11,
|
|
325
|
-
'Extremely Fresh': 10,
|
|
326
|
-
'Very Fresh': 9,
|
|
327
|
-
Fresh: 8,
|
|
328
|
-
'No Effect': 7,
|
|
329
|
-
Stale: 6,
|
|
330
|
-
'Very Stale': 5,
|
|
331
|
-
'Extremely Stale': 4,
|
|
332
|
-
'Insanely Stale': 3,
|
|
333
|
-
'Ultimately Stale': 2,
|
|
334
|
-
'Uber Stale': 1,
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
return data[textValue];
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Get the power type ID.
|
|
342
|
-
*
|
|
343
|
-
* @param {string} powerType The power type.
|
|
344
|
-
*
|
|
345
|
-
* @return {string} The power type ID.
|
|
346
|
-
*/
|
|
347
|
-
const getPowerTypeId = (powerType) => {
|
|
348
|
-
const data = {
|
|
349
|
-
arcane: 'arcn',
|
|
350
|
-
draconic: 'drcnc',
|
|
351
|
-
forgotten: 'frgttn',
|
|
352
|
-
hydro: 'hdr',
|
|
353
|
-
law: 'law',
|
|
354
|
-
parental: 'prntl',
|
|
355
|
-
physical: 'phscl',
|
|
356
|
-
rift: 'rift',
|
|
357
|
-
shadow: 'shdw',
|
|
358
|
-
tactical: 'tctcl',
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
return data[powerType] || powerType;
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Make the component picker for editing a setup.
|
|
366
|
-
*
|
|
367
|
-
* @param {string} setupId The setup ID.
|
|
368
|
-
* @param {string} type The type of item.
|
|
369
|
-
* @param {string} currentId The current item ID.
|
|
370
|
-
* @param {Function} callback The callback to run when an item is selected.
|
|
371
|
-
*/
|
|
372
|
-
const makeImagePicker = async (setupId, type, currentId, callback) => {
|
|
373
|
-
let components;
|
|
374
|
-
const cached = sessionGet('mh-improved-favorite-setups-components');
|
|
375
|
-
if (cached) {
|
|
376
|
-
components = cached;
|
|
377
|
-
} else {
|
|
378
|
-
const response = await doRequest('managers/ajax/users/gettrapcomponents.php');
|
|
379
|
-
|
|
380
|
-
components = response?.components || [];
|
|
381
|
-
|
|
382
|
-
// re-sort the items by item name.
|
|
383
|
-
components.sort((a, b) => {
|
|
384
|
-
if (a.name < b.name) {
|
|
385
|
-
return -1;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
if (a.name > b.name) {
|
|
389
|
-
return 1;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
return 0;
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
sessionSet('mh-improved-favorite-setups-components', components);
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
const items = components.filter((item) => item.classification === type);
|
|
399
|
-
|
|
400
|
-
let content = '<div class="mh-improved-favorite-setups-component-picker-popup">';
|
|
401
|
-
content += '<div class="mh-improved-favorite-setups-component-picker-popup-body">';
|
|
402
|
-
content += '<div class="mh-improved-favorite-setups-component-picker-popup-search">';
|
|
403
|
-
content += '<input type="text" placeholder="Search" id="mh-improved-favorite-setups-component-picker-popup-search-input" />';
|
|
404
|
-
content += '<div class="mh-improved-favorites-setups-component-picker-popup-use-current mousehuntActionButton" title="Use current item"><span>Use currently armed item</span></div>';
|
|
405
|
-
content += '</div>';
|
|
406
|
-
content += '<div class="mh-improved-favorite-setups-component-picker-popup-body-items">';
|
|
407
|
-
for (const item of items) {
|
|
408
|
-
/**
|
|
409
|
-
* Get the markup for a stat row.
|
|
410
|
-
*
|
|
411
|
-
* @param {string} stat The stat to get the row for.
|
|
412
|
-
* @param {string} title The title of the stat.
|
|
413
|
-
* @param {string} formatted The formatted value of the stat.
|
|
414
|
-
* @param {number} compare The value to compare the stat to.
|
|
415
|
-
*
|
|
416
|
-
* @return {string} The stat row markup.
|
|
417
|
-
*/
|
|
418
|
-
const getStatRow = (stat, title, formatted, compare) => {
|
|
419
|
-
let compareStat = item[stat];
|
|
420
|
-
if ('cheese_effect' === stat) {
|
|
421
|
-
compareStat = getCheeseEffect(item);
|
|
422
|
-
compare = getCheeseEffect(compare);
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
const compareClass = compare === compareStat ? '' : (compare > compareStat ? 'better' : 'worse');
|
|
426
|
-
|
|
427
|
-
return `<div class="campPage-trap-itemBrowser-item-stat ${stat} ${compareClass}" title="${title}">
|
|
428
|
-
<div class="value"><span>${formatted}</span></div>
|
|
429
|
-
</div>`;
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
content += `<div class="campPage-trap-itemBrowser-item loaded ${type}" data-item-id="${item.item_id}">`;
|
|
433
|
-
content += ' <div class="campPage-trap-itemBrowser-item-leftBar">';
|
|
434
|
-
content += ` <a href="#"><div class="campPage-trap-itemBrowser-item-image" style="background-image:url(${item.thumbnail});"></div></a>`;
|
|
435
|
-
content += ` <a href="#" class="campPage-trap-itemBrowser-item-armButton save-button" data-item-id="${item.item_id}" data-item-classification="${type}" data-item-image="${item.thumbnail}" data-the-power-type="${item.power_type_image_name}">Use</a>`;
|
|
436
|
-
content += ' </div>';
|
|
437
|
-
content += ' <div class="campPage-trap-itemBrowser-item-content">';
|
|
438
|
-
content += ` <div class="campPage-trap-itemBrowser-item-name">${item.name}</div>`;
|
|
439
|
-
if ('bait' === type || 'trinket' === type) {
|
|
440
|
-
content += `<div class="campPage-trap-itemBrowser-item-quantity"><span class="quantity">${Number.parseInt(item.quantity).toLocaleString()}</span><span class="label">Quantity</span></div>`;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
if (item.power_type) {
|
|
444
|
-
content += `<div class="campPage-trap-itemBrowser-item-powerType ${item.power_type}"></div>`;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
if (item.has_stats) {
|
|
448
|
-
content += '<div class="campPage-trap-itemBrowser-item-statContainer">';
|
|
449
|
-
content += item.has_power ? getStatRow('power', 'Power', item.power_formatted, user.trap_power) : '';
|
|
450
|
-
content += item.has_power_bonus ? getStatRow('power_bonus', 'Power Bonus', item.power_bonus_formatted, user.trap_power_bonus) : '';
|
|
451
|
-
content += item.has_attraction_bonus ? getStatRow('attraction_bonus', 'Attraction Bonus', item.attraction_bonus_formatted, user.trap_attraction_bonus) : '';
|
|
452
|
-
content += item.has_luck ? getStatRow('luck', 'Luck', item.luck_formatted, user.trap_luck) : '';
|
|
453
|
-
content += getStatRow('cheese_effect', 'Cheese Effect', item.cheese_effect, user.trap_cheese_effect);
|
|
454
|
-
content += '</div>';
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
content += '<div class="campPage-trap-itemBrowser-item-description shortDescription">';
|
|
458
|
-
content += item.consume_method ? `<div class="campPage-trap-itemBrowser-item-description-consumeMethod"><b>Consumed on:</b> ${item.consume_method}</div>` : '';
|
|
459
|
-
|
|
460
|
-
content += '</div>';
|
|
461
|
-
content += '</div>';
|
|
462
|
-
content += '</div>';
|
|
463
|
-
}
|
|
464
|
-
content += '</div>';
|
|
465
|
-
content += '</div>';
|
|
466
|
-
content += '</div>';
|
|
467
|
-
|
|
468
|
-
const popup = createPopup({
|
|
469
|
-
id: 'mh-improved-favorite-setups-component-picker',
|
|
470
|
-
title: '',
|
|
471
|
-
content,
|
|
472
|
-
className: 'mh-improved-favorite-setups-component-picker',
|
|
473
|
-
});
|
|
474
|
-
|
|
475
|
-
// popup.setIsModal(true);
|
|
476
|
-
popup.show();
|
|
477
|
-
|
|
478
|
-
const saveButtons = document.querySelectorAll('.campPage-trap-itemBrowser-item-armButton.save-button');
|
|
479
|
-
saveButtons.forEach((saveButton) => {
|
|
480
|
-
saveButton.addEventListener('click', async (event) => {
|
|
481
|
-
event.preventDefault();
|
|
482
|
-
event.stopPropagation();
|
|
483
|
-
|
|
484
|
-
callback(
|
|
485
|
-
saveButton.getAttribute('data-item-id'),
|
|
486
|
-
saveButton.getAttribute('data-item-classification'),
|
|
487
|
-
saveButton.getAttribute('data-item-image'),
|
|
488
|
-
saveButton.getAttribute('data-the-power-type')
|
|
489
|
-
);
|
|
490
|
-
popup.hide();
|
|
491
|
-
});
|
|
492
|
-
});
|
|
493
|
-
|
|
494
|
-
const searchInput = document.querySelector('#mh-improved-favorite-setups-component-picker-popup-search-input');
|
|
495
|
-
|
|
496
|
-
if (! searchInput) {
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
searchInput.focus();
|
|
501
|
-
|
|
502
|
-
searchInput.addEventListener('keyup', () => {
|
|
503
|
-
const filter = searchInput.value.toLowerCase();
|
|
504
|
-
const searchItems = document.querySelectorAll('.campPage-trap-itemBrowser-item');
|
|
505
|
-
searchItems.forEach((item) => {
|
|
506
|
-
const name = item.querySelector('.campPage-trap-itemBrowser-item-name');
|
|
507
|
-
if (name.textContent.toLowerCase().includes(filter)) {
|
|
508
|
-
item.classList.remove('hidden');
|
|
509
|
-
} else {
|
|
510
|
-
item.classList.add('hidden');
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
});
|
|
514
|
-
|
|
515
|
-
const useCurrentItemButton = document.querySelector('.mh-improved-favorites-setups-component-picker-popup-use-current');
|
|
516
|
-
useCurrentItemButton.addEventListener('click', () => {
|
|
517
|
-
const item = document.querySelector(`.campPage-trap-itemBrowser-item[data-item-id="${user[`${type}_item_id`]}"]`);
|
|
518
|
-
if (! item) {
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
const saveButton = item.querySelector('.campPage-trap-itemBrowser-item-armButton.save-button');
|
|
523
|
-
if (! saveButton) {
|
|
524
|
-
return;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
callback(
|
|
528
|
-
saveButton.getAttribute('data-item-id'),
|
|
529
|
-
saveButton.getAttribute('data-item-classification'),
|
|
530
|
-
saveButton.getAttribute('data-item-image'),
|
|
531
|
-
saveButton.getAttribute('data-the-power-type')
|
|
532
|
-
);
|
|
533
|
-
popup.hide();
|
|
534
|
-
});
|
|
535
|
-
};
|
|
536
|
-
|
|
537
|
-
/**
|
|
538
|
-
* Equip items.
|
|
539
|
-
*
|
|
540
|
-
* @param {Array} items The items to arm.
|
|
541
|
-
*
|
|
542
|
-
* @return {Promise} Resolves when the items are armed.
|
|
543
|
-
*/
|
|
544
|
-
const armItem = async (items) => {
|
|
545
|
-
return new Promise((resolve, reject) => {
|
|
546
|
-
items.forEach(({ id, type }) => {
|
|
547
|
-
if (! id) {
|
|
548
|
-
if ('bait' === type) {
|
|
549
|
-
hg.utils.TrapControl.disarmBait();
|
|
550
|
-
} else if ('trinket' === type) {
|
|
551
|
-
hg.utils.TrapControl.disarmTrinket();
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
hg.utils.TrapControl.armItem(id, type);
|
|
558
|
-
});
|
|
559
|
-
|
|
560
|
-
hg.utils.TrapControl.go(resolve, reject);
|
|
561
|
-
});
|
|
562
|
-
};
|
|
563
|
-
|
|
564
|
-
/**
|
|
565
|
-
* Make the setups sortable with drag and drop.
|
|
566
|
-
*
|
|
567
|
-
* @param {Element} container The container element with the setup rows.
|
|
568
|
-
*/
|
|
569
|
-
const makeSortable = (container) => {
|
|
570
|
-
let draggedElement = null;
|
|
571
|
-
let placeholder = null;
|
|
572
|
-
|
|
573
|
-
const rows = container.querySelectorAll('.row-wrapper .row:not([data-setup-id="current"])');
|
|
574
|
-
|
|
575
|
-
rows.forEach((row) => {
|
|
576
|
-
// Skip location favorites as they can't be reordered - they're shortcuts
|
|
577
|
-
if (row.classList.contains('location-favorite') || row.classList.contains('mobile-setup')) {
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
row.draggable = true;
|
|
582
|
-
row.classList.add('draggable');
|
|
583
|
-
|
|
584
|
-
row.addEventListener('dragstart', (e) => {
|
|
585
|
-
draggedElement = row;
|
|
586
|
-
row.classList.add('dragging');
|
|
587
|
-
|
|
588
|
-
// Create placeholder
|
|
589
|
-
placeholder = makeElement('div', ['row', 'placeholder']);
|
|
590
|
-
makeElement('div', 'placeholder-text', 'Drop here', placeholder);
|
|
591
|
-
|
|
592
|
-
e.dataTransfer.effectAllowed = 'move';
|
|
593
|
-
e.dataTransfer.setData('text/html', row.outerHTML);
|
|
594
|
-
});
|
|
595
|
-
|
|
596
|
-
row.addEventListener('dragend', () => {
|
|
597
|
-
row.classList.remove('dragging');
|
|
598
|
-
if (placeholder && placeholder.parentNode) {
|
|
599
|
-
placeholder.remove();
|
|
600
|
-
}
|
|
601
|
-
draggedElement = null;
|
|
602
|
-
placeholder = null;
|
|
603
|
-
});
|
|
604
|
-
|
|
605
|
-
row.addEventListener('dragover', (e) => {
|
|
606
|
-
e.preventDefault();
|
|
607
|
-
e.dataTransfer.dropEffect = 'move';
|
|
608
|
-
|
|
609
|
-
if (draggedElement && row !== draggedElement && ! row.classList.contains('location-favorite')) {
|
|
610
|
-
// Remove placeholder from its current position if it exists
|
|
611
|
-
if (placeholder && placeholder.parentNode) {
|
|
612
|
-
placeholder.remove();
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
const rect = row.getBoundingClientRect();
|
|
616
|
-
const midpoint = rect.top + (rect.height / 2);
|
|
617
|
-
|
|
618
|
-
if (e.clientY < midpoint) {
|
|
619
|
-
row.parentNode.insertBefore(placeholder, row);
|
|
620
|
-
} else {
|
|
621
|
-
row.parentNode.insertBefore(placeholder, row.nextSibling);
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
});
|
|
625
|
-
|
|
626
|
-
row.addEventListener('drop', async (e) => {
|
|
627
|
-
e.preventDefault();
|
|
628
|
-
|
|
629
|
-
if (draggedElement && placeholder && placeholder.parentNode) {
|
|
630
|
-
// Insert the dragged element where the placeholder is
|
|
631
|
-
placeholder.parentNode.insertBefore(draggedElement, placeholder);
|
|
632
|
-
placeholder.remove();
|
|
633
|
-
|
|
634
|
-
// Update the order in storage
|
|
635
|
-
await updateSetupOrder(container);
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
});
|
|
639
|
-
|
|
640
|
-
// Add dragover to main container
|
|
641
|
-
container.addEventListener('dragover', (e) => {
|
|
642
|
-
e.preventDefault();
|
|
643
|
-
|
|
644
|
-
if (draggedElement && ! draggedElement.classList.contains('location-favorite') && // If we're dragging over empty space in the main container
|
|
645
|
-
e.target === container) {
|
|
646
|
-
if (placeholder && placeholder.parentNode) {
|
|
647
|
-
placeholder.remove();
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
// Find the last draggable setup row (excluding location favorites)
|
|
651
|
-
const lastDraggableRow = container.querySelector('.row.draggable:not(.dragging):not(.location-favorite):last-of-type');
|
|
652
|
-
if (lastDraggableRow) {
|
|
653
|
-
lastDraggableRow.parentNode.insertBefore(placeholder, lastDraggableRow.nextSibling);
|
|
654
|
-
} else {
|
|
655
|
-
// If no suitable row found, append to container
|
|
656
|
-
container.append(placeholder);
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
});
|
|
660
|
-
|
|
661
|
-
container.addEventListener('drop', async (e) => {
|
|
662
|
-
e.preventDefault();
|
|
663
|
-
|
|
664
|
-
if (draggedElement && placeholder && placeholder.parentNode && ! draggedElement.classList.contains('location-favorite')) {
|
|
665
|
-
placeholder.parentNode.insertBefore(draggedElement, placeholder);
|
|
666
|
-
placeholder.remove();
|
|
667
|
-
await updateSetupOrder(container);
|
|
668
|
-
}
|
|
669
|
-
});
|
|
670
|
-
};
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* Update the setup order based on the current DOM order.
|
|
674
|
-
*
|
|
675
|
-
* @param {Element} container The container with the setup rows.
|
|
676
|
-
*/
|
|
677
|
-
const updateSetupOrder = async (container) => {
|
|
678
|
-
const setups = await getFavoriteSetups();
|
|
679
|
-
if (! setups.length) {
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
// Get all draggable rows (including mobile setups) in their new order
|
|
684
|
-
const draggableRows = container.querySelectorAll('.row:not([data-setup-id="current"]):not(.location-favorite)');
|
|
685
|
-
const newOrder = [];
|
|
686
|
-
|
|
687
|
-
draggableRows.forEach((row) => {
|
|
688
|
-
const setupId = row.getAttribute('data-setup-id');
|
|
689
|
-
const setup = setups.find((s) => s?.id === setupId);
|
|
690
|
-
if (setup) {
|
|
691
|
-
newOrder.push(setup);
|
|
692
|
-
}
|
|
693
|
-
});
|
|
694
|
-
|
|
695
|
-
saveSetting('favorite-setups.setups', newOrder);
|
|
696
|
-
};
|
|
697
|
-
|
|
698
|
-
/**
|
|
699
|
-
* Make a single favorite setup row.
|
|
700
|
-
*
|
|
701
|
-
* @param {Object} setup The setup to make a row for.
|
|
702
|
-
* @param {boolean} isCurrent Whether the setup is the current setup.
|
|
703
|
-
*
|
|
704
|
-
* @return {Promise<Element|boolean>} The setup row element.
|
|
705
|
-
*/
|
|
706
|
-
const makeBlueprintRow = async (setup, isCurrent = false) => {
|
|
707
|
-
if (! setup) {
|
|
708
|
-
return false;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
const setupContainer = makeElement('div', ['row']);
|
|
712
|
-
setupContainer.setAttribute('data-setup-id', setup.id);
|
|
713
|
-
|
|
714
|
-
// Add drag handle for non-current and non-location-favorite setups
|
|
715
|
-
if (! (
|
|
716
|
-
isCurrent ||
|
|
717
|
-
setup?.isLocationFavorite ||
|
|
718
|
-
setup?.is_mobile
|
|
719
|
-
)) {
|
|
720
|
-
const dragHandle = makeElement('div', ['drag-handle']);
|
|
721
|
-
dragHandle.innerHTML = '⋮⋮';
|
|
722
|
-
dragHandle.setAttribute('title', 'Drag to reorder');
|
|
723
|
-
setupContainer.append(dragHandle);
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
const controls = makeElement('div', ['controls']);
|
|
727
|
-
makeElement('div', ['label'], setup?.name || '', controls);
|
|
728
|
-
|
|
729
|
-
let hasHighlighted = false;
|
|
730
|
-
const buttonWrapper = makeElement('div', ['button-wrapper']);
|
|
731
|
-
if (isCurrent) {
|
|
732
|
-
buttonWrapper.append(makeMhButton({
|
|
733
|
-
text: 'Save',
|
|
734
|
-
className: ['action', 'save', 'lightBlue'],
|
|
735
|
-
/**
|
|
736
|
-
* Save the current setup as a favorite setup.
|
|
737
|
-
*/
|
|
738
|
-
callback: async () => {
|
|
739
|
-
// Save the current setup, using the current location as the name.
|
|
740
|
-
let currentSetup = getCurrentSetup();
|
|
741
|
-
|
|
742
|
-
// if the setup already exists, then just alert the user.
|
|
743
|
-
const setups = await getFavoriteSetups();
|
|
744
|
-
|
|
745
|
-
if (setups.length) {
|
|
746
|
-
// check if the setup has a matching bait, base, weapon, and trinket.
|
|
747
|
-
const existingSetup = setups.find((s) => {
|
|
748
|
-
return s?.bait_id === currentSetup.bait_id &&
|
|
749
|
-
s?.base_id === currentSetup.base_id &&
|
|
750
|
-
s?.weapon_id === currentSetup.weapon_id &&
|
|
751
|
-
s?.trinket_id === currentSetup.trinket_id &&
|
|
752
|
-
s?.location === currentSetup.location;
|
|
753
|
-
});
|
|
754
|
-
|
|
755
|
-
if (existingSetup && ! hasHighlighted) {
|
|
756
|
-
// flash both the shortcut and main list rows
|
|
757
|
-
const rows = document.querySelectorAll(`.mh-improved-favorite-setups-blueprint-container .row[data-setup-id="${existingSetup.id}"]`);
|
|
758
|
-
rows.forEach((row) => {
|
|
759
|
-
row.classList.add('flash');
|
|
760
|
-
setTimeout(() => row.classList.remove('flash'), 1000);
|
|
761
|
-
});
|
|
762
|
-
|
|
763
|
-
hasHighlighted = true;
|
|
764
|
-
// allow clicking save a second time to bypass the highlight for 2 seconds.
|
|
765
|
-
setTimeout(() => {
|
|
766
|
-
hasHighlighted = false;
|
|
767
|
-
}, 2000);
|
|
768
|
-
|
|
769
|
-
return;
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
// Generate a random name for the setup.
|
|
774
|
-
currentSetup.id = Math.random().toString(36).slice(2, 15) + Math.random().toString(36).slice(2, 15);
|
|
775
|
-
|
|
776
|
-
currentSetup = await saveFavoriteSetup(currentSetup, true);
|
|
777
|
-
|
|
778
|
-
// append the new setup to the list.
|
|
779
|
-
const setupRow = await makeBlueprintRow(currentSetup);
|
|
780
|
-
|
|
781
|
-
// If there are mobile rows, then insert the new row before the first.
|
|
782
|
-
const mobileRow = document.querySelector('.mh-improved-favorite-setups-blueprint-container .content .row.mobile-setup');
|
|
783
|
-
if (mobileRow) {
|
|
784
|
-
mobileRow.before(setupRow);
|
|
785
|
-
} else {
|
|
786
|
-
const content = document.querySelector('.mh-improved-favorite-setups-blueprint-container .content');
|
|
787
|
-
content.append(setupRow);
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
updateFavoriteSetupName();
|
|
791
|
-
}
|
|
792
|
-
}));
|
|
793
|
-
} else {
|
|
794
|
-
const armButton = makeMhButton({
|
|
795
|
-
text: 'Arm',
|
|
796
|
-
className: ['action', 'arm'],
|
|
797
|
-
/**
|
|
798
|
-
* Arm the setup.
|
|
799
|
-
*/
|
|
800
|
-
callback: async () => {
|
|
801
|
-
armButton.classList.add('loading');
|
|
802
|
-
|
|
803
|
-
// Arm the setup.
|
|
804
|
-
const setupId = setupContainer.getAttribute('data-setup-id');
|
|
805
|
-
debuglog('favorite-setups', `Arming setup ${setupId}`);
|
|
806
|
-
|
|
807
|
-
// get the setup.
|
|
808
|
-
const setups = await getFavoriteSetups();
|
|
809
|
-
if (! setups.length) {
|
|
810
|
-
return;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
if (! setupId) {
|
|
814
|
-
return;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
const index = setups.findIndex((s) => s?.id && (s.id === setupId));
|
|
818
|
-
|
|
819
|
-
const thisSetup = setups[index];
|
|
820
|
-
if (! thisSetup) {
|
|
821
|
-
return;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
const toArm = [];
|
|
825
|
-
|
|
826
|
-
// eslint-disable-next-line eqeqeq
|
|
827
|
-
if (thisSetup.base_id && thisSetup.base_id != user.base_item_id) {
|
|
828
|
-
toArm.push({ id: thisSetup.base_id, type: 'base' });
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
// eslint-disable-next-line eqeqeq
|
|
832
|
-
if (thisSetup.weapon_id && thisSetup.weapon_id != user.weapon_item_id) {
|
|
833
|
-
toArm.push({ id: thisSetup.weapon_id, type: 'weapon' });
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
// eslint-disable-next-line eqeqeq
|
|
837
|
-
if (thisSetup.trinket_id && thisSetup.trinket_id != user.trinket_item_id) {
|
|
838
|
-
toArm.push({ id: thisSetup.trinket_id, type: 'trinket' });
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
// eslint-disable-next-line eqeqeq
|
|
842
|
-
if (thisSetup.bait_id && thisSetup.bait_id != user.bait_item_id) {
|
|
843
|
-
toArm.push({ id: thisSetup.bait_id, type: 'bait' });
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
if (toArm.length) {
|
|
847
|
-
await armItem(toArm);
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
const currentSetupRow = document.querySelector('.mh-improved-favorite-setups-blueprint-container .row[data-setup-id="current"]');
|
|
851
|
-
if (currentSetupRow) {
|
|
852
|
-
const newRow = await makeBlueprintRow(getCurrentSetup(), true);
|
|
853
|
-
if (newRow) {
|
|
854
|
-
currentSetupRow.replaceWith(newRow);
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
armButton.classList.remove('loading');
|
|
859
|
-
|
|
860
|
-
updateFavoriteSetupName();
|
|
861
|
-
}
|
|
862
|
-
});
|
|
863
|
-
|
|
864
|
-
buttonWrapper.append(armButton);
|
|
865
|
-
|
|
866
|
-
let editClickables = [];
|
|
867
|
-
buttonWrapper.append(makeMhButton({
|
|
868
|
-
text: 'Edit',
|
|
869
|
-
className: ['action', 'edit-setup'],
|
|
870
|
-
/**
|
|
871
|
-
* Edit the setup.
|
|
872
|
-
*/
|
|
873
|
-
callback: () => {
|
|
874
|
-
const setupId = setupContainer.getAttribute('data-setup-id');
|
|
875
|
-
debuglog('favorite-setups', `Editing setup ${setupId}`);
|
|
876
|
-
|
|
877
|
-
setupContainer.classList.add('editing');
|
|
878
|
-
|
|
879
|
-
// Update the setup title to be an input.
|
|
880
|
-
const title = setupContainer.querySelector('.label');
|
|
881
|
-
|
|
882
|
-
const randomTitleButton = makeElement('a', 'random-title');
|
|
883
|
-
randomTitleButton.setAttribute('title', 'Generate a random name for this setup');
|
|
884
|
-
|
|
885
|
-
randomTitleButton.addEventListener('click', async (e) => {
|
|
886
|
-
e.preventDefault();
|
|
887
|
-
|
|
888
|
-
e.target.classList.add('loading');
|
|
889
|
-
|
|
890
|
-
const setupNameData = await getGeneratedName(setup);
|
|
891
|
-
|
|
892
|
-
if (setupNameData.name) {
|
|
893
|
-
title.querySelector('input').value = setupNameData.name;
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
e.target.classList.remove('loading');
|
|
897
|
-
});
|
|
898
|
-
|
|
899
|
-
const titleInput = makeElement('input', 'setup-title-input');
|
|
900
|
-
titleInput.setAttribute('type', 'text');
|
|
901
|
-
titleInput.setAttribute('name', 'setup-title');
|
|
902
|
-
titleInput.value = title.textContent;
|
|
903
|
-
title.textContent = '';
|
|
904
|
-
title.append(titleInput);
|
|
905
|
-
title.prepend(randomTitleButton);
|
|
906
|
-
|
|
907
|
-
const powerTypeInput = makeElement('input', ['hidden', 'power-type-input']);
|
|
908
|
-
powerTypeInput.setAttribute('type', 'hidden');
|
|
909
|
-
powerTypeInput.setAttribute('name', 'power-type');
|
|
910
|
-
powerTypeInput.setAttribute('data-the-power-type', setup.power_type);
|
|
911
|
-
title.append(powerTypeInput);
|
|
912
|
-
|
|
913
|
-
// Update the setup images to be clickable.
|
|
914
|
-
const images = setupContainer.querySelectorAll('.campPage-trap-itemBrowser-favorite-item');
|
|
915
|
-
images.forEach((image) => {
|
|
916
|
-
image.classList.add('clickable');
|
|
917
|
-
const eventListenerClickable = image.addEventListener('click', async () => {
|
|
918
|
-
image.classList.add('loading');
|
|
919
|
-
|
|
920
|
-
// Handle image click
|
|
921
|
-
const itemType = image.getAttribute('data-item-type');
|
|
922
|
-
const itemId = image.getAttribute('data-item-id');
|
|
923
|
-
const imageDisplay = image.querySelector('.campPage-trap-itemBrowser-favorite-item-image');
|
|
924
|
-
await makeImagePicker(setupId, itemType, itemId, (newItemId, newItemType, newItemImageUrl, newItemPowerType) => {
|
|
925
|
-
if (itemType !== newItemType) {
|
|
926
|
-
return;
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
if (itemId == newItemId) { // eslint-disable-line eqeqeq
|
|
930
|
-
return;
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
image.setAttribute('data-new-item-id', newItemId);
|
|
934
|
-
image.setAttribute('data-new-item-image', newItemImageUrl);
|
|
935
|
-
image.setAttribute('data-old-image-url', imageDisplay.style.backgroundImage);
|
|
936
|
-
|
|
937
|
-
if (newItemPowerType && 'undefined' !== newItemPowerType) {
|
|
938
|
-
const ptInput = setupContainer.querySelector('.power-type-input');
|
|
939
|
-
ptInput.setAttribute('data-power-type', newItemPowerType);
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
imageDisplay.style.backgroundImage = `url(${newItemImageUrl})`;
|
|
943
|
-
});
|
|
944
|
-
|
|
945
|
-
image.classList.remove('loading');
|
|
946
|
-
});
|
|
947
|
-
|
|
948
|
-
editClickables.push({ image, event: eventListenerClickable });
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
}));
|
|
952
|
-
|
|
953
|
-
/**
|
|
954
|
-
* Stop editing the setup.
|
|
955
|
-
*/
|
|
956
|
-
const stopEditing = () => {
|
|
957
|
-
// Remove the event listeners from the images.
|
|
958
|
-
editClickables.forEach(({ image, event }) => {
|
|
959
|
-
image.removeEventListener('click', event);
|
|
960
|
-
image.classList.remove('clickable');
|
|
961
|
-
});
|
|
962
|
-
|
|
963
|
-
editClickables = [];
|
|
964
|
-
};
|
|
965
|
-
|
|
966
|
-
buttonWrapper.append(makeMhButton({
|
|
967
|
-
text: 'Save',
|
|
968
|
-
className: ['action', 'save-setup'],
|
|
969
|
-
/**
|
|
970
|
-
* Save the edited setup.
|
|
971
|
-
*/
|
|
972
|
-
callback: async () => {
|
|
973
|
-
const setupId = setupContainer.getAttribute('data-setup-id');
|
|
974
|
-
debuglog('favorite-setups', `Saving setup ${setupId}`);
|
|
975
|
-
|
|
976
|
-
setupContainer.classList.remove('editing');
|
|
977
|
-
// When save is clicked, save the changes.
|
|
978
|
-
|
|
979
|
-
const newSetup = setup;
|
|
980
|
-
|
|
981
|
-
const title = setupContainer.querySelector('.label');
|
|
982
|
-
const titleInput = title.querySelector('input');
|
|
983
|
-
setup.name = titleInput.value;
|
|
984
|
-
|
|
985
|
-
const powerTypeInput = setupContainer.querySelector('.power-type-input');
|
|
986
|
-
if (powerTypeInput) {
|
|
987
|
-
const lastPowerType = setup.power_type;
|
|
988
|
-
const newPowerType = powerTypeInput.getAttribute('data-the-power-type');
|
|
989
|
-
|
|
990
|
-
if (newPowerType && lastPowerType !== newPowerType) {
|
|
991
|
-
setup.power_type = newPowerType;
|
|
992
|
-
|
|
993
|
-
const powerTypeImage = setupContainer.querySelector('.campPage-trap-itemBrowser-item-powerType');
|
|
994
|
-
if (powerTypeImage) {
|
|
995
|
-
const lastPowerTypeClass = lastPowerType ? getPowerTypeId(lastPowerType) : 'hidden';
|
|
996
|
-
const newPowerTypeClass = newPowerType ? getPowerTypeId(newPowerType) : 'hidden';
|
|
997
|
-
|
|
998
|
-
powerTypeImage.classList.remove(lastPowerTypeClass);
|
|
999
|
-
powerTypeImage.classList.add(newPowerTypeClass);
|
|
1000
|
-
powerTypeImage.classList.remove('hidden');
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
// if there are any items with a new-item-id, then update the setup.
|
|
1006
|
-
const images = setupContainer.querySelectorAll('.campPage-trap-itemBrowser-favorite-item');
|
|
1007
|
-
images.forEach((image) => {
|
|
1008
|
-
const newItemId = image.getAttribute('data-new-item-id');
|
|
1009
|
-
if (! newItemId) {
|
|
1010
|
-
return;
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
const itemType = image.getAttribute('data-item-type');
|
|
1014
|
-
|
|
1015
|
-
// update the setup.
|
|
1016
|
-
newSetup[`${itemType}_id`] = newItemId;
|
|
1017
|
-
|
|
1018
|
-
// remove the new-item-id attribute.
|
|
1019
|
-
image.removeAttribute('data-new-item-id');
|
|
1020
|
-
image.removeAttribute('data-new-item-image');
|
|
1021
|
-
image.removeAttribute('data-old-image-url');
|
|
1022
|
-
});
|
|
1023
|
-
|
|
1024
|
-
// Update the setup title to be a div.
|
|
1025
|
-
title.textContent = newSetup.name;
|
|
1026
|
-
titleInput.remove();
|
|
1027
|
-
|
|
1028
|
-
let setups = await getFavoriteSetups();
|
|
1029
|
-
if (! setups.length) {
|
|
1030
|
-
setups = [];
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
const index = setups.findIndex((s) => s?.id && (s.id === setupId));
|
|
1034
|
-
|
|
1035
|
-
// replace the setup in the list.
|
|
1036
|
-
setups[index] = newSetup;
|
|
1037
|
-
saveSetting('favorite-setups.setups', removeMobileSetups(setups));
|
|
1038
|
-
|
|
1039
|
-
if (setupId.startsWith('mobile-')) {
|
|
1040
|
-
const mobileIndex = setups.filter((s) => s?.is_mobile ?? false).findIndex((s) => s.id === setupId);
|
|
1041
|
-
await setMobileFavourite(mobileIndex, newSetup);
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
updateFavoriteSetupName();
|
|
1045
|
-
|
|
1046
|
-
stopEditing();
|
|
1047
|
-
}
|
|
1048
|
-
}));
|
|
1049
|
-
|
|
1050
|
-
buttonWrapper.append(makeMhButton({
|
|
1051
|
-
text: 'Cancel',
|
|
1052
|
-
className: ['action', 'cancel-setup'],
|
|
1053
|
-
/**
|
|
1054
|
-
* Cancel editing the setup.
|
|
1055
|
-
*/
|
|
1056
|
-
callback: () => {
|
|
1057
|
-
setupContainer.classList.remove('editing');
|
|
1058
|
-
// When cancel is clicked, revert the changes.
|
|
1059
|
-
|
|
1060
|
-
// title.
|
|
1061
|
-
const titleInput = setupContainer.querySelector('.label input');
|
|
1062
|
-
const title = setupContainer.querySelector('.label');
|
|
1063
|
-
title.textContent = setup.name;
|
|
1064
|
-
titleInput.remove();
|
|
1065
|
-
|
|
1066
|
-
// check for any new-item-id attributes.
|
|
1067
|
-
const images = setupContainer.querySelectorAll('.campPage-trap-itemBrowser-favorite-item');
|
|
1068
|
-
images.forEach((image) => {
|
|
1069
|
-
const newItemId = image.getAttribute('data-new-item-id');
|
|
1070
|
-
if (! newItemId) {
|
|
1071
|
-
return;
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
// reset the image background.
|
|
1075
|
-
const imageDisplay = image.querySelector('.campPage-trap-itemBrowser-favorite-item-image');
|
|
1076
|
-
imageDisplay.style.backgroundImage = image.getAttribute('data-old-image-url');
|
|
1077
|
-
|
|
1078
|
-
// remove the new-item-id attribute.
|
|
1079
|
-
image.removeAttribute('data-new-item-id');
|
|
1080
|
-
image.removeAttribute('data-new-item-image');
|
|
1081
|
-
image.removeAttribute('data-old-image-url');
|
|
1082
|
-
});
|
|
1083
|
-
|
|
1084
|
-
stopEditing();
|
|
1085
|
-
}
|
|
1086
|
-
}));
|
|
1087
|
-
|
|
1088
|
-
buttonWrapper.append(makeMhButton({
|
|
1089
|
-
text: 'Delete',
|
|
1090
|
-
className: ['action', 'delete', 'danger'],
|
|
1091
|
-
/**
|
|
1092
|
-
* Delete the setup.
|
|
1093
|
-
*/
|
|
1094
|
-
callback: async () => {
|
|
1095
|
-
const setupId = setupContainer.getAttribute('data-setup-id');
|
|
1096
|
-
debuglog('favorite-setups', `Deleting setup ${setupId}`);
|
|
1097
|
-
|
|
1098
|
-
// show a confirmation dialog.
|
|
1099
|
-
const confirmed = confirm('Are you sure you want to delete this setup?'); // eslint-disable-line no-alert
|
|
1100
|
-
if (! confirmed) {
|
|
1101
|
-
return;
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
// remove the setup from the list.
|
|
1105
|
-
let setups = await getFavoriteSetups();
|
|
1106
|
-
if (! setups.length) {
|
|
1107
|
-
setups = [];
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
if (setupId.startsWith('mobile-')) {
|
|
1111
|
-
const mobileIndex = setups.filter((s) => s?.is_mobile ?? false).findIndex((s) => s.id === setupId);
|
|
1112
|
-
await deleteMobileFavourite(mobileIndex);
|
|
1113
|
-
|
|
1114
|
-
const newContainer = await makeBlueprintRow({
|
|
1115
|
-
id: `mobile-${mobileIndex}`,
|
|
1116
|
-
is_mobile: true,
|
|
1117
|
-
});
|
|
1118
|
-
setupContainer.replaceWith(newContainer);
|
|
1119
|
-
} else {
|
|
1120
|
-
const index = setups.findIndex((s) => s?.id && (s.id === setupId));
|
|
1121
|
-
setups.splice(index, 1);
|
|
1122
|
-
saveSetting('favorite-setups.setups', removeMobileSetups(setups));
|
|
1123
|
-
|
|
1124
|
-
// Remove all instances of this setup (both shortcut and main list)
|
|
1125
|
-
const allInstances = document.querySelectorAll(`.row[data-setup-id="${setupId}"]`);
|
|
1126
|
-
allInstances.forEach((instance) => {
|
|
1127
|
-
instance.remove();
|
|
1128
|
-
});
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
}));
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
controls.append(buttonWrapper);
|
|
1135
|
-
setupContainer.append(controls);
|
|
1136
|
-
|
|
1137
|
-
const powerTypeId = getPowerTypeId(setup?.power_type);
|
|
1138
|
-
const powertype = makeElement('div', ['campPage-trap-itemBrowser-item-powerType', powerTypeId]);
|
|
1139
|
-
if (! powerTypeId) {
|
|
1140
|
-
powertype.classList.add('hidden');
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
setupContainer.append(powertype);
|
|
1144
|
-
|
|
1145
|
-
await addImage('bait', setup.bait_id, setupContainer);
|
|
1146
|
-
await addImage('base', setup.base_id, setupContainer);
|
|
1147
|
-
await addImage('weapon', setup.weapon_id, setupContainer);
|
|
1148
|
-
await addImage('trinket', setup.trinket_id, setupContainer);
|
|
1149
|
-
|
|
1150
|
-
if (setup?.is_mobile) {
|
|
1151
|
-
setupContainer.classList.add('mobile-setup');
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
return setupContainer;
|
|
1155
|
-
};
|
|
1156
|
-
|
|
1157
|
-
/**
|
|
1158
|
-
* Create the favorite setups container.
|
|
1159
|
-
*
|
|
1160
|
-
* @return {Promise<HTMLElement>} The favorite setups container.
|
|
1161
|
-
*/
|
|
1162
|
-
const makeBlueprintContainer = async () => {
|
|
1163
|
-
const existing = document.querySelector('.mh-improved-favorite-setups-blueprint-container');
|
|
1164
|
-
if (existing) {
|
|
1165
|
-
existing.remove();
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
const container = makeElement('div', 'mh-improved-favorite-setups-blueprint-container');
|
|
1169
|
-
|
|
1170
|
-
const header = makeElement('div', ['header']);
|
|
1171
|
-
makeElement('b', ['title'], 'Favorite Setups', header);
|
|
1172
|
-
|
|
1173
|
-
container.append(header);
|
|
1174
|
-
|
|
1175
|
-
const body = makeElement('div', ['content']);
|
|
1176
|
-
|
|
1177
|
-
const currentSetupRow = await makeBlueprintRow(getCurrentSetup(), true);
|
|
1178
|
-
body.append(currentSetupRow);
|
|
1179
|
-
|
|
1180
|
-
const setups = await getFavoriteSetups();
|
|
1181
|
-
if (setups.length) {
|
|
1182
|
-
// Find location favorites and display them as shortcuts at the top
|
|
1183
|
-
let locationFavorites = [];
|
|
1184
|
-
|
|
1185
|
-
if (getSetting('favorite-setups.show-location-favorites', true)) {
|
|
1186
|
-
// Get the current location from the user data
|
|
1187
|
-
locationFavorites = setups.filter((setup) =>
|
|
1188
|
-
setup && setup.id && setup.location && setup.location === getCurrentLocation()
|
|
1189
|
-
);
|
|
1190
|
-
|
|
1191
|
-
if (getFlag('favorite-setups-limit-location-favorites')) {
|
|
1192
|
-
locationFavorites = locationFavorites.slice(0, 3);
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
if (locationFavorites.length) {
|
|
1197
|
-
const locationWrapper = makeElement('div', ['location-favorites']);
|
|
1198
|
-
|
|
1199
|
-
for (const setup of locationFavorites) {
|
|
1200
|
-
const setupContainer = await makeBlueprintRow({
|
|
1201
|
-
id: `location-favorite-${setup.id}`,
|
|
1202
|
-
...setup,
|
|
1203
|
-
isLocationFavorite: true,
|
|
1204
|
-
});
|
|
1205
|
-
setupContainer.classList.add('location-favorite');
|
|
1206
|
-
locationWrapper.append(setupContainer);
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
body.append(locationWrapper);
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
const rowWrapper = makeElement('div', ['row-wrapper']);
|
|
1213
|
-
|
|
1214
|
-
// Display ALL setups (including location favorites and mobile) in their saved order
|
|
1215
|
-
for (const setup of setups) {
|
|
1216
|
-
if (! setup || ! setup.id) {
|
|
1217
|
-
continue;
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
const setupContainer = await makeBlueprintRow(setup);
|
|
1221
|
-
|
|
1222
|
-
if (setup.id.startsWith('mobile-')) {
|
|
1223
|
-
setupContainer.classList.add('mobile-setup');
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
rowWrapper.append(setupContainer);
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
body.append(rowWrapper);
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
container.append(body);
|
|
1233
|
-
|
|
1234
|
-
// Initialize drag and drop functionality
|
|
1235
|
-
makeSortable(body);
|
|
1236
|
-
|
|
1237
|
-
return container;
|
|
1238
|
-
};
|
|
1239
|
-
|
|
1240
|
-
/**
|
|
1241
|
-
* Get the name of the current setup.
|
|
1242
|
-
*
|
|
1243
|
-
* @return {Promise<string>} The name of the current setup.
|
|
1244
|
-
*/
|
|
1245
|
-
const getNameOfCurrentSetup = async () => {
|
|
1246
|
-
const setups = await getFavoriteSetups(false);
|
|
1247
|
-
|
|
1248
|
-
if (! setups.length) {
|
|
1249
|
-
return '';
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
// if we have a setup with the same IDs, then return the name of that setup.
|
|
1253
|
-
const currentSetup = getCurrentSetup();
|
|
1254
|
-
|
|
1255
|
-
const setup = setups.find((s) => {
|
|
1256
|
-
return s?.bait_id === currentSetup?.bait_id &&
|
|
1257
|
-
s?.base_id === currentSetup?.base_id &&
|
|
1258
|
-
s?.weapon_id === currentSetup?.weapon_id &&
|
|
1259
|
-
s?.trinket_id === currentSetup?.trinket_id;
|
|
1260
|
-
});
|
|
1261
|
-
|
|
1262
|
-
if (setup && setup.name) {
|
|
1263
|
-
return setup.name;
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
return '';
|
|
1267
|
-
};
|
|
1268
|
-
|
|
1269
|
-
/**
|
|
1270
|
-
* Update the name of the current setup in the trap UI.
|
|
1271
|
-
*/
|
|
1272
|
-
const updateFavoriteSetupName = async () => {
|
|
1273
|
-
const label = document.querySelector('.mh-improved-favorite-setups-button-label');
|
|
1274
|
-
if (label) {
|
|
1275
|
-
label.innerHTML = await getNameOfCurrentSetup() || '';
|
|
1276
|
-
}
|
|
1277
|
-
};
|
|
1278
|
-
|
|
1279
|
-
/**
|
|
1280
|
-
* Send a setup to the mobile app.
|
|
1281
|
-
* @param {number} slot The slot to send the setup to.
|
|
1282
|
-
* @param {FavoriteSetup} setup The setup to send.
|
|
1283
|
-
* @return {Promise<Object>} The response from the server.
|
|
1284
|
-
*/
|
|
1285
|
-
const setMobileFavourite = async (slot, setup) => {
|
|
1286
|
-
const response = await postMobileTrapAction('set', {
|
|
1287
|
-
slot,
|
|
1288
|
-
weapon_id: setup.weapon_id ?? '',
|
|
1289
|
-
base_id: setup.base_id ?? '',
|
|
1290
|
-
trinket_id: setup.trinket_id ?? '',
|
|
1291
|
-
skin_id: '',
|
|
1292
|
-
bait_id: setup.bait_id ?? '',
|
|
1293
|
-
name: setup.name.slice(0, 20) ?? '',
|
|
1294
|
-
is_current_favourite: false,
|
|
1295
|
-
});
|
|
1296
|
-
|
|
1297
|
-
return response;
|
|
1298
|
-
};
|
|
1299
|
-
|
|
1300
|
-
/**
|
|
1301
|
-
* Delete a mobile favourite setup.
|
|
1302
|
-
* @param {*} slot The slot to delete.
|
|
1303
|
-
* @return {Promise<Object>} The response from the server.
|
|
1304
|
-
*/
|
|
1305
|
-
const deleteMobileFavourite = async (slot) => {
|
|
1306
|
-
const response = await postMobileTrapAction('delete', {
|
|
1307
|
-
slot,
|
|
1308
|
-
});
|
|
1309
|
-
|
|
1310
|
-
return response;
|
|
1311
|
-
};
|
|
1312
|
-
|
|
1313
|
-
/**
|
|
1314
|
-
* Send a favorite setup action.
|
|
1315
|
-
* @param {string} action The action to send.
|
|
1316
|
-
* @param {Object} data The data to send.
|
|
1317
|
-
* @return {Promise<Object>} The user data.
|
|
1318
|
-
*/
|
|
1319
|
-
const postMobileTrapAction = async (action, data) => {
|
|
1320
|
-
const response = await doRequest('api/action/trapfavourite', {
|
|
1321
|
-
...data,
|
|
1322
|
-
action,
|
|
1323
|
-
});
|
|
1324
|
-
|
|
1325
|
-
return response.user;
|
|
1326
|
-
};
|
|
1327
|
-
|
|
1328
|
-
/**
|
|
1329
|
-
* Add a button to the camp page to toggle the favorite setups.
|
|
1330
|
-
*/
|
|
1331
|
-
const addFavoriteSetupsButton = async () => {
|
|
1332
|
-
if ('camp' !== getCurrentPage()) {
|
|
1333
|
-
return;
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
const existingButton = document.querySelector('.mh-improved-favorite-setups-button');
|
|
1337
|
-
if (existingButton) {
|
|
1338
|
-
return;
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
const appendTo = document.querySelector('.trapSelectorView__trapStatSummaryContainer');
|
|
1342
|
-
if (! appendTo) {
|
|
1343
|
-
return;
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
const button = makeElement('a', ['mh-improved-favorite-setups-button']);
|
|
1347
|
-
makeElement('div', ['mh-improved-favorite-setups-button-text'], 'Favorite Setups', button);
|
|
1348
|
-
const label = makeElement('div', ['mh-improved-favorite-setups-button-label']);
|
|
1349
|
-
|
|
1350
|
-
label.innerHTML = await getNameOfCurrentSetup();
|
|
1351
|
-
button.append(label);
|
|
1352
|
-
|
|
1353
|
-
button.addEventListener('click', toggleFavoriteSetups);
|
|
1354
|
-
|
|
1355
|
-
const auraTable = document.querySelector('.mh-improved-aura-view.campPage-trap-auraEffectiveness');
|
|
1356
|
-
if (auraTable) {
|
|
1357
|
-
// Insert after the aura table.
|
|
1358
|
-
auraTable.after(button);
|
|
1359
|
-
} else {
|
|
1360
|
-
const minLuckTable = document.querySelector('.mh-cre-table.campPage-trap-trapEffectiveness');
|
|
1361
|
-
if (minLuckTable) {
|
|
1362
|
-
minLuckTable.before(button);
|
|
1363
|
-
return;
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
// Append as a sibling to the existing button.
|
|
1367
|
-
appendTo.append(button);
|
|
1368
|
-
}
|
|
1369
|
-
};
|
|
1370
|
-
|
|
1371
|
-
/**
|
|
1372
|
-
* Show or hide the favorite setups.
|
|
1373
|
-
*/
|
|
1374
|
-
const toggleFavoriteSetups = async () => {
|
|
1375
|
-
const content = await makeBlueprintContainer();
|
|
1376
|
-
toggleBlueprint('favorite-setups', content);
|
|
1377
|
-
};
|
|
1378
|
-
|
|
1379
|
-
/**
|
|
1380
|
-
* Add an icon to the menu.
|
|
1381
|
-
*/
|
|
1382
|
-
const addIcon = () => {
|
|
1383
|
-
addIconToMenu({
|
|
1384
|
-
id: 'favorite-setups',
|
|
1385
|
-
classname: 'mousehunt-improved-favorite-setups-icon',
|
|
1386
|
-
title: 'Favorite Setups',
|
|
1387
|
-
action: toggleFavoriteSetups,
|
|
1388
|
-
position: 'prepend',
|
|
1389
|
-
});
|
|
1390
|
-
};
|
|
1391
|
-
|
|
1392
|
-
/**
|
|
1393
|
-
* Initialize the module.
|
|
1394
|
-
*/
|
|
1395
|
-
const init = async () => {
|
|
1396
|
-
addStyles(styles, 'favorite-setups');
|
|
1397
|
-
|
|
1398
|
-
onNavigation(addFavoriteSetupsButton, {
|
|
1399
|
-
page: 'camp',
|
|
1400
|
-
});
|
|
1401
|
-
|
|
1402
|
-
let timeoutId;
|
|
1403
|
-
onEvent('camp_page_arm_item', () => {
|
|
1404
|
-
// Clear the previous timeout if it exists
|
|
1405
|
-
if (timeoutId) {
|
|
1406
|
-
clearTimeout(timeoutId);
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
// Set a new timeout to call the function after 500ms
|
|
1410
|
-
timeoutId = setTimeout(updateFavoriteSetupName, 500);
|
|
1411
|
-
});
|
|
1412
|
-
|
|
1413
|
-
if (getSetting('experiments.favorite-setups-toggle', false)) {
|
|
1414
|
-
addIcon();
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
onEvent('mh-improved-toggle-favorite-setups', toggleFavoriteSetups);
|
|
1418
|
-
};
|
|
1419
|
-
|
|
1420
|
-
/**
|
|
1421
|
-
* Initialize the module.
|
|
1422
|
-
*/
|
|
1423
|
-
export default {
|
|
1424
|
-
id: 'favorite-setups',
|
|
1425
|
-
name: 'Favorite Setups',
|
|
1426
|
-
type: 'feature',
|
|
1427
|
-
default: true,
|
|
1428
|
-
description: 'Save your favorite setups and arm them with a single click.',
|
|
1429
|
-
load: init,
|
|
1430
|
-
settings,
|
|
1431
|
-
};
|