Page 1 of 1

This doesn't make any sense, mouseover glitch? FIXED

PostPosted: Sat Apr 10, 2010 2:18 pm
by Hblade
I fixed this using this code:
Code: Select all
switch(cloneindex)
{
    case 0:
    if (Chao_options.index == 1)
    {
        PlaySound2("data/Cursor.wav", 1.000000, 1, 0.000000);
        Chao_options.index = cloneindex;
    }
    break;
    case 1:
    if (Chao_options.index == 0)
    {
        PlaySound2("data/Cursor.wav", 1.000000, 1, 0.000000);
        Chao_options.index = cloneindex;
    }
    break;
}

THE OLD GLITCH:

Dude I've ran into something that really doesn't make sense...
ON MOUSEOVER:
Code: Select all
Chao_options.index = cloneindex;
switch(cloneindex)
{
    case 0:
    if (Chao_options.index == 1)
    {
        PlaySound2("data/Cursor.wav", 1.000000, 1, 0.000000);
    }
    break;
    case 1:
    if (Chao_options.index == 0)
    {
        PlaySound2("data/Cursor.wav", 1.000000, 1, 0.000000);
    }
    break;
}

Shouldn't that mean if the Chao_options' index is 0, it wont play the sound but if it's not on that selection it plays the sound?

I'm trying to make it NOT repeat the sound effect when hovered over and over again on the same selection
but NOOO, for some reason it doesn't play the sound at all, but yet if I do this:
Code: Select all
switch(cloneindex)
{
    case 0:
    if (Chao_options.index == 0)
    {
        PlaySound2("data/Cursor.wav", 1.000000, 1, 0.000000);
    }
    break;
    case 1:
    if (Chao_options.index == 1)
    {
        PlaySound2("data/Cursor.wav", 1.000000, 1, 0.000000);
    }
    break;
}

if plays the sound effect but it repeats... DOESNT MAKE ANY SENSE