fenaren/cs420-game — pull request #46 by fenaren (2014-11-09 04:50:47+00:00)
Title: Port ship ui display

Okay, here's a working UI that shows ship data as well as data for all the ports. It all changes position and size as the window changes size, and it all updates in real-time. Try it out and see what you think.

I added 3 new UIElements: UITextField (shows a simple text string), UIPortData (shows the data associated with a port), and UIShipData (shows the data associated with the ship). To get these to update I added a new "update" function to UIElement. HumanGameView now updates all UIElements each frame.

mapToWindow() and windowToMap() changed to take sf::Vector2f rather than sf::Vector2u arguments, because SFML positions everything with sf::Vector2f vectors for some reason.

Port now has a member function that returns the price of rum that that port. There are a couple places where we've hardcoded the rum price at a port. Now that this exists we don't have to do that anymore.

The 'test' UITextInput field in HumanGameView is now deleted when the HumanGameView is, and the same now goes for all UIElements.