View Single Post
  #4  
Old 06-07-2011, 05:06 AM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by DeCeaseD View Post
How exactly would I break out of the loop though, I don't really get it.
Something like this, although I haven't tested obviously:

PHP Code:
    //Mouse over for Slot
    
this.newDebug = false; // assume false
    
temp.mouse_xy = {mousescreenx, mousescreeny};
    for ( 
i=0; i < this.equipSlotCount; i++; ) {
      
temp.chSlots = this.equipSlots[i];
      if ( 
mouse_xy[0] in |menu_xy[0] + chSlots[1], menu_xy[0] + chSlots[1] + 32| &&
           
mouse_xy[1] in |menu_xy[1] + chSlots[2], menu_xy[1] + chSlots[2] + 32| ) {
        
this.newDebug = true;

        
///// snip your image stuff //////

        // Hide remaining images
        
hideImgs(203 + i + 1, 203 + this.equipSlotCount);
        
hideImgs(223 + i + 1, 223 + this.equipSlotCount);

        
// break out of the loop b/c we only have one mouse location and we already know which object it's hovering over
        
break;
      } else { 
// Keep this to hide the images before we find one that's true   
        
hideImg(203 + i); 
        
hideImg(223 + i);
      }
    } 
__________________
Reply With Quote