inline if didn't work. Added intermediate register_event function in transition library
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
|
||||
local dt = require "darktable"
|
||||
local du = require "lib/dtutils"
|
||||
require "lib/darktable_transition"
|
||||
|
||||
-- added version check
|
||||
du.check_min_api_version("3.0.0", "rate_group")
|
||||
@@ -60,37 +61,37 @@ local function apply_rating(rating)
|
||||
end
|
||||
end
|
||||
|
||||
dt.register_event(CURR_API_STRING >= "6.2.1" and "rg_reject", "shortcut" or "shortcut" ,
|
||||
dt.register_event("rg_reject", "shortcut",
|
||||
function(event, shortcut)
|
||||
apply_rating(-1)
|
||||
end, "Reject group")
|
||||
|
||||
dt.register_event(CURR_API_STRING >= "6.2.1" and "rg0", "shortcut" or "shortcut",
|
||||
dt.register_event("rg0", "shortcut",
|
||||
function(event, shortcut)
|
||||
apply_rating(0)
|
||||
end, "Rate group 0")
|
||||
|
||||
dt.register_event(CURR_API_STRING >= "6.2.1" and "rg1", "shortcut" or "shortcut",
|
||||
dt.register_event("rg1", "shortcut",
|
||||
function(event, shortcut)
|
||||
apply_rating(1)
|
||||
end, "Rate group 1")
|
||||
|
||||
dt.register_event(CURR_API_STRING >= "6.2.1" and "rg2", "shortcut" or "shortcut",
|
||||
dt.register_event("rg2", "shortcut",
|
||||
function(event, shortcut)
|
||||
apply_rating(2)
|
||||
end, "Rate group 2")
|
||||
|
||||
dt.register_event(CURR_API_STRING >= "6.2.1" and "rg3", "shortcut" or "shortcut",
|
||||
dt.register_event("rg3", "shortcut",
|
||||
function(event, shortcut)
|
||||
apply_rating(3)
|
||||
end, "Rate group 3")
|
||||
|
||||
dt.register_event(CURR_API_STRING >= "6.2.1" and "rg4", "shortcut" or "shortcut",
|
||||
dt.register_event("rg4", "shortcut",
|
||||
function(event, shortcut)
|
||||
apply_rating(4)
|
||||
end, "Rate group 4")
|
||||
|
||||
dt.register_event(CURR_API_STRING >= "6.2.1" and "rg5", "shortcut" or "shortcut",
|
||||
dt.register_event("rg5", "shortcut",
|
||||
function(event, shortcut)
|
||||
apply_rating(5)
|
||||
end, "Rate group 5")
|
||||
|
||||
Reference in New Issue
Block a user