Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

0xdavidel
Copy link
Collaborator

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

No need to crowd the base directory, Code at this point doesn't support it, don't use this commit
1. Using BetterStashTabAPI
2. Using BetterFilterAPI
3. Fixed the Overaly movement
4. Added a Sync thread
5. Major code refactor and commenting the whole code
6. Extracted most "magic values" out of the code
7. Added a better filter selection dialog
8. Removed redundant code
9. Changed the highlight code to not use exec()
10. Highlights will now use the actual item size and not a preset number
11. Better debug printing by wrapping the original pprint function
12. Better screen resolution config handling
13. Remade the overlay content to better show how many identified and unidentified items there are
14. Changed the paths to work with the new folder structure
Now you can use pip install -r requirements to setup all the libraries needed
@0xdavidel
Copy link
Collaborator Author

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

This should allow the ability to put full paths in the setup.ini file in case of custom filter directories
@notablackbear
Copy link
Owner

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

0xdavidel commented Sep 27, 2020

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
Copy link
Collaborator Author

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
Copy link
Owner

notablackbear commented Sep 30, 2020

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:

  • Overlay text is too large
  • Doesn't save filter to Setup file after first time user selects it
  • Location of Chaos Recipe filter blocks overrides other filter rules (here is example of influenced item with chaos recipe highlighting)
    BadHighlightingDueToFilterOrdering

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

self.chaos_filter_parsed=load_rules_from_base_filter(
chaos_filter_path)
except Exception as e:
debug_print("Exception reading chaos filter: {}".format(str(e)))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be self.debug_print(

@notablackbear notablackbear mentioned this pull request Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants