aboutsummaryrefslogtreecommitdiffstats
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
parent131fac9291d6c8cd08004e0c770542def7ee5034 (diff)
downloadaegisub-scripts-4f7469e56a07250d1e044cf940b44eaf612d3282.tar.gz
aegisub-scripts-4f7469e56a07250d1e044cf940b44eaf612d3282.tar.bz2
aegisub-scripts-4f7469e56a07250d1e044cf940b44eaf612d3282.zip
rename cr restyler -> restyler
-rw-r--r--README.md20
-rw-r--r--become-fansubber.lua9
2 files changed, 14 insertions, 15 deletions
diff --git a/README.md b/README.md
index 2232982..9d950df 100644
--- a/README.md
+++ b/README.md
@@ -62,16 +62,6 @@ Language is currently hardcoded to english.
**Done better by**: `Significance` by UA.
-### CR Restyler
-
-`become-fansubber.lua`
-
-Changes style of selected lines to `Default` (for now),
- and copies italic+alignment values from cr's styles to inline tags.
-
-assumes a relatively clean cr script.
- if not, you're on your own.
-
### Dupe and Comment
Duplicates a line and comments out the original.
@@ -97,6 +87,16 @@ makes doing alpha timing significantly easier
originally created to convert stuff that should've been alpha timed in the first place
but used a weird hack with `\ko` instead.
+### Restyler
+
+`become-fansubber.lua`
+
+Changes style of selected lines to `Default` (for now, will be configurable in future),
+ and copies italic+alignment values from the script's styles to inline tags.
+
+Can't help if the source script isn't properly styled.
+**cannot handle inline tags!**
+
### Scenebleed Detector
Finds scenebleeds in the selected lines, and marks them with an effect (`bleed`).
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