GiovanH / unofficial-homestuck-collection

An offline collection of Homestuck and its related works.
GNU General Public License v3.0
37 stars 4 forks source link

Retconned Panels appear in New Reader Mode for A6A5A1x2 #465

Closed Ylimegirl closed 1 year ago

Ylimegirl commented 1 year ago

Describe the bug When looking at page 5806 in the collection while in New Reader mode, the oil retcon file shows up instead of the original.

To Reproduce Steps to reproduce the behavior:

  1. Go to settings
  2. Set New Reader mode to page 5806
  3. Go to page 5806
  4. Uh oh! There's Oil!

Desktop (please complete the following information):

Additional context The asset pack has both versions of the panel in it (5803_2.gif and 5803_2_retcon.gif), so this seems to be a client display issue rather than an asset issue. Additionally, toggling the relevant granular retcon setting when out of new reader mode seems to have no effect either.

thecnoNSMB commented 1 year ago

I was able to reproduce this on my copy.

Bodertz commented 1 year ago

I may be stating the obvious, but the issue is a result of the combination of the "R4" flag and the "X2COMBO" flag. Removing the X2COMBO flag from the page in mspa.json will have the image show up de-retcon'd, but obviously it won't be a x2combo page anymore.

Bodertz commented 1 year ago

It seems to fix things if you add the deretcon method from Page.vue to x2Combo.vue:

methods: {
    deretcon(media) {
        // TODO: Refactor retcon resource reservations
        if (
            (this.thisPage.flag.includes('R1') && !this.$shouldRetcon('retcon1')) ||
                (this.thisPage.flag.includes('R2') && !this.$shouldRetcon('retcon2')) ||
                (this.thisPage.flag.includes('R3') && !this.$shouldRetcon('retcon3')) ||
                (this.thisPage.flag.includes('R4') && !this.$shouldRetcon('retcon4')) ||
                (this.thisPage.flag.includes('R5') && !this.$shouldRetcon('retcon5')) ){ 
            for (let i in media) {
                media[i] = media[i]
                    .replace(/1([0-9]{4})\/1[0-9]{4}\.swf/g, "0$1/0$1.swf")
                    .replace(/_?retcon(heir)?/, "")
                // if (media[i] != this.thisPage.media[i]) {
                //   console.log(`DERETCONNING: ${this.thisPage.media[i]} ==> ${media[i]}`)
                // }
            }
        }
        return media
    },
    [...]
}

And edit pageMedia:

computed: {
    [...]
    pageMedia() {
      // TODO: This doesn't seem to be used anywhere or do anything.
      // Also it's a side-effect in a computed statement for no good reason.
      this.preload = []
      let preloadPages = [
        this.nextPagesArray[1][0],
        this.$archive.mspa.story[this.nextPagesArray[1][0].next[0]]
      ]
      preloadPages.forEach(page => {
        page.media.forEach(media => {
          if (/(gif|png)$/i.test(media)) {
            let img = new Image()
            img.src = this.$getResourceURL(media)
            this.preload.push(img)
          }
        })
        })

        const media1 = Array.from(this.thisPages[0].media)
        const media2 = Array.from(this.thisPages[1].media)
        this.deretcon(media1)
        this.deretcon(media2)

        return [media1, media2]
    },
    [...]
}

The edits don't do anything with the preloadPages stuff, but the comment seems to indicate it isn't used anywhere anyway. Also, there is some high quality flash audio stuff in Page.vue's pageMedia which could probably be copied over also if necessary.

GiovanH commented 1 year ago

Fixed with 0ad94058130d85dbe059266effad7b7b6b15a88c