Tool Others F95Checker [WillyJL]

5.00 star(s) 23 Votes

ascsd

Newbie
Jul 26, 2021
79
54
I noticed you're using pygame only for the image reading but also importing PIL
You can slightly optimize things if you change the render function to this

Code:
    def reload(self):
        self.reset()
        image = Image.open(self.path)
        self.width,self.height = image.size[:2]
        image = image.tobytes('raw', 'RGBA')
        self.data = image
ive timed the 2 modules and the read time is exactly the same. (i think pygame uses PIL to read anyways? but dont quote me on that)
it avoids the 2 flips and since you're not using pygame anywhere else you can remove it as a dependancy

i tried converting to a numpy array instead of .tobytes but was slightly slower so no luck there
 
Last edited:
  • Like
Reactions: WillyJL
Jan 10, 2022
229
778
Just wanted to say that i LOVE that tool, ty so much for that.

With the future Rating System,Filter and Game Tag feature this will be by far the best tool on this Page(y)
 
  • Red Heart
Reactions: WillyJL

WillyJL

Well-Known Member
Respected User
Mar 7, 2019
1,111
922
ascsd yes, the image issue is partly fixed. I have never used imgui in a full project of mine and same goes for OpenGL and the like. Before I was loading the image with pillow, then getting its image data and turning it into an array using numpy. However the numpy array conversion was taking ages so I put it into a separate process to not hang the GUI, but it left the blank texture while it converted... I saw this paradigm on multiple PyOpenGL snippets so I thought this was the best way. Then I gave a shot with using just pillow with a method similar to what you suggested and it wouldn’t work for some reason... so I looked in the PyImGui GitHub issues and saw that pygame snippet, tried it and it worked very well so I decided to keep that for the time being... but I too dislike needing pygame just to read images so I’ll try with your pillow snippet and see how it goes, thanks. And yeah I had fixed it but hadn’t posted another vid here cos the other updates were relatively minimal. Now I’m working on interface style and the relative settings, so when that’s done I’ll put another vid here :D
 
  • Like
Reactions: ascsd

WillyJL

Well-Known Member
Respected User
Mar 7, 2019
1,111
922
ascsd yea so I had found some pillow snippets online but they all used .tostring() which has been deprecated and removed, so trying to adapt to .tobytes() I couldn’t figure it out... your snippet works well, only thing is that the tool saves as jpeg so no alpha layer, so it needs to convert to RGBA. Simple check for that, and after timing it’s kinda hit or miss, sometimes pillow is faster, sometimes pygame is, but they are always in the same order of magnitude if you will, so it’s just better this way without the pygame dependency :D
 
  • Like
Reactions: ascsd

ascsd

Newbie
Jul 26, 2021
79
54
ascsd yea so I had found some pillow snippets online but they all used .tostring() which has been deprecated and removed, so trying to adapt to .tobytes() I couldn’t figure it out... your snippet works well, only thing is that the tool saves as jpeg so no alpha layer, so it needs to convert to RGBA. Simple check for that, and after timing it’s kinda hit or miss, sometimes pillow is faster, sometimes pygame is, but they are always in the same order of magnitude if you will, so it’s just better this way without the pygame dependency :D
Yea, tested different conversions using different modules and the results always changed but within the same order of magnitude

Also, do you mean you dont want the RGBA? because you can use .tobytes('raw', 'RGBX')
but that apparently still returns a 4th channel so you need to change the apply function to change only the first GL_RGBA to GL_RGB and leave the second one (or the opposite way around, i can't remember right now and i already deleted everything)
 
Last edited:

WillyJL

Well-Known Member
Respected User
Mar 7, 2019
1,111
922
Yea, tested different conversions using different modules and the results always changed but within the same order of magnitude

Also, do you mean you dont want the RGBA? because you can use .tobytes('raw', 'RGBX')
but that apparently still returns a 4th channel so you need to change the apply function to change only the first GL_RGBA to GL_RGB and leave the second one (or the opposite way around, i can't remember right now and i already deleted everything)
I need RGBA because in some rare occasions, I still can't understand why, some select RGB images if loaded with GL in RGB mode they have some pixel color and alignment issues, so I always converted to RGBA to be sure. But it looks like that RGBX trick works really well, thanks! So now RGB images are extracted as RGBX and loaded as RGBA, RGBA images are handled as is, always in RGBA, and other modes are converted; perfect!
 

WillyJL

Well-Known Member
Respected User
Mar 7, 2019
1,111
922
Progress update!
- Better popups with titlebar and close button (can still click outside to close)
- Added some options to manage the game's executable path
- Added context (right click) menus
- Fixed slow image loading
- Added support for gif / animated images
- Added a custom browser configuration screen and relative file browser / picker (will also be used for selecting the game exe later on)
- Added an interface scaling setting
- Added an "About F95Checker" popup with info about the license, development, links to stuff and some cool people that have been supporting this project for a while :D

View attachment Record_F95Checker_20220420221857.mp4

Next up is probably grid mode and then a bit of a facelift for the UI
 

ascsd

Newbie
Jul 26, 2021
79
54
I'm hesitating to ask this incase you are already doing it :ROFLMAO:
For grid view, if you can include the star rating, last version played and the customized note (even if its only the first line or few words)
And a new view, lets call it expanded list, which has a second row with smaller font that also has rating, last version played and note
 
  • Like
Reactions: WillyJL

WillyJL

Well-Known Member
Respected User
Mar 7, 2019
1,111
922
For grid view, if you can include the star rating, last version played and the customized note (even if its only the first line or few words)
I am working on grid view right now. So far I’ve only managed to show all the images, but that was the hard part: calculating aspect ratios and cropping, and also loading them lazily so that the interface doesn’t freeze with long lists to load all the images. Now what I need to figure out is how to handle sorting... because for the main list view I heavily rely on imgui to keep track of what columns are visible and which one is used for sorting... but I can get that data only while rendering the normal list, so if I’m rendering the grid view I don’t have access to this info... I could make settings for it in the sidebar but then I can’t update the list view to the new sort mode... in the end I think I will simply keep the grid mode in manual sorting mode, and allow dragging the games around to change their sorting (the manual sort order will be shared between the grid and list view). Also in grid view you will have settings to choose what to show. By default it will be the usual: name, version, status, play button, played and installed checkboxes, and the open thread button. But nearly all other game attributes will be togglable to be shown in grid mode. I’ll see what I can do about the notes ;)
Also grid will be very similar to the “latest updates” here on the website in terms of aesthetic
And a new view, lets call it expanded list, which has a second row with smaller font that also has rating, last version played and note
Well first of all the last played field is a date, not a version. What I think you’re referring to I have explained here https://f95zone.to/threads/f95checker-8-5-willyjl.44173/page-43#post-7909042
Second this data is already available in the main list mode, you can simply right click the column headers at the top to be able to select what columns are shown (like any other respectable table system can :D). Again we’ll see about the note in the list mode, but as it stands I think an expanded list mode is superfluous, you can make your own by choosing what to show :)

PS: if what you meant was having something similar to the list view, but more relaxed, less cluttered, and with the image, well the grid mode will have a setting for how many are shown per line, and if you only choose one I’ll shift the information from under the image to the side, so it’s more like a list but kinda grid. You’ll see what I mean soon enough ;)
 
Last edited:

Dukez

Member
Dec 19, 2020
417
1,525
I see you added a way to open folder location for the game which is nice. Hopefully you also decouple the 'play' button from if the latest update is installed or not. Seems kind of pointless if an update comes out (e.g bugfix) and it disables the play button until you check the box that says you downloaded (or not) the update to enable the button again. I think having the game name in a different colour etc, perhaps a different coloured play button as well? (along with the boxes on the side..) is more than enough to highlight an update is available. Doesn't really need to disable functionality requiring you to interact with it further.
 

ascsd

Newbie
Jul 26, 2021
79
54
I just looked into pyimgui and dear imgui's code and its ridiculous how they expose nothing to programmatically change the sorting... the function is right there TableSetColumnSortDirection :cry:

I think you should just keep the same sort order thats selected in the list view, and you'd only be able to change the sort in list view (unless you drag and drop and it becomes manual sort). Its not good UX but I think it would be even worse UX if a user changes from list to grid and the order changes.

since you wouldn't be able to access the sort order while in grid id just grab self.sorted_games_ids before switching from list to grid and save it in the sqlite db. Then the next time they open the program and its in grid view, the sort state persists (im guessing you do something similar for the manual sorting?)


As for the last played stuff, i guess "last version installed" would be what i was asking for instead of last played since that makes more sense being a date.
The reason behind me caring about the notes being easily visible is to tie it into the last version installed. Some devs release a big update/chapter as a minor version number, while other devs release them as a major version number. So id just want to tell myself that if the new version of game A is a minor version wait for more updates, but for game B theres enough content to play it.
I think you mentioned custom columns before so if you do add that then it would work instead of showing the notes

as for the expanded list view, i forgot that you will be adding the togglable columns with all the information so that takes care of it
 

WillyJL

Well-Known Member
Respected User
Mar 7, 2019
1,111
922
I see you added a way to open folder location for the game which is nice. Hopefully you also decouple the 'play' button from if the latest update is installed or not. Seems kind of pointless if an update comes out (e.g bugfix) and it disables the play button until you check the box that says you downloaded (or not) the update to enable the button again. I think having the game name in a different colour etc, perhaps a different coloured play button as well? (along with the boxes on the side..) is more than enough to highlight an update is available. Doesn't really need to disable functionality requiring you to interact with it further.
yes the current behavior is not that smart, but the new one i implemented makes slightly more sense:
the tool no longer remembers whether you installed the game or not, but remembers what version you installed. the checkbox simply shows whether the installed is equal to the latest.

you can have three situations (this represents how the values are stored in code format):
- game.version = "1.1", game.installed = "" => the game is not installed, the checkbox is empty, the version text shows only latest version, play button is disabled
- game.version = "1.1", game.installed = "1.0" => the game is installed but not the latest version, the checkbox is empty, the version text shows both latest and installed versions, the play button works
- game.version = "1.1", game.installed = "1.1" => game is installed and its the latest version, the checkbox is full, the version text shows only the latest version, the play button works


in actual usage:
- when you add the game the game.installed is empty so the game is not installed
- when you enable the checkbox it remembers you installed the latest version
- when an update comes, it removes the checkbox (latest version and installed one are not equal anymore) but it still know an older verrsion is installed, so the play button is enabled and the version text shows the two separate versions
- if you manually unselect the checkbox then it resets the game.installed data to empty "" so the play button is disabled


in video:
View attachment Record_F95Checker_20220421215755.mp4

i hope this explains once and for all how it works.
the played checkbox is instead a simple marker for yourself. toggling it changes nothing in how the tool works. it will be unchecked when an update comes, but you are free to enable it without touching the installed checkbox
 
  • Like
Reactions: ascsd

WillyJL

Well-Known Member
Respected User
Mar 7, 2019
1,111
922
I just looked into pyimgui and dear imgui's code and its ridiculous how they expose nothing to programmatically change the sorting... the function is right there TableSetColumnSortDirection :cry:
yea thats an internal api function for imgui, its not supposed to be used by the end user, so pyimgui is likely not going to implement it...
as for the expanded list view, i forgot that you will be adding the togglable columns with all the information so that takes care of it
they are already available btw, as im saying just right click the table header row :D
As for the last played stuff, i guess "last version installed" would be what i was asking for instead of last played since that makes more sense being a date.
The reason behind me caring about the notes being easily visible is to tie it into the last version installed. Some devs release a big update/chapter as a minor version number, while other devs release them as a major version number. So id just want to tell myself that if the new version of game A is a minor version wait for more updates, but for game B theres enough content to play it.
I think you mentioned custom columns before so if you do add that then it would work instead of showing the notes
yea, also look above for a more details explanation and showcase of how it works!
for notes i think ill put a single line note editor, but using the same notes from the full popup
 
  • Like
Reactions: ascsd

WillyJL

Well-Known Member
Respected User
Mar 7, 2019
1,111
922
ascsd i found a solution! turns out imgui only cares about table id, column count and table flags to handle the sort specs, so i can just open the imgui list table outside the viewport, get the specs, and close the table to then render the grid instead. so yeah you can only change sorting settings from list mode, but they persist to grid mode and even after a program restart. this also allows me to check if manual sorting is enabled very easily, so then i can add the drag and drop functionality just as easily. you can check the latest commit if youre interested :D
 

ascsd

Newbie
Jul 26, 2021
79
54
Awesome! I thought imgui would definitely either conflict with grid if you initialize the table aswell or that you wouldn't be able to initialize the table without it being seen.
 

GAB

Salty Montrealer
Donor
May 10, 2017
2,402
18,132
Found a bug where the checker doesn't give game update even though I know a game thread has been updated an hour ago and it's in the checker list

I don't know if it's because Windows sleep mode, checker background mode or checker BG refresh delay but a feature I'd like to have is Show last updated game appearing on a new window, similar to when I have an alert or a game has been updated, to counter that glitch

P.S. magrao121 there's a bug on your signature that stretches the pic
1651463626846.png
 
5.00 star(s) 23 Votes