Closed janxious closed 6 years ago
I see what you're saying in code; but I cannot reproduce this in game.
I'll re-check with all mods disabled (as I believe I did the first time) and if I can still reproduce it, maybe it's a mac bug.
Closed for now since seems to not happen anymore
Describe the problem Players can easily skirt the intended limitations on buying and selling goods while in flight to jumpships and on jumpships by using the enter/return key.
Provide an example of the code where the problem occurs Code in question is https://github.com/saltyhotdog/BattletechSLN/blob/master/Assembly-CSharp/BattleTech/UI/SG_Shop_Screen.cs#L537-L557 combined with https://github.com/saltyhotdog/BattletechSLN/blob/master/Assembly-CSharp/BattleTech/UI/SG_Shop_Screen.cs#L669-L672
In my testing, if one inspects the button's state, it is set to visible and enabled, which I believe is the problem. I haven't traced down that part.
Provide an example of your proposed solution
Fixing the button to not be callable in that enter handler is probably most correct. I've solved it in a mod by checking the current travel status before buying and selling occurs: https://github.com/janxious/ShopSeller/blob/master/ShopSeller.cs#L101-L107