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

Animal and Prisoner Zone Assignment Improvement - add search & sort by creature's profession #4015

Closed
xBlackTalonX opened this issue Nov 12, 2023 · 3 comments

Comments

@xBlackTalonX
Copy link
Contributor

A "Stray Dog" which has been changed to be a "Breeder Dog" (which I believe is the animal's profession?) cannot be identified from DFHack's Animal Zone Assignment interface.

Application in Game Play

If I have a "Stray Dog" and I review its character sheet I may find a trait that I want to breed for by separating this individual to join others like it in a specific pen. Let's say eye color. So I change it from being a "Stray Dog" to "Breeder Dog - Aqua Eyes". Now when I assign these dogs to their own pen it becomes a tedious process using the default UI when I have 20+ animals. DFHack Pen/Pasture Zone Assignment Interface to the rescue! However, currently the search in the DFHack Animal Assignment Interface does not search upon this profession field that was changed from "Stray Dog" to "Breeder Dog - Aqua Eyes". It would work if I had changed the dog's name instead of its profession.

None of this is particularly important, just a silly thing I sometimes do in my game play and DFHack is already very close to making easier but because of the way I've changed the animal's profession instead of the name the search DFHack offers doesn't find the animals I'm looking for. And I've hesitated to change the name of the animal instead because in similar use cases I'm trying to mark that animal for future slaughter (not a good breeder) based on its character sheet. When viewing its character sheet I have to mark it somehow for future reference. And if I change its name, my understanding is that autobutcher now won't slaughter this named livestock when its time has come. This is obviously not ideal since the reason I was marking this creature is because I actually want it to be slaughtered!

@neumond
Copy link
Contributor

neumond commented Jan 17, 2024

Partially done in #4182
It can't search by profession yet though, there's another issue that limits set of characters in search string: #4186 The interface doesn't allow entering specific characters like + or uppercase letters, so it was better to just not add profession field to the search (yet).

@myk002
Copy link
Member

myk002 commented Jan 17, 2024

actually, I think this is completed. The modified description text is incorporated into the search key

searches are case insensitive, so capitalization doesn't matter

it's true that symbols can't be entered. That's something that is easily changeable, though. The allowed characters are determined by the on_char callback:

        widgets.EditField{
            view_id='search',
            frame={l=35, t=0},
            label_text='Search: ',
            on_char=function(ch) return ch:match('[%l -]') end,
        },

changing it to '%l%p -' would allow punctuation

@myk002
Copy link
Member

myk002 commented Jan 17, 2024

I was wrong, regex escape sequences make this a bit more trouble. I'm going to say that lowercase-only should be the search space for now

@myk002 myk002 closed this as completed Jan 17, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in 50.11-r5 Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants