kagof / intellij-pokemon-progress

A Pokémon themed progress bar for IntelliJ IDEA.
https://plugins.jetbrains.com/plugin/15090-pokemon-progress
MIT License
196 stars 22 forks source link

Support for IntelliJ 2020.3 #28

Closed kamronbatman closed 3 years ago

kamronbatman commented 3 years ago

Description of the bug & expected behaviour (required) Currently doesn't load.

Environment Info (required)

Steps to reproduce (optional)

  1. Open IntelliJ
  2. Do not see Pokemon progress bar
Rikj000 commented 3 years ago

For me it stopped working in the latest version as well.

Environment Info (required):

I can also confirm that it still works in Rider v2020.4

Imgur - IntelliJ IDEA error message

Would love to see the little Pokemons fly around again, they really made my days at work a tad more fun! :)

kagof commented 3 years ago

Thanks for the bug report @kamronbatman, and thanks for the extra info @Rikj000, that's extremely helpful. I'll look into this.

Strangely I'm also on IntelliJ Ultimate 2020.3 and plugin v1.2.0 and it seems to currently be working for me.

I'm now able to repro, should be able to fix this :)

kamronbatman commented 3 years ago

I didn't look into it but I assumed it was just a version cap that needs to be lifted. I would probably not have a version check and let it hard break in the future, then version cap it if needed with a minor update to cap it.

kagof commented 3 years ago

A bit of a progress update, if you're interested.

Unfortunately it isn't a version cap that I'm (knowingly, at least) putting in. The intelliJ plugin verifier says that it should be compatible:

However even manually installing the plugin from a zip doesn't work

I've updated the plugin to build using the SDK for IntelliJ 2020.3. However, long story short, it seems like with some of the changes IntelliJ has done to their IconLoader, the Pokémon sprite gifs no longer load. I've been playing around with different ways of handling them with limited success, but hopefully with some tinkering over this weekend I'll be able to get something working.

kamronbatman commented 3 years ago

It looks like other progress cars are not affected or have been updated. I wonder if they figured it out? If I get some time I'll do some digging.

kagof commented 3 years ago

Specifically the issue I'm having with the sprites is because they are animated. Unfortunately the only other progress bars I know that use animated sprites (the ones by KikiManjaro) do not have their source code available online, so I can't check out the way they do it.

Things that don't work:

  1. the plugin originally uses gifs for all sprites, however gif loading seems to not work in the latest version.
  2. Animated png files with transparency do not seem to load (in this version, nor the previous versions)

Options that are viable & I've been playing around with:

  1. I've been playing around with not using the JetBrains IconLoader at all, and just directly loading from the classpath.
    • pros:
    • don't need to change away from using gifs
    • I don't think the IconLoader is really giving us a ton of benefits, other than some in memory caching, which could easily be replaced if needed
    • cons:
    • Its possible the IconLoader has some optimizations or something else that I'm not aware of, which we then lose
  2. Loading individual png files and wrapping them in an AnimatedIcon. I've checked that this works
    • pros:
    • can continue using the IconLoader
    • easy to adjust the speed of the animation
    • potentially don't need the separate reversed sprites; IconUtil.flip doesn't seem to work on animated gifs, but likely is workable with this solution
    • cons:
    • I'd need to migrate all existing sprites to be a sequence of pngs, and change my process for creating new ones.

I'm really hoping to stick with option 1, since changing from gifs to a sequence of pngs will be a pain. Although, maybe it'll be better in the long run, who knows.

kagof commented 3 years ago

I was able to go with option 1 :)

version 1.2.1 has been uploaded to JetBrains, hopefully should be approved in not too long. In the mean time it is uploaded as an attachment on the release: https://github.com/kagof/intellij-pokemon-progress/releases/tag/1.2.1