Skip to content

Commit

Permalink
remove rename part from code
Browse files Browse the repository at this point in the history
  • Loading branch information
rslgp authored Jun 19, 2024
1 parent 8c9fda0 commit ef02e05
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions all-unmet-needs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ for _, unit in pairs(df.global.getCitizens()) do
end
end

unit_name=getNick(unit)
if opts.removenick and string.find(unit_name, "NDS_") then
dfhack.units.setNickname(unit, string.sub(unit_name, string.find(unit_name, "_NDS")+5))
end
-- unit_name=getNick(unit)
-- if opts.removenick and string.find(unit_name, "NDS_") then
-- dfhack.units.setNickname(unit, string.sub(unit_name, string.find(unit_name, "_NDS")+5))
-- end

end

Expand All @@ -123,23 +123,23 @@ print(([[%20s %8s %8s %10s]]):format("Need", "Weight", "Focus", "# Dwarves"))
for i, need in pairs(sorted_fort_needs) do
local names = ""
--if i < 4 then --CAN limit only the firsts #3 needs
for _, unit in pairs(need[5]) do
local modResult = ""
local nickMod = convertNeeds[need[1]]
unit_name=getNick(unit)
if opts.setnick and not string.find(unit_name, nickMod) then
if string.find(unit_name, "NDS_") then --arready mod
local endString = string.find(unit_name, "_NDS")+4
local nick = string.sub(unit_name, endString)
local prevNeeds = string.sub(unit_name, string.find(unit_name, "NDS_"), endString-5)
modResult = prevNeeds .. nickMod .. " _NDS" .. nick
else
modResult = ("NDS_ %s _NDS %s"):format(nickMod, unit_name)
end
dfhack.units.setNickname(unit,modResult)
end
names = names .. modResult
end
-- for _, unit in pairs(need[5]) do
-- local modResult = ""
-- local nickMod = convertNeeds[need[1]]
-- unit_name=getNick(unit)
-- if opts.setnick and not string.find(unit_name, nickMod) then
-- if string.find(unit_name, "NDS_") then --arready mod
-- local endString = string.find(unit_name, "_NDS")+4
-- local nick = string.sub(unit_name, endString)
-- local prevNeeds = string.sub(unit_name, string.find(unit_name, "NDS_"), endString-5)
-- modResult = prevNeeds .. nickMod .. " _NDS" .. nick
-- else
-- modResult = ("NDS_ %s _NDS %s"):format(nickMod, unit_name)
-- end
-- dfhack.units.setNickname(unit,modResult)
-- end
-- names = names .. modResult
-- end
--end

--print(([[%20s %8.f %8.f %10d %20s]]):format(need[1] .. " ".. convertNeeds[need[1]], need[2], need[3], need[4], names)) --DEBUG show units names
Expand Down

0 comments on commit ef02e05

Please sign in to comment.