mapkoc Posted January 1, 2018 Report Share Posted January 1, 2018 Not sure if this is a bug or intended behavior. Tested on a22 and svn. If you try to pay tributes in diplomacy window and press Shift and click on any res and without releasing Shift click on another res, only 500 of last res is sent after releasing Shift. If you now click on first resource, a 500 tribute will be sent. If you shift click on first resource instead, a 1000 tribute is sent. I find this counter intuitive if intended. If tributes are not sent when shift key is not release then they should be reset, not compounded like that. 1 Quote Link to comment Share on other sites More sharing options...
elexis Posted January 1, 2018 Report Share Posted January 1, 2018 Agree to reset the tribute factor when clicking on a different resource, not only when releasing shift. Does that also happen with tributing? Guess not. Wanna try a patch? It's in gui/session/ somewhere, likely menu.js Otherwise you could also write a ticket on trac if you don't want to have it lost on the forums. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted January 1, 2018 Report Share Posted January 1, 2018 The whole diplomacy screen needs redesigned, along with how tribute is sent. Quote Link to comment Share on other sites More sharing options...
mapkoc Posted January 1, 2018 Author Report Share Posted January 1, 2018 I press Shift and click on food and without releasing Shift click on wood and release shift. The result I would expect is to give the tribute as soon as I click without waiting to release shift. Now amounts[food] is dirty and if I shift click on food once and release If you click (no shift) on food, a 500 tribute will be sent, I have no idea why. The file elexis said is binaries/data/mods/public/gui/session/menu.js the function 470 -> function diplomacyFormatTributeButtons(i, hidden) but I don't know how to fix Quote Link to comment Share on other sites More sharing options...
elexis Posted January 1, 2018 Report Share Posted January 1, 2018 I guess it should be possible to reset the factor upon mouse-enter of the buttons. (Otherwise we'd have to use an ugly global). button.onMouseEnter we have it. 1 Quote Link to comment Share on other sites More sharing options...
mapkoc Posted January 1, 2018 Author Report Share Posted January 1, 2018 I tried button.onMouseEnter but now you give 100 tributes on hover and get even crazier with shift. Quote Link to comment Share on other sites More sharing options...
mapkoc Posted January 1, 2018 Author Report Share Posted January 1, 2018 I found a way to reset previous clicks when masstributing and not releasing shift. Add multiplier = 1; before closing onPress, say in line 522. You still can't give several tributes with 1 shift because g_FlushTributing is only called on shift release. case INPUT_MASSTRIBUTING: if (ev.type == "hotkeyup" && ev.hotkey == "session.masstribute") Maybe with an event != "hotkeyup" ? Quote Link to comment Share on other sites More sharing options...
mapkoc Posted January 1, 2018 Author Report Share Posted January 1, 2018 The previous hack breaks sending more than 500. This is the only way I could solve "the bug". Move declaration of multiplier and amounts outside onPress callback, before for (let resCode of resCodes) and make multiplier an array and initialize, like this let multiplier = {}; let amounts = {}; for (let res of resCodes) { multiplier[res] = 1; amounts[res] = 0; } change updates of multiplier to multiplier[resCode] but inside g_FlushTributing reset arrays like this for (let res of resCodes) { multiplier[res] = 1; amounts[res] = 0; } Now it works as I expected Quote Link to comment Share on other sites More sharing options...
elexis Posted January 2, 2018 Report Share Posted January 2, 2018 You wrote a patch and you have an aco@#$% on phabricator. If I get an actual patch instead of an instruction, that would make things easier. I'm still not sure if it wouldn't be the easiest solution to reset upon onMouseEnter. But we will see. Also add yourself to gui/credits/programming.json :-) 1 Quote Link to comment Share on other sites More sharing options...
mapkoc Posted January 2, 2018 Author Report Share Posted January 2, 2018 7 hours ago, elexis said: you have an aco@#$% Is that an entity or a swear word? I was hoping you did all the work. Well, that was hard, first time. (D1191) I guess one should follow https://trac.wildfiregames.com/wiki/SubmittingPatches Since the code already mixes two styles and https://trac.wildfiregames.com/wiki/Coding_Conventions#Misc also (the for_each), i figured I choose the one I like best. 9 hours ago, elexis said: add yourself to gui/credits/programming.json :-) No thanks, I'm good. 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted January 2, 2018 Report Share Posted January 2, 2018 You can put only your nickname there you're not forced to put your real identity. Quote Link to comment Share on other sites More sharing options...
elexis Posted January 2, 2018 Report Share Posted January 2, 2018 I think I wrote accont instead of account, probably not too far off :-) We add that for everyone who has added a patch. Some have contributed less that what you uploaded. It can be the nickname if you don't want your fullname shown. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.