Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hello :D!
- I am working on a HUD
- This HUD has a series of pages:
- Main page > Next panel with 3 buttons > Another panel with more buttons
- 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...
- I am using this script in each button to open up each panel:
- integer buttonnumber=1; //(or 2, or 3)
- integer open = TRUE;
- yes(){llMessageLinked(LINK_ALL_CHILDREN, buttonnumber, "open", "");
- open = TRUE;}
- no(){llMessageLinked(LINK_ALL_CHILDREN, buttonnumber, "close", "");
- open = FALSE;}
- default
- {
- state_entry()
- {
- }
- touch_start(integer total_number)
- {
- if(open)
- {
- no();
- }
- else if(!open)
- {
- yes();
- }
- }
- }
- and then this script in each button to MOVE the prims to the location:
- integer open;
- integer panelnumber=1; //(or 2, or 3)
- default
- {
- state_entry()
- {
- }
- link_message(integer sender,integer num,string message, key id)
- {
- if(message == "open" && num==panelnumber )
- {
- if(open==FALSE)
- {
- llSetPos(llGetLocalPos() - <0.45,0,0>);
- open=TRUE;
- }
- }
- else if((message == "open" && num!=panelnumer) ||(message=="close" && num==panelnumber))
- {
- if(open==TRUE)
- {
- llSetPos(llGetLocalPos() + <0.45,0,0>);
- open==FALSE;
- }
- }
- }
- }
- 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