0) {
descD = sprintf("visible when viewpoint within\n%.0f meters", getprop("/sim/rendering/static-lod/aimp-detailed"));
} else {
descB = "always visible";
}
} else if (mode == "High Detail only") {
descW = "Always visible regardless of distance";
} else {
descW = "";
descD = sprintf("0 to %.0fm from viewpoint", getprop("/sim/rendering/static-lod/aimp-detailed"));
descB = sprintf("%.0fm to %.0fm", getprop("/sim/rendering/static-lod/aimp-detailed"), getprop("/sim/rendering/static-lod/aimp-detailed")+getprop("/sim/rendering/static-lod/aimp-bare"));
var lowDetailRange = getprop("/sim/rendering/static-lod/aimp-detailed") + getprop("/sim/rendering/static-lod/aimp-bare") ;
if (lowDetailRange < 1000)
descW = sprintf("WARNING: Low Detail too close, nothing drawn over %.0fm", lowDetailRange);
}
} else {
if (mode == "Low Detail only") {
if (getprop("/sim/rendering/static-lod/aimp-bare")>0) {
descD = sprintf("visible when larger than\n%.0f pixels in size on screen", getprop("/sim/rendering/static-lod/aimp-detailed"));
descB = "";
descW = sprintf("WARNING: When smaller than %.0f pixels nothing will be drawn", getprop("/sim/rendering/static-lod/aimp-bare"));
} else {
descW = "";
descD = "";
descB = "always visible";
}
} else if (mode == "High Detail only") {
descW = "Always visible regardless of distance";
} else {
descW = "";
if (getprop("/sim/rendering/static-lod/aimp-bare")>0)
descW = sprintf("WARNING: Below %.0f pixels in size nothing will be drawn", getprop("/sim/rendering/static-lod/aimp-bare"));
descD = sprintf("above %.0f pixels in size", getprop("/sim/rendering/static-lod/aimp-detailed"));
descB = sprintf("above %.0f pixels in size", getprop("/sim/rendering/static-lod/aimp-bare"));
}
}
setprop("/sim/gui/dialogs/static-lod/aimp-detailed-description", descD);
setprop("/sim/gui/dialogs/static-lod/aimp-bare-description", descB);
setprop("/sim/gui/dialogs/static-lod/aimp-bare-description1", descW);
};
# returns non zero if the value was adjusted and it can be adjusted (can_reload)
adjustValue = func(id, nodeId, value, can_reload){
var node = nodeId.getNode(id);
if (node != nil) {
var cv = node.getValue();
if (cv != value) {
node.setValue(value);
if (can_reload)
reload_sliders(1);
}
}
return 0; # no need to reload.
}
update_ai_mp = func(can_reload) {
var mode = update_enabling ();
var distance_mode = getprop("sim/rendering/static-lod/aimp-range-mode-distance");
update_description(mode);
if (mode == "Low Detail only") {
setprop("/sim/rendering/static-lod/aimp-detailed",getprop("/sim/rendering/static-lod/aimp-bare"));
can_reload = adjustValue("max", ai_mp_bare, 2000, can_reload);
reload_sliders(can_reload);
} else if (mode == "High Detail only") {
# setprop("/sim/rendering/static-lod/aimp-bare", 0);
# setprop("/sim/rendering/static-lod/aimp-detailed",-1);
} else {
if (!distance_mode) {
if (getprop("/sim/rendering/static-lod/aimp-bare") > getprop("/sim/rendering/static-lod/aimp-detailed")){
setprop("/sim/rendering/static-lod/aimp-bare", getprop("/sim/rendering/static-lod/aimp-detailed")-1 ) ;
}
can_reload = adjustValue("max", ai_mp_detailed, 2000, can_reload);
can_reload = adjustValue("max", ai_mp_bare, getprop("/sim/rendering/static-lod/aimp-detailed"), can_reload);
} else {
can_reload = adjustValue("max", ai_mp_detailed, 3000, can_reload);
can_reload = adjustValue("max", ai_mp_bare, 3000, can_reload);
}
}
}
update_aimp_mode = func{
var new_mode = getprop("/sim/gui/dialogs/static-lod/aimp-mp-mode");
if (new_mode != current_ai_mp_mode) {
if (current_ai_mp_mode == "Specify Ranges") {
current_detailed = getprop("/sim/rendering/static-lod/aimp-detailed");
current_bare =getprop("/sim/rendering/static-lod/aimp-bare");
}
if (current_ai_mp_mode == "Low Detail only" or current_ai_mp_mode == "High Detail only") {
if (current_detailed != nil)
setprop("/sim/rendering/static-lod/aimp-detailed", current_detailed );
if (current_bare != nil)
setprop("/sim/rendering/static-lod/aimp-bare",current_bare);
}
if (new_mode == "High Detail only") {
setprop("/sim/rendering/static-lod/aimp-detailed", -1);
setprop("/sim/rendering/static-lod/aimp-bare",0);
} else if (new_mode == "Low Detail only"){
setprop("/sim/rendering/static-lod/aimp-detailed", 0);
setprop("/sim/rendering/static-lod/aimp-bare",0);
}
current_ai_mp_mode = new_mode;
}
update_description(update_enabling());
}
# setlistener("/sim/gui/dialogs/static-lod/aimp-mp-mode", func(v){
# },0 ,0);
update_scenery_text ();
update_ai_mp (0);
]]>
static-lod
vbox
hbox
1
1
table
center
0
1
center
1
0
1
1
300
14
scenery-detailed
/sim/rendering/static-lod/detailed
1
0
100000
dialog-apply
scenery-detailed
nasal
1
2
left
true
/sim/rendering/static-lod/detailed-description
2
0
2
1
300
14
scenery-rough
/sim/rendering/static-lod/rough-delta
1
0
200000
dialog-apply
scenery-rough
nasal
2
2
left
true
/sim/rendering/static-lod/rough-delta-description
3
0
3
1
300
14
scenery-bare
/sim/rendering/static-lod/bare-delta
1
0
200000
dialog-apply
scenery-bare
nasal
3
2
left
true
/sim/rendering/static-lod/bare-delta-description
4
0
7
5
1
center
6
1
200
aimp-mode
/sim/gui/dialogs/static-lod/aimp-mp-mode
Specify Ranges
Low Detail only
High Detail only
false
dialog-apply
aimp-mode
nasal
6
2
left
distance
sim/rendering/static-lod/aimp-range-mode-distance
true
property-toggle
sim/rendering/static-lod/aimp-range-mode-distance
0
nasal
7
0
aimp-detailed-label
/sim/gui/dialogs/static-lod/aimp-mp-detailed-enabled
7
1
300
14
aimp-detailed
/sim/gui/dialogs/static-lod/aimp-mp-detailed-enabled
/sim/rendering/static-lod/aimp-detailed
1
0
1500
dialog-apply
aimp-detailed
nasal
dialog-update
7
2
left
true
/sim/gui/dialogs/static-lod/aimp-detailed-description
aimp-bare-label
/sim/gui/dialogs/static-lod/aimp-mp-bare-enabled
8
0
8
1
/sim/gui/dialogs/static-lod/aimp-mp-bare-enabled
300
14
aimp-bare
/sim/rendering/static-lod/aimp-bare
1
0
1500
dialog-apply
aimp-bare
nasal
dialog-update
8
2
left
top
true
/sim/gui/dialogs/static-lod/aimp-bare-description
9
1
left
top
true
/sim/gui/dialogs/static-lod/aimp-bare-description1
11
0
right
11
1
300
14
aimp-interior
/sim/rendering/static-lod/aimp-interior
1
0
1500
dialog-apply
aimp-interior
11
2
left
top
%.0f
true
/sim/rendering/static-lod/aimp-interior
hbox
left
true
hbox
left
hbox
left
hbox
center
table
4
center
0
0
/scenery/use-vpb
true
elev-lod
0
1
/scenery/use-vpb
true
1.0
10.0
1.0
0.17
/scenery/elevation-mesh/lod-range-factor
dialog-apply
elev-lod
nasal
0
2
/scenery/use-vpb
true
%dkm
true
/sim/gui/dialogs/static-lod/lod-range-km
1
0
/scenery/use-vpb
true
1
1
line-lod
/scenery/use-vpb
true
0.0
6.0
1.0
0.17
/sim/rendering/static-lod/line-features-lod-level
dialog-apply
line-lod
1
2
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/line-features-lod-level
2
0
/scenery/use-vpb
true
2
1
veg-lod
/scenery/use-vpb
true
0.0
6.0
1.0
0.17
/sim/rendering/static-lod/vegetation-lod-level
dialog-apply
veg-lod
2
2
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/vegetation-lod-level
3
0
/scenery/use-vpb
true
3
1
area-lod
/scenery/use-vpb
true
0.0
6.0
1.0
0.17
/sim/rendering/static-lod/area-features-lod-level
dialog-apply
area-lod
3
2
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/area-features-lod-level
hbox
center
table
4
center
0
0
0
1
2
0
3
2
1
0
1
1
line-width-lod0
/scenery/use-vpb
true
1.0
50.0
1.0
0.17
/sim/rendering/static-lod/lod-level[0]/line-features-min-width
dialog-apply
line-width-lod0
1
2
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[0]/line-features-min-width
1
3
area-lod0
/scenery/use-vpb
true
1.0
10000.0
100.0
0.17
/sim/rendering/static-lod/lod-level[0]/area-features-min-width
dialog-apply
area-lod0
1
4
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[0]/area-features-min-width
2
0
2
1
line-width-lod1
/scenery/use-vpb
true
1.0
50.0
1.0
0.17
/sim/rendering/static-lod/lod-level[1]/line-features-min-width
dialog-apply
line-width-lod1
2
2
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[1]/line-features-min-width
2
3
area-lod1
/scenery/use-vpb
true
1.0
10000.0
100.0
0.17
/sim/rendering/static-lod/lod-level[1]/area-features-min-width
dialog-apply
area-lod1
2
4
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[1]/area-features-min-width
3
0
3
1
line-width-lod2
/scenery/use-vpb
true
1.0
50.0
1.0
0.17
/sim/rendering/static-lod/lod-level[2]/line-features-min-width
dialog-apply
line-width-lod2
3
2
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[2]/line-features-min-width
3
3
area-lod2
/scenery/use-vpb
true
1.0
10000.0
100.0
0.17
/sim/rendering/static-lod/lod-level[2]/area-features-min-width
dialog-apply
area-lod2
3
4
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[2]/area-features-min-width
4
0
4
1
line-width-lod3
/scenery/use-vpb
true
1.0
50.0
1.0
0.17
/sim/rendering/static-lod/lod-level[3]/line-features-min-width
dialog-apply
line-width-lod3
4
2
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[3]/line-features-min-width
4
3
area-lod3
/scenery/use-vpb
true
1.0
10000.0
100.0
0.17
/sim/rendering/static-lod/lod-level[3]/area-features-min-width
dialog-apply
area-lod2
4
4
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[3]/area-features-min-width
5
0
5
1
line-width-lod4
/scenery/use-vpb
true
1.0
50.0
1.0
0.17
/sim/rendering/static-lod/lod-level[4]/line-features-min-width
dialog-apply
line-width-lod4
5
2
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[4]/line-features-min-width
5
3
area-lod4
/scenery/use-vpb
true
1.0
10000.0
100.0
0.17
/sim/rendering/static-lod/lod-level[4]/area-features-min-width
dialog-apply
area-lod4
5
4
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[4]/area-features-min-width
6
0
6
1
line-width-lod5
/scenery/use-vpb
true
1.0
50.0
1.0
0.17
/sim/rendering/static-lod/lod-level[5]/line-features-min-width
dialog-apply
line-width-lod5
6
2
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[5]/line-features-min-width
6
3
area-lod5
/scenery/use-vpb
true
1.0
10000.0
100.0
0.17
/sim/rendering/static-lod/lod-level[5]/area-features-min-width
dialog-apply
area-lod5
6
4
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[5]/area-features-min-width
7
0
7
1
line-width-lod6
/scenery/use-vpb
true
1.0
50.0
1.0
0.17
/sim/rendering/static-lod/lod-level[6]/line-features-min-width
dialog-apply
line-width-lod6
7
2
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[6]/line-features-min-width
7
3
area-lod6
/scenery/use-vpb
true
1.0
10000.0
100.0
0.17
/sim/rendering/static-lod/lod-level[6]/area-features-min-width
dialog-apply
area-lod6
7
4
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/lod-level[6]/area-features-min-width
hbox
10
true
true
true
true