Skip to content

Commit

Permalink
Pre-empting update that breaks upgrade page quicknav module
Browse files Browse the repository at this point in the history
  • Loading branch information
Numbers committed Dec 6, 2022
1 parent 3249718 commit 0099f93
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
1.28.12: Pre-empting update that breaks upgrade page quicknav module
1.28.11: Pre-empting update that breaks pachinko names module
1.28.10: Fixing Double Date indicator on the home screen. Updating patrons list for December.
1.28.9: Adding new world data for CxH and PSH
Expand Down
6 changes: 3 additions & 3 deletions dist/hh-plus-plus.dev.user.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/hh-plus-plus.meta.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Hentai Heroes++ BDSM version
// @description Adding things here and there in the Hentai Heroes game. Also supports HHCore-based games such as GH and CxH.
// @version 1.28.11
// @version 1.28.12
// @match https://*.hentaiheroes.com/*
// @match https://nutaku.haremheroes.com/*
// @match https://*.gayharem.com/*
Expand Down
6 changes: 3 additions & 3 deletions dist/hh-plus-plus.user.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hh-plus-plus",
"version": "1.28.11",
"version": "1.28.12",
"description": "Adding things here and there in the Hentai Heroes game. Also supports HHCore-based games such as GH and CxH.",
"private": "true",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/collectors/HaremFilterCollector.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { lsKeys } from '../common/Constants'
import Helpers from '../common/Helpers'

class HaremFilterCollector {
static collect () {
static collect() {
if (Helpers.isCurrentPage('harem') && !Helpers.isCurrentPage('hero')) {
Helpers.defer(() => {
const hook = (actual, ...args) => {
const ret = actual(...args)
const {harem: {sortedGirls, filteredGirlsIds}} = window
const { harem: { sortedGirls, filteredGirlsIds } } = window
if (sortedGirls && filteredGirlsIds) {
setTimeout(Helpers.lsSet(lsKeys.HAREM_FILTER_IDS, sortedGirls.filter(({id_girl, own})=>own && filteredGirlsIds.includes(id_girl)).map(({id_girl})=>id_girl)))
setTimeout(Helpers.lsSet(lsKeys.HAREM_FILTER_IDS, sortedGirls.filter(({ id_girl, own }) => own && filteredGirlsIds.includes(id_girl)).map(({ id_girl }) => `${id_girl}`)))
}
return ret
}
Expand Down
24 changes: 12 additions & 12 deletions src/modules/UpgradeQuickNavModule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ const MODULE_KEY = 'upgradeQuickNav'
const RESOURCE_TYPES = ['experience', 'affection']

class UpgradeQuickNavModule extends CoreModule {
constructor () {
constructor() {
super({
baseKey: MODULE_KEY,
label: I18n.getModuleLabel('config', MODULE_KEY),
default: true
})
this.label = I18n.getModuleLabel.bind(this, MODULE_KEY)

this.linkUrls = {prev: {}, next: {}}
this.linkUrls = { prev: {}, next: {} }
}

shouldRun () {
shouldRun() {
return Helpers.isCurrentPage('/girl/')
}

run () {
if (this.hasRun || !this.shouldRun()) {return}
run() {
if (this.hasRun || !this.shouldRun()) { return }

styles.use()

Helpers.defer(() => {
const filteredGirlIds = Helpers.lsGet(lsKeys.HAREM_FILTER_IDS)
if (!filteredGirlIds || filteredGirlIds.length < 2) {return}
if (!filteredGirlIds || filteredGirlIds.length < 2) { return }
const girlDictionary = Helpers.getGirlDictionary()
const currentGirlId = window.girl.id_girl

Expand All @@ -57,8 +57,8 @@ class UpgradeQuickNavModule extends CoreModule {
nextGirlId = filteredGirlIds[filteredGirlIds.length - 1]
}

const previousGirl = girlDictionary.get(previousGirlId)
const nextGirl = girlDictionary.get(nextGirlId)
const previousGirl = girlDictionary.get(`${previousGirlId}`)
const nextGirl = girlDictionary.get(`${nextGirlId}`)

const $girlAvatar = $('.girl-section .girl-avatar')

Expand All @@ -76,10 +76,10 @@ class UpgradeQuickNavModule extends CoreModule {
const tabSystemHook = (...args) => {
const ret = initTabSystem_actual(...args)

const {tab_system_instances} = window
const { tab_system_instances } = window

const tabsInstance = tab_system_instances['girl-leveler-tabs']
const {tabs} = tabsInstance
const { tabs } = tabsInstance

const switchTab_actual = tabs.affection.callback
const hook = (tabContent) => {
Expand All @@ -97,7 +97,7 @@ class UpgradeQuickNavModule extends CoreModule {
this.hasRun = true
}

buildAvatarHtml (id, {pose}, className) {
buildAvatarHtml(id, { pose }, className) {
const ava = `${Helpers.getCDNHost()}/pictures/girls/${id}/ava${pose}.png`
RESOURCE_TYPES.forEach(type => {
this.linkUrls[className][type] = `/girl/${id}?resource=${type}`
Expand All @@ -106,7 +106,7 @@ class UpgradeQuickNavModule extends CoreModule {
return Helpers.$(`<a class="script-quicknav-${className}" href="${this.linkUrls[className][this.getCurrentResource()]}"><img girl-ava-src="${ava}"/></a>`)
}

getCurrentResource () {
getCurrentResource() {
let resource = 'experience'
if (location.search && location.search.includes('resource')) {
const urlPattern = new RegExp('resource=(?<resource>[a-z]+)')
Expand Down

0 comments on commit 0099f93

Please sign in to comment.