Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use new helpdb has_tag api #1142

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions gui/teleport.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ saved_hostile = saved_hostile or (saved_hostile == nil and true)

local indicator = df.global.game.main_interface.recenter_indicator_m

local function get_dims(pos1, pos2)
local width, height, depth = math.abs(pos1.x - pos2.x) + 1,
math.abs(pos1.y - pos2.y) + 1,
math.abs(pos1.z - pos2.z) + 1
return width, height, depth
end

local function is_good_unit(include, unit)
if not unit then return false end
if dfhack.units.isDead(unit) or
Expand Down Expand Up @@ -360,7 +353,7 @@ end
function Teleport:do_teleport(pos)
pos = pos or dfhack.gui.getMousePos()
if not pos then return end
print(('teleporting %d units'):format(#self.selected_units.list))
print(('teleporting %d unit(s)'):format(#self.selected_units.list))
for _,unit in ipairs(self.selected_units.list) do
dfhack.units.teleport(unit, pos)
end
Expand Down
4 changes: 1 addition & 3 deletions internal/control-panel/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ function command_passes_filters(data, target_group, filter_strs)
end
filter_strs = filter_strs or {}
local first_word = get_first_word(data.help_command or data.command)
if dfhack.getHideArmokTools() and helpdb.is_entry(first_word)
and helpdb.get_entry_tags(first_word).armok
then
if dfhack.getHideArmokTools() and helpdb.has_tag(first_word, 'armok') then
return false
end
return data.help_command and
Expand Down