jamesg31 / TowerGame

PyGame Tower ATC simulation.
GNU General Public License v3.0
6 stars 1 forks source link

Basic GUI Implementation #16

Closed jamesg31 closed 3 years ago

jamesg31 commented 3 years ago

Not finished yet, just thought I would create a PR to keep track of progress. I have decided to use the pygame_gui package.

  1. Altitude dropdown menu opens when an aircraft is selected.
  2. Can change aircraft altitude.

I am having a strange issue that I cant really figure out, when you click on an aircraft the altitude selector shows the last selected value for the entire selector, and only when you click on the selector to open it does the current altitude populate the box. Feel free (please! I am so confused) to take a look because I cant figure it out @AdamJCavanaugh

Closes #2

jamesg31 commented 3 years ago

GUI is working nicely now

AdamJCavanaugh commented 3 years ago

I made 1 comment... I'm not 100% sure I'm correct, but the first time clicking each aircraft, the altitude shows empty, right?

Maybe related, if you click directly from 1 aircraft to the other (without clicking empty space to clear in between), the selected_option doesn't update.

jamesg31 commented 3 years ago

If you look at where we create the gui element, there's a initial value. I have it set to an empty string rn bc I didn't know what to set it initially. That's why it shows up blank when you first click. We should probably just pass the current altitude in I suppose when we create the element when the gui is initialized in the aircraft class.

AdamJCavanaugh commented 3 years ago

Thanks for the comment. I was already poking around (commit d7b106f), so I figured out exactly what do once you pointed it out (332d00f).

Feel free to update/rename/etc

AdamJCavanaugh commented 3 years ago

I'd like to see this PR finalized and merged before I start looking at issue #3 ... I'd want to use the GUI to pop up a menu with spawning options (I think) for initial testing. Adding it to the debug options... once that's set, I'd be able to consider spawning based on gates, timing, etc

jamesg31 commented 3 years ago

I am fine merging it as it is now (its only meant to be a basic implementation), though it will need to be moved around a bit to resolve the conflicts #25 caused.