mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-13 01:20:54 +00:00
4.14.10
* Added: Two new profile rule types: `If` for choosing between two different sets of rules based on a condition. `True or False` for a rule that is always true or false.
This commit is contained in:
parent
9c2053bf9b
commit
c26f2ea09b
4 changed files with 135 additions and 3 deletions
|
@ -39,6 +39,39 @@ export const Or = {
|
|||
editor: () => import(/* webpackChunkName: 'main-menu' */ './components/nested.vue')
|
||||
};
|
||||
|
||||
export const If = {
|
||||
createTest(config, rule_types) {
|
||||
const cond = createTester(config[0], rule_types),
|
||||
if_true = createTester(config[1], rule_types),
|
||||
if_false = createTester(config[2], rule_types);
|
||||
|
||||
return ctx => cond(ctx) ? if_true(ctx) : if_false(ctx)
|
||||
},
|
||||
|
||||
childRules: true,
|
||||
tall: true,
|
||||
title: 'If',
|
||||
i18n: 'settings.filter.if',
|
||||
|
||||
default: () => [[], [], []],
|
||||
editor: () => import(/* webpackChunkName: 'main-menu' */ './components/if.vue')
|
||||
};
|
||||
|
||||
export const Constant = {
|
||||
createTest(config) {
|
||||
if ( config )
|
||||
return () => true;
|
||||
return () => false;
|
||||
},
|
||||
|
||||
title: 'True or False',
|
||||
i18n: 'settings.filter.true_false',
|
||||
|
||||
default: true,
|
||||
|
||||
editor: () => import(/* webpackChunkName: 'main-menu' */ './components/basic-toggle.vue')
|
||||
}
|
||||
|
||||
|
||||
// Context Stuff
|
||||
|
||||
|
@ -104,7 +137,7 @@ export const Time = {
|
|||
title: 'Time of Day',
|
||||
i18n: 'settings.filter.time',
|
||||
|
||||
default: ['08:00', '18:00'],
|
||||
default: () => ['08:00', '18:00'],
|
||||
|
||||
editor: () => import(/* webpackChunkName: 'main-menu' */ './components/time.vue')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue