That line appears in the middle of a big function.
You can superload to just overwrite that function, but it's pretty big.
Here's how I overloaded one function in that dialog in Nulltweaks:
Code: Select all
-- tome-nulltweaks/superload/mod/dialogs/LevelupDialog.lua
local _M = loadPrevious(...)
_M.isUnlearnable = function(self, t, limit)
if not self.actor.last_learnt_talents then return end
if self.on_birth and self.actor:knowTalent(t.id) and not t.no_unlearn_last then return 1 end -- On birth we can reset any talents except a very few
local list = self.actor.last_learnt_talents[t.generic and "generic" or "class"]
local max = self.actor:lastLearntTalentsMax(t.generic and "generic" or "class")
local min = 1
if limit then min = math.max(1, #list - (max - 1)) end
local seen = 0
-- Check for visible monsters, only see LOS actors, so telepathy wont prevent it
if game and game.level and game.level.entities then
for k, v in pairs(game.level.entities) do
if v.__CLASSNAME and (v.__CLASSNAME == "mod.class.NPC") and (game.player:reactionToward(v) < 0) and (v.hasEffect and not v:hasEffect(v.EFF_VAULTED)) then
seen = seen + 1
end
end
end
for i = #list, min, -1 do
if list[i] == t.id then
if not game.state.birth.force_town_respec or (seen <= 0) or (game.level and game.level.data and game.level.data.allow_respec == "limited")
then
return i
else
return nil, i
end
end
end
return nil
end
return _M
On the upside, here's the code in 1.6 git right now:
Code: Select all
Dialog.init(self, "Levelup: "..actor.name..", level "..actor.level, game.w * 0.9, game.h * 0.9, game.w * 0.05, game.h * 0.05)
So basically what you want to happen is already going to happen, eventually.