Compare commits

...
Author SHA1 Message Date
D4rkst3r d1edad425f merge: fix/flaschenwahl-unser-design 2026-10-10 18:41:40 +02:00
D4rkst3randClaude Opus 5.5 8eb1ebbdef fix: Flaschenwahl im d4rk_lib-Design (#158)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 18:41:40 +02:00
D4rkst3r 79f468d1aa merge: fix/befehle-f8 (#81) 2026-10-07 12:49:19 +02:00
3 changed files with 18 additions and 17 deletions

No files matched your search

+14 -15
View File
@@ -193,31 +193,30 @@ end
local function chooseTank(tanks)
if #tanks == 1 then return tanks[1] end
local selection = promise.new()
local options = {}
-- Im d4rk_lib-Design statt lib.registerContext (d4rk-rp-planung CLAUDE.md
-- "Unser Design, nicht das von ox_lib", 10.10.2026). Beendet wird mit dem
-- Knopf je Flasche oder ESC (= nil); blockiert wie vorher das promise.
local eintraege = {}
for i = 1, #tanks do
local tank = tanks[i]
options[i] = {
title = tank.label,
description = locale('info.tank_remaining', formatTime(tank.oxygen),
eintraege[i] = {
id = tostring(i),
titel = tank.label,
unterzeile = locale('info.tank_remaining', formatTime(tank.oxygen),
math.floor(tank.oxygen / tank.capacity * 100),
tank.gas or '?', math.floor(tank.maxDepth or 0)),
icon = 'fa-solid fa-bottle-water',
onSelect = function() selection:resolve(tank) end
symbol = 'wind',
aktionen = { { id = 'waehlen', label = locale('menu.use_tank'), art = 'primaer' } },
}
end
lib.registerContext({
id = 'd4rk_divegear_tanks',
title = locale('menu.choose_tank'),
options = options,
onExit = function() selection:resolve(nil) end
local wahl = exports.d4rk_lib:menu({
titel = locale('menu.choose_tank'),
eintraege = eintraege,
})
lib.showContext('d4rk_divegear_tanks')
return Citizen.Await(selection)
return type(wahl) == 'table' and tanks[tonumber(wahl.eintrag) or -1] or nil
end
lib.callback.register('d4rk_divegear:client:fillTank', function(tanks)
+2 -1
View File
@@ -35,7 +35,8 @@
"patrone_einsetzen": "Patrone wird eingesetzt..."
},
"menu": {
"choose_tank": "Tauchflasche wählen"
"choose_tank": "Tauchflasche wählen",
"use_tank": "Diese Flasche"
},
"hud": {
"air": "Luft",
+2 -1
View File
@@ -35,7 +35,8 @@
"patrone_einsetzen": "Inserting cartridge..."
},
"menu": {
"choose_tank": "Choose an air tank"
"choose_tank": "Choose an air tank",
"use_tank": "Use this tank"
},
"hud": {
"air": "Air",