diff --git a/misc/os_test/MonoTest.cs b/misc/os_test/MonoTest.cs new file mode 100644 index 00000000..404dd8ea --- /dev/null +++ b/misc/os_test/MonoTest.cs @@ -0,0 +1,93 @@ +using Godot; +using System; + +public class MonoTest : Node +{ + public string Architecture() + { +#if GODOT_ARM64 || GODOT_ARM64_V8A + return "64-bit ARM"; +#elif GODOT_ARMV7 || GODOT_ARMEABI_V7A + return "32-bit ARM"; +#elif GODOT_X86_64 + return "64-bit x86"; +#elif GODOT_X86 + return "32-bit x86"; +#elif GODOT_128 + return "128-bit"; +#elif GODOT_64 + return "64-bit"; +#elif GODOT_32 + return "32-bit"; +#else + return "Unknown"; +#endif + } + + public string OperatingSystem() + { +#if GODOT_WINDOWS + return "Windows"; +#elif GODOT_LINUXBSD || GODOT_X11 + return "Linux (or BSD)"; +#elif GODOT_SERVER + return "Server (Linux or BSD)"; +#elif GODOT_MACOS || GODOT_OSX + return "macOS"; +#elif GODOT_ANDROID + return "Android"; +#elif GODOT_IOS + return "iOS"; +#elif GODOT_HTML5 + return "HTML5"; +#elif GODOT_HAIKU + return "Haiku"; +#elif GODOT_UWP + return "UWP (Windows 10)"; +#else + return "Unknown"; +#endif + } + + public string PlatformType() + { +#if GODOT_PC + return "PC"; +#elif GODOT_MOBILE + return "Mobile"; +#elif GODOT_WEB + return "Web"; +#elif GODOT + return "Godot Editor (not exported)"; +#else + return "Unknown"; +#endif + } + + public string TextureCompression() + { + string compression = ""; +#if GODOT_S3TC + compression += "S3TC"; +#endif +#if GODOT_ETC + if (compression.Length > 0) + { + compression += ", "; + } + compression += "ETC"; +#endif +#if GODOT_ETC2 + if (compression.Length > 0) + { + compression += ", "; + } + compression += "ETC2"; +#endif + if (compression.Length > 0) + { + return compression; + } + return "Not exported or no textures"; + } +} diff --git a/misc/os_test/Operating System Testing.csproj b/misc/os_test/Operating System Testing.csproj new file mode 100644 index 00000000..08043e25 --- /dev/null +++ b/misc/os_test/Operating System Testing.csproj @@ -0,0 +1,60 @@ + + + + Tools + AnyCPU + {780B9CDA-51E7-446A-816F-0E2CF667C96C} + Library + .mono/temp/bin/$(Configuration) + OperatingSystemTesting + Operating System Testing + v4.7 + 1.0.7374.17554 + .mono/temp/obj + $(BaseIntermediateOutputPath)/$(Configuration) + Debug + Release + + + true + portable + false + $(GodotDefineConstants);GODOT;DEBUG; + prompt + 4 + false + + + portable + true + $(GodotDefineConstants);GODOT; + prompt + 4 + false + + + true + portable + false + $(GodotDefineConstants);GODOT;DEBUG;TOOLS; + prompt + 4 + false + + + + $(ProjectDir)/.mono/assemblies/$(ApiConfiguration)/GodotSharp.dll + False + + + $(ProjectDir)/.mono/assemblies/$(ApiConfiguration)/GodotSharpEditor.dll + False + + + + + + + + + diff --git a/misc/os_test/Operating System Testing.sln b/misc/os_test/Operating System Testing.sln new file mode 100644 index 00000000..ec320432 --- /dev/null +++ b/misc/os_test/Operating System Testing.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Operating System Testing", "Operating System Testing.csproj", "{780B9CDA-51E7-446A-816F-0E2CF667C96C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + Tools|Any CPU = Tools|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {780B9CDA-51E7-446A-816F-0E2CF667C96C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {780B9CDA-51E7-446A-816F-0E2CF667C96C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {780B9CDA-51E7-446A-816F-0E2CF667C96C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {780B9CDA-51E7-446A-816F-0E2CF667C96C}.Release|Any CPU.Build.0 = Release|Any CPU + {780B9CDA-51E7-446A-816F-0E2CF667C96C}.Tools|Any CPU.ActiveCfg = Tools|Any CPU + {780B9CDA-51E7-446A-816F-0E2CF667C96C}.Tools|Any CPU.Build.0 = Tools|Any CPU + EndGlobalSection +EndGlobal diff --git a/misc/os_test/Properties/AssemblyInfo.cs b/misc/os_test/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..9ac83655 --- /dev/null +++ b/misc/os_test/Properties/AssemblyInfo.cs @@ -0,0 +1,25 @@ +using System.Reflection; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("Operating System Testing")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] diff --git a/misc/os_test/os_test.gd b/misc/os_test/os_test.gd index ce956f55..759efb0e 100644 --- a/misc/os_test/os_test.gd +++ b/misc/os_test/os_test.gd @@ -1,6 +1,7 @@ extends Panel onready var rtl = $HBoxContainer/Features +onready var mono_test = $MonoTest # Returns a human-readable string from a date and time, date, or time dictionary. @@ -98,6 +99,13 @@ func _ready(): add_line("Value of `PATH`", OS.get_environment("PATH")) add_line("Value of `path`", OS.get_environment("path")) + add_header("Hardware") + add_line("Model name", OS.get_model_name()) + add_line("Processor count", OS.get_processor_count()) + add_line("Device unique ID", OS.get_unique_id()) + add_line("Video adapter name", VisualServer.get_video_adapter_name()) + add_line("Video adapter vendor", VisualServer.get_video_adapter_vendor()) + add_header("Input") add_line("Latin keyboard variant", OS.get_latin_keyboard_variant()) add_line("Device has touch screen", OS.has_touchscreen_ui_hint()) @@ -107,16 +115,19 @@ func _ready(): add_header("Localization") add_line("Locale", OS.get_locale()) - add_header("Hardware") - add_line("Model name", OS.get_model_name()) - add_line("Processor count", OS.get_processor_count()) - add_line("Device unique ID", OS.get_unique_id()) - add_line("Video adapter name", VisualServer.get_video_adapter_name()) - add_line("Video adapter vendor", VisualServer.get_video_adapter_vendor()) - add_header("Mobile") add_line("Granted permissions", OS.get_granted_permissions()) + add_header("Mono (C#)") + var mono_enabled = ResourceLoader.exists("res://MonoTest.cs") + add_line("Mono module enabled", "Yes" if mono_enabled else "No") + if mono_enabled: + mono_test.set_script(load("res://MonoTest.cs")) + add_line("Architecture", mono_test.Architecture()) + add_line("Operating System", mono_test.OperatingSystem()) + add_line("Platform Type", mono_test.PlatformType()) + add_line("Texture Compression", mono_test.TextureCompression()) + add_header("Software") add_line("OS name", OS.get_name()) add_line("Process ID", OS.get_process_id()) diff --git a/misc/os_test/os_test.tscn b/misc/os_test/os_test.tscn index c8627240..7841b95d 100644 --- a/misc/os_test/os_test.tscn +++ b/misc/os_test/os_test.tscn @@ -196,6 +196,8 @@ margin_bottom = 514.0 size_flags_horizontal = 3 size_flags_vertical = 3 text = "Kill Current Process" + +[node name="MonoTest" type="Node" parent="."] [connection signal="pressed" from="HBoxContainer/Actions/GridContainer/OpenShellWeb" to="HBoxContainer/Actions" method="_on_OpenShellWeb_pressed"] [connection signal="pressed" from="HBoxContainer/Actions/GridContainer/OpenShellFolder" to="HBoxContainer/Actions" method="_on_OpenShellFolder_pressed"] [connection signal="pressed" from="HBoxContainer/Actions/GridContainer/ChangeWindowTitle" to="HBoxContainer/Actions" method="_on_ChangeWindowTitle_pressed"]