From 1f45f26cdb73e8fdcef6078afae42e9a62ff2f6c Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Tue, 30 Nov 2021 23:13:56 -0500 Subject: [PATCH] [lua] Add accelerators to switch between solid-dash --- plugins/ColorCycle/main.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/ColorCycle/main.lua b/plugins/ColorCycle/main.lua index f7fc1d8c..03f5c3e0 100644 --- a/plugins/ColorCycle/main.lua +++ b/plugins/ColorCycle/main.lua @@ -6,6 +6,8 @@ function initUi() app.registerUi({["menu"] = "Color 2", ["callback"] = "colorTwo", ["accelerator"] = "F16"}); app.registerUi({["menu"] = "Color 3", ["callback"] = "colorThree", ["accelerator"] = "F17"}); app.registerUi({["menu"] = "Color 4", ["callback"] = "colorFour", ["accelerator"] = "F18"}); +app.registerUi({["menu"] = "Solid", ["callback"] = "solid", ["accelerator"] = "F15"}); +app.registerUi({["menu"] = "dash", ["callback"] = "dash", ["accelerator"] = "F16"}); -- if you want to have multiple color lists you must use the app.registerUi function multiple times -- with different callback functions and accelerators end @@ -46,6 +48,13 @@ function colorFour() app.changeToolColor({["color"] = colorList[currentColor][2], ["selection"] = true}) end +function solid() + app.uiAction({["action"]="ACTION_TOOL_LINE_STYLE_PLAIN"}) +end + +function dash() + app.uiAction({["action"]="ACTION_TOOL_LINE_STYLE_DOT"}) +end function cycle() if (currentColor < #colorList) then