From 24f360dfd14480e655da3b72fa041ba418bcf0de Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 15 Mar 2006 16:16:47 +0000 Subject: [PATCH] - add "upright" button to zero roll/pitch - add "dump" button (same as d-key) --- Aircraft/ufo/ufo.nas | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Aircraft/ufo/ufo.nas b/Aircraft/ufo/ufo.nas index 2ffc067d6..f7a8bfeab 100644 --- a/Aircraft/ufo/ufo.nas +++ b/Aircraft/ufo/ufo.nas @@ -184,6 +184,10 @@ Object = { update : func { 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["roll"].inOffsN, "roll", [0.6, 1.0, 1.0], 36, 6); - w = dialog.addChild("button"); - w.set("legend", "center"); + g = dialog.addChild("group"); + 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-width", 50); w.prop().getNode("binding[0]/command", 1).setValue("nasal"); 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()); gui.showDialog(name); }