Skip to content

Commit

Permalink
only hide numeric flag names if dfhack.getHideArmokTools() == true
Browse files Browse the repository at this point in the history
cache references to global statics
  • Loading branch information
TymurGubayev committed Nov 7, 2023
1 parent bd88a1a commit 77ab5b9
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions gui/job-details.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ local function list_flags(list, bitfield)
-- a job_item_flags3[20] might be set on a job item (f.e. Cut Gems)
-- even though the flag is unnamed (i.e. `df.job_item_flags3[20] == nil`)
-- we'll ignore those for clarity.
if isString(name) then
if not dfhack.getHideArmokTools() or isString(name) then
table.insert(list, name)
end
end
Expand Down Expand Up @@ -355,18 +355,13 @@ function JobDetails:onChangeTrait()
}:show()
end

local function ScrJobDetails()
return df.global.game.main_interface.job_details
end

local function ScrWorkorderConditions()
return df.global.game.main_interface.info.work_orders.conditions
end
local ScrJobDetails = df.global.game.main_interface.job_details
local ScrWorkorderConditions = df.global.game.main_interface.info.work_orders.conditions

local function show_job_details()
local job
local context
local scr = ScrJobDetails()
local scr = ScrJobDetails

if scr.open
then
Expand All @@ -384,7 +379,7 @@ local function show_job_details()
qerror("Unhandled screen context: ".. df.job_details_context_type[context])
end
else
scr = ScrWorkorderConditions()
scr = ScrWorkorderConditions
if scr.open
then
context = df.job_details_context_type.MANAGER_WORK_ORDER
Expand Down

0 comments on commit 77ab5b9

Please sign in to comment.