From 2f711db66c52d18584fc3417cf78c6defb78618e Mon Sep 17 00:00:00 2001 From: GaboGG Date: Fri, 31 Jul 2026 10:42:39 -0400 Subject: [PATCH] v0.14.38 - Gear analysis on equipment pages too (ss=eq) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - enhanceGearAnalysis now also fires on Character > Equipment pages (id=eqsb), not just Bazaar (equiplist) - On equipment pages only the Analyze button shows (Rescan hidden — no store/inventory data to rescan there, but the localStorage DB is still accessible for the comparison) - Clicking Analyze on ss=eq rescrapes equipped slots + opens panel with stored/purchasable comparisons from localStorage --- scripts/hv-unified.user.js | 22 +++++++++++++++------- scripts/latest.user.js | 22 +++++++++++++++------- src/config.js | 2 +- src/gear-analysis.js | 18 +++++++++++++----- src/header.user.js | 2 +- 5 files changed, 45 insertions(+), 21 deletions(-) diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index 866f8e1..dbc3568 100644 --- a/scripts/hv-unified.user.js +++ b/scripts/hv-unified.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.14.37 +// @version 0.14.38 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* @@ -17,7 +17,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.14.37'; +const VERSION = '0.14.38'; const CFG = { // — Battle automation @@ -3936,12 +3936,16 @@ function buildGearPanel() { } function enhanceGearAnalysis() { - // Only on Bazaar pages with equiplist - if (!document.getElementById('equiplist')) return; + // Works on Bazaar pages (equiplist) AND equipment pages (eqsb) + const equiplist = document.getElementById('equiplist'); + const eqsb = document.getElementById('eqsb'); + if (!equiplist && !eqsb) return; if (document.getElementById('hv-gear-btn')) return; const url = window.location.href || ''; const isBuy = url.includes('screen=purchase') || url.includes('ss=bi'); + // On equipment pages, only show the Analyze button (no rescan — no store data there) + const isEquipPage = !!eqsb && !equiplist; const bar = document.createElement('div'); bar.id = 'hv-gear-btn'; @@ -3998,13 +4002,17 @@ function enhanceGearAnalysis() { } }; bar.appendChild(rescanBtn); + if (isEquipPage) rescanBtn.style.display = 'none'; - // Insert into the page (next to the armory toolbar if present) - const equiplist = document.getElementById('equiplist'); + // Insert into the page — before equiplist (Bazaar) or after eqsb (equipment page) const container = document.createElement('div'); container.style.cssText = 'margin-bottom:4px'; container.appendChild(bar); - equiplist.parentNode.insertBefore(container, equiplist); + if (equiplist) { + equiplist.parentNode.insertBefore(container, equiplist); + } else if (eqsb) { + eqsb.parentNode.insertBefore(container, eqsb.nextSibling); + } console.log('%c[HV] 🛡️ Gear analysis enabled — click 🔍 or 🔄', 'color:#0f0'); } diff --git a/scripts/latest.user.js b/scripts/latest.user.js index 866f8e1..dbc3568 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.14.37 +// @version 0.14.38 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* @@ -17,7 +17,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.14.37'; +const VERSION = '0.14.38'; const CFG = { // — Battle automation @@ -3936,12 +3936,16 @@ function buildGearPanel() { } function enhanceGearAnalysis() { - // Only on Bazaar pages with equiplist - if (!document.getElementById('equiplist')) return; + // Works on Bazaar pages (equiplist) AND equipment pages (eqsb) + const equiplist = document.getElementById('equiplist'); + const eqsb = document.getElementById('eqsb'); + if (!equiplist && !eqsb) return; if (document.getElementById('hv-gear-btn')) return; const url = window.location.href || ''; const isBuy = url.includes('screen=purchase') || url.includes('ss=bi'); + // On equipment pages, only show the Analyze button (no rescan — no store data there) + const isEquipPage = !!eqsb && !equiplist; const bar = document.createElement('div'); bar.id = 'hv-gear-btn'; @@ -3998,13 +4002,17 @@ function enhanceGearAnalysis() { } }; bar.appendChild(rescanBtn); + if (isEquipPage) rescanBtn.style.display = 'none'; - // Insert into the page (next to the armory toolbar if present) - const equiplist = document.getElementById('equiplist'); + // Insert into the page — before equiplist (Bazaar) or after eqsb (equipment page) const container = document.createElement('div'); container.style.cssText = 'margin-bottom:4px'; container.appendChild(bar); - equiplist.parentNode.insertBefore(container, equiplist); + if (equiplist) { + equiplist.parentNode.insertBefore(container, equiplist); + } else if (eqsb) { + eqsb.parentNode.insertBefore(container, eqsb.nextSibling); + } console.log('%c[HV] 🛡️ Gear analysis enabled — click 🔍 or 🔄', 'color:#0f0'); } diff --git a/src/config.js b/src/config.js index d8cc74f..61fded9 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.14.37'; +const VERSION = '0.14.38'; const CFG = { // — Battle automation diff --git a/src/gear-analysis.js b/src/gear-analysis.js index 94ca46b..577999c 100644 --- a/src/gear-analysis.js +++ b/src/gear-analysis.js @@ -228,12 +228,16 @@ function buildGearPanel() { } function enhanceGearAnalysis() { - // Only on Bazaar pages with equiplist - if (!document.getElementById('equiplist')) return; + // Works on Bazaar pages (equiplist) AND equipment pages (eqsb) + const equiplist = document.getElementById('equiplist'); + const eqsb = document.getElementById('eqsb'); + if (!equiplist && !eqsb) return; if (document.getElementById('hv-gear-btn')) return; const url = window.location.href || ''; const isBuy = url.includes('screen=purchase') || url.includes('ss=bi'); + // On equipment pages, only show the Analyze button (no rescan — no store data there) + const isEquipPage = !!eqsb && !equiplist; const bar = document.createElement('div'); bar.id = 'hv-gear-btn'; @@ -290,13 +294,17 @@ function enhanceGearAnalysis() { } }; bar.appendChild(rescanBtn); + if (isEquipPage) rescanBtn.style.display = 'none'; - // Insert into the page (next to the armory toolbar if present) - const equiplist = document.getElementById('equiplist'); + // Insert into the page — before equiplist (Bazaar) or after eqsb (equipment page) const container = document.createElement('div'); container.style.cssText = 'margin-bottom:4px'; container.appendChild(bar); - equiplist.parentNode.insertBefore(container, equiplist); + if (equiplist) { + equiplist.parentNode.insertBefore(container, equiplist); + } else if (eqsb) { + eqsb.parentNode.insertBefore(container, eqsb.nextSibling); + } console.log('%c[HV] 🛡️ Gear analysis enabled — click 🔍 or 🔄', 'color:#0f0'); } diff --git a/src/header.user.js b/src/header.user.js index 306664b..05f7b98 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.14.37 +// @version 0.14.38 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/*