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

feat: smart Heirloom pop alert #239

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,8 @@ var toReturn = {
voidPopups: {
extraTags: "alerts",
enabled: 1,
description: "Decide whether or not you want popups on looting an Heirloom.",
titles: ["No Heirloom Pop", "Popping Heirlooms"]
description: "Decide whether or not you want popups on looting an Heirloom, depending on the rarity of your currently equipped heirloom",
titles: ["No Heirloom Pop", "Popping Heirlooms", "Same or better Heirlooms", "Better Heirlooms"]
},
detailedPerks: {
extraTags: "qol",
Expand Down
24 changes: 24 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6612,6 +6612,30 @@ var lastDisplayedHeirloom = new Date().getTime();
function displaySelectedHeirloom(modSelected, selectedIndex, fromTooltip, locationOvr, indexOvr, fromPopup, fromSelect){
if (fromPopup && !game.options.menu.voidPopups.enabled) return;
var heirloom = getSelectedHeirloom(locationOvr, indexOvr);

if (fromPopup && game.options.menu.voidPopups.enabled > 1) {
var currentHeirloom;
switch (heirloom.type) {
case "Staff":
currentHeirloom = game.global.StaffEquipped;
break;
case "Shield":
currentHeirloom = game.global.ShieldEquipped;
break;
case "Core":
currentHeirloom = game.global.CoreEquipped;
break;
}
if (currentHeirloom) {
var targetRarity = currentHeirloom.rarity;
if (game.options.menu.voidPopups.enabled === 3) {
targetRarity++;
}

if (heirloom.rarity < targetRarity) return;
}
}

var icon = getHeirloomIcon(heirloom);
var animated = (game.options.menu.showHeirloomAnimations.enabled) ? "animated " : "";
var html = '<div class="selectedHeirloomItem ' + animated + 'heirloomRare' + heirloom.rarity + '"><div class="row selectedHeirloomRow"><div onclick="tooltip(\'Change Heirloom Icon\', null, \'update\')" class="col-xs-2 selectedHeirloomIcon" id="' + ((fromTooltip) ? 'tooltipHeirloomIcon' : 'selectedHeirloomIcon') + '"><span class="' + icon + '"></span></div><div class="col-xs-10"><h5 aria-label="Rename Heirloom" onclick="renameHeirloom(';
Expand Down