I have a function in the skin I'm working on that does the following:
1. Check the mute status.
2. If mute is on, it changes the mute button's bitmap to indicate that mute is on, otherwise, it changes it to show that it's off.
That's all it does.
I call this script in two places. Once in the OnInitialize function so that it will be set properly when switching to the skin, and again when the button is pressed.
It works perfectly in OnInitialize.
When I click the button, though... it always gets switched to the opposite of what it should be.
This is really boggling my mind. I've finally put in two functions. One that is only called in OnInitialize and the other, which does things backwards that I call everywhere else. I can't for the life of me figure out how this can be happening, but it is.
Here's the function:
function SetMuteButton()
{
Vid.GetSkinItem(typeButton, "Mute").SetBitmap
(g_MCMixer.Mute == MuteOff ? "muteoff.bmp" : "muteon.bmp", defTransColor);
}
Any ideas why this shouldn't be working?