So let's get right to the matter. I would like to be able to change profiles/layouts based on whether or not I have my pet out or not. I'm thinking this might also be a handy feature for other events as well. I'm assuming that this would require writing an addon that hooks into Pitbull.
I'm willing to write this myself, I work as a Java web programmer so programming languages and user interfaces aren't alien to me but this will be my first foray into LUA. This topic is more to get some feedback on the best methods to go about writing such an addon or even if this addon needs to be written at all (I'm sure I'm not the first person to think of this). Therefore feedback is definitely wanted and appreciated!
OK, to the design:
The config UI would basically consist of a text field that you could add events into and a drop down to select existing Pitbull layouts. An 'OK' button to add the input to your list of saved events. Finally a list box of the event/profile combinations you've created. You can click on a predefined event/profile to edit it (it would populate the predefined text box and drop down), so we'll also need a 'Cancel' button to back out of any edits.
To make the rest of this easier lets name the addon 'Pitbull_profileSwitcher'.
The Pitbull_profileSwitcher.lua file will contain the logic for registering listeners for the defined events when the addon is loaded and when any new combinations are created. It will also be responsible for writing the combinations to a saved variables file.
The Pitbull_profileSwitcher.lua saved variables file will simply store the neccessary data.
The Pitbull_profileSwitcher.xml file will of course define the UI for the addon.
Is there some good documentation out there for registering listeners for events?
What calls,methods, functions (whatever they're called in the LUA world) would I use to tell Pitbull to swap the layout?
Is this addon even possible given the profile structure that Pitbull uses?