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
center
hbox
center
/scenery/use-vpb
true
line-lod
/scenery/use-vpb
true
1.0
8.0
1.0
0.17
/sim/rendering/static-lod/line-features-lod-level
dialog-apply
line-lod
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/line-features-lod-level
hbox
center
/scenery/use-vpb
true
veg-lod
/scenery/use-vpb
true
1.0
8.0
1.0
0.17
/sim/rendering/static-lod/vegetation-lod-level
dialog-apply
veg-lod
/scenery/use-vpb
true
%d
true
/sim/rendering/static-lod/vegetation-lod-level
hbox
10
true
true
true
true