While write some plugins, I have encountered a few times that there are conflicts in terms of functions/actions/styles.
For example:
Plugin 1: (simpleplugin.xml)
<action name="dosomething" scope="local"> doA() </action>
Plugin 1: (anotherplugin.xml)
<action name="dosomething" scope="local"> doB() </action>
in tour.xml, we have
<include url='simpleplugin.xml' />
<include url='anotherplugin.xml' />
<action name="dosomething" scope="local"> doC() </action>
What happens is that the functionality of "dosomething" is determined by the one that is "seen" last by krpano. Even if it is called from plugin 1, the functionality executed will be the one that is last "seen/loaded" by krpano.
I have not tested it with javascript plugins yet. But I assume that (global) actions defined withing the javascript plugin will have the same behaviour.
Same with layers/styles/...
For example,
Plugin 1:
<layer name="overlay"></layer>
Plugin 2:
<layer name="overlay"></layer>
Is not going to end up well
I have read https://krpano.com/docu/xml/#action.scope, but that scope only applies to variables defined within the action.
My question
- is there a way to define private scopes for functions (and layers/hotspots/...) so that when I call an action from plugin1, the action from plugin1 is executed (and not the action from plugin2)
- any other suggestions? I now work around this with a naming convention (plugin1_dosomething()), but that adds a lot of typing
Looking forward to your suggestions!
KME