View Single Post
09-10-10, 05:48 PM   #12
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
The shape (round or square) will be saved but that doesn't help much since I'm sure the users would care more about the actual texture (custom texture) that goes with it. The only way to keep that value persistent across sessions is to use saved variables. Considering all your other configuration is basically done through editing the top of the lua file, I don't really see the point in one setting being different than all the others.

I'd recommend just keeping the configuration solely through lua edits like it is for the rest, otherwise, you will need to use saved variables and apply the settings once they are loaded. If you are going to do that for one setting then you may as well do it for all of them. Which means needing to expand your slash command or adding a GUI.

Also, I think it was you that mentioned wanting the addon to be light weight and that was one reason you were sticking to editing the lua for all configuration (could be mistaken). I'd say just remove the ability to change the "shape" in game and have them manually edit wmshape in the lua like for the other config options.

Side note: In that code you just posted, textures don't have OnEvent scripts or a RegisterEvent method. And registering an event without an OnEvent handler won't accomplish anything anyway. I doubt textures have a SetUserPlaced method either (don't feel like checking).
  Reply With Quote