-
Notifications
You must be signed in to change notification settings - Fork 198
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
global necronomicon functionality #1325
Changes from 3 commits
48373de
22b1fa5
4a1c14f
e129df5
ad2ccfa
d92a90e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -79,20 +79,50 @@ function necronomicon(include_slabs) | |||||
end | ||||||
end | ||||||
|
||||||
function necronomicon_world(include_slabs) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you fix the indentation of this function? it should be four spaces per indent, no tabs. The pre-commit.ci autofix might be able to do it for you. (see https://results.pre-commit.ci/run/github/54066125/1728398159.cyDmLoGvQYO2Zc9I5N4ilg ) |
||||||
if include_slabs then | ||||||
print("Slabs:") | ||||||
print() | ||||||
for _,rec in ipairs(df.global.world.artifacts.all) do | ||||||
if df.item_slabst:is_instance(rec.item) and check_slab_secrets(rec.item) then | ||||||
print(dfhack.TranslateName(rec.name)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
end | ||||||
end | ||||||
print() | ||||||
end | ||||||
print("Books and Scrolls:") | ||||||
print() | ||||||
for _,rec in ipairs(df.global.world.artifacts.all) do | ||||||
if df.item_bookst:is_instance(rec.item) or df.item_toolst:is_instance(rec.item) then | ||||||
local title, interactions = get_book_interactions(rec.item) | ||||||
|
||||||
if next(interactions) then | ||||||
print(" " .. dfhack.df2console(title)) | ||||||
print_interactions(interactions) | ||||||
print() | ||||||
end | ||||||
end | ||||||
end | ||||||
end | ||||||
|
||||||
local help = false | ||||||
local include_slabs = false | ||||||
local include_slabs, scan_world = false, false | ||||||
local args = argparse.processArgsGetopt({...}, { | ||||||
{"s", "include-slabs", handler=function() include_slabs = true end}, | ||||||
{"w", "world", handler=function() scan_world = true end}, | ||||||
{"h", "help", handler=function() help = true end} | ||||||
}) | ||||||
|
||||||
local cmd = args[1] | ||||||
|
||||||
if help or cmd == "help" then | ||||||
print(dfhack.script_help()) | ||||||
elseif cmd == nil or cmd == "" then | ||||||
necronomicon(include_slabs) | ||||||
elseif not cmd then | ||||||
if scan_world then | ||||||
necronomicon_world(include_slabs) | ||||||
else | ||||||
necronomicon(include_slabs) | ||||||
end | ||||||
else | ||||||
print(('necronomicon: Invalid argument: "%s"'):format(cmd)) | ||||||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.