INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Strange... bug? Or is it me?  (Read 2066 times)

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5906
  • Farm Animal Stupid
Strange... bug? Or is it me?
« on: September 12, 2003, 07:41:46 pm »

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?
Logged

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5906
  • Farm Animal Stupid
Re: Strange... bug? Or is it me?
« Reply #1 on: September 12, 2003, 07:58:02 pm »

Well, I did things a little bit differently... same exact function, but I'm calling it from the OnMixerChanged event instead of the OnButtonDown event and now it works as expected.

Something funky with the OnButtonDown event maybe?
Logged
Pages: [1]   Go Up