Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.36.0 #315

Merged
merged 91 commits into from Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
f1317eb
Rewrite update migration
bradp Mar 16, 2024
887751f
Fix typos
bradp Mar 16, 2024
cdf6f91
Remove Larry's Links module
bradp Mar 16, 2024
b520894
Organizes fixes, add fix for tab styles
bradp Mar 16, 2024
cb6f378
- Journal replacement and modifications now happen more efficiently a…
bradp Mar 16, 2024
25e6517
Move mice data to external file for brift location hud
bradp Mar 16, 2024
094c880
Add Hide News Ticker module
bradp Mar 16, 2024
f7d07eb
Remove empty file
bradp Mar 16, 2024
bff27ad
Move feature flags code to experiments module, add new experiments: "…
bradp Mar 16, 2024
252d47c
Adds new ‘Hide max quantity owned’ setting, Adds new setting to show …
bradp Mar 16, 2024
d3e818d
Adds a ‘Show Drop Rates’ setting for Better Item View, Adds a ‘Show A…
bradp Mar 16, 2024
d82c59d
remove news ticker from adblock, use the standalone module
bradp Mar 16, 2024
62aa9fb
Fixes the recipe results tooltip not showing quickly & not caching th…
bradp Mar 16, 2024
58f4920
minor cleanup
bradp Mar 16, 2024
93eb052
Add styles
bradp Mar 16, 2024
edad4be
rewrote much of image upscaling for better performance and memory usa…
bradp Mar 16, 2024
d245f5b
Fix show auras duplicating and behaving oddly, fix styles and display
bradp Mar 16, 2024
df18ba7
Fixes bugs with favorite setups showing, saves location where setup w…
bradp Mar 16, 2024
03c2d6e
update external links
bradp Mar 16, 2024
7e42b54
fix
bradp Mar 16, 2024
82b7b4f
Fix typos
bradp Mar 16, 2024
af7d830
Use id for logging
bradp Mar 16, 2024
dc94c09
Updates Bountiful Beanstalk Location HUD: makes the inventory panel s…
bradp Mar 16, 2024
816918a
Updates Iceberg Location HUD - allows scrolling the map, adds setting…
bradp Mar 16, 2024
2528148
remove map show on clicl
bradp Mar 16, 2024
19652ce
Updates Laby Location HUD - adds easter egg when clicking on the curr…
bradp Mar 16, 2024
bbfee18
Update styles
bradp Mar 16, 2024
5ff2d0a
Use Enable/Disable for location HUD button rather than Enable HUD/Dis…
bradp Mar 16, 2024
ea57d2c
Clean up travel settings
bradp Mar 16, 2024
d5622cf
Add version number to settings page, clicking on it opens update summary
bradp Mar 16, 2024
e6db9c8
Rewrite update notifications
bradp Mar 16, 2024
5389627
Update styles and other misc func
bradp Mar 16, 2024
142127e
Better Marketplace - Add option to show charts on category pages
bradp Mar 16, 2024
584a107
Add update summary, update changelog, minor changes
bradp Mar 16, 2024
61bef3f
Linting
bradp Mar 16, 2024
b9f8e80
linting
bradp Mar 16, 2024
e35b6a0
fixes and updates
bradp Mar 16, 2024
2bd622a
Call journal replacements twice, once after delay
bradp Mar 18, 2024
db2242a
Update styles.css in various modules
bradp Mar 18, 2024
9109e7b
Add click to equip cursebreaking charms in cursed city
bradp Mar 18, 2024
2c0a88f
Makes the giant more visible during chase
bradp Mar 18, 2024
f278ba1
Pull update summary from api
bradp Mar 18, 2024
17a2b32
Fix journal changer incorrectly randomizing theme more than once per day
bradp Mar 18, 2024
13bdc9a
remove update summary infavor of api
bradp Mar 18, 2024
b519034
Update CHANGELOG.md with new features and settings
bradp Mar 18, 2024
f80f8de
Update tab header height and padding
bradp Mar 18, 2024
c358ad9
Fix typo in troll mode function call
bradp Mar 18, 2024
60cba38
Cleanup
bradp Mar 18, 2024
3814af7
Remove unused function isTwisted() from region-living-garden module
bradp Mar 18, 2024
84fc1e8
Add margin and border-radius to word meter value
bradp Mar 18, 2024
f6a5455
Update timeout values in onRequest function
bradp Mar 18, 2024
330eb39
Update changelog
bradp Mar 18, 2024
7869d6a
Update CSS styles for various modules
bradp Mar 19, 2024
f9ee8d0
Add styles.css to better-journal-icons module
bradp Mar 19, 2024
dba1f88
Make mice info view break group and subgroup into two lines
bradp Mar 19, 2024
b87fed9
Add mice hover
bradp Mar 19, 2024
a7bb56c
Add quest class to aura view
bradp Mar 19, 2024
fcd305e
Add more custom hud
bradp Mar 19, 2024
315cd00
styles
bradp Mar 19, 2024
606b0cd
linting
bradp Mar 19, 2024
950f305
Add loading placeholder to hover profiles
bradp Mar 19, 2024
ee323ba
Fix data caching issues
bradp Mar 19, 2024
dd301ed
fix double journal replacements
bradp Mar 19, 2024
a0d40ca
update changelog
bradp Mar 19, 2024
3f0a02d
Fix offset calculation in lgs-reminder module
bradp Mar 19, 2024
5639aa5
Update changelog
bradp Mar 19, 2024
850c909
fix lint
bradp Mar 19, 2024
3a0f154
Update journal item colors to use json file and dynamically create it…
bradp Mar 19, 2024
9ed5860
update changelog
bradp Mar 19, 2024
4c396b0
update styles
bradp Mar 20, 2024
14d1194
Add SEH styles
bradp Mar 20, 2024
2d1f656
Fix image upscaling
bradp Mar 20, 2024
7c9c045
Update journal list and replacements to work with more things
bradp Mar 20, 2024
f6061f1
Fix recipe results tooltip not showing on page navigation, only on re…
bradp Mar 20, 2024
1830165
Adds styles for the Tsuitu's autoloader
bradp Mar 20, 2024
9be8b5a
Fix potential null var in map travel confirmation
bradp Mar 20, 2024
6b0ae85
cleanup
bradp Mar 20, 2024
139aefa
Adds Spring Egg Hunt horn as an option to custom horn
bradp Mar 20, 2024
8881196
Fix show auras duplicating
bradp Mar 20, 2024
b744c96
update changelog
bradp Mar 20, 2024
b2e6698
Comment out patreon link
bradp Mar 20, 2024
9feec88
Update folklore-forest.css with flexbox and height adjustments
bradp Mar 20, 2024
24bc2fa
fix duplicate gold and points entries
bradp Mar 20, 2024
7998a29
fix show auras
bradp Mar 20, 2024
c5513b6
update journal history
bradp Mar 20, 2024
cb05bd0
update dark mode
bradp Mar 20, 2024
265f5bb
Update styles.css for spring-egg-hunt and settings modules
bradp Mar 20, 2024
5b58b23
update styles/fix linting
bradp Mar 20, 2024
86d9c38
move marketplace charts to experiment
bradp Mar 20, 2024
d173f32
update changelog
bradp Mar 20, 2024
686e449
update update notification
bradp Mar 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
318 changes: 235 additions & 83 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "mh-ui",
"version": "0.35.6",
"version": "0.36.0",
"description": "Improve your MouseHunt experience.",
"author": "Brad Parbs <brad@bradparbs.com> (https://bradparbs.com/)",
"license": "MIT",
Expand Down
40 changes: 32 additions & 8 deletions src/data/settings.json
@@ -1,17 +1,41 @@
{
"no-reminders": [
"adblock",
"inline-wiki",
"no-footer",
"no-sidebar",
"hide-daily-reward-popup",
"journal-privacy",
"journal-privacy.show-toggle-icon",
"debug",
"better-gifts.ignore-bad-gifts",
"better-gifts.send-order",
"better-item-view.show-drop-rates",
"better-marketplace.search-all",
"better-marketplace.show-chart-images",
"better-mice.show-attraction-rates",
"better-quests.m400-helper",
"better-send-supplies.pinned-items",
"better-tournaments.time-inline",
"better-travel.default-to-simple-travel",
"better-travel.show-alphabetized-list",
"debug.all",
"debug.dialog",
"debug.events",
"debug.module-loading",
"debug.navigation",
"debug.request",
"debug.events"
"debug.utils-data",
"debug",
"error-reporting",
"hide-codices",
"hide-daily-reward-popup",
"hide-news-ticker",
"inline-wiki",
"inventory-only-open-multiple",
"journal-privacy.show-toggle-icon",
"journal-privacy",
"larger-codices",
"lgs-reminder.new-style",
"no-footer",
"no-share",
"no-sidebar",
"quick-send-supplies.items",
"taller-windows",
"ultimate-checkmark.show"
],
"icons": [
{
Expand Down
8 changes: 4 additions & 4 deletions src/extension/popup.html
Expand Up @@ -41,10 +41,10 @@ <h1>MouseHunt Improved</h1>
</header>
<main>
<ul>
<li><a href="https://www.mousehuntgame.com/preferences.php?tab=mousehunt-improved-settings" target="_blank">Settings</a></li>
<li><a href="https://github.com/MHCommunity/mousehunt-improved/releases" target="_blank">Changelog</a></li>
<li><a href="https://github.com/MHCommunity/mousehunt-improved" target="_blank">GitHub</a></li>
<li><a href="https://github.com/MHCommunity/mousehunt-improved/issues" target="_blank">Report an issue</a></li>
<li><a href="https://www.mousehuntgame.com/preferences.php?tab=mousehunt-improved-settings" target="_blank" rel="noopener noreferrer">Settings</a></li>
<li><a href="https://github.com/MHCommunity/mousehunt-improved/releases" target="_blank" rel="noopener noreferrer">Changelog</a></li>
<li><a href="https://github.com/MHCommunity/mousehunt-improved" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="https://github.com/MHCommunity/mousehunt-improved/issues" target="_blank" rel="noopener noreferrer">Report an issue</a></li>
</ul>
</main>
</body>
4 changes: 2 additions & 2 deletions src/index.js
Expand Up @@ -26,7 +26,7 @@ const modules = imported;
const loadModules = async () => {
const categories = [
{ id: 'required', name: 'Always Loaded' },
{ id: 'better', name: 'MouseHunt Improved' },
{ id: 'better', name: `MouseHunt Improved <span class="version">v${mhImprovedVersion}</span>` },
{ id: 'feature', name: 'Features' },
{ id: 'design', name: 'Design' },
{ id: 'element-hiding', name: 'Hide Page Elements' },
Expand Down Expand Up @@ -114,7 +114,7 @@ const loadModules = async () => {
}

// Log the loaded modules for the category.
debuglog('module-loading', `Loaded ${category.modules.length} ${category.name} modules`, loadedModules);
debuglog('module-loading', `Loaded ${category.modules.length} ${category.id} modules`, loadedModules);
}

// Wait for all modules to load.
Expand Down
1 change: 0 additions & 1 deletion src/modules/adblock/styles.css
Expand Up @@ -6,7 +6,6 @@
.journalactions a[data-share-type="journal"],
.journalactions a[data-type="journal"],
.mousehuntHeaderView-gameBanner,
.mousehuntHeaderView-newsTicker,
.pageSidebarView .fb-page,
.socialLink,
.newsPostFacebookContainer,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/better-gifts/settings/index.js
Expand Up @@ -64,7 +64,7 @@ export default async () => {
},
{
id: 'better-gifts.ignore-bad-gifts',
title: 'Ignore gifts that aren\'t the Gift of the Day',
title: 'Ignore gifts',
default: [skipBadGiftOptions[0]],
description: '',
settings: {
Expand Down
1 change: 0 additions & 1 deletion src/modules/better-gifts/styles.css
Expand Up @@ -443,7 +443,6 @@ a.mousehuntActionButton.giftSelectorView-action-confirm span {
border-color: #424242;
}

.mh-dark-mode .pageFrameView #mousehuntContainer.PageCamp .mh-improved-favorite-setups-button:hover,
.mh-dark-mode .pageFrameView #mousehuntContainer.PageCamp .campPage-trap-statsContainer:hover {
background-color: #494949;
}
Expand Down
10 changes: 5 additions & 5 deletions src/modules/better-inventory/index.js
Expand Up @@ -53,7 +53,7 @@ const setOpenQuantityOnClick = (attempts = 0) => {
/**
* Add the open all button to the convertible items.
*/
const addOpenAlltoConvertible = () => {
const addOpenAllToConvertible = () => {
const form = document.querySelector('.convertible .itemView-action-convertForm');
if (! form) {
return;
Expand All @@ -68,7 +68,7 @@ const addOpenAlltoConvertible = () => {
// get the innerHTML and split it on the input tag. then wrap the second match in a span so we can target it
const formHTML = form.innerHTML;
const formHTMLArray = formHTML.split(' /');
// if we dont have a second match, just return
// if we don't have a second match, just return
if (! formHTMLArray[1]) {
return;
}
Expand Down Expand Up @@ -162,19 +162,19 @@ const main = () => {
setOpenQuantityOnClick();
}

addOpenAlltoConvertible();
addOpenAllToConvertible();
addItemViewPopupToCollectibles();
addArmButtonToCharms();

onNavigation(() => {
addOpenAlltoConvertible();
addOpenAllToConvertible();
addItemViewPopupToCollectibles();
addArmButtonToCharms();
}, {
page: 'inventory',
});

onEvent('js_dialog_show', addOpenAlltoConvertible);
onEvent('js_dialog_show', addOpenAllToConvertible);

recipes();
};
Expand Down
23 changes: 22 additions & 1 deletion src/modules/better-inventory/recipes.js
@@ -1,4 +1,6 @@
import {
cacheGet,
cacheSet,
getCurrentSubtab,
getCurrentTab,
getUserItems,
Expand Down Expand Up @@ -148,6 +150,10 @@ const modifySmashableTooltip = async () => {
return;
}

item.addEventListener('mouseleave', () => {
item.classList.remove('new-tooltip-loading');
});

item.addEventListener('mouseenter', async () => {
if (item.getAttribute('data-new-tooltip') === 'newTooltip') {
return;
Expand All @@ -160,7 +166,14 @@ const modifySmashableTooltip = async () => {
const itemType = item.getAttribute('data-item-type');
producedItem.push(itemType);

const itemData = await getUserItems(producedItem);
item.classList.add('new-tooltip-loading');

let itemData = await cacheGet(`smashable-${producedItem.join('-')}`);
if (! itemData) {
itemData = await getUserItems(producedItem);
cacheSet(`smashable-${producedItem.join('-')}`, itemData);
}

if (! itemData || ! itemData[0]) {
return;
}
Expand Down Expand Up @@ -211,6 +224,8 @@ const modifySmashableTooltip = async () => {
});

tooltip.parentNode.insertBefore(tooltipWrapper, tooltip.nextSibling);

item.classList.remove('new-tooltip-loading');
});
});
};
Expand Down Expand Up @@ -288,6 +303,12 @@ export default async () => {
subtab: 'recipe',
});

onNavigation(modifySmashableTooltip, {
page: 'inventory',
tab: 'crafting',
subtab: 'hammer',
});

onEvent('js_dialog_show', warnOnBadCrafts);

modifySmashableTooltip();
Expand Down
52 changes: 41 additions & 11 deletions src/modules/better-inventory/styles/styles.css
Expand Up @@ -90,15 +90,9 @@
font-size: 9px;
}

.mousehuntHud-page-subTabContent.hammer .inventoryPage-item-margin.clear-block {
border: none;
border-radius: 0;
}

.mousehuntHud-page-subTabContent.hammer .inventoryPage-item:hover .inventoryPage-item-margin {
background-color: #e3e3e3;
outline: 1px solid #888;
box-shadow: none;
border-color: #c9c9c9;
}

.mousehuntHud-page-subTabContent.hammer .inventoryPage-item .tooltip,
Expand All @@ -107,9 +101,25 @@
}

.mousehuntHud-page-subTabContent.hammer .inventoryPage-item:hover .newTooltip {
left: 50%;
display: flex;
gap: 10px;
align-items: center;
justify-content: center;
width: auto;
min-width: 100px;
padding: 0;
border: none;
transform: translateX(-50%);
}

.mousehuntHud-page-subTabContent.hammer .inventoryPage-item:hover .newTooltip .inventoryPage-item-margin {
display: flex;
flex-direction: column;
align-items: center;
background-color: transparent;
border: none;
box-shadow: none;
}

.mousehuntHud-page-subTabContent.hammer .inventoryPage-item:hover .tooltip .inventoryPage-item-margin {
Expand Down Expand Up @@ -262,9 +272,15 @@ input.inventoryPage-tagDirectory-searchBar-input {
.inventoryPage-item.torn_page input.viewFront,
.inventoryPage-item.torn_page input.viewBack {
display: inline-block;
padding: 3px 5px;
border-radius: 3px;
box-shadow: 1px 1px 4px #fff2aa inset;
padding: 2px 4px;
color: #000;
text-shadow: 0 0 1px #fff;
background-color: #f4e830;
border: 1px solid #000;
border-radius: 4px;
box-shadow:
0 -5px 8px -2px #ffae00 inset,
1px 1px 1px #eee;
}

.inventoryPage-craftingTable-title {
Expand Down Expand Up @@ -514,9 +530,23 @@ a.inventoryPage-item-larryLexicon.tsitu-lock-convertible {

.inventoryPage-item.small .inventoryPage-item-margin {
margin-bottom: 10px;
box-shadow: 0 4px 10px -10px #000;
box-shadow: 0 4px 10px -8px #000;
}

.mousehuntHud-page-subTabContent.trinket .mousehuntHud-page-subTabContent-prefix {
display: none;
}

.new-tooltip-loading::after {
position: absolute;
inset: 0 0 10px;
content: "";
background:
url(https://www.mousehuntgame.com/images/ui/loaders/drip_spinner.gif?asset_cache_version=2) center no-repeat,
url(https://www.mousehuntgame.com/images/ui/backgrounds/overlay.png?asset_cache_version=2) 0 0 repeat;
border-radius: 10px;
}

.inventoryPage-item.small .tooltip {
padding: 10px;
}
30 changes: 19 additions & 11 deletions src/modules/better-item-view/index.js
@@ -1,13 +1,16 @@
import {
addStyles,
getArForMouse,
getSetting,
makeElement,
makeLink,
makeTooltip,
onOverlayChange,
onPageChange
} from '@utils';

import settings from './settings';

import styles from './styles.css';

/**
Expand Down Expand Up @@ -78,10 +81,14 @@ const updateItemView = async () => {

addLinks(itemId);

// dont show drop rates for items that arent consistent.
if (! getSetting('better-item-view.show-drop-rates', true)) {
return;
}

// don't show drop rates for items that aren't consistent.
const id = Number.parseInt(itemId, 10);
const ignored = [
2473, // mina's gift
2473, // Mina's gift
823, // party charm
803, // chrome charm
420, // king's credits
Expand All @@ -93,8 +100,8 @@ const updateItemView = async () => {
return;
}

let mhctjson = await getArForMouse(itemId, 'item');
if (! mhctjson || mhctjson === undefined) {
let mhctJson = await getArForMouse(itemId, 'item');
if (! mhctJson || mhctJson === undefined) {
return;
}

Expand All @@ -111,7 +118,7 @@ const updateItemView = async () => {

makeTooltip({
appendTo: titleText,
text: 'The best location and bait, according to data gathered by <a href="https://mhct.win/" target="_blank">MHCT</a>.',
text: 'The best location and bait, according to data gathered by <a href="https://mhct.win/" target="_blank" rel="noopener noreferrer">MHCT</a>.',
});

const link = makeElement('a', 'ar-link', 'View on MHCT →');
Expand All @@ -123,18 +130,18 @@ const updateItemView = async () => {
const itemsArWrapper = makeElement('div', 'item-ar-wrapper');

// check if there are stages in any of the item
const hasStages = mhctjson.some((itemAr) => itemAr.stage);
const hasStages = mhctJson.some((itemAr) => itemAr.stage);

if (hasStages) {
itemsArWrapper.classList.add('has-stages');
}

// shrink the mhctjson array to only include items with non-zero drop rates and a maxiumum of 15 items
mhctjson = mhctjson
// shrink the mhct json array to only include items with non-zero drop rates and a maximum of 15 items
mhctJson = mhctJson
.filter((itemAr) => Number.parseInt(itemAr.drop_pct, 10) > 0)
.slice(0, 15);
.slice(0, 10);

mhctjson.forEach((itemAr) => {
mhctJson.forEach((itemAr) => {
const dropPercent = Number.parseInt(itemAr.drop_pct, 10).toFixed(2);
if (dropPercent !== '0.00') {
const itemArWrapper = makeElement('div', 'mouse-ar-wrapper');
Expand All @@ -152,7 +159,7 @@ const updateItemView = async () => {
}
});

if (mhctjson.length > 0) {
if (mhctJson.length > 0) {
arWrapper.append(itemsArWrapper);
container.append(arWrapper);
}
Expand All @@ -174,4 +181,5 @@ export default {
default: true,
description: 'Updates the styles and shows drop rates, links to MHCT, and MH Wiki.',
load: init,
settings,
};