Skip to content

Commit f075e44

Browse files
committed
Added bool? parameter to showfps command.
1 parent 0acbe67 commit f075e44

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Runtime/DevConsoleMono.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,13 +1150,18 @@ private void InitBuiltInCommands()
11501150
() => LogVariable("Application path", AppDomain.CurrentDomain.BaseDirectory)
11511151
));
11521152

1153-
AddCommand(Command.Create<bool>(
1153+
AddCommand(Command.Create<bool?>(
11541154
"showfps",
11551155
"displayfps",
11561156
"Query or set whether the fps is being displayed on-screen",
11571157
Parameter.Create("enabled", "Whether the fps is being displayed on-screen"),
11581158
b =>
11591159
{
1160+
if (!b.HasValue)
1161+
{
1162+
b = !_isDisplayingFps;
1163+
}
1164+
11601165
if (b != _isDisplayingFps)
11611166
{
11621167
_isDisplayingFps = !_isDisplayingFps;
@@ -1171,7 +1176,7 @@ private void InitBuiltInCommands()
11711176
}
11721177
}
11731178

1174-
LogSuccess($"{(b ? "Enabled" : "Disabled")} the on-screen fps.");
1179+
LogSuccess($"{(b.Value ? "Enabled" : "Disabled")} the on-screen fps.");
11751180
},
11761181
() => LogVariable("Show fps", _isDisplayingFps)
11771182
));

0 commit comments

Comments
 (0)