From ff2619973550769b455da25bf8905ea39368dd06 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Tue, 22 Sep 2020 17:56:46 -0500 Subject: Rewrite keysmash template as a template transformer --- app/lib/command_tag/command/text_tools.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/lib/command_tag/command/text_tools.rb b/app/lib/command_tag/command/text_tools.rb index b9c3f3ad7..6b37b66b7 100644 --- a/app/lib/command_tag/command/text_tools.rb +++ b/app/lib/command_tag/command/text_tools.rb @@ -1,10 +1,6 @@ # frozen_string_literal: true module CommandTag::Command::TextTools - def handle_000_keysmash_startup(args = [100, 100]) - @vars['keysmash'] = [handle_keysmash_with_return(args)] - end - def handle_code_at_start(args) return if args.count < 2 @@ -70,12 +66,11 @@ module CommandTag::Command::TextTools 't', 'x', ',', 'q', 'z', 'y', 'b', - 'p', '[', - '.', '/', - ']', '\\' + 'p', '.', + '[', ']' ] - min_size = [[1, args[1].to_i].max, 100].min + min_size = [[5, args[1].to_i].max, 100].min max_size = [args[0].to_i, 100].min max_size = 33 unless max_size.positive? @@ -87,4 +82,8 @@ module CommandTag::Command::TextTools chunk.join end + + def transform_keysmash_template_return(_, args) + handle_keysmash_with_return([args[0], args[2]]) + end end -- cgit