Skip to content

Commit 6c73980

Browse files
committed
Added fullscreen_mode command.
1 parent 39d3896 commit 6c73980

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

Runtime/DevConsoleMono.cs

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -875,14 +875,14 @@ private void InitBuiltInCommands()
875875
"appversion",
876876
"",
877877
"Display the application version",
878-
() => Log($"App version: {Application.version}.")
878+
() => LogVariable("App version", Application.version)
879879
));
880880

881881
AddCommand(Command.Create(
882882
"unityversion",
883883
"",
884884
"Display the engine version",
885-
() => Log($"Engine version: {Application.unityVersion}.")
885+
() => LogVariable("Engine version", Application.unityVersion)
886886
));
887887

888888
AddCommand(Command.Create(
@@ -903,7 +903,7 @@ private void InitBuiltInCommands()
903903
"path",
904904
"",
905905
"Display the path to the application executable",
906-
() => Log($"Application path: {AppDomain.CurrentDomain.BaseDirectory}.")
906+
() => LogVariable("Application path", AppDomain.CurrentDomain.BaseDirectory)
907907
));
908908

909909
#endregion
@@ -913,14 +913,27 @@ private void InitBuiltInCommands()
913913
AddCommand(Command.Create<bool>(
914914
"fullscreen",
915915
"",
916-
"Query or set whether the window is fullscreen",
917-
Parameter.Create("enabled", "Whether the window is fullscreen"),
916+
"Query or set whether the window is full screen",
917+
Parameter.Create("enabled", "Whether the window is full screen"),
918918
b =>
919919
{
920920
Screen.fullScreen = b;
921921
LogSuccess($"{(b ? "Enabled" : "Disabled")} fullscreen mode.");
922922
},
923-
() => LogVariable("Fullscreen", Screen.fullScreen)
923+
() => LogVariable("Full screen", Screen.fullScreen)
924+
));
925+
926+
AddCommand(Command.Create<FullScreenMode>(
927+
"fullscreen_mode",
928+
"",
929+
$"Query or set the full screen mode",
930+
Parameter.Create("mode", ""),
931+
m =>
932+
{
933+
Screen.fullScreenMode = m;
934+
LogSuccess($"Full screen mode set to {m}.");
935+
},
936+
() => LogVariable("Full screen mode", Screen.fullScreenMode)
924937
));
925938

926939
AddCommand(Command.Create<int>(
@@ -939,16 +952,23 @@ private void InitBuiltInCommands()
939952
QualitySettings.vSyncCount = i;
940953
LogSuccess($"VSyncCount set to {i}.");
941954
},
942-
() => LogVariable("VSyncCount", QualitySettings.vSyncCount)
955+
() => LogVariable("VSync count", QualitySettings.vSyncCount)
943956
));
944957

945958
AddCommand(Command.Create(
946959
"resolution",
947960
"",
948-
"Display the current screen resolution",
961+
"Display the current monitor resolution",
949962
() => LogVariable("Resolution", Screen.currentResolution)
950963
));
951964

965+
AddCommand(Command.Create(
966+
"screen_size",
967+
"",
968+
"Display the current window resolution",
969+
() => LogVariable("Resolution", new Vector2Int(Screen.width, Screen.height))
970+
));
971+
952972
AddCommand(Command.Create<int>(
953973
"fps_target",
954974
"fps_max",
@@ -959,7 +979,7 @@ private void InitBuiltInCommands()
959979
Application.targetFrameRate = i;
960980
LogSuccess($"Target frame rate set to {i}.");
961981
},
962-
() => LogVariable("TargetFrameRate", Application.targetFrameRate)
982+
() => LogVariable("Target frame rate", Application.targetFrameRate)
963983
));
964984

965985
#endregion
@@ -1018,7 +1038,7 @@ private void InitBuiltInCommands()
10181038
return;
10191039
}
10201040

1021-
LogVariable("FieldOfView", Camera.main.fieldOfView);
1041+
LogVariable("Field of view", Camera.main.fieldOfView);
10221042
}
10231043
));
10241044

0 commit comments

Comments
 (0)