I worked a lot on the clicking functionality for the gui this week, trying to balance out the program so that one change would not instantly break it. That basically involved simplifying the code so that there was less to obstruct the flow of logic.
I first fixed the right-click menu when a player clicks an object on the system planet panel. Before, the code was sending the specific div name of where to place the order's menu. However, since there's three places the menu can appear, the code had to be changed so that the parent element of the clicked object would be where the order menu is created in.
There was an issue with the drawing of the object path where once a ship left the system, it would no longer draw the path. So that was fixed.
I simplified the rollover functionality for a map object. Before, it had a variable switch that was enacted when the mouse entered the children panel of that object. However, a bit of the rollover code changed a bit so this was no longer necessary to have and merely complicated things further.
There was also an issue with the rollover functionality when an order was submitted. This was because the code was redrawing the objects on the map (in case paths or what not changed), but it wasn't reimplementing the css event handlers for the map objects, leading to the failure of rollover functionality. So this event handler code had to be put in its own function so it could be called from multiple places.
A small change was also made to the info panel close button. I think it's a bit faster now.
After all this, a new bug showed up that launched the info panel whenever an object was right-clicked. For some reason, Jquery's left/right clicking events seem to jumble and confuse themselves when fired. I ultimately had to change most of the live events that can be defined before an object is created, to more standard binding where the object has to be in the DOM structure for the event handler to apply. It seemed to clear up some of the bugginess with the clicking, but it still didn't clear up this issue. In order to do that, I had to have the code disable clicking for an object that gets right-clicked until the order menu is closed.
Looks like this is the last week, so I'll be playing matches to find any more bugs hidden in the functionality.
Tuesday, August 10, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment