Giter VIP home page Giter VIP logo

Comments (5)

towerofnix avatar towerofnix commented on June 29, 2024
ext.currentTrigger = null;

ext.getsEvent = function(which) {
    if (ext.currentTrigger === which) {
        ext.currentTrigger = null;
        // Do stuff
    }
};
ext.sendsEvent = function(which) {
    ext.currentTrigger = which;
};

ext.descriptor = {
    blocks: [
        ['h', 'when event %s sent', 'getsEvent', 'evt1']
        [' ', 'send event %s', 'sendsEvent', 'evt1']
    ]
};

As for "special" events such as what could be 'greenFlag', I'm not sure how you would send those. Probably like you said, ext.trigger("special")?

Note - not tested, but should work.. :P

from scratch-extension-docs.

alyssarosenzweig avatar alyssarosenzweig commented on June 29, 2024

@liam4 That's exactly the kind of code I'm hoping to avoid..

from scratch-extension-docs.

towerofnix avatar towerofnix commented on June 29, 2024

@bobbybee I see what you mean, but while they don't implement it, it'll work. :P

from scratch-extension-docs.

sclements avatar sclements commented on June 29, 2024

that's an interesting idea which we may implement at some point. The current implementation supports having hat blocks that accept arguments and we wanted that flexibility. For example, you can currently put a reporter from one extension into a hat block argument of another extension.

from scratch-extension-docs.

rschamp avatar rschamp commented on June 29, 2024

@bobbybee Thanks for the suggestion! We have moved the content in this repo to https://github.com/LLK/scratchx/, would you please re-open this feature request on that repo?

from scratch-extension-docs.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.