From 8991034e1d36eb33843ee763070c35956fcd9b85 Mon Sep 17 00:00:00 2001 From: Heino <132708558+HeinoDev@users.noreply.github.com> Date: Thu, 12 Nov 2026 19:26:08 +0100 Subject: [PATCH 1/3] Danish locale created --- locales/da.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 locales/da.json diff --git a/locales/da.json b/locales/da.json new file mode 100644 index 0000000..19b1f9b --- /dev/null +++ b/locales/da.json @@ -0,0 +1,11 @@ +{ + "hold": "Hold", + "keymap": { + "interact": "Brug", + "next": "Næste valg", + "prev": "Forrige valg", + "interact_pad": "Brug (controller)", + "next_pad": "Næste valg (controller)", + "prev_pad": "Forrige valg (controller)" + } +} From b3e3c0d68c66ded8baef36568b9ec154c0c9c8a4 Mon Sep 17 00:00:00 2001 From: Heino <132708558+HeinoDev@users.noreply.github.com> Date: Thu, 12 Nov 2026 19:27:43 +0100 Subject: [PATCH 2/3] Swedish locale created --- locales/sv.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 locales/sv.json diff --git a/locales/sv.json b/locales/sv.json new file mode 100644 index 0000000..5859cf3 --- /dev/null +++ b/locales/sv.json @@ -0,0 +1,11 @@ +{ + "hold": "Håll", + "keymap": { + "interact": "Använd", + "next": "Nästa val", + "prev": "Föregående val", + "interact_pad": "Använd (handkontroll)", + "next_pad": "Nästa val (handkontroll)", + "prev_pad": "Föregående val (handkontroll)" + } +} From fd035b28356157bf81470f2e986ae5f3bf682ddc Mon Sep 17 00:00:00 2001 From: Heino <132708558+HeinoDev@users.noreply.github.com> Date: Thu, 12 Nov 2026 19:35:06 +0100 Subject: [PATCH 3/3] Danish & Swedish locales and clearer runtime messages --- client/compat/convert.lua | 2 +- client/interact/loop.lua | 2 +- client/interact/points.lua | 37 +++++++++++++++++++++++++++++++++---- client/interact/run.lua | 2 +- client/main.lua | 6 +++--- 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/client/compat/convert.lua b/client/compat/convert.lua index 9488d08..0cec4fa 100644 --- a/client/compat/convert.lua +++ b/client/compat/convert.lua @@ -261,7 +261,7 @@ function convert.qb(o, maxDistance) TriggerEvent(d.event, d) end else - error('No trigger setup') + error('This option has no action or event.') end end diff --git a/client/interact/loop.lua b/client/interact/loop.lua index 780bc6b..8156bb3 100644 --- a/client/interact/loop.lua +++ b/client/interact/loop.lua @@ -156,7 +156,7 @@ local function take(c) shownSig = sig if config.Debug then - lib.print.info(('focus %s (%d options)'):format(c.key, #c.options)) + lib.print.info(('Showing %s (%d options).'):format(c.key, #c.options)) end end diff --git a/client/interact/points.lua b/client/interact/points.lua index 2cda634..d06bc89 100644 --- a/client/interact/points.lua +++ b/client/interact/points.lua @@ -59,6 +59,7 @@ local DEF = config.Interact ---@return InteractOption[] local function cleanOptions(list) local out = {} + local invalid = 0 if type(list) ~= 'table' then return out @@ -69,12 +70,14 @@ local function cleanOptions(list) end for _, o in ipairs(list) do - if type(o) == 'table' and type(o.label) == 'string' then + if type(o) == 'table' and type(o.label) == 'string' and o.label ~= '' then out[#out + 1] = o + else + invalid = invalid + 1 end end - return out + return out, invalid end ---@param v any @@ -104,10 +107,17 @@ local function make(kind, data, resource) lastId = lastId + 1 data = type(data) == 'table' and data or {} + local options, invalid = cleanOptions(data.options or data) + + if invalid > 0 then + lib.print.warn(('Resource "%s": skipped %d option(s) with no valid label. Each option needs a text label.') + :format(resource, invalid)) + end + local p = { id = lastId, kind = kind, - options = cleanOptions(data.options or data), + options = options, distance = tonumber(data.distance) or DEF.Distance, interactDistance = tonumber(data.interactDistance) or DEF.InteractDistance, lineOfSight = data.lineOfSight == nil and DEF.LineOfSight or data.lineOfSight == true, @@ -129,6 +139,12 @@ end ---@param p InteractPoint ---@return integer id local function put(p) + if #p.options == 0 then + lib.print.warn(('Resource "%s": skipped a point with no valid options.') + :format(p.resource)) + return nil + end + all[p.id] = p points.version = points.version + 1 return p.id @@ -285,7 +301,20 @@ function points.update(id, data) if not p or type(data) ~= 'table' then return false end if data.options then - p.options = cleanOptions(data.options) + local options, invalid = cleanOptions(data.options) + + if invalid > 0 then + lib.print.warn(('Resource "%s": skipped %d option(s) with no valid label while updating point %d.') + :format(p.resource, invalid, id)) + end + + if #options == 0 then + lib.print.warn(('Resource "%s": point %d needs at least one valid option. Update skipped.') + :format(p.resource, id)) + return false + end + + p.options = options end if data.distance then diff --git a/client/interact/run.lua b/client/interact/run.lua index 3df7978..8e15e68 100644 --- a/client/interact/run.lua +++ b/client/interact/run.lua @@ -39,7 +39,7 @@ function run.option(c, o) end) if not ok then - lib.print.error(('option "%s" of a %s point failed: %s'):format(o.label, c.point.resource, tostring(err))) + lib.print.error(('Option "%s" from resource "%s" failed: %s'):format(o.label, c.point.resource, tostring(err))) end end diff --git a/client/main.lua b/client/main.lua index e097adf..a9a7374 100644 --- a/client/main.lua +++ b/client/main.lua @@ -24,8 +24,8 @@ do ---@type table qb-target's / qtarget's API (client.compat.qb_target). local qb = require 'client.compat.qb_target' local layers = { ox_target = ox, qtarget = qb, ['qb-target'] = qb } - local warning = 'Replace.%s is on and something called %s is started: ' - .. 'if the real %s is still installed, remove it from your server.cfg' + local warning = 'Can’t replace %s while resource "%s" is running. ' + .. 'Stop the real %s resource or remove it from server.cfg.' for name, on in pairs(config.Replace) do local layer = layers[name] @@ -45,7 +45,7 @@ do end layer.provide(name) - lib.print.info(('answering %s exports'):format(name)) + lib.print.info(('Using %s compatibility exports.'):format(name)) end end end