Files
vrcnext-example-plugins/dist/hello-world.js
T

3 lines
860 B
JavaScript

var s={greetOnFriendOnline:{kind:"boolean",label:"Log a line when a friend comes online",description:"Writes to the plugin log, not to VRChat.",default:!0},tone:{kind:"select",label:"Greeting tone",default:"friendly",options:[{value:"friendly",label:"Friendly"},{value:"terse",label:"Terse"}]}},z={id:"hello-world",settings:s,activate(e){e.logger.info(`Hello from v${e.version}.`);let t=e.settings.get("tone")==="terse"?"Online:":"Welcome back,";e.events.on("friendTimelineEvent",n=>{e.settings.get("greetOnFriendOnline")&&n.type==="online"&&e.logger.info(`${t} ${n.friendName}`)}),e.ui.addSettingsCard({title:"Hello World",icon:"back_hand",render:n=>{n.appendChild(e.ui.createToggleRow("Show a toast right now",!1,i=>{i&&e.ui.toast({message:"Hello from a VRCNext plugin."})}))}})},deactivate(){}};export{z as default};
//# sourceMappingURL=hello-world.js.map