mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Added dedicated fps command
This commit is contained in:
32
lib/ui/commands/fps_command.rb
Normal file
32
lib/ui/commands/fps_command.rb
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
class IMICFPS
|
||||||
|
class Commands
|
||||||
|
class FPSCommand < Command
|
||||||
|
def group
|
||||||
|
:global
|
||||||
|
end
|
||||||
|
|
||||||
|
def command
|
||||||
|
:fps
|
||||||
|
end
|
||||||
|
|
||||||
|
def handle(arguments, console)
|
||||||
|
case arguments.last
|
||||||
|
when "", nil
|
||||||
|
console.stdin("#{Style.highlight("fps")}: #{$debug.get(:fps)}")
|
||||||
|
when "on"
|
||||||
|
var = $debug.set(:fps, true)
|
||||||
|
console.stdin("fps => #{Style.highlight(var)}")
|
||||||
|
when "off"
|
||||||
|
var = $debug.set(:fps, false)
|
||||||
|
console.stdin("fps => #{Style.highlight(var)}")
|
||||||
|
else
|
||||||
|
console.stdin("Invalid argument for #{Style.highlight("#{command}")}, got #{Style.error(arguments.last)} expected #{Style.notice("on")}, or #{Style.notice("off")}.")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def usage
|
||||||
|
"#{Style.highlight("fps")} #{Style.notice("[on|off]")}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user