1
0
Fork 0

Add function allowing selection of the materials.xml file to Rendering Options dialog.

This commit is contained in:
Stuart Buchanan 2012-10-06 23:03:40 +01:00
parent 3dbe249685
commit 56241b81f6

View file

@ -13,7 +13,7 @@
</empty>
<text>
<label>Rendering options</label>
<label>Rendering Options</label>
</text>
<empty>
@ -206,11 +206,46 @@
<group>
<layout>table</layout>
<checkbox>
<text>
<row>0</row>
<col>0</col>
<halign>left</halign>
<label>Texture set</label>
</text>
<combo>
<row>0</row>
<col>1</col>
<colspan>3</colspan>
<name>texture-set</name>
<halign>fill</halign>
<stretch>true</stretch>
<pref-width>150</pref-width>
<property>sim/gui/dialogs/rendering/texture-set</property>
<value>Region-specific</value>
<value>Global</value>
<value>DDS</value>
<binding>
<command>dialog-apply</command>
<object-name>texture-set</object-name>
</binding>
<binding>
<command>nasal</command>
<script>
var file = materials[getprop("/sim/gui/dialogs/rendering/texture-set")];
setprop("/sim/rendering/materials-file", file);
</script>
</binding>
<binding>
<command>reload-materials</command>
</binding>
</combo>
<checkbox>
<row>1</row>
<col>0</col>
<halign>left</halign>
<label>Animated jetways</label>
<name>jetways</name>
<property>/nasal/jetways/enabled</property>
@ -221,7 +256,7 @@
</checkbox>
<checkbox>
<row>1</row>
<row>2</row>
<col>0</col>
<halign>left</halign>
<label>Random buildings</label>
@ -234,7 +269,7 @@
</checkbox>
<text>
<row>1</row>
<row>2</row>
<col>1</col>
<colspan>3</colspan>
<color>
@ -246,7 +281,7 @@
</text>
<checkbox>
<row>2</row>
<row>3</row>
<col>0</col>
<halign>left</halign>
<label>Random objects</label>
@ -259,7 +294,7 @@
</checkbox>
<checkbox>
<row>3</row>
<row>4</row>
<col>0</col>
<halign>left</halign>
<label>Random vegetation</label>
@ -271,7 +306,7 @@
</binding>
</checkbox>
<text>
<row>3</row>
<row>4</row>
<col>1</col>
<label>density</label>
<enable>
@ -279,7 +314,7 @@
</enable>
</text>
<slider>
<row>3</row>
<row>4</row>
<col>2</col>
<name>vegetation-density</name>
<min>0</min>
@ -292,7 +327,7 @@
</binding>
</slider>
<text>
<row>3</row>
<row>4</row>
<col>3</col>
<label>12345678</label>
<format>%.1f</format>
@ -699,9 +734,22 @@
<nasal>
<open>
var materials = { "Region-specific" : "Materials/regions/materials.xml",
"Global" : "Materials/default/materials.xml",
"DDS" : "Materials/dds/materials.xml" };
gui.enable_widgets(cmdarg(), "shadows-debug", getprop("/sim/gui/devel-widgets"));
props.globals.getNode("/sim/rendering/shaders/quality-level", 1).setAttribute("userarchive", 0);
setprop("/sim/gui/frame-rate-throttled", (getprop("/sim/frame-rate-throttle-hz") > 0));
var matfile = getprop("/sim/rendering/materials-file");
foreach (var name; keys(materials)) {
if (matfile == materials[name]) {
setprop("/sim/gui/dialogs/rendering/texture-set", name);
}
}
</open>
</nasal>
</PropertyList>