notablackbear / poe_qolV2

52 stars 34 forks source link

Major refactor, added 2 custom libraries, fixed overlay movement #58

Open 0xdavidel opened 3 years ago

0xdavidel commented 3 years ago

This is probably too many changes for a single pull request, got carried away, whoops Here is the gist:

  1. Created BetterStashTabAPI - This is a custom library to access POE stash tabs and parse them.
  2. Created BetterFilterAPI - This is a custom library to read and modify .filter files, it only knows how to add a custom section to the file and how to modify those custom sections. This allows for an easy way to modify any filter file and add the chaos recipe rules to it
  3. Changed the chaos recipe comments to allow use with the BetterFilterAPI
  4. Fixed the Overlay movement, now you can click and drag using the leftmost button
  5. Added a Sync thread to synchronize between the local and remote stash states
  6. Major code refactor and commenting the whole code - Basically, I made it more readable and maintainable
  7. Extracted most "magic values" out of the code - To allow maintenance and easy changes magic values should not exits
  8. Added a better filter selection dialog, now instead of selecting a folder (that is static btw), you choose what filter you want to change
  9. Removed redundant code, part of the refactor, there were some unused functions
  10. Changed the highlight code to not use exec()
  11. Highlights will now use the actual item size and not a preset number - possible using the BetterStashTabAPI
  12. Better debug printing by wrapping the original pprint function - no more need to check if we are in debugging and then print, I wrapped it
  13. Better screen resolution config handling - now you can have spaces and use a big X if you want
  14. Remade the overlay content to better show how many identified and unidentified items there are - a simple text swap and using the BetterStashTabAPI to check the Identified and Unidentified files
  15. Changed the paths to work with the new folder structure
0xdavidel commented 3 years ago

A bug I found - Accidentaly I am using os.exit instead of using sys.exit.

this results in an error instead of a clean exit, but it doesn't break the functionality of the code, fixing it now

notablackbear commented 3 years ago

So i'm trying to test this branch out, but i'm having a ton of trouble closing the program since the extra thread is not being handled on close. I am trying to figure out how to handle it, but you might be able to quicker.

0xdavidel commented 3 years ago

Thats odd, the thread is set to daemon mode, one sec, ill reimplement the function so that it doesn't sleep for 10 seconds

0xdavidel commented 3 years ago

Try it now, it now sleeps only half a seconds and each time it checks if enough time elapsed from the previous stash_sync check

Nevermind, I see what you mean, the gui closes but the python keeps on running, ill see what I can do

0xdavidel commented 3 years ago

Added a way to close it, not the best code but the whole GUI side of the app still needs a refactor so that the tkApp only handles the GUI and separate out the logic into a different class and functions that are not inside the GUI class.

notablackbear commented 3 years ago

So i've been testing this out, and it works really well for the most part. I think it might be good to keep perfecting it in another branch before merging into master though? Here's a couple of notes:

I think a couple of these are easy to fix, like the text.