1
0
Fork 0
fgdata/gui/dialogs/static-lod.xml
Stuart Buchanan 97d54bf17f Make LOD for trees/buildings/objects/STG configurable.
Now based on /sim/rendering/static-lod/rough.

This commit removes a large number of range
settings that should in general be set by the user.
2016-04-08 22:39:29 +01:00

245 lines
5.7 KiB
XML

<?xml version="1.0"?>
<PropertyList>
<nasal>
<open>
<![CDATA[
var modePixel = (getprop("/sim/rendering/static-lod/ai-range-mode-pixel") == 1);
setprop( "/sim/gui/dialogs/static-lod/mode/pixel", modePixel );
setprop( "/sim/gui/dialogs/static-lod/mode/distance", !modePixel );
var reload_props = [
"/sim/rendering/static-lod/rough",
"/sim/rendering/static-lod/bare"];
var reload_vals = {};
foreach (var p; reload_props) {
reload_vals[p] = getprop(p);
}
]]>
</open>
</nasal>
<name>static-lod</name>
<layout>vbox</layout>
<group>
<layout>hbox</layout>
<empty><stretch>1</stretch></empty>
<text>
<label>Adjust Level Of Detail Ranges</label>
</text>
<empty><stretch>1</stretch></empty>
<button>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<legend></legend>
<keynum>27</keynum>
<border>2</border>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>table</layout>
<halign>center</halign>
<text>
<row>0</row><col>1</col><colspan>3</colspan>
<label>Max. Ranges (m)</label>
</text>
<text>
<row>1</row><col>1</col>
<label>Detailed</label>
</text>
<text>
<row>1</row><col>2</col>
<label>Rough</label>
</text>
<text>
<row>1</row><col>3</col>
<label>Bare</label>
</text>
<text>
<row>2</row><col>0</col>
<halign>right</halign>
<label>Scenery</label>
</text>
<input>
<row>2</row><col>1</col>
<halign>fill</halign>
<property>/sim/rendering/static-lod/detailed</property>
</input>
<input>
<row>2</row><col>2</col>
<halign>fill</halign>
<property>/sim/rendering/static-lod/rough</property>
</input>
<input>
<row>2</row><col>3</col>
<halign>fill</halign>
<property>/sim/rendering/static-lod/bare</property>
</input>
<text>
<row>3</row><col>0</col>
<halign>right</halign>
<label>AI/MP Aircraft</label>
</text>
<input>
<row>3</row><col>1</col>
<halign>fill</halign>
<property>/sim/rendering/static-lod/ai-detailed</property>
</input>
<radio>
<row>3</row>
<col>2</col>
<halign>left</halign>
<name>pixel</name>
<property>sim/gui/dialogs/static-lod/mode/pixel</property>
<live>true</live>
<label>Pixel</label>
<binding>
<command>property-assign</command>
<property>sim/gui/dialogs/static-lod/mode/distance</property>
<value>0</value>
</binding>
<binding>
<command>property-assign</command>
<property>sim/gui/dialogs/static-lod/mode/pixel</property>
<value>1</value>
</binding>
<binding>
<command>property-assign</command>
<property>sim/rendering/static-lod/ai-range-mode-pixel</property>
<value>1</value>
</binding>
</radio>
<radio>
<row>3</row>
<col>3</col>
<halign>left</halign>
<name>distance</name>
<property>sim/gui/dialogs/static-lod/mode/distance</property>
<live>true</live>
<label>Distance (m)</label>
<binding>
<command>property-assign</command>
<property>sim/gui/dialogs/static-lod/mode/distance</property>
<value>1</value>
</binding>
<binding>
<command>property-assign</command>
<property>sim/gui/dialogs/static-lod/mode/pixel</property>
<value>0</value>
</binding>
<binding>
<command>property-assign</command>
<property>sim/rendering/static-lod/ai-range-mode-pixel</property>
<value>0</value>
</binding>
</radio>
<text>
<row>4</row><col>0</col>
<halign>right</halign>
<label>AI/MP Interior</label>
</text>
<input>
<row>4</row><col>1</col>
<halign>fill</halign>
<property>/sim/rendering/static-lod/ai-interior</property>
</input>
<!-- // meaningless for now...
<input>
<row>3</row><col>3</col>
<halign>fill</halign>
<property>/sim/rendering/static-lod/ai-bare</property>
</input>
-->
</group>
<hrule/>
<group>
<layout>hbox</layout>
<default-padding>10</default-padding>
<empty><stretch>true</stretch></empty>
<button>
<legend>OK</legend>
<default>true</default>
<equal>true</equal>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>nasal</command>
<script><![CDATA[
var reinit = 0;
foreach (var p; reload_props) {
if (reload_vals[p] != getprop(p)) {
reinit = 1;
}
}
if (reinit) {
fgcommand("reload-materials", props.Node.new());
fgcommand("reinit", props.Node.new({"subsystem": "tile-manager"}));
}
]]>
</script>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<empty><stretch>true</stretch></empty>
<button>
<legend>Apply</legend>
<equal>true</equal>
<binding>
<command>dialog-apply</command>
</binding>
</button>
<empty><stretch>true</stretch></empty>
<button>
<legend>Reset</legend>
<equal>true</equal>
<binding>
<command>dialog-update</command>
</binding>
</button>
<empty><stretch>true</stretch></empty>
<button>
<legend>Cancel</legend>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<nasal>
<open>
</open>
</nasal>
</PropertyList>