-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way for javascript to call back to the overlay plugin. #24
Conversation
This adds an overlayMessage() function to the OverlayPluginApi object, which will call a virtual OverlayMessage() function on OverlayBase. Plugins can override it and parse the string to do whatever they wish, such as Text-to-Speech for example. The sendMessage() function takes 2 arguments, which are the |name| of the overlay plugin to send it to, and the |message| string to send. overlayMessage() takes the same 2 arguments. In order to send the overlayMessage() to the same plugin which is running the javascript, the name of the plugin needs to be known, but it is user defined. So we also add an |overlayName| readonly string to the OverlayPluginApi object, that has the name of the overlay plugin. Then the javascript may do the following to send a string to its c# plugin: OverlayPluginApi.overlayMessage(OverlayPluginApi.overlayName, 'hello');
Hello! I'm working to add text-to-speech in cactbot (https://github.com/quisquous/cactbot/) but we need a way to get a message from JS to C#. The sendMessage() function almost works but has 2 problems:
This should solve both of those, with a new function to not make sendMessage do different things for different plugins - whereas overlayMessage() will do something specific to that overlay plugin. Thanks! |
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
I'm curious, what events are being handled in the client side (javascript inside chromium) that the server side (ACT plugin) isn't aware of that requires the client side to send a request back to the server-side code to process for TTS? From my quick review of your pull request, I don't see any issues with the implementation, I'm just curious about how the need for it arose. Also, is there any problem with me including Cactpot as part of the installer bundle with OverlayPlugin, OverlayPlugin-Themes, and Enmity addon? |
The JS processes log events, and has complex logic that we don't want to express in the c# plugin. It decides to show things on screen, play sounds, or in this case read text-to-speech. You can have a look at the cactbot readme (the link above) to see more about the built-in UIs it provides.
There's no problem IMO, it'd be exciting to see it in more hands. We've been gearing up to the point of getting it out to more people and we feel it's in pretty good shape (the TTS will really help for people who expect that from other ACT interactions tho). But pls spell it "Cactbot" :) |
Largely, this is for expressing more complicated triggers, e.g. https://github.com/quisquous/cactbot/blob/master/ui/raidboss/data/triggers/susano-ex.js#L60. Other plugins like triggernometry or the built in custom triggers in ACT do this all in C#, but cactbot does it in javascript.
I'd be excited to see cactbot included with the OverlayPlugin bundle too, as long as there's a link to https://github.com/quisquous/cactbot/ somewhere in the installer bundle documentation so users know how to set up cactbot. The only downside I can think of is that it could make distribution a little bit more awkward for the bundle. It means that the cactbot that comes with the bundle might be outdated (or might not even work properly with the latest ffxiv plugin). I don't want to force the bundle to have to release just because cactbot does. cactbot does have a version check though and will tell users to go update, so maybe that's good enough? |
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
This will be included in 0.3.4.0, thanks for great work! |
Thanks :D |
Its not a problem, I already do it for enmity plugin (and to a lesser extent themes as well, though themes generally doesn't have any breaking changes between non-expansion updates) and I try to streamline my custom build scripts to automate the process as much as possible. The enmity plugin has the update notices too, so I think that will work well. People who don't want to wait for me to update the bundle can grab the updates manually, otherwise they can wait for the bundle, so it shouldn't be too big of an issue. I'll work on getting it integrated this weekend. |
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
@hibiyasleep Do you have any plans about when 0.3.4.0 will be happening? We're excited to give people TTS :) |
I'm currently on travel. I'll release within 3-4 days, sorry for much delay :( |
Oh no problem, thanks! That's really great news. |
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
@danakj @ezsoftware now released, sorry I'm too late |
Thanks very much :) |
This depends on a patch to OverlayPlugin found at hibiyasleep/OverlayPlugin#24
Extend try block to cover isValid for enmity
This adds an overlayMessage() function to the OverlayPluginApi object,
which will call a virtual OverlayMessage() function on OverlayBase.
Plugins can override it and parse the string to do whatever they wish,
such as Text-to-Speech for example.
The sendMessage() function takes 2 arguments, which are the |name| of
the overlay plugin to send it to, and the |message| string to send.
overlayMessage() takes the same 2 arguments.
In order to send the overlayMessage() to the same plugin which is
running the javascript, the name of the plugin needs to be known,
but it is user defined. So we also add an |overlayName| readonly
string to the OverlayPluginApi object, that has the name of the
overlay plugin. Then the javascript may do the following to send
a string to its c# plugin:
OverlayPluginApi.overlayMessage(OverlayPluginApi.overlayName, 'hello');