// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Dimension trim menu // Not compiled or tested in-world // Setup: Use a spare nonphysical prim no larger than ten meters per axis. Owner-touch; Home restores captured scale. // Stop / restore: Use the Restore or Home action described in setup before removing or resetting if you want the startup appearance. Menu listeners expire after 45 seconds. // Notes: Local owner-only control. Saved snapshots live in script memory and are lost on reset. Prim center stays fixed. Mesh visual bounds and collision bounds may differ. Clamps dimensions between 0.05 and 10 meters. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer channel; integer handle; close() { if(handle)llListenRemove(handle); handle=0; llSetTimerEvent(0.0); } menu(string prompt,list buttons) { if(!handle) { channel=-1000-(integer)llFrand(1000000.0); handle=llListen(channel,"",llGetOwner(),""); } llDialog(llGetOwner(),prompt,buttons,channel); llSetTimerEvent(45.0); } vector home; init() { home=llGetScale(); } show() { menu("Size: 5 cm increments (0.05 to 10 m)",["X+","X-","Y+","Y-","Z+","Z-","Home"]); } choose(string s) { if(llGetStatus(STATUS_PHYSICS))return; vector size=llGetScale(); if(s=="Home")size=home; else { if(s=="X+")size.x+=0.05; else if(s=="X-")size.x-=0.05; else if(s=="Y+")size.y+=0.05; else if(s=="Y-")size.y-=0.05; else if(s=="Z+")size.z+=0.05; else if(s=="Z-")size.z-=0.05; else return; if(size.x<0.05)size.x=0.05; if(size.y<0.05)size.y=0.05; if(size.z<0.05)size.z=0.05; if(size.x>10.0)size.x=10.0; if(size.y>10.0)size.y=10.0; if(size.z>10.0)size.z=10.0; } llSetScale(size); show(); } default { state_entry() { init(); } touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; close(); show(); } listen(integer ch,string name,key id,string message) { if(!handle||ch!=channel||id!=llGetOwner())return; choose(message); } timer() { close(); } changed(integer change) { if(change&CHANGED_OWNER)llResetScript(); } }