aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2021-12-23 17:26:40 +0000
committergarret <garret@airmail.cc>2022-06-17 22:45:00 +0100
commita86e96d96b1c018a91a8d656e9e85e8f2507c120 (patch)
treee79a02f6fb6f0c93f66d7be16165cfe4eb86576e
parent8e13d9167e8f4c05a8901f673bb34c2c99b7041d (diff)
downloadaegisub-scripts-a86e96d96b1c018a91a8d656e9e85e8f2507c120.tar.gz
aegisub-scripts-a86e96d96b1c018a91a8d656e9e85e8f2507c120.tar.bz2
aegisub-scripts-a86e96d96b1c018a91a8d656e9e85e8f2507c120.zip
use syntactic sugar (thing:func vs func(thing, etc))
-rw-r--r--macros/garret.inverse-glow.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/macros/garret.inverse-glow.lua b/macros/garret.inverse-glow.lua
index 9733424..ec3edd1 100644
--- a/macros/garret.inverse-glow.lua
+++ b/macros/garret.inverse-glow.lua
@@ -1,7 +1,7 @@
script_name = "Inverse Glow"
script_description = "glow but it goes inside the letter"
script_author = "garret"
-script_version = "1.0.0"
+script_version = "1.0.1"
script_namespace = "garret.inverse-glow"
local haveDepCtrl, DependencyControl, depctrl = pcall(require, "l0.DependencyControl")
@@ -22,25 +22,25 @@ local function main(subs, sel)
for i = #sel, 1, -1 do
local line = subs[sel[i]]
local tags, text = line.text:match(patterns.tags_text)
- local blur = string.match(tags, patterns.bord) -- \bord = value of \blur
+ local blur = tags:match(patterns.bord) -- \bord = value of \blur
local dark = tags:match(patterns.dark) -- \c = colour of dark layer
local light = tags:match(patterns.light) -- \3c = colour of light layer
if tags and blur and dark and light then -- skip lines that don't have everything needed
- tags = string.gsub(tags, patterns.bord, "") -- remove \bord
- tags = string.gsub(tags, patterns.dark, "") -- and both colours
- tags = string.gsub(tags, patterns.light, "")
+ tags = tags:gsub(patterns.bord, "") -- remove \bord
+ tags = tags:gsub(patterns.dark, "") -- and both colours
+ tags = tags:gsub(patterns.light, "")
-- light layer
local light_line = util.copy(line)
light_line.layer = line.layer + 1
- local light_tags = string.gsub(tags, "}", "\\bord0\\shad0\\c" .. light .. "}") -- } (end of tag block) --> \cLightColour}
+ local light_tags = tags:gsub("}", "\\bord0\\shad0\\c" .. light .. "}") -- } (end of tag block) --> \cLightColour}
light_line.text = light_tags .. text
subs[sel[i]] = light_line
local dark_line = util.copy(line)
dark_line.layer = line.layer + 2
- local dark_tags = string.gsub(tags, "}", "\\bord0\\shad0\\c" .. dark .. "\\blur" .. blur .. "}") -- } -> \cDarkColour\blurBord}
+ local dark_tags = tags:gsub("}", "\\bord0\\shad0\\c" .. dark .. "\\blur" .. blur .. "}") -- } -> \cDarkColour\blurBord}
dark_line.text = dark_tags .. text
subs.insert(sel[i] + 1, dark_line)
end