Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
71
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 panelnumber=1; //(or 2, or 3)
  42. default
  43. {
  44.     state_entry()
  45.     {
  46.     }
  47.  
  48.     link_message(integer sender,integer num,string message, key id)
  49.     {
  50.         if(message == "open" && num==panelnumber)
  51.         {llSetPos(llGetLocalPos() - <0.45,0,0>);
  52.         }
  53.         else if((message == "open" && num!=panelnumer) ||(message=="close" && num==panelnumber))
  54.         {llSetPos(llGetLocalPos() + <0.45,0,0>);
  55.         }
  56.     }
  57. }
  58.  
  59.  
  60. 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