GSOC Day 22 – Improvements to panelInfo


I worked mostly on panelInfo today, but I’ll start with my finalization of the Orders panel changes. I seem to have been doing too much C++ lately, as I had added a few unnecessary semicolons to the patch. Other than that, however, the code was mostly solid. After a few minor touch-ups, I pushed the Order changes, finally, and I’m fairly happy with how they turned out. Unless a new ruleset needs one of the panels that has not yet been implemented, things should go well.

My main focus, however, has now shifted to panelInfo, which displays information about each object’s properties. Now, it works with tp04, since I have written a function that can return an easy-to-read string that describes an object’s properties recursively. It requires a rather ugly if statement, since the only way to print them nicely is to look at their type and differentiate based on that, but it should be robust and efficient.

Unfortunately, I may need to replace that method in the future, although I will be able to use at least some elements of it. The reason for this is that I want to make the list into a tree, with collapsing sections, and this can’t be done with plain text. I also want to try to link certain elements of the tree to object references and such, to make it more useful than just text. This will be what I work on tomorrow.

For now, though, it prints nicely at least.

For instance, a planet:

Positional: 
    Position: [-1409957242, 184613036, 0]
    Velocity: [0, 0, 0]
    Size: 2
Media: 
    Icon: common/object-icons/planet
    Media: common-2d/foreign/freeorion/planet-small/animation/barren1
Ownership: 
    Owner: Player: greywhind
Orders: 
    Order Queue: 
        Queue #11, with 0 orders
        Allowed order types: [No Operation, Build Fleet]
Resources: 
    Resource List: 
        Home Planet: Stored: 1, Minable: 0, Unavailable: 0
Orders2: 
    Order Queue 2: 
        Queue #0, with 0 orders
        Allowed order types: []

Or a fleet:

Positional: 
    Position: [-1409884802, 184685666, 0]
    Velocity: [0, 0, 0]
    Size: 2
Media: 
    Icon: common/object-icons/ship
    Media: common-2d/foreign/vegastrike/ship-small/aeon-hud
Ownership: 
    Owner: Player: greywhind
Orders: 
    Order Queue: 
        Queue #14, with 0 orders
        Allowed order types: [No Operation, Move, Colonise, Split Fleet, Merge Fleet]
Ships: 
    Ship List: 
        Design: Frigate (1)
    Damage: 0
Advertisements

~ by greywhind on June 14, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: