Page 1 of 1

Yet another request for someone else to write an oxp. .

Posted: Tue Jan 18, 2011 11:04 am
by UK_Eliter
Dear ComOOnity

How about an oxp, call it 'statistics.oxp', that combines Thargoid's excellent Flight Log with something that shows how much profit or loss you've made (ie. current cash minus previous cash) since your last dock? That would be handy, and could be satisfying.

Re: Yet another request for someone else to write an oxp. .

Posted: Tue Jan 18, 2011 2:06 pm
by Fatleaf
Ever tried keeping a pad and pen next to your computer? :wink:

Re: Yet another request for someone else to write an oxp. .

Posted: Tue Jan 18, 2011 2:45 pm
by UK_Eliter
What, with my credits being in the millions, and those credits being displayed without any seperating commas? And when number-crunching is what computers are good at? But, since I am not much good at programming ( :( ), I thought someone else might like to have a go at it. Perhaps. .

Re: Yet another request for someone else to write an oxp. .

Posted: Tue Jan 18, 2011 6:15 pm
by Thargoid
That could perhaps be rolled up into flight log itself. Although getting two columns of text/figures to display properly on a mission screen isn't easy...

Re: Yet another request for someone else to write an oxp. .

Posted: Tue Jan 18, 2011 8:52 pm
by Switeck
Could it even include how many kills were gained since last jump?
...since that's the other way the game keeps "score". :lol:

Re: Yet another request for someone else to write an oxp. .

Posted: Wed Jan 19, 2011 6:58 pm
by Thargoid
Any such information can be included.

The trick is to make it appear on a mission screen without the whole thing decending into a complete and utterly unreadable mess. The current mission screen (or perhaps font) capabilities don't include much by way of lining variable width text into columns. Tab doesn't cut it unfortunately.

Re: Yet another request for someone else to write an oxp. .

Posted: Wed Jan 19, 2011 8:25 pm
by Switeck
Ouch, so there would have to be a check for how many kills and have 3 possibilities -- 1, 2, or 3 spaces. (I doubt anyone will get >999 kills in 1 system.) Then the number of spaces used would depend on that result.

Amount of credits changed would also possibly be negative if you don't take into account cargo bought, so it could vary wildly...possibly even by 5 digits.

Re: Yet another request for someone else to write an oxp. .

Posted: Wed Jan 19, 2011 10:39 pm
by Thargoid
No, because the characters in the font aren't monospace (or don't seem to be) - If you make a mission screen with a line of 10 of a selection of different characters, they'll be of different lengths. Plus of course the font can be changed.

The two-column mission screen that pops up when you buy a Vortex for example took rather a lot of time to set up, and even that has a bit of variation in it depending on the MAC number of the ship.

Also look closely at the cargo bay screens for the ship, note how the columns aren't quite straight in a couple of places... I spent a while trying to improve, but it wasn't having it.

I now sit and wait for someone to correct me, or offer a simple way to do it that I hadn't thought of (aside from bringing my own monospace font to the party).

Re: Yet another request for someone else to write an oxp. .

Posted: Wed Jan 19, 2011 10:43 pm
by JensAyton
Oolite’s super-advanced text layout engine supports tab stops, but only left-aligned ones. Still, these should probably be exposed to mission screens.

Re: Yet another request for someone else to write an oxp. .

Posted: Thu Jan 20, 2011 2:07 am
by Switeck
Looks like a core-side fix is necessary. :(

Re: Yet another request for someone else to write an oxp. .

Posted: Thu Jan 20, 2011 5:41 pm
by Thargoid
Anyway, I got bored during a telephone conference at work, so I've got a test version of Flight Log on my USB key that also lists the kills and credit difference (profit/loss) for the 10 systems in the log.

I need to give it some testing, then I'll make it available for a wider beta-test before upgrading the full version.

Re: Yet another request for someone else to write an oxp. .

Posted: Thu Jan 20, 2011 5:47 pm
by UK_Eliter
Thargoid: are you as good at fulfilling others' 'RL' wishes you are their Oolite wishes? If so. .

Re: Yet another request for someone else to write an oxp. .

Posted: Sun Jan 23, 2011 1:32 pm
by JensAyton
The good news is, Oolite doesn’t only support left-aligned tab stops.

The bad news is, the way it’s currently implemented means mixing tab stops with flowed text would require a serious rewrite of the layout system. So, not before MNSR.

Re: Yet another request for someone else to write an oxp. .

Posted: Sun Jan 23, 2011 3:40 pm
by Thargoid
So what can we actually do, in 1.74.2 and in 1.75 as-is?

Just so I know I've not missed something in what can be done with such mission screen layouts.

Re: Yet another request for someone else to write an oxp. .

Posted: Sun Jan 23, 2011 5:32 pm
by JensAyton
Very little.

I’ve been planning to add a method to measure the length of strings (should be easy barring unforeseen complications), which would make it possible to get alignment right to the nearest space, but I can’t really offer more than that right now. (Cabal Common Functions has a method called strToWidth() which nominally does this, but it has several unfixable bugs, which is the motivation for considering a measuring method in the first place.)