X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fitem%2Fnexposee.c;h=0adc399e0887c45a29931df8ef3fbfd4debf09e9;hb=a035d049951445f892a37bfdef3e738f8a18e8b9;hp=8f8f45119f8744bd74d900776d4b97015bc25406;hpb=3618a0f2000f064d6f59b99c7b79d7a3c25f77b9;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/item/nexposee.c b/qcsrc/menu/item/nexposee.c index 8f8f45119..0adc399e0 100644 --- a/qcsrc/menu/item/nexposee.c +++ b/qcsrc/menu/item/nexposee.c @@ -92,7 +92,7 @@ void Nexposee_calc(entity me) float scale; entity e, e2; vector emins, emaxs, e2mins, e2maxs; - + for(scale = 0.7;; scale *= 0.99) { Nexposee_Calc_Scale(me, scale); @@ -219,6 +219,7 @@ float Nexposee_mousePress(entity me, vector pos) Nexposee_mouseMove(me, pos); if(me.mouseFocusedChild) { + m_play_click_sound(MENU_SOUND_OPEN); me.animationState = 1; SUPER(Nexposee).setFocus(me, NULL); } @@ -228,8 +229,9 @@ float Nexposee_mousePress(entity me, vector pos) } else if(me.animationState == 2) { - if not(SUPER(Nexposee).mousePress(me, pos)) + if (!(SUPER(Nexposee).mousePress(me, pos))) { + m_play_click_sound(MENU_SOUND_CLOSE); me.animationState = 3; SUPER(Nexposee).setFocus(me, NULL); } @@ -263,7 +265,7 @@ float Nexposee_mouseMove(entity me, vector pos) if(me.animationState == 0) { if(me.mouseFocusedChild) - if(me.mouseFocusedChild != e) + if(me.mouseFocusedChild != e || me.mouseFocusedChild != me.selectedChild) me.selectedChild = me.mouseFocusedChild; return 1; } @@ -279,7 +281,7 @@ float Nexposee_keyUp(entity me, float scan, float ascii, float shift) float Nexposee_keyDown(entity me, float scan, float ascii, float shift) { - float nexposeeKey; + float nexposeeKey = 0; if(me.animationState == 2) if(SUPER(Nexposee).keyDown(me, scan, ascii, shift)) return 1; @@ -291,14 +293,14 @@ float Nexposee_keyDown(entity me, float scan, float ascii, float shift) { if(me.selectedChild) me.selectedChild = me.selectedChild.prevSibling; - if not(me.selectedChild) + if (!me.selectedChild) me.selectedChild = me.lastChild; } else { if(me.selectedChild) me.selectedChild = me.selectedChild.nextSibling; - if not(me.selectedChild) + if (!me.selectedChild) me.selectedChild = me.firstChild; } } @@ -322,16 +324,18 @@ float Nexposee_keyDown(entity me, float scan, float ascii, float shift) default: case 0: case 3: + m_play_click_sound(MENU_SOUND_OPEN); me.animationState = 1; break; case 1: case 2: + m_play_click_sound(MENU_SOUND_CLOSE); me.animationState = 3; break; } if(me.focusedChild) me.selectedChild = me.focusedChild; - if not(me.selectedChild) + if (!me.selectedChild) me.animationState = 0; SUPER(Nexposee).setFocus(me, NULL); return 1;