5180 fichiers 38.5 Mo 0 téléchargements 215 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / api / wired / WiredPlayTest.ts
WiredPlayTest.ts 1.1 Ko Télécharger le fichier
import { GetRoomSessionManager } from '@octane/renderer';

/** Flips playtest mode with the switch notification: what AIR's `:playtest` chat command does. */
export const WIRED_PLAYTEST_TOGGLE_LINK = 'wired-tools/playtest/toggle';

/** The notification AIR's WiredMenuController.setPlayTestMode shows after the user switched it. */
export const wiredPlayTestNotificationKey = (enabled: boolean): string =>
    `wiredmenu.settings.preferences.notification.playtest.${enabled ? 'enabled' : 'disabled'}`;

/**
 * AIR WiredMenuController.setPlayTestMode: the preference goes on the room session, whose
 * controllerLevel then reads "no rights" and whose room engine refuses furni moves and the use of
 * rights-only furni; the session manager keeps it for every room entered later. A renderer without
 * the playtest API leaves the room as it is.
 */
export const applyWiredPlayTestMode = (enabled: boolean): void => {
    const manager = GetRoomSessionManager();

    if (!manager || typeof manager.setPlayTestMode !== 'function') return;

    manager.setPlayTestMode(!!enabled);
};
15Sujets
1Dépôts
20Membres
2En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser