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

Select track UI implemented #19

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

Select track UI implemented #19

wants to merge 7 commits into from

Conversation

mareksmorag
Copy link
Collaborator

No description provided.

@mareksmorag mareksmorag linked an issue Jun 6, 2020 that may be closed by this pull request
Copy link
Collaborator

@ErykKrupa ErykKrupa left a comment

Choose a reason for hiding this comment

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

Like I said on Discord, I can't see right arrow, both tracks are represented by the same picture and track choice doesn't affect play and train windows.

src/view/options_menu.py Outdated Show resolved Hide resolved
src/view/options_menu.py Outdated Show resolved Hide resolved
src/view/options_menu.py Show resolved Hide resolved
self.divider = 0.4
self.selected_action: Optional[Action] = None
self.img = pygame.image.load("resources/graphics/track1.jpg")
self.logo_image = pygame.image.load("resources/graphics/logo.png")

def draw(self, destination: Surface, events: List[EventType]) -> Optional[Action]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a very long method, maybe we can split it?

@ErykKrupa ErykKrupa added the enhancement New feature or request label Jun 7, 2020
Copy link
Collaborator

@ErykKrupa ErykKrupa left a comment

Choose a reason for hiding this comment

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

Beautiful menu :P
But there is no fourth track and previews for second and third tracks are not corresponding to actual tracks.

src/main.py Outdated Show resolved Hide resolved
src/main.py Outdated
Comment on lines 80 to 103
tv1 = TrackView(Track.from_points(tracks[1]["points"]))
tv2 = TrackView(Track.from_points(tracks[3]["points"]))
tv3 = TrackView(Track.from_points(tracks[4]["points"]))

track_options = {
"Track1": Action(ActionType.CHANGE_VIEW, 2),
"Track2": Action(ActionType.CHANGE_VIEW, 3),
"Track3": Action(ActionType.CHANGE_VIEW, 4),
}
track_images = [
pygame.image.load("resources/graphics/track1.jpg"),
pygame.image.load("resources/graphics/track2.jpg"),
pygame.image.load("resources/graphics/track3.jpg")
]
options_menu = OptionsMenu(tracks=track_options, tracks_thumbnails=track_images)
options_menu.background_image = pygame.image.load(
"resources/graphics/menu-background.png"
)

window.add_view(menu, 0, True)
window.add_view(tv1, 1)
window.add_view(tv2, 2)
window.add_view(tv1, 2)
window.add_view(tv2, 3)
window.add_view(tv3, 4)
window.add_view(options_menu, 1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Previews for second and third tracks are not corresponding to actual tracks. Please fix it and add the forth track also. Furthermore, we can give them nicer names like "DNA", "Straight", "Loop" and so on.

Copy link
Collaborator

Choose a reason for hiding this comment

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

To be fixed when last two tracks will be merged

src/view/menu.py Outdated Show resolved Hide resolved
src/view/options_menu.py Outdated Show resolved Hide resolved
@mareksmorag mareksmorag requested a review from ErykKrupa June 13, 2020 16:38
Copy link
Collaborator

@BartoszRodak BartoszRodak left a comment

Choose a reason for hiding this comment

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

Some changes should be added, especially when it comes to loading track thumbnails, but nothing of a critical concern.

src/view/menu.py Outdated Show resolved Hide resolved
src/view/menu.py Outdated Show resolved Hide resolved
src/view/options_menu.py Outdated Show resolved Hide resolved
@mareksmorag mareksmorag requested a review from jakubdabek June 14, 2020 22:12
@ErykKrupa ErykKrupa self-requested a review June 21, 2020 13:52
Copy link
Collaborator

@ErykKrupa ErykKrupa left a comment

Choose a reason for hiding this comment

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

Needs small fix to show all the tracks on the menu correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window for selecting track
5 participants