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

Combine stacks of coins, make combine work in adventure mode #1227

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Crystalwarrior
Copy link
Contributor

@Crystalwarrior Crystalwarrior commented Jul 3, 2024

Allow combine to work in adventure mode and also combine stacks of coins

Note that it's safer to use the (z) -> Items tab to combine stacks currently, as doing so from the (i)nventory will not update the interface to reflect the change until you quit out of the inventory and come back. Need to figure out how to resolve that.

Copy link
Contributor

@Ozzatron Ozzatron left a comment

Choose a reason for hiding this comment

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

Functionality looks good. Main thing I was concerned about is coins max stacking at 500 (which is what you've done). Some of the user feedback could be improved though.

Comment on lines +826 to 827
if not dfhack.isMapLoaded() then
qerror('combine needs a loaded fortress map to work')
Copy link
Contributor

Choose a reason for hiding this comment

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

Using combine from the main menu now gives a disingenuous error message, because it works in adventure mode. Perhaps change this to combine can only be used in-game.

Comment on lines +704 to +706
if dfhack.world.isAdventureMode() and df.global.game.main_interface.adventure.inventory.open then
-- refresh the inventory to prevent stale item references
df.global.game.main_interface.adventure.inventory.open = false
Copy link
Contributor

Choose a reason for hiding this comment

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

The user should be notified at least in command console output if their inventory was closed automatically to prevent bugs. Running a tool that does not ostensibly claim it will manipulate UI and having it, surprisingly, manipulate UI, can be a distressing and disorienting experience for users.

@myk002
Copy link
Member

myk002 commented Jul 19, 2024

until you quit out of the inventory and come back

can you synthesize this with sent keystrokes?

@@ -792,6 +808,8 @@ local function parse_commandline(opts, args)
opts.all=get_stockpile_all()
elseif positionals[1] == 'here' then
opts.here=get_stockpile_here()
elseif positionals[1] == 'item' then
Copy link
Member

Choose a reason for hiding this comment

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

needs docs

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.

3 participants