Remove Plugins / Layers / hotspot dynamically in Loop by Selection Criteria
Hi,
thanks to this blog, I have a little loop where i turn on/off hotspots etc in
loop by criteria. e.g. in a tour belonging to this pano, or specific infospot etc
etc
From this I built a loop to REMOVE the some "krpano elements". The loop works fine.
So here the example - I want to remove the skin buttons (THERE IS a reason I do
not just set "visible false"):
STYLE:
<style name="MyButtons" ... tag="controlbuttons" ..../>
BUTTON PLUGIN
<plugin name="PRESS_ME" style="MyButtons|tooltip" ...../>
CALL:
remove_hotspots/plugin( plugin, 'dumy', 'dumy', tag, controlbuttons );
dumy dumy is, because i once was setting values .. not use, but till now i did not want
to go into redesign of the loop for the remove-action.
ACTION:
<action name="remove_hotspots/plugin">
sub(i,%1.count,1);
if(i GE 0, rmv_loop_all_hotspots/plugin(get(i),%1,%2,%3,%4,%5,%6,%7) );
</action>
%1 is "plugin"
%2 and %3 are dumy
%4 is "tag"
%5 is "controlbuttons"
Now the removeaction
!!!! Each variable %x now "moves" by 1 because the counter variable
become %1 when call this action
With my way to call, ONLY the section with trace "1. Set of Parms "
IS HIT / MET.
It removes the plugins / layers, keeps plugins / layers not meeting the criteria, BUT..
1.) my tracing delivers Nonsens
2.) MY TRACES drop messi information as I would expect to see the NAME of the PLUGIN to meet the criteria, but i see ... sthing ... and
neither get(%2[%1]) nor just %2 leads to "plugin" .. always confused abaout the syntax ==> always get "object kinterface...."
==> I would likt to see in the trace the TYPE of ELEMENT i adress better that met the criteria (layer / plugin, hotspot)
<action name="rmv_loop_all_hotspots/plugin">
if (%7 == null
, <!-- NO 2. Set of Params to Compare , would be %7 and %8 -->
if (%5 == null
, <!-- NO 1. Set of Params to Compare , so just if match, then REMOVE it -->
if (%2 == layer, removelayer ( %1 ) );
if (%2 == hotspot, removehotspot( %1 ) );
trace( 'NO 1. Set of Parms Type (Lay, Plug, Spot: ',get(%2[%1]),' name: ',%2[%1].name,' Var is: ',%5,' of value: ',%6);
, <!-- 1. Set of Params to Compare , so Compare the Variable %5 to Value %6 -->
if (%2[%1].%5 == %6
, <!-- and if match, then if match, then REMOVE it -->
if (%2 == layer, removelayer ( %1 ) );
if (%2 == hotspot, removehotspot( %1 ) );
trace( ' 1. Set of Parms Type (Lay, Plug, Spot: ',get(%2[%1]),' name: ',%2[%1].name,' Var is: ',%5,' of value: ',%6);
);
);
, <!-- !!!! WE HAVE A 2. Set of Params to Compare !!!! -->
if (%2[%1].%7 == %8
, <!-- and if match, then Compare the Variable %5 to Value %6 -->
if (%2[%1].%5 == %6
, <!-- and if match, then REMOVE it -->
trace( ' + 2. Set of Parms Type (Lay, Plug, Spot: ',get(%2[%1]),' name: ',%2[%1].name,' Var is: ',%5,' of value: ',%6);
if (%2 == layer, removelayer ( %1 ) );
if (%2 == hotspot, removehotspot( %1 ) );
);
);
);
dec(i);
if(i GE 0, rmv_loop_all_hotspots/plugin(get(i),%2,%3,%4,%5,%6,%7,%8) );
</action>
Thanks for supporting me.
Honi soit qui mal y pense !
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »JPG_master« (20. März 2015, 17:02)