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> <road-traffic-direction type="int">1</road-traffic-direction>
</osm> </osm>
<scenery-path-suffix> <scenery-path-suffix n="0">
<name type="string">Pylons</name> <name type="string">Pylons</name>
<enabled type="bool" userarchive="y">false</enabled> <enabled type="bool" userarchive="y">false</enabled>
</scenery-path-suffix> </scenery-path-suffix>
<scenery-path-suffix> <scenery-path-suffix n="1">
<name type="string">Roads</name> <name type="string">Roads</name>
<enabled type="bool" userarchive="y">false</enabled> <enabled type="bool" userarchive="y">false</enabled>
</scenery-path-suffix> </scenery-path-suffix>
<scenery-path-suffix> <scenery-path-suffix n="2">
<name type="string">Buildings</name> <name type="string">Buildings</name>
<enabled type="bool" userarchive="y">false</enabled> <enabled type="bool" userarchive="y">false</enabled>
</scenery-path-suffix> </scenery-path-suffix>
<scenery-path-suffix> <scenery-path-suffix n="3">
<name type="string">Objects</name> <name type="string">Objects</name>
<enabled type="bool" userarchive="y">true</enabled> <enabled type="bool" userarchive="y">true</enabled>
</scenery-path-suffix> </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 --> <!-- Terrain must be last, as the suffixes are searched in order -->
<scenery-path-suffix n="99"> <scenery-path-suffix n="99">
<name type="string">Terrain</name> <name type="string">Terrain</name>

View file

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