mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-20 03:16:46 -07:00
Improve startup dictionary sync UX and default playback keybindings
- Add default `f` fullscreen overlay binding and switch default AniSkip skip key to `Tab` - Make character-dictionary auto-sync non-blocking at startup with tokenization gating for Yomitan mutations - Add ordered startup OSD progress (checking/generating/updating/importing), refresh current subtitle on sync completion, and extend regression tests
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
local M = {}
|
||||
local matcher = require("aniskip_match")
|
||||
local DEFAULT_ANISKIP_BUTTON_KEY = "TAB"
|
||||
|
||||
function M.create(ctx)
|
||||
local mp = ctx.mp
|
||||
@@ -464,7 +465,7 @@ function M.create(ctx)
|
||||
local intro_start = state.aniskip.intro_start or -1
|
||||
local hint_window_end = intro_start + 3
|
||||
if in_intro and not state.aniskip.prompt_shown and now >= intro_start and now < hint_window_end then
|
||||
local key = opts.aniskip_button_key ~= "" and opts.aniskip_button_key or "y-k"
|
||||
local key = opts.aniskip_button_key ~= "" and opts.aniskip_button_key or DEFAULT_ANISKIP_BUTTON_KEY
|
||||
local message = string.format(opts.aniskip_button_text, key)
|
||||
mp.osd_message(message, tonumber(opts.aniskip_button_duration) or 3)
|
||||
state.aniskip.prompt_shown = true
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
local M = {}
|
||||
local DEFAULT_ANISKIP_BUTTON_KEY = "TAB"
|
||||
|
||||
local function normalize_socket_path_option(socket_path, default_socket_path)
|
||||
if type(default_socket_path) ~= "string" then
|
||||
@@ -42,7 +43,7 @@ function M.load(options_lib, default_socket_path)
|
||||
aniskip_payload = "",
|
||||
aniskip_show_button = true,
|
||||
aniskip_button_text = "You can skip by pressing %s",
|
||||
aniskip_button_key = "y-k",
|
||||
aniskip_button_key = DEFAULT_ANISKIP_BUTTON_KEY,
|
||||
aniskip_button_duration = 3,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
local M = {}
|
||||
local DEFAULT_ANISKIP_BUTTON_KEY = "TAB"
|
||||
local LEGACY_ANISKIP_BUTTON_KEY = "y-k"
|
||||
|
||||
function M.create(ctx)
|
||||
local mp = ctx.mp
|
||||
@@ -89,8 +91,11 @@ function M.create(ctx)
|
||||
aniskip.skip_intro_now()
|
||||
end)
|
||||
end
|
||||
if opts.aniskip_button_key ~= "y-k" then
|
||||
mp.add_key_binding("y-k", "subminer-skip-intro-fallback", function()
|
||||
if
|
||||
opts.aniskip_button_key ~= LEGACY_ANISKIP_BUTTON_KEY
|
||||
and opts.aniskip_button_key ~= DEFAULT_ANISKIP_BUTTON_KEY
|
||||
then
|
||||
mp.add_key_binding(LEGACY_ANISKIP_BUTTON_KEY, "subminer-skip-intro-fallback", function()
|
||||
aniskip.skip_intro_now()
|
||||
end)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user