aboutsummaryrefslogtreecommitdiffstats
path: root/become-fansubber.lua
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2021-08-21 13:48:00 +0100
committergarret <garret@airmail.cc>2021-08-21 13:48:00 +0100
commit4f7469e56a07250d1e044cf940b44eaf612d3282 (patch)
tree768427794529dfdf9fb296b497c1803597d707b3 /become-fansubber.lua
parent131fac9291d6c8cd08004e0c770542def7ee5034 (diff)
downloadaegisub-scripts-4f7469e56a07250d1e044cf940b44eaf612d3282.tar.gz
aegisub-scripts-4f7469e56a07250d1e044cf940b44eaf612d3282.tar.bz2
aegisub-scripts-4f7469e56a07250d1e044cf940b44eaf612d3282.zip
rename cr restyler -> restyler
Diffstat (limited to 'become-fansubber.lua')
-rw-r--r--become-fansubber.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/become-fansubber.lua b/become-fansubber.lua
index 9f5ac32..4db028e 100644
--- a/become-fansubber.lua
+++ b/become-fansubber.lua
@@ -1,4 +1,4 @@
-script_name="CR Restyler"
+script_name="Restyler"
script_description="become a fansubber with a click of a button"
script_author = "garret"
script_version = "2.0.0-dev"
@@ -35,14 +35,13 @@ function get_new(old, new)
end
function main(sub, sel)
- local _, styles = karaskel.collect_head(sub) -- i'd like to not have it log if possible
+ local _, styles = karaskel.collect_head(sub, false)
local new_style_name = "Default" -- the one we'll be changing stuff to - TODO: configurable
local new_style = styles[new_style_name]
for h, i in ipairs(sel) do
- -- maybe don't do if the style has "sign" in the name?
- -- need proper list of stuff cr uses
+ -- TODO: automatically exclude styles (also configurable)
local line = sub[i]
- local old_style = styles[line.style]
+ local old_style = styles[line.style] -- reinventing the wheel a bit here, since karaskel can do this with preproc_line_size (line.styleref), but it also adds loads of other crap we don't care about for the same functionality in the end, so ¯\_(ツ)_/¯
local italic = get_new(old_style.italic, new_style.italic)
local align = get_new(old_style.align, new_style.align)
line.style = new_style_name