5180 fichiers 38.5 Mo 0 téléchargements 202 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / api / wired / WiredMenuPreferences.ts
WiredMenuPreferences.ts 965 o Télécharger le fichier
import { normalizeWiredStyle, WiredStyleName } from './WiredStyle';

/** The wired menu preferences the server stores (the official WiredMenuController ones). */
export interface WiredMenuStoredPreferences {
    showToolbarButton: boolean;
    showInspectButton: boolean;
    playTestMode: boolean;
    showSystemNotifications: boolean;
    wiredStyle: WiredStyleName;
}

/**
 * The server's stored text, `menu,inspect,playtest,showAll,style`; null while the user never saved
 * them (the client keeps its own defaults then).
 */
export const decodeWiredMenuPreferences = (text: string): WiredMenuStoredPreferences | null => {
    const parts = (text ?? '').split(',');

    if (parts.length < 5) return null;

    return {
        showToolbarButton: parts[0] === '1',
        showInspectButton: parts[1] === '1',
        playTestMode: parts[2] === '1',
        showSystemNotifications: parts[3] === '1',
        wiredStyle: normalizeWiredStyle(parts[4])
    };
};
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