Conversation
Signed-off-by: M. David Bennett <mdavidbennett@syntheticworks.com>
Signed-off-by: M. David Bennett <mdavidbennett@syntheticworks.com>
|
There's some good stuff in there, thank you. The current overlay is very much a first draft. My plan is to only support the modern overlay so I don't have to deal with a lot of backward compatibility. Different positioning for the galaxy map vs the cockpit is a great thought. I know my formatting isn't entirely python standard but it is intentional – I find some of PEP8 to be completely moronic and it reduces readability. Then again I've always had a love/hate relationship with python. :) Having it all reformatted isn't something I really want to have happen. Having a countdown on the cooldown timer is something I was thinking should be added, and for the jump countdown.
I suspected the carrier cooldown popup might have issues in Linux, that's something I need to look at. It's almost certainly that Linux doesn't support the Tk options that are in use. Also the cooldown popup should have a preference option to turn it on/off.
Meaning an entry within the EDMC window? |
Hey hey! Opening this as a draft for feedback and since this isn't really in a polished state at the moment.
The massive amount of changes are due to my editor applying black formatting automatically on save on the files I touch, I can disable that if needed and rework the changes to only what's being modified without formatting. That being said, I would strongly recommend black or some other auto-formatter fired off by pre-commit since it would make contributing much easier (I'd be happy to send a PR your way to set that up).
This changes how the overlay works by adding two attributes,
title_textandbody_text, that automatically trigger a redraw when they're modified, making it easier to work with in the classes that publish content to the overlay. The messages these produce are sent to the overlay without a ttl, making them persistent until changed. This also adds a concept of view modes to the overlay so it can move the offset around depending on the screen that's pulled up, so it keeps it out of the way if you pull up the galaxy map, for example.There are three view modes currently:
It will only display the overlay if in the cockpit without a focus (normal flying) or in the galaxy map. As part of this, I removed the
xandyconfig options and replaced them with a cockpit offset and a galaxy map offset.I also added a message to the overlay to indicate how many jumps to the next fuel stop (if that's available in the route) and if you should refuel at the current system.
I reworked how the carrier cooldown and jump countdown calculation is handled, using the timestamp from the journal entry. This gets fed into a thread that tracks the jump countdown/cooldown and displays the time left at 1 second intervals in the overlay. I'm not entirely happy with how this works at the moment, I would prefer that the
Routerclass not be in the business of updating UI elements. I'm thinking of reworking it to a callback system so theUIclass can subscribe to updates from theRouterclass instead of the router class having to push updates to the UI. The benefit would be that the logic of the Router class would be self-contained and not have an external dependency on the UI, making it easier to test.As a side note, I removed the call to create the popup that the carrier cooldown is complete. On my system at least it just spawned a blank square in the top left of my screen that I could not close without a restart of EDMC. Not sure if that's a me problem (I'm running this on gentoo linux through flatpak, things breaking randomly is par for the course lol) or if that's a bug other's were experiencing. I'd ideally like to add a UI element to show the carrier countdown instead of the popup.
Feedback is appreciated!