Update TransX: Typed input button and graphics fix

atomicdryad

Fracking toaster
Addon Developer
Joined
Dec 25, 2010
Messages
46
Reaction score
0
Points
0
The input system of TransX has always irked me as sometimes I just want to type in a value, without having to click my way there via +/-adj and ++/--

So I added an [ENT] button that lets one do just that. Then, while testing, I got distracted by the disappearing-graphics issue, so I fixed that too...in a way. OOP and private variables have made it hard to find -what- is causing the deletion of sketchpad pens, but TransX now detects and deals with it:

Code:
diff -ur ../transx/transx/TransX/trunk/TransXFunction.cpp ./TransXFunction.cpp
--- ../transx/transx/TransX/trunk/TransXFunction.cpp    2011-01-30 04:33:20.047875000 -0600
+++ ./TransXFunction.cpp        2011-01-30 14:11:26.813500000 -0600
@@ -337,10 +337,18 @@
                                                                                                                        //(rbd-)
 Pen* TransXFunction::SelectDefaultPen(Sketchpad *sketchpad, int value)
 {
-       if(value < NUM_PENS) //(rbd+)
-               return sketchpad->SetPen(pens[value]);
-       else
-               return sketchpad->SetPen(pens[Green]);
+       oapi::Pen* ret;
+       if(value < NUM_PENS) {//(rbd+)
+               ret=sketchpad->SetPen(pens[value]);
+       } else {
+               ret=sketchpad->SetPen(pens[Green]);
+       }
+       if(ret==NULL) {
+               char dstr[256];
+               sprintf(dstr,"TransX: SelectDefaultPen(%i): Pen got nuked, fixing.",value);oapiWriteLog(dstr);
+               initpens();
+       }
+       return ret;
 }
 
 Brush* TransXFunction::SelectBrush(Sketchpad *sketchpad, int value)

A precompiled dll (tested with 2010p1) is available at:

http://orbiterfixes.googlecode.com/files/transx-3.13-enterbutton-graphicsfix.zip

The summary of all changes, and full source, is available at:
http://code.google.com/p/orbiterfixes/source/detail?r=7
 
Last edited:
Just downloaded and tested on a LEO-Moon (free-return)-GEO plan. It works magnificently! :thumbup:

As for the graphics issue, it ussually happened to me, when i make plans with many stages, (usually more than 6-7). This time i set up a 13 stage one with no problems so far.

Thank you very much! This is exactly what was missing from TransX.
:hailprobe:
 
Just downloaded and tested on a LEO-Moon (free-return)-GEO plan. It works magnificently! :thumbup:

As for the graphics issue, it ussually happened to me, when i make plans with many stages, (usually more than 6-7). This time i set up a 13 stage one with no problems so far.

When looking over things I'm starting to suspect there's no bug after all. The SVN code I pulled was relatively recent.

Unless a slingshot plan is -not- supposed to look like this?
attachment.php


(And if there was, it was covered up by my fix, not caused by it :P~~).


This is exactly what was missing from TransX.
It's missing something else now...I may add support for input such as:
65535+10
Because right now one must do:
65535(backspace x 5)10+

I may be a typer, but I'm a lazy one...
 

Attachments

  • transx-sling.png
    transx-sling.png
    126.6 KB · Views: 309
Back
Top