Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Hello :D!
  2.  
  3. I am working on a HUD
  4. This HUD has a series of pages:
  5. Main page > Next panel with 3 buttons > Another panel with more buttons
  6.  
  7. The problem is if I open up lets say the second button on the second panel... And then open another, the other one won't close. It stays open and gets in the way...
  8.  
  9. I am using this script in each button to open up each panel:
  10.  
  11. integer buttonnumber=1; //(or 2, or 3)
  12. integer open = TRUE;
  13. yes(){llMessageLinked(LINK_ALL_CHILDREN, buttonnumber, "open", "");
  14.             open = TRUE;}
  15. no(){llMessageLinked(LINK_ALL_CHILDREN, buttonnumber, "close", "");
  16.             open = FALSE;}
  17.            
  18. default
  19. {
  20.     state_entry()
  21.     {
  22.     }
  23.  
  24.     touch_start(integer total_number)
  25.     {
  26.         if(open)
  27.         {
  28.             no();
  29.         }
  30.         else if(!open)
  31.         {
  32.             yes();
  33.         }
  34.     }
  35. }
  36.  
  37.  
  38.  
  39. and then this script in each button to MOVE the prims to the location:
  40.  
  41. integer open;
  42. integer panelnumber=1; //(or 2, or 3)
  43. default
  44. {
  45.     state_entry()
  46.     {
  47.     }
  48.  
  49.     link_message(integer sender,integer num,string message, key id)
  50.     {
  51.         if(message == "open" && num==panelnumber )
  52.         {
  53.           if(open==FALSE)
  54.            {
  55.              llSetPos(llGetLocalPos() - <0.45,0,0>);
  56.              open=TRUE;
  57.             }
  58.         }
  59.         else if((message == "open" && num!=panelnumer) ||(message=="close" && num==panelnumber))
  60.         {
  61.           if(open==TRUE)
  62.           {
  63.              llSetPos(llGetLocalPos() + <0.45,0,0>);
  64.              open==FALSE;
  65.           }
  66.         }
  67.     }
  68. }
  69.  
  70.  
  71. and I can not for the life of me find a way to close previous tabs without either messing up the offset, so the prims go in weird places. Or opening/closing the wrong things in general :(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement