diff --git a/layout/components/version-info.xml b/layout/components/version-info.xml new file mode 100644 index 00000000..45c46fa6 --- /dev/null +++ b/layout/components/version-info.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/scripts/components/version-info.js b/scripts/components/version-info.js new file mode 100644 index 00000000..7e730d17 --- /dev/null +++ b/scripts/components/version-info.js @@ -0,0 +1,25 @@ +'use strict'; + +class VersionInfo { + static { + $.GetContextPanel().jsClass = this; + } + + static update() { + const cp = $.GetContextPanel(); + + const graphics = VersionAPI.GetGraphicsAPI(); + const version = VersionAPI.GetVersion(); + const branch = VersionAPI.GetBranch(); + const platform = VersionAPI.GetPlatform(); + const physics = VersionAPI.GetPhysicsEngine(); + + // Set the dialog variables so this can be used in label + cp.SetDialogVariable("graphics", graphics); + cp.SetDialogVariable("version", version); + cp.SetDialogVariable("branch", branch); + cp.SetDialogVariable("platform", platform); + cp.SetDialogVariable("physics", physics); + } +} + diff --git a/scripts/util/panel-registration.js b/scripts/util/panel-registration.js index d63afa0f..1e13e6ca 100644 --- a/scripts/util/panel-registration.js +++ b/scripts/util/panel-registration.js @@ -5,3 +5,4 @@ //-------------------------------------------------------------------------------------------------- UiToolkitAPI.RegisterPanel2d('LineGraph', 'file://{resources}/layout/components/graphs/line-graph.xml'); +UiToolkitAPI.RegisterPanel2d('VersionInfo', 'file://{resources}/layout/components/version-info.xml'); diff --git a/styles/components/version-info.scss b/styles/components/version-info.scss new file mode 100644 index 00000000..5e6fe7bf --- /dev/null +++ b/styles/components/version-info.scss @@ -0,0 +1,9 @@ +.VersionInfo { + flow-children: down; + + .VersionInfoText { + font-size: 18px; + } + + color: black; +}