I'll try to illustrate what I'm talking about better.
currently, I have (paraphrased):
Code:
<Frame>
<Size/>
<Anchors/>
<Layers/>
</Frame>
The above is repeated over and over in the xml, for each element presented. I used templates where i could for the size and layers, but that's the gist. In the case of a button tray, that's 12 frames, one for each slot, which are in turn manipulated entirely by the MoveAnything! AddOn. At the time, that was all I was capable of doing.
I'm still not saavy enough to understand all the internal workings of MoveAnything, but I would imagine this could potentially call it's functions into play as well, certainly during set-up, possibly even during game-play.
What I'm thinking of doing now is instead of having 12 of those frames, is have but 1 for any given "action bar" backdrop. Then, I would paint 1-12 slot "versions" of a backdrop that could be altered via a SetTexture. SquidMod does this for the default end-caps, via slash commands.
In Squidmod, after a variable is established using a slash command (I'm thinking of using sliders), the following is done in the lua:
Code:
function SquidMod_Update()
if(SquidModSettings) then
if(SquidModSettings.toggle == 0) then
MainMenuBarLeftEndCap:Hide();
MainMenuBarRightEndCap:Hide();
elseif(SquidModSettings.toggle == 1) then
MainMenuBarLeftEndCap:Show();
MainMenuBarRightEndCap:Show();
SquidModSettings.toggle = 2;
SquidMod_Update();
elseif(SquidModSettings.toggle == 2) then
-- Thanx to Vjeux for SetTexture code
MainMenuBarLeftEndCap:SetTexture("Interface\\AddOns\\SquidMod\\skin\\SquidModDefault.tga");
MainMenuBarRightEndCap:SetTexture("Interface\\AddOns\\SquidMod\\skin\\SquidModDefault.tga");
elseif(SquidModSettings.toggle == 3) then
MainMenuBarLeftEndCap:SetTexture("Interface\\AddOns\\SquidMod\\skin\\BlizzDefault1.tga");
MainMenuBarRightEndCap:SetTexture("Interface\\AddOns\\SquidMod\\skin\\BlizzDefault1.tga");
elseif(SquidModSettings.toggle == 4) then
MainMenuBarLeftEndCap:SetTexture("Interface\\AddOns\\SquidMod\\skin\\BlizzDefault2.tga");
MainMenuBarRightEndCap:SetTexture("Interface\\AddOns\\SquidMod\\skin\\BlizzDefault2.tga");
elseif(SquidModSettings.toggle == 5) then
etc.
end
The update is only called on a slash command with that addon, in my application, I am thinking I would call it on a slider <OnValueChanged>.
In essence, for every actionbar backdrop, I would ditch 11 frames for it's "slots" and just paint the appropriate texture called for by the slider and saved as a variable.
I could do the same thing for any image basically, even including a Show and a Hide function for variables. If I could sort locking and unlocking the various bits for movement, I imagine I could do away with the moveanything! dependency all together, leaving it optional if one wanted to resize elements.
Of course, I'm still fuzzy on saved variables, or more specifically, I think I would want a table? set up here for them, which im also fuzzy on, but that's another thread.