1
0
Fork 0

OSM2City: Add Details and Trees directories

Update defaults.xml and Rendering dialog to include
Details and Trees directories, for use by osm2city
This commit is contained in:
Stuart Buchanan 2021-02-02 15:56:07 +00:00
parent d887e4b22d
commit c9428e0beb
2 changed files with 72 additions and 15 deletions

View file

@ -300,26 +300,36 @@ Started September 2000 by David Megginson, david@megginson.com
<road-traffic-direction type="int">1</road-traffic-direction>
</osm>
<scenery-path-suffix>
<scenery-path-suffix n="0">
<name type="string">Pylons</name>
<enabled type="bool" userarchive="y">false</enabled>
</scenery-path-suffix>
<scenery-path-suffix>
<scenery-path-suffix n="1">
<name type="string">Roads</name>
<enabled type="bool" userarchive="y">false</enabled>
</scenery-path-suffix>
<scenery-path-suffix>
<scenery-path-suffix n="2">
<name type="string">Buildings</name>
<enabled type="bool" userarchive="y">false</enabled>
</scenery-path-suffix>
<scenery-path-suffix>
<scenery-path-suffix n="3">
<name type="string">Objects</name>
<enabled type="bool" userarchive="y">true</enabled>
</scenery-path-suffix>
<scenery-path-suffix n="4">
<name type="string">Details</name>
<enabled type="bool" userarchive="y">false</enabled>
</scenery-path-suffix>
<scenery-path-suffix n="5">
<name type="string">Trees</name>
<enabled type="bool" userarchive="y">false</enabled>
</scenery-path-suffix>
<!-- Terrain must be last, as the suffixes are searched in order -->
<scenery-path-suffix n="99">
<name type="string">Terrain</name>

View file

@ -649,7 +649,8 @@
<pref-width>200</pref-width>
<property>/sim/gui/dialogs/rendering/pylons</property>
<value>Disabled</value>
<value>Enabled</value>
<value>Basic</value>
<value>Detailed</value>
<binding>
<command>dialog-apply</command>
<object-name>pylons</object-name>
@ -658,10 +659,15 @@
<command>nasal</command>
<script>
var val = getprop("/sim/gui/dialogs/rendering/pylons");
if (val == "Enabled") {
if (val == "Detailed") {
setScenerySuffix("Pylons", 1);
setScenerySuffix("Details", 1);
} else if (val == "Basic") {
setScenerySuffix("Pylons", 1);
setScenerySuffix("Details", 0);
} else {
setScenerySuffix("Pylons", 0);
setScenerySuffix("Pylons", 0);
setScenerySuffix("Details", 0);
}
</script>
</binding>
@ -777,7 +783,7 @@
<row>4</row>
<col>0</col>
<halign>left</halign>
<label>Vegetation</label>
<label>Autogenerated Vegetation</label>
</text>
<combo>
<row>4</row>
@ -848,11 +854,44 @@
<row>5</row>
<col>0</col>
<halign>left</halign>
<label>Vegetation Shadows</label>
<label>OpenStreetMap Trees</label>
</text>
<combo>
<row>5</row>
<col>1</col>
<name>osm2city-trees</name>
<pref-width>200</pref-width>
<property>/sim/gui/dialogs/rendering/osm2city-trees</property>
<value>Disabled</value>
<value>Enabled</value>
<binding>
<command>dialog-apply</command>
<object-name>osm2city-trees</object-name>
</binding>
<binding>
<command>nasal</command>
<script>
var val = getprop("/sim/gui/dialogs/rendering/osm2city-trees");
if (val == "Enabled") {
setScenerySuffix("Trees", 1);
} else {
setScenerySuffix("Trees", 0);
}
</script>
</binding>
</combo>
<text>
<row>6</row>
<col>0</col>
<halign>left</halign>
<label>Vegetation Shadows</label>
</text>
<combo>
<row>6</row>
<col>1</col>
<name>vegetation-shadows</name>
<pref-width>200</pref-width>
<property>/sim/gui/dialogs/rendering/vegetation-shadows</property>
@ -876,14 +915,14 @@
</combo>
<text>
<row>6</row>
<row>7</row>
<col>0</col>
<halign>left</halign>
<label>Scenery Objects</label>
</text>
<combo>
<row>6</row>
<row>7</row>
<col>1</col>
<name>placed-objects</name>
<pref-width>200</pref-width>
@ -1095,15 +1134,17 @@
# Mapping from underlying properties to those used by the GUI.
if (getScenerySuffix("Pylons")) {
setprop("/sim/gui/dialogs/rendering/pylons", "Enabled");
} else {
if (getScenerySuffix("Details")) {
setprop("/sim/gui/dialogs/rendering/pylons", "Detailed");
} else if (getScenerySuffix("Pylons")) {
setprop("/sim/gui/dialogs/rendering/pylons", "Basic");
} else {
setprop("/sim/gui/dialogs/rendering/pylons", "Disabled");
}
if (getScenerySuffix("Roads")) {
setprop("/sim/gui/dialogs/rendering/roads", "Enabled");
} else {
} else {
setprop("/sim/gui/dialogs/rendering/roads", "Disabled");
}
@ -1149,6 +1190,12 @@
setprop("/sim/gui/dialogs/rendering/random-vegetation", "Disabled");
}
if (getScenerySuffix("Trees")) {
setprop("/sim/gui/dialogs/rendering/osm2city-trees", "Enabled");
} else {
setprop("/sim/gui/dialogs/rendering/osm2city-trees", "Disabled");
}
if (getprop("/sim/rendering/random-vegetation-shadows")) {
setprop("/sim/gui/dialogs/rendering/vegetation-shadows", "Enabled");
} else {