remove a few old, bad, and/or useless scripts
I'm sure there are better layer orderers out there. I'm not a typesetter, so I'll never actually use mine enough that I fix the glaring issues. I don't even remember what inverse glow was for any more
This commit is contained in:
parent
84915e3859
commit
509d6e9518
|
@ -1,55 +0,0 @@
|
||||||
script_name = "Inverse Glow"
|
|
||||||
script_description = "glow but it goes inside the letter"
|
|
||||||
script_author = "garret"
|
|
||||||
script_version = "1.0.1"
|
|
||||||
script_namespace = "garret.inverse-glow"
|
|
||||||
|
|
||||||
local haveDepCtrl, DependencyControl, depctrl = pcall(require, "l0.DependencyControl")
|
|
||||||
local util
|
|
||||||
if haveDepCtrl then
|
|
||||||
depctrl = DependencyControl({
|
|
||||||
--feed="TODO",
|
|
||||||
{ "aegisub.util" },
|
|
||||||
})
|
|
||||||
util = depctrl:requireModules()
|
|
||||||
else
|
|
||||||
util = require("aegisub.util")
|
|
||||||
end
|
|
||||||
|
|
||||||
local patterns = { tags_text = "(%b{})(.*)", bord = "\\bord(%d+)", dark = "\\c(&?H*%x+&?)", light = "\\3c(&?H*%x+&?)" }
|
|
||||||
|
|
||||||
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 = 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 = 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 = 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 = tags:gsub("}", "\\bord0\\shad0\\c" .. dark .. "\\blur" .. blur .. "}") -- } -> \cDarkColour\blurBord}
|
|
||||||
dark_line.text = dark_tags .. text
|
|
||||||
subs.insert(sel[i] + 1, dark_line)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
aegisub.set_undo_point(script_name)
|
|
||||||
end
|
|
||||||
|
|
||||||
if haveDepCtrl then
|
|
||||||
depctrl:registerMacro(main)
|
|
||||||
else
|
|
||||||
aegisub.register_macro(script_name, script_description, main)
|
|
||||||
end
|
|
|
@ -1,34 +0,0 @@
|
||||||
script_name = "Order layers"
|
|
||||||
script_description = "puts each selected line on its own layer so they don't clash"
|
|
||||||
script_author = "garret"
|
|
||||||
script_version = "1.0.1"
|
|
||||||
script_namespace = "garret.order-layers"
|
|
||||||
|
|
||||||
local haveDepCtrl, DependencyControl, depctrl = pcall(require, "l0.DependencyControl")
|
|
||||||
if haveDepCtrl then
|
|
||||||
depctrl = DependencyControl {
|
|
||||||
--feed="TODO",
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local function main(sub, sel)
|
|
||||||
local i = 0
|
|
||||||
local last_start, last_end
|
|
||||||
for si,li in ipairs(sel) do
|
|
||||||
line = sub[li]
|
|
||||||
if line.start_time == last_start or line.end_time == last_end or si == 1 then
|
|
||||||
line.layer = i
|
|
||||||
i = i + 1
|
|
||||||
end
|
|
||||||
last_start = line.start_time
|
|
||||||
last_end = line.end_time
|
|
||||||
sub[li] = line
|
|
||||||
end
|
|
||||||
aegisub.set_undo_point(script_name)
|
|
||||||
end
|
|
||||||
|
|
||||||
if haveDepCtrl then
|
|
||||||
depctrl:registerMacro(main)
|
|
||||||
else
|
|
||||||
aegisub.register_macro(script_name, script_description, main)
|
|
||||||
end
|
|
Loading…
Reference in New Issue