- let Ctrl-g have the same meaning as g (necessary for LMB emulation)
- more cosmetics
This commit is contained in:
parent
4c16eacf96
commit
a571440567
2 changed files with 22 additions and 8 deletions
|
@ -183,6 +183,21 @@
|
||||||
</binding>
|
</binding>
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
|
<key n="7">
|
||||||
|
<name>Ctrl-G</name>
|
||||||
|
<desc>Gear Up.</desc>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>controls.gearDown(-1)</script>
|
||||||
|
</binding>
|
||||||
|
<mod-up>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>controls.gearDown(0)</script>
|
||||||
|
</binding>
|
||||||
|
</mod-up>
|
||||||
|
</key>
|
||||||
|
|
||||||
<key n="9">
|
<key n="9">
|
||||||
<name>Ctrl-I</name>
|
<name>Ctrl-I</name>
|
||||||
<desc>Show object adjustment dialog</desc>
|
<desc>Show object adjustment dialog</desc>
|
||||||
|
|
|
@ -201,7 +201,7 @@ var scan_models = func(base) {
|
||||||
if (list == nil)
|
if (list == nil)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
var extensions = { ".ac": 1, ".osg": 2, ".xml": 3 }; # priority
|
var ext = { ".ac": 1, ".osg": 2, ".xml": 3 }; # extension priorities
|
||||||
var files = {};
|
var files = {};
|
||||||
foreach (var d; list) {
|
foreach (var d; list) {
|
||||||
if (d[0] == `.` or d == "CVS")
|
if (d[0] == `.` or d == "CVS")
|
||||||
|
@ -213,10 +213,10 @@ var scan_models = func(base) {
|
||||||
append(result, s);
|
append(result, s);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach (var e; keys(extensions)) {
|
foreach (var e; keys(ext)) {
|
||||||
if (substr(d, -size(e)) == e) {
|
if (substr(d, -size(e)) == e) {
|
||||||
var basepath = base ~ "/" ~ substr(d, 0, size(d) - size(e));
|
var basepath = base ~ "/" ~ substr(d, 0, size(d) - size(e));
|
||||||
if (!contains(files, basepath) or extensions[e] > extensions[files[basepath]])
|
if (!contains(files, basepath) or ext[e] > ext[files[basepath]])
|
||||||
files[basepath] = e;
|
files[basepath] = e;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -666,7 +666,7 @@ var ModelMgr = {
|
||||||
var scan_dirs = func(csv) {
|
var scan_dirs = func(csv) {
|
||||||
var list = ["Aircraft/ufo/Models/sign.ac", "Aircraft/ufo/Models/cursor.ac"];
|
var list = ["Aircraft/ufo/Models/sign.ac", "Aircraft/ufo/Models/cursor.ac"];
|
||||||
foreach (var dir; split(",", csv))
|
foreach (var dir; split(",", csv))
|
||||||
foreach(var m; scan_models(dir))
|
foreach (var m; scan_models(dir))
|
||||||
append(list, m);
|
append(list, m);
|
||||||
|
|
||||||
return sort(list, cmp);
|
return sort(list, cmp);
|
||||||
|
@ -811,16 +811,15 @@ var file_selector = nil;
|
||||||
|
|
||||||
# called via l-key (load object from disk)
|
# called via l-key (load object from disk)
|
||||||
var file_select_model = func {
|
var file_select_model = func {
|
||||||
if (file_selector == nil) {
|
if (file_selector == nil)
|
||||||
file_selector = gui.FileSelector.new(fsel_callback,
|
file_selector = gui.FileSelector.new(fsel_callback,
|
||||||
"Select 3D model file", "Load Model",
|
"Select 3D model file", "Load Model",
|
||||||
["*.ac", "*.osg", "*.xml"], getprop("/sim/fg-root"));
|
["*.ac", "*.osg", "*.xml"], getprop("/sim/fg-root"));
|
||||||
}
|
|
||||||
file_selector.open();
|
file_selector.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
var fsel_callback = func {
|
var fsel_callback = func(n) {
|
||||||
var model = cmdarg().getValue();
|
var model = n.getValue();
|
||||||
var root = string.fixpath(getprop("/sim/fg-root")) ~ "/";
|
var root = string.fixpath(getprop("/sim/fg-root")) ~ "/";
|
||||||
if (substr(model, 0, size(root)) == root)
|
if (substr(model, 0, size(root)) == root)
|
||||||
model = substr(model, size(root));
|
model = substr(model, size(root));
|
||||||
|
|
Loading…
Add table
Reference in a new issue