Find handler by id

My problem:
I have a dialog system (plugin) with blocks, and I want to call appropriate code when reach the block
For now I need do something like:
dlgIssue
blocksExample
and call appropriate code:

(stateName: String) 
  [
    if stateName = "state_300" 
    [
      state300() //handler
    ]
  ]

maybe I miss some ability for do it better like get class by id. Sorry if this out of topic
My method has lot of problem…mostly with validate and ugly)
I saw here but it is nothing about how use handlers
load-a-skookum-script-with-c-at-runtime

I don’t have a good solution here. I think calling into :sk: from C++ would be ideal because theoretically you could call a method or coroutine by name. I don’t have an example of how to do this at the moment, but I recently made some changes that might actually make this possible.

This thread discusses the details, but there are some missing steps and this hasn’t really been tested for a long time.

If I get some time next week I might be able to look into whether things have changed enough in this area to easily do this.

Other than this, if the plugin provided any sort of multicast delegates or class methods that could be overridden…

The other thing I thought of is if you could store a TMap of <Enum,Closure>. I think this would work well, unfortunately I have not yet integrated the TMap type, there is an open feature request for it.

I don’t have lot of experience in c++ and It would be very cool if you will have a time to get some examples relate call from c++. Make same names for nodes and coroutines sounds like cool idea. I have a hundreds blocks with very ugly call system so your help can solve large problems for me.
off top:
I am very pleased to meet such a good community. At the same time very happy the wonderful world that I got into with sookum and I look with horror back. I’m using sk only third day and I can’t realize how lived without it before. I really hope that your language will be develop and support.

1 Like