glacier-modding / RPKG-Tool

The RPKG tool allows for easy (un)packing of files from the Glacier Engine RPKG file format! Hitman 3 has the most support.
https://glaciermodding.org/rpkg/
Other
47 stars 9 forks source link

Hash Calculator and GUI edits #27

Closed Notexe closed 2 years ago

Notexe commented 2 years ago

Fixes the hash calculator from remembering previous hashes when copying new ones to the clipboard.

Also removed unnecessary exit buttons and moved the hash calculator into the utilities menu for some organisation.

github-actions[bot] commented 2 years ago

Download the artifacts for this pull request:

grappigegovert commented 2 years ago

I might not be the best to judge, because I don't really use this feature, but this sounds to me like an easy way to lose all your found hashes by accidentally clicking the copy button twice. Why would you not want to copy previously copied hashes?

Notexe commented 2 years ago

It still copies the ones that are in the input on the left. It just prevents copying them when they don't even exist in the input anymore. I suppose a better solution may exist though. This was just annoying me that it kept old items in memory even when they were deleted from the input window.

On Thu, 21 Oct 2021, 3:41 pm Govert de Gans, @.***> wrote:

I might not be the best to judge, because I don't really use this feature, but this sounds to me like an easy way to lose all your found hashes by accidentally clicking the copy button twice. Why would you not want to copy previously copied hashes?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/glacier-modding/RPKG-Tool/pull/27#issuecomment-948275083, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKKKMI6PQUYDHPZVKO7R56TUH6RYDANCNFSM5GNFJQSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Notexe commented 2 years ago

Save to clipboard should only save what you've entered in the input. It shouldn't be remembering previous entries.

Notexe commented 2 years ago

I might try and come up with a better solution to this so pressing the save to clipboard button twice still saves what is in the current input list.

grappigegovert commented 2 years ago

Save to clipboard should only save what you've entered in the input. It shouldn't be remembering previous entries.

If you want this then your solution works perfectly I think, I was just suggesting that one might want their previous entries remembered

Notexe commented 2 years ago

If you want this then your solution works perfectly I think, I was just suggesting that one might want their previous entries remembered

I need to filter out duplicates from being added into the collection instead I think. My original solution breaks the save to clipboard button if you press it twice, it ignores all of the hashes that are still in the input window since they were cleared from the collection.

So I guess the best solution is just preventing duplicate entries from being added in, but the collection would still need to be cleared when they are removed from the input window.

grappigegovert commented 2 years ago

it ignores all of the hashes that are still in the input window since they were cleared from the collection.

Ah, I didn't think of that. I guess you can move the newlyFoundHashes.Clear(); to the start of checkHashes() instead?

Notexe commented 2 years ago

I guess you can move the newlyFoundHashes.Clear(); to the start of checkHashes() instead?

How did I not even think about putting it there haha. That seems to work perfectly now.

grappigegovert commented 2 years ago

There shouldn't be any duplicates though. A HashSet can't have duplicates.

Notexe commented 2 years ago

There shouldn't be any duplicates though. A HashSet can't have duplicates.

Yeah, there doesn't seem to be any. I don't know why I assumed there was, I think I was just confused before haha.