X Tutup
Commit 3b01e04e authored by Cosmo Myzrail Gorynych's avatar Cosmo Myzrail Gorynych 😼
Browse files

Catnip: Add mutators for "action is down/pressed/released" blocks

parent aaa17816
Loading
Loading
Loading
Loading
Loading
+24 −3
Original line number Diff line number Diff line
@@ -27,7 +27,14 @@ const blocks: (IBlockCommandDeclaration | IBlockComputedDeclaration)[] = [{
        typeHint: 'string',
        key: 'action'
    }],
    jsTemplate: (values) => `actions[${values.action}].pressed`
    jsTemplate: (values) => `actions[${values.action}].pressed`,
    mutators: [{
        code: 'action down',
        lib: 'core.actions'
    }, {
        code: 'action released',
        lib: 'core.actions'
    }]
}, {
    name: 'is action down',
    type: 'computed',
@@ -42,7 +49,14 @@ const blocks: (IBlockCommandDeclaration | IBlockComputedDeclaration)[] = [{
        typeHint: 'string',
        key: 'action'
    }],
    jsTemplate: (values) => `actions[${values.action}].down`
    jsTemplate: (values) => `actions[${values.action}].down`,
    mutators: [{
        code: 'action pressed',
        lib: 'core.actions'
    }, {
        code: 'action released',
        lib: 'core.actions'
    }]
}, {
    name: 'is action released',
    type: 'computed',
@@ -57,7 +71,14 @@ const blocks: (IBlockCommandDeclaration | IBlockComputedDeclaration)[] = [{
        typeHint: 'string',
        key: 'action'
    }],
    jsTemplate: (values) => `actions[${values.action}].released`
    jsTemplate: (values) => `actions[${values.action}].released`,
    mutators: [{
        code: 'action down',
        lib: 'core.actions'
    }, {
        code: 'action pressed',
        lib: 'core.actions'
    }]
}];

export default blocks;
X Tutup