This simple modification makes pressing Escape or the X close button always 'BuyBricks.' This means you can close the window any way you're used to closing it and not have to worry you canceled selecting your bricks. The modification amends to default commands in an attempt to be future-active. There is a console command provided should you wish to disable this effect:
toggleBSDFix();Thanks to Adam487 for giving me direction, showing me where to change, looking over my code, etc. Also thanks to "M" for publicly releasing libstr.cs. (I would link the topic and correct the name, but my internet is being strange as hell at the moment.)
Download