Skip to content

Commit

Permalink
Add weekly set filter for random spots (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalD96 committed Jan 11, 2023
1 parent 7ff3d38 commit 9333149
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions assets/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,12 @@ function filterMapMarkers() {
const weeklyItems = Weekly.current.collectibleItems.map(item => item.itemId);
filterType = marker => weeklyItems.includes(marker.itemId);
}
else if (Settings.filterType === 'weeklyAndRandom') {
const weeklyItems = Weekly.current.collectibleItems.map(item => item.itemId);
filterType = marker =>
weeklyItems.includes(marker.itemId) ||
weeklyItems.some(item => marker.possibleItems && marker.possibleItems.includes(item));
}
else if (Settings.filterType === 'important') {
const importantItems = Item.items.filter(item => item.isImportant).map(item => item.itemId);
filterType = marker => importantItems.includes(marker.itemId);
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ <h2 class="header-title" data-text="menu.settings">Settings</h2>
<option value="moonshiner" data-text="menu.filter_type.moonshiner">Moonshiner</option>
<option value="naturalist" data-text="menu.filter_type.naturalist">Naturalist</option>
<option value="weekly" data-text="menu.filter_type.weekly_set">Weekly set</option>
<option value="weeklyAndRandom" data-text="menu.filter_type.weekly_set_and_random">Weekly set + random spots</option>
<option value="important" data-text="menu.filter_type.important_items">Important items</option>
<option value="static" data-text="menu.filter_type.only_static">Only static</option>
<option value="hideFlowers" data-text="menu.filter_type.hide_flowers">Hide no ingredients flowers</option>
Expand Down
9 changes: 5 additions & 4 deletions langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1876,15 +1876,18 @@
"menu.modal_loot_table_title": "Loot Table",
"menu.modal_loot_table_all_tables_descr": "To view all loot tables visit {int.random_spot.link}",
"menu.filter_type": "Filter markers",
"help.filter_type": "Allows you to filter items based on certain criteria.",
"help.filter_type": "Allows you to filter items based on certain criteria.\n\"+ random spots\" means that only random spots, where you have a chance to find filtered items will be shown.",
"menu.filter_type.none": "None",
"menu.filter_type.moonshiner": "Moonshiner",
"menu.filter_type.naturalist": "Naturalist",
"menu.filter_type.weekly_set": "Weekly set",
"menu.filter_type.weekly_set_and_random": "Weekly set + random spots",
"menu.filter_type.important_items": "Important items",
"menu.filter_type.only_static": "Only static",
"menu.filter_type.all_coins_spots": "All possible coins spots",
"menu.filter_type.hide_flowers": "Hide no ingredients flowers",
"menu.filter_type.hide_flowers": "Hide no moonshine ingredients flowers",
"menu.filter_type.low_amount_items": "Only low inventory items",
"menu.filter_type.low_amount_items_and_random": "Only low inventory items + random spots",
"menu.join_discord": "Join our Discord!",
"help.join_discord": "Opens the new tab with collectors map Discord.",
"help.weekly_item_collectable": "This item can be collected by going to the corresponding location marked on the map.",
Expand Down Expand Up @@ -2107,8 +2110,6 @@
"menu.random_spot_metal": "Random Spots (metal detector)",
"menu.random_spot_shovel": "Random Spots (shovel)",
"help.filter_min_amount_items": "Allows you to set max amount of items in your inventory considered as \"low inventory items\".",
"menu.filter_type.low_amount_items": "Only low inventory items",
"menu.filter_type.low_amount_items_and_random": "Only low inventory items + random spots",
"menu.filter_min_amount_items": "Show only items amount lower than",
"menu.sponsors": "Sponsors",
"menu.import_rdo_inventory": "Import RDO inventory",
Expand Down

0 comments on commit 9333149

Please sign in to comment.