dfhack
dfhack copied to clipboard
Make getplants plugin case-insensitive
The "getplants" command requires the plant types to be inputted in all capital letters. It would be more convenient to allow them to be inputted with any capitalization, as with the "exterminate" script.
Hello I'm a beginner I want to contribute on this one. Can you give me some more pointers about it.
Sure! This is a C++ tool, so you'll need to be able to compile DFHack to test it. Our compilation docs are here: https://docs.dfhack.org/en/stable/docs/Compile.html You'll also need an installation of Dwarf Fortress to install into, ideally 0.47.05.
As for implementation: we have a toLower()
in MiscUtils.h
that works on strings, so you could probably do this by normalizing the contents of plantNames
to lowercase when names are added:
https://github.com/DFHack/dfhack/blob/d5d41cd374fdda6093f3be8b5b23f97e7af6c380/plugins/getplants.cpp#L398
and when they are checked:
https://github.com/DFHack/dfhack/blob/d5d41cd374fdda6093f3be8b5b23f97e7af6c380/plugins/getplants.cpp#L431-L433
Documentation on how to use getplants
is here: https://docs.dfhack.org/en/stable/docs/Plugins.html#getplants
Thank you so much. I'll try my best to do it.
Hi! Is this done? If not I would like to take a shot
Hi! Is this done? If not I would like to take a shot
The last comment on this bug is more than a year old. You are welcome to take ownership of it and submit a PR. Thanks!