1
0
Fork 0

- add "upright" button to zero roll/pitch

- add "dump" button  (same as d-key)
This commit is contained in:
mfranz 2006-03-15 16:16:47 +00:00
parent f1362484ef
commit 24f360dfd1

View file

@ -184,6 +184,10 @@ Object = {
update : func { update : func {
foreach (v; keys(me.values)) { me.valuse[v].update() } foreach (v; keys(me.values)) { me.valuse[v].update() }
}, },
upright : func {
me.values["pitch"].set(0);
me.values["roll"].set(0);
},
}; };
@ -274,13 +278,33 @@ showDialog = func {
slider(cursor.values["pitch"].inOffsN, "pitch", [1.0, 0.6, 1.0], 36, 6); slider(cursor.values["pitch"].inOffsN, "pitch", [1.0, 0.6, 1.0], 36, 6);
slider(cursor.values["roll"].inOffsN, "roll", [0.6, 1.0, 1.0], 36, 6); slider(cursor.values["roll"].inOffsN, "roll", [0.6, 1.0, 1.0], 36, 6);
w = dialog.addChild("button"); g = dialog.addChild("group");
w.set("legend", "center"); g.set("layout", "hbox");
w = g.addChild("button");
w.set("halign", "left");
w.set("legend", "Upright");
w.set("pref-height", 22);
w.set("pref-width", 50);
w.prop().getNode("binding[0]/command", 1).setValue("nasal");
w.prop().getNode("binding[0]/script", 1).setValue("ufo.cursor.upright()");
w = g.addChild("button");
w.set("halign", "center");
w.set("legend", "Center");
w.set("pref-height", 22); w.set("pref-height", 22);
w.set("pref-width", 50); w.set("pref-width", 50);
w.prop().getNode("binding[0]/command", 1).setValue("nasal"); w.prop().getNode("binding[0]/command", 1).setValue("nasal");
w.prop().getNode("binding[0]/script", 1).setValue("ufo.cursor.center()"); w.prop().getNode("binding[0]/script", 1).setValue("ufo.cursor.center()");
w = g.addChild("button");
w.set("halign", "right");
w.set("legend", "Dump");
w.set("pref-height", 22);
w.set("pref-width", 50);
w.prop().getNode("binding[0]/command", 1).setValue("nasal");
w.prop().getNode("binding[0]/script", 1).setValue("ufo.dumpCoords()");
fgcommand("dialog-new", dialog.prop()); fgcommand("dialog-new", dialog.prop());
gui.showDialog(name); gui.showDialog(name);
} }