0.1.186: Rechenspitzen im Hintergrund (Lernplan, Ziele, Datenzählung, Berufs-Hinweis)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
Lacustat
2026-10-29 22:53:17 +01:00
co-authored by Claude Sonnet 5.5
parent f3ad39df3e
commit f6061b92f2
3 changed files with 35 additions and 2 deletions
+23 -1
View File
@@ -68,9 +68,15 @@ function Hints.ClassEntries(level)
end
-- Berufslehrer-Fähigkeiten, deren Fertigkeitswert in (von, bis] liegt
function Hints.ProfEntries(skill, from, to)
function Hints.ProfEntries(skill, from, to, yield)
local list, seen = {}, {}
local n = 0
for _, u in pairs(Codex.V().units) do
n = n + 1
if yield and n % 250 == 0 then
local Q = FW.Quest
if Q and Q.Yield then Q.Yield() end
end
if u.tr and u.ro and (u.ro.proftrainer or 0) > 0 then
for key, r in pairs(u.tr) do
if r.sn == skill and r.sr and r.sr > from and r.sr <= to then
@@ -284,6 +290,22 @@ function Hints.OnSkill(skill, value)
local from = prevSkill[skill] or (value - 1)
prevSkill[skill] = value
if not Hints.ProfOn() or not Codex.db.settings.enabled then return false end
-- Die Suche ueber alle Lehrer dauerte bis 450 ms am Stueck: wenn das Quest-Modul laeuft, in kleinen Stuecken im Hintergrund
local Q = FW.Quest
if Q and Q.Slice and Q.Slice.Run and Q.Yield then
local title = string.format(FW.L.CODEX_HINT_PROF_TITLE, skill, value)
local started = Q.Slice.Run("skillhint:" .. skill .. ":" .. value, function()
return Hints.ProfEntries(skill, from, value, true)
end, {
silent = true,
done = function(ok, entries)
if ok and type(entries) == "table" then
Hints.Push({ title = title, entries = entries, onClick = function() UI:Show("codex") end })
end
end,
})
if started then return true end
end
local entries = Hints.ProfEntries(skill, from, value)
return Hints.Push({ title = string.format(FW.L.CODEX_HINT_PROF_TITLE, skill, value), entries = entries, onClick = function() UI:Show("codex") end })
end