Extracted Console into CyberarmEngine

This commit is contained in:
2021-06-26 13:10:45 +00:00
parent cf37b94d80
commit 87bff4ab82
12 changed files with 32 additions and 584 deletions

View File

@@ -2,7 +2,7 @@
class IMICFPS
class Commands
class HUDCommand < Command
class HUDCommand < CyberarmEngine::Console::Command
def group
:global
end
@@ -17,26 +17,26 @@ class IMICFPS
def handle(arguments, console)
if arguments.size > 1
console.stdin("to many arguments for #{Style.highlight(command.to_s)}, got #{Style.error(arguments.size)} expected #{Style.notice(1)}.")
console.stdin("to many arguments for #{Console::Style.highlight(command.to_s)}, got #{Console::Style.error(arguments.size)} expected #{Console::Style.notice(1)}.")
return
end
case arguments.last
when "", nil
console.stdin("#{Style.highlight(command.to_s)}: #{$window.config.get(:options, command)}")
console.stdin("#{Console::Style.highlight(command.to_s)}: #{$window.config.get(:options, command)}")
when "on"
var = $window.config[:options, command] = true
console.stdin("fps => #{Style.highlight(var)}")
console.stdin("#{command} => #{Console::Style.highlight(var)}")
when "off"
var = $window.config[:options, command] = false
console.stdin("fps => #{Style.highlight(var)}")
console.stdin("#{command} => #{Console::Style.highlight(var)}")
else
console.stdin("Invalid argument for #{Style.highlight(command.to_s)}, got #{Style.error(arguments.last)} expected #{Style.notice('on')}, or #{Style.notice('off')}.")
console.stdin("Invalid argument for #{Console::Style.highlight(command.to_s)}, got #{Console::Style.error(arguments.last)} expected #{Console::Style.notice('on')}, or #{Console::Style.notice('off')}.")
end
end
def usage
"#{Style.highlight('hud')} #{Style.notice('[on|off]')}"
"#{Console::Style.highlight('hud')} #{Console::Style.notice('[on|off]')}"
end
end
end