Atm when hitting escape in game when units selected and dialog open (barter e.g.) and menu open, u want to close menu by hit escape but u close menu, dialog and units deselected at once.
The desired effect would be only close first menu. On next escape hit close dialog. On next escape hit deselect units.
So the cancel hotkey should get a stacked order in code. First close menu if open second close a dialog if open.
The bug with deselection is only there cause we got binded same hotkey as cancel hotkey for it (escape key). So we need to check here if it binded to the same key in user config. Then it needs to be stacked at last in the cancel hotkey stack.
This code does this.
Its finished and ready to commit.
This will help patch D297 to not close selection when dialog open for info that just want to be closed on escape hit.