5180 fichiers 38.5 Mo 0 téléchargements 457 vues mis à jour il y a 7 heures ui
nitro-v36-with-renderer-v36 / src / components / wired / views / triggers / clickTriggerSources.ts
clickTriggerSources.ts 1.1 Ko Télécharger le fichier
import { WiredSourceOption } from '../WiredSourcesSelector';

/**
 * Furni sources of the Click Furni and Click Tile triggers. The server's InputSourcesConf lists only the picks (100)
 * and the selector (200), so a box never offers the triggering furni (0). A row stored with 0 before that rule keeps
 * it (the server still saves a source the box already holds), so 0 stays shown for that box only.
 */
export const CLICK_TRIGGER_FURNI_SOURCES: WiredSourceOption[] = [
    { value: 100, label: 'wiredfurni.params.sources.furni.100' },
    { value: 200, label: 'wiredfurni.params.sources.furni.200' }
];

const STORED_TRIGGER_SOURCE: WiredSourceOption = { value: 0, label: 'wiredfurni.params.sources.furni.0' };

export const normalizeClickTriggerFurniSource = (value: number) =>
    value === 0 || CLICK_TRIGGER_FURNI_SOURCES.some((option) => option.value === value) ? value : 100;

/** The options for a box whose stored source is `stored`. */
export const clickTriggerFurniSources = (stored: number): WiredSourceOption[] =>
    stored === 0 ? [...CLICK_TRIGGER_FURNI_SOURCES, STORED_TRIGGER_SOURCE] : CLICK_TRIGGER_FURNI_SOURCES;
15Sujets
1Dépôts
20Membres
3En 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