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

WIP update zone #2930

Closed
wants to merge 2 commits into from
Closed

WIP update zone #2930

wants to merge 2 commits into from

Conversation

robob27
Copy link
Contributor

@robob27 robob27 commented Feb 19, 2023

Very WIP on #2913, I wouldn't spend too much time reviewing yet unless you are graciously assisting me with specific questions lol

@robob27
Copy link
Contributor Author

robob27 commented Feb 19, 2023

pre-commit.ci autofix

Copy link
Member

@myk002 myk002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what I think of all this state yet. Can the searching be done in a ZScreen?

@@ -98,7 +98,8 @@ enable automelt

# Other interface improvement tools
enable \
confirm
confirm \
zone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like zone has no functionally left that needs enabling at the plugin level. Overlay enabling is managed by overlay. It can be removed from this file, and the enabled state and plugin_enable function in the cpp can be removed.

return #df.global.world.raws.creatures.all[unit.race].caste[unit.caste].shearable_tissue_layer > 0
end

local function copyTable(table_to_copy)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use the copyall global function instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually had some problems using copyall because it maintains the zero index, which gets missed in ipairs when it's an actual table. Like if I sub in copyall in place of copyTable right now things would break lol

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, ok, understood. maybe the function should be called toLuaList() then?

}

local function zone_assign_is_active()
return dfhack.gui.matchFocusString('dwarfmode/UnitSelector') and (df.global.game.main_interface.unit_selector.context == 0 or df.global.game.main_interface.unit_selector.context == 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The focus string part should move into the viewscreen attribute on the overlay. See orders.lua for an example

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And should the context value be part of the focus string as well?

@myk002
Copy link
Member

myk002 commented Mar 19, 2023

Request from Reddit: would it be possible to autoassign hachlings to their mothers pastures? Nestboxes is an amazing function but it's painful to use if you just get goslings running amok.

@myk002
Copy link
Member

myk002 commented Mar 19, 2023

continuation of reddit convo:

  • I believe DF does this by default, but not consistently. Moreover, it might not be a good idea to assign an entire brood of goslings to a single tile pasture. This sounds like a good problem to solve, though.
  • Right now all animals except egglayers get assigned to their mother's pasture so that's the only issue. Single pasture isn't really a problem with autobutcher and one species per pasture c:

@myk002
Copy link
Member

myk002 commented Nov 29, 2023

closing PR for now since the functionality is now offered by the assign to pasture dialog. I'm keeping the reference to this PR in the associated issue, though, since there are bits of this PR we might want to merge into that dialog

@myk002 myk002 closed this Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants