Options - Cancel button without effect?

Describe any bugs you've found.
Post Reply
Dynaletik
Posts: 429
Joined: Mon May 29, 2006 8:32 am
Location: Germany

Options - Cancel button without effect?

Post by Dynaletik » Sun Apr 19, 2009 7:47 am

Hey Dan,

if you change options in the options menu of Atlas, they directly get applied. It is the same if you click on OK or Cancel then. So remove the cancel button or fix it? :D

User avatar
Dan Gilbert
Developer
Posts: 2579
Joined: Sun Jan 29, 2006 10:24 pm
Location: Amherst, MA
Contact:

Re: Options - Cancel button without effect?

Post by Dan Gilbert » Sun Apr 19, 2009 4:42 pm

Those buttons are part of the Blizzard options interface. So, it's a nice thought, but they have to stay as-is.

User avatar
Phanx
Posts: 11
Joined: Tue Dec 05, 2006 1:57 am

Re: Options - Cancel button without effect?

Post by Phanx » Mon Apr 27, 2009 1:12 am

You can make your options work with the Blizz cancel button by adding a .cancel method to your options frame. The easiest way to implement it is to set an :OnShow() script that stores the current values of all settings in a cache. Then, in your .cancel method, overwrite the now-current values with the cached values. Or, you can take a different approach and store any settings changes in a cache while the frame is open, and add an .okay method that actually applies them.

Unfortunately, the easiest way to close the Interface Options window is to press the Escape key, and Blizzard code treats pressing the Escape key the same way it treats clicking the Cancel button, so neither of the above approaches to utilizing the .okay and/or .cancel methods are very practical since the majority of addons don't use them and many users just hit Escape. I removed support for these methods in my own addons after receiving unanimous user feedback to the effect that it was frustrating and unintuitive. :(

User avatar
Dan Gilbert
Developer
Posts: 2579
Joined: Sun Jan 29, 2006 10:24 pm
Location: Amherst, MA
Contact:

Re: Options - Cancel button without effect?

Post by Dan Gilbert » Mon Apr 27, 2009 5:08 pm

Yeah, that doesn't surprise me. Since all Atlas options go into effect immediately, I think it should probably stay as-is, for the reasons you've described. So the Cancel button will essentially remain as a "Close" button.

Post Reply