Add the option to the Debug menu to save the video configuration file
This commit is contained in:
parent
496727e87f
commit
0d623d5f5e
4 changed files with 57 additions and 0 deletions
47
Nasal/video.nas
Normal file
47
Nasal/video.nas
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
print("A");
|
||||||
|
|
||||||
|
var save = func()
|
||||||
|
{
|
||||||
|
var _props = [
|
||||||
|
"random-objects",
|
||||||
|
"random-vegetation",
|
||||||
|
"random-vegetation-shadows",
|
||||||
|
"random-vegetation-normals",
|
||||||
|
"vegetation-density",
|
||||||
|
"random-buildings",
|
||||||
|
"building-density",
|
||||||
|
"point-sprites",
|
||||||
|
"particles",
|
||||||
|
"clouds3d-enable",
|
||||||
|
"clouds3d-vis-range",
|
||||||
|
"clouds3d-detail-range",
|
||||||
|
"clouds3d-density",
|
||||||
|
"shadows/enabled"];
|
||||||
|
var sprop = props.globals.getNode("/sim/rendering/");
|
||||||
|
var dprop = props.globals.getNode("/tmp/rendering/", 1);
|
||||||
|
props.copy(sprop.getNode("shaders"), dprop.getNode("shaders", 1), 1);
|
||||||
|
foreach (var p; _props) {
|
||||||
|
var src = sprop.getNode(p);
|
||||||
|
var dest = dprop.getNode(p, 1);
|
||||||
|
var type = src.getType();
|
||||||
|
var val = src.getValue();
|
||||||
|
if(type == "ALIAS" or type == "NONE") return;
|
||||||
|
elsif(type == "BOOL") dest.setBoolValue(val);
|
||||||
|
elsif(type == "INT" or type == "LONG") dest.setIntValue(val);
|
||||||
|
elsif(type == "FLOAT" or type == "DOUBLE") dest.setDoubleValue(val);
|
||||||
|
else dest.setValue(val);
|
||||||
|
dest.setAttribute(src.getAttribute());
|
||||||
|
}
|
||||||
|
|
||||||
|
var fg_home = getprop("/sim/fg-home");
|
||||||
|
var renderer = getprop("/sim/rendering/gl-renderer");
|
||||||
|
var file = renderer;
|
||||||
|
var pos = find("x86/", renderer);
|
||||||
|
if (pos == -1) pos = find("/", renderer);
|
||||||
|
if (pos == -1) pos = find(" (", renderer);
|
||||||
|
if (pos != -1) file = substr(renderer, 0, int(pos));
|
||||||
|
|
||||||
|
var path = fg_home ~ "/Export/" ~ file ~ ".xml";
|
||||||
|
io.write_properties( path, dprop);
|
||||||
|
gui.popupTip("Configuration is written to:\n" ~ path, 6);
|
||||||
|
}
|
|
@ -108,6 +108,7 @@
|
||||||
<print-rendering-statistics>Print Rendering Statistics</print-rendering-statistics>
|
<print-rendering-statistics>Print Rendering Statistics</print-rendering-statistics>
|
||||||
<statistics-display>Cycle On-Screen Statistics</statistics-display>
|
<statistics-display>Cycle On-Screen Statistics</statistics-display>
|
||||||
<performance-monitor>Monitor System Performance</performance-monitor>
|
<performance-monitor>Monitor System Performance</performance-monitor>
|
||||||
|
<write-video-config>Save Video Configuration</write-video-config>
|
||||||
<property-browser>Browse Internal Properties</property-browser>
|
<property-browser>Browse Internal Properties</property-browser>
|
||||||
<logging>Logging</logging>
|
<logging>Logging</logging>
|
||||||
<local_weather>Local Weather (Test)</local_weather>
|
<local_weather>Local Weather (Test)</local_weather>
|
||||||
|
|
|
@ -117,6 +117,7 @@
|
||||||
<print-rendering-statistics>Weergavestatistieken printen</print-rendering-statistics> <!-- English: "Print Rendering Statistics" -->
|
<print-rendering-statistics>Weergavestatistieken printen</print-rendering-statistics> <!-- English: "Print Rendering Statistics" -->
|
||||||
<statistics-display>Blader door schermstatiestieken</statistics-display> <!-- English: "Cycle On-Screen Statistics" -->
|
<statistics-display>Blader door schermstatiestieken</statistics-display> <!-- English: "Cycle On-Screen Statistics" -->
|
||||||
<performance-monitor>Monitor systeemprestaties</performance-monitor> <!-- English: "Monitor System Performance" -->
|
<performance-monitor>Monitor systeemprestaties</performance-monitor> <!-- English: "Monitor System Performance" -->
|
||||||
|
<write-video-config>Bewaar Video configuratie</write-video-config> <!-- English: "Save Video configuration" -->
|
||||||
<property-browser>Blader door interne eigenschappen</property-browser> <!-- English: "Browse Internal Properties" -->
|
<property-browser>Blader door interne eigenschappen</property-browser> <!-- English: "Browse Internal Properties" -->
|
||||||
<logging>Logging</logging> <!-- English: "Logging" -->
|
<logging>Logging</logging> <!-- English: "Logging" -->
|
||||||
<local_weather>Local weather (test)</local_weather> <!-- English: "Local Weather (Test)" -->
|
<local_weather>Local weather (test)</local_weather> <!-- English: "Local Weather (Test)" -->
|
||||||
|
|
|
@ -718,6 +718,14 @@
|
||||||
</binding>
|
</binding>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<name>write-video-config</name>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>video.save()</script>
|
||||||
|
</binding>
|
||||||
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<name>property-browser</name>
|
<name>property-browser</name>
|
||||||
<binding>
|
<binding>
|
||||||
|
|
Loading…
Reference in a new issue