Bug #2506
openUI: add a hook to update diplomacy gold
0%
Description
If I open a meeting on turn N and offer gold on turn N+1, the gold fields are still constrained to the gold on turn N, even though that might be lower or higher now.
To reproduce: open a meeting, get more gold (end the turn, or "/lua cmd edit.change_gold(find.player(0), 1000)"), then try to offer it all; the spin button stops at the old amount and that is what gets offered.
The gold spin buttons get their range from economic.gold when the dialog is built and never again; handle_player_info() refreshes other dialogs but not this one.
Attached patch adds update_diplomacy_gold(), called from handle_player_info() next to update_intel_dialog(), and the gtk3.22, gtk4 and gtk4x clients reset the spin buttons' range from it. The value-changed handler is blocked while doing so, as otherwise a fall in gold would rewrite an offered gold clause by itself.
Files
Updated by Sweet Tea Dorminy 4 days ago
- File 0002-gtk-clients-Keep-diplomacy-gold-limit-in-step-with-p-S3_3.patch added
- File 0001-Add-update_diplomacy_gold-client-GUI-hook-S3_3.patch 0001-Add-update_diplomacy_gold-client-GUI-hook-S3_3.patch added
- File 0002-gtk-clients-Keep-diplomacy-gold-limit-in-step-with-p-main.patch added
- File 0001-Add-update_diplomacy_gold-client-GUI-hook-main.patch 0001-Add-update_diplomacy_gold-client-GUI-hook-main.patch added
Updated by Marko Lindqvist 4 days ago
Can you split this in to two tickets so that each would have only one patch (for each branch)? It might be quite theoretical, but that would us allow to apply the "hooks" ticket + some other client depending on "hooks", but not gtk clients, on some branch. Ticket can only be resolved or not, not half so (esp. in the NEWS of a release)
btw. Are you now able to set ticket relations yourself? (Is there "Add" button on the top right corner of the "Related issues" section?)
Updated by Sweet Tea Dorminy 3 days ago
Sorry, I don't understand what you're asking: a separate main vs 3.3 ticket; or a separate "add the hook" ticket vs a "use the hook in gtk" ticket? Apologies.
Unfortunately no I don't have the related issues sectoin as far as I can tell.
Updated by Sweet Tea Dorminy about 14 hours ago
- Subject changed from UI (gtk*): diplomacy gold is cached from start of meeting to UI: add a hook to update diplomacy gold
- Category changed from gtk4-client to client-common
Updated title. Will open a new gtk bug depending here.
Updated by Sweet Tea Dorminy about 14 hours ago
- File deleted (
0002-gtk-clients-Keep-diplomacy-gold-limit-in-step-with-p-S3_3.patch)
Updated by Sweet Tea Dorminy about 14 hours ago
- File deleted (
0002-gtk-clients-Keep-diplomacy-gold-limit-in-step-with-p-main.patch)