XML 66
Automap.xml Guest on 2nd June 2020 12:45:32 PM
  1. <!--  Automatic Map XML plugin by OrangeBox  -->
  2. <krpano>
  3. <textstyle name="maponhovertext" font="Arial" fontsize="14.0" bold="true" italic="false" textcolor="0xFFFFFF" effect="glow(0x000000,1,4,4);" background="false" backgroundcolor="" textshadow="2" border="false" bordercolor="" origin="cursor" noclip="true" edge="lefttop" textalign="lefttop" xoffset="20" yoffset="10" showtime="0.1" fadetime="0.0" fadeintime="0.0" alpha="1.0" blendmode="normal"/>
  4. <action name="mapdefault">
  5. if(map[%1].scale === null, set(map[%1].scale,1); ); if(map[%1].scale == "", set(map[%1].scale,1); ); if(map[%1].alpha === null, set(map[%1].alpha,1); ); if(map[%1].alpha == "", set(map[%1].alpha,1); ); if(map[%1].direction === null, set(map[%1].direction,0); ); if(map[%1].direction == "", set(map[%1].direction,0); ); if(map[%1].path === null, set(map[%1].path,%CURRENTXML%/automap/); ); if(map[%1].path == "", set(map[%1].path,%CURRENTXML%/automap/); ); if(map[%1].map === null, txtadd(map[%1].map,get(map[%1].path),map.jpg); ); if(map[%1].map == "", txtadd(map[%1].map,get(map[%1].path),map.jpg); ); if(map[%1].mask === null, copy(map[%1].mask,map[%1].map); ); if(map[%1].mask == "", copy(map[%1].mask,map[%1].map); ); if(map[%1].radar_alpha === null, set(map[%1].radar_alpha,0.4); ); if(map[%1].radar_alpha == "", set(map[%1].radar_alpha,0.4); ); if(map[%1].radar_visible != false, set(map[%1].radar_visible,true); ); if(map[%1].keep === null, set(map[%1].keep,true); ); if(map[%1].keep == "", set(map[%1].keep,true); ); if(map[%1].zorder === null, set(map[%1].zorder,1); ); if(map[%1].zorder == "", set(map[%1].zorder,1); ); if(map[%1].edge === null, set(map[%1].edge,lefttop); ); if(map[%1].edge == "", set(map[%1].edge,lefttop); ); if(map[%1].align === null, set(map[%1].align,lefttop); ); if(map[%1].align == "", set(map[%1].align,lefttop); ); if(map[%1].x === null, set(map[%1].x,0); ); if(map[%1].x == "", set(map[%1].x,0); ); if(map[%1].y === null, set(map[%1].y,0); ); if(map[%1].y == "", set(map[%1].y,0); ); if(map[%1].point_url === null, txtadd(map[%1].point_url,get(map[%1].path),viewpoint.png); ); if(map[%1].point_url == "", txtadd(map[%1].point_url,get(map[%1].path),viewpoint.png); ); if(map[%1].point_crop === null, set(map[%1].point_crop,32); ); if(map[%1].point_crop == "", set(map[%1].point_crop,32); ); if(map[%1].onhover === null, set(map[%1].onhover,); ); if(map[%1].onhover == "", set(map[%1].onhover,); );
  6. </action>
  7. <action name="buildmap">
  8. mapdefault(%1); if(map[%1].editmode, copy(map[%1].edge,lefttop); copy(map[%1].align,lefttop); copy(map[%1].x,0); copy(map[%1].y,0); ); txtadd(map[%1].imask,%1,_mask); txtadd(map[%1].image,%1,_image); txtadd(map[%1].radarlight,%1,_radarlight); txtadd(map[%1].radarmask,%1,_radarmask); txtadd(map[%1].radarmask2,%1,_radarmask2); txtadd(map[%1].radar,%1,_radar); if(map[%1].ready,, if(events.onviewchange !== null, txtadd(events.onviewchange,get(events.onviewchange),"mapradarrotate(", %1, ");" ); , txtadd(events.onviewchange,"mapradarrotate(", %1, ");" ); ); ); addplugin(%1); txtadd(plugin[%1].url,get(map[%1].path),spacer.png); copy(plugin[%1].alpha,map[%1].alpha); copy(plugin[%1].parent,map[%1].parent); set(plugin[%1].enabled,true); set(plugin[%1].capture,false); set(plugin[%1].children,true); copy(plugin[%1].scale,map[%1].scale); copy(plugin[%1].keep,map[%1].keep); set(plugin[%1].scalechildren,true); copy(plugin[%1].zorder,map[%1].zorder); copy(plugin[%1].edge,map[%1].edge); copy(plugin[%1].align,map[%1].align); copy(plugin[%1].x,map[%1].x); copy(plugin[%1].y,map[%1].y); set(plugin[%1].onclick,get(map[%1].onclick)); if(map[%1].editmode, set(plugin[%1].zorder,10000); set(plugin[%1].onhover, txtadd(mapxy,'x=',get(mouse.stagex),' ','y=',get(mouse.stagey)); showtext(get(mapxy),maponhovertext); ); , set(plugin[%1].onhover,map[%1].onhover); ); addplugin(get(map[%1].imask)); copy(plugin[get(map[%1].imask)].keep,map[%1].keep); set(plugin[get(map[%1].imask)].parent,%1); copy(plugin[get(map[%1].imask)].url,map[%1].mask); set(plugin[get(map[%1].imask)].enabled,false); set(plugin[get(map[%1].imask)].capture,false); copy(plugin[get(map[%1].imask)].edge,map[%1].edge); copy(plugin[get(map[%1].imask)].align,map[%1].align); copy(plugin[get(map[%1].imask)].x,0); copy(plugin[get(map[%1].imask)].y,0); if(plugin[get(map[%1].image)].loaded,removeplugin(get(map[%1].image))); addplugin(get(map[%1].image)); copy(plugin[get(map[%1].image)].keep,map[%1].keep); set(plugin[get(map[%1].image)].scalechildren,true); set(plugin[get(map[%1].image)].parent,%1); add(plugin[get(map[%1].image)].zorder,get(map[%1].zorder),1); copy(plugin[get(map[%1].image)].url,map[%1].map); set(plugin[get(map[%1].image)].enabled,true); set(plugin[get(map[%1].image)].capture,false); copy(plugin[get(map[%1].image)].edge,map[%1].edge); copy(plugin[get(map[%1].image)].align,map[%1].align); copy(plugin[get(map[%1].image)].x,0); copy(plugin[get(map[%1].image)].y,0); set(plugin[get(map[%1].image)].onclick,plugin[%1].onclick); txtadd(plugin[get(map[%1].image)].onloaded,"map_setmask(",%1,");"); set(map[%1].pointscount,); if(map[%1].viewpoint_auto, set(map[%1].mapscenecount,0); map_autoviewpointadd(%1); ); map_addviewponits(%1); addplugin(get(map[%1].radar)); copy(plugin[get(map[%1].radar)].keep,map[%1].keep); copy(plugin[get(map[%1].radar)].parent,map[%1].image); set(plugin[get(map[%1].radar)].scalechildren,true); copy(plugin[get(map[%1].radar)].visible,map[%1].radar_visible); set(plugin[get(map[%1].radar)].enabled,true); set(plugin[get(map[%1].radar)].capture,true); add(plugin[get(map[%1].radar)].zorder,get(map[%1].zorder),10); txtadd(plugin[get(map[%1].radar)].url,get(map[%1].path),spacer.png); set(plugin[get(map[%1].radar)].edge,lefttop); set(plugin[get(map[%1].radar)].align,lefttop); set(plugin[get(map[%1].radar)].x,-2000); set(plugin[get(map[%1].radar)].y,0); copy(plugin[get(map[%1].radar)].mask,map[%1].imask); if(plugin[get(map[%1].radar)].viewpoint GT -1, map_setradar(%1,get(plugin[get(map[%1].radar)].viewpoint)); ); addplugin(get(map[%1].radarmask)); copy(plugin[get(map[%1].radarmask)].keep,map[%1].keep); copy(plugin[get(map[%1].radarmask)].parent,map[%1].radar); set(plugin[get(map[%1].radarmask)].enabled,false); set(plugin[get(map[%1].radarmask)].capture,false); add(plugin[get(map[%1].radarmask)].zorder,get(map[%1].zorder),10); txtadd(plugin[get(map[%1].radarmask)].url,get(map[%1].path),radar.png); set(plugin[get(map[%1].radarmask)].edge,left); set(plugin[get(map[%1].radarmask)].align,lefttop); set(plugin[get(map[%1].radarmask)].x,0); set(plugin[get(map[%1].radarmask)].y,0); addplugin(get(map[%1].radarlight)); copy(plugin[get(map[%1].radarlight)].keep,map[%1].keep); copy(plugin[get(map[%1].radarlight)].alpha,map[%1].radar_alpha); copy(plugin[get(map[%1].radarlight)].parent,map[%1].radar); set(plugin[get(map[%1].image)].capture,true); add(plugin[get(map[%1].radarlight)].zorder,get(map[%1].zorder),1000); txtadd(plugin[get(map[%1].radarlight)].url,get(map[%1].path),radar.png); set(plugin[get(map[%1].radarlight)].edge,left); set(plugin[get(map[%1].radarlight)].align,lefttop); set(plugin[get(map[%1].radarlight)].x,0); set(plugin[get(map[%1].radarlight)].y,0); copy(plugin[get(map[%1].radarlight)].mask,map[%1].radarmask); set(plugin[get(map[%1].radarlight)].ondown, set(map[%1].editonhover,get(plugin[%1].onhover)); set(plugin[%1].onhover,); set(mapradardown,true); rotateradar(%1); ); set(plugin[get(map[%1].radarlight)].onup, set(mapradardown,false); set(plugin[%1].onhover,get(map[%1].editonhover)); ); set(map[%1].ready,true);
  9. </action>
  10. <action name="map_setmask">
  11. if(plugin[get(map[%1].imask)].loaded, copy(plugin[get(map[%1].image)].mask,map[%1].imask); , txtadd(plugin[get(map[%1].imask)].onloaded,"copy(plugin[get(map[",%1,"].image)].mask,map[",%1,"].imask);" ); );
  12. </action>
  13. <action name="map_autoviewpointadd">
  14. if(map[%1].mapscenecount == 0, set(map[%1].pointscount,0); ); if(scene[get(map[%1].mapscenecount)].map == %1, copy(map[%1].viewpoint[get(map[%1].pointscount)].x, scene[get(map[%1].mapscenecount)].mapx ); copy(map[%1].viewpoint[get(map[%1].pointscount)].y, scene[get(map[%1].mapscenecount)].mapy ); copy(map[%1].viewpoint[get(map[%1].pointscount)].mask, scene[get(map[%1].mapscenecount)].mask ); copy(map[%1].viewpoint[get(map[%1].pointscount)].heading, scene[get(map[%1].mapscenecount)].heading ); copy(map[%1].viewpoint[get(map[%1].pointscount)].scene, scene[get(map[%1].mapscenecount)].name ); txtadd(map[%1].viewpoint[get(map[%1].pointscount)].onclick, "mapgotoscene(", get(scene[get(map[%1].mapscenecount)].name), ");" ); txtadd(map[%1].viewpoint[get(map[%1].pointscount)].onhover, "showtext(", get(scene[get(map[%1].mapscenecount)].title), ",maponhovertext);" ); add(map[%1].pointscount,1); ); add(map[%1].mapscenecount,1); if(map[%1].mapscenecount LT scene.count, map_autoviewpointadd(%1); );
  15. </action>
  16. <action name="map_addradarmask">
  17. addplugin(get(map[%1].radarmask2)); copy(plugin[get(map[%1].radarmask2)].keep,map[%1].keep); copy(plugin[get(map[%1].radarmask2)].parent,map[%1].image); set(plugin[get(map[%1].radarmask2)].enabled,false); set(plugin[get(map[%1].radarmask2)].capture,false); set(plugin[get(map[%1].radarmask2)].edge,map[%1].edge); set(plugin[get(map[%1].radarmask2)].align,map[%1].align); set(plugin[get(map[%1].radarmask2)].x,0); set(plugin[get(map[%1].radarmask2)].y,0); set(plugin[get(map[%1].radarmask2)].url,%4);
  18. </action>
  19. <action name="map_addviewponits">
  20. if(map[%1].check, ,set(map[%1].pointscount,0); set(map[%1].check,true); ); txtadd(map[%1].point,%1,_viewpoint_,get(map[%1].pointscount)); copy(map[%1].viewpoint[get(map[%1].pointscount)].pluginname,map[%1].point); addplugin(get(map[%1].point)); copy(plugin[get(map[%1].point)].radar,map[%1].radarlight); copy(plugin[get(map[%1].point)].radarmask,map[%1].radarmask); copy(plugin[get(map[%1].point)].parent,map[%1].image); copy(plugin[get(map[%1].point)].keep,map[%1].keep); add(plugin[get(map[%1].point)].zorder,get(map[%1].zorder),2000); copy(plugin[get(map[%1].point)].url,map[%1].point_url); txtadd(pointnormalcrop, "0|0|", get(map[%1].point_crop), "|", get(map[%1].point_crop) ); txtadd(pointhovercrop, get(map[%1].point_crop), "|0|", get(map[%1].point_crop), "|", get(map[%1].point_crop) ); copy(plugin[get(map[%1].point)].crop,pointnormalcrop); set(plugin[get(map[%1].point)].edge,center); set(plugin[get(map[%1].point)].align,lefttop); copy(plugin[get(map[%1].point)].x,map[%1].viewpoint[get(map[%1].pointscount)].x); copy(plugin[get(map[%1].point)].y,map[%1].viewpoint[get(map[%1].pointscount)].y); copy(plugin[get(map[%1].point)].onhover, map[%1].viewpoint[get(map[%1].pointscount)].onhover); txtadd(plugin[get(map[%1].point)].onover, "copy(storecrop,crop); set(crop,", get(pointhovercrop), ");" ); set(plugin[get(map[%1].point)].onout, copy(crop,storecrop); ); copy(plugin[get(map[%1].point)].onclick, map[%1].viewpoint[get(map[%1].pointscount)].onclick ); txtadd(pointsetradar, "map_setradar(", %1, ",", get(map[%1].pointscount), ");" ); if(map[%1].viewpoint[get(map[%1].pointscount)].scene !== null, txtadd(scene[get(map[%1].viewpoint[get(map[%1].pointscount)].scene)].onstart, get(pointsetradar) ); , txtadd(plugin[get(map[%1].point)].onclick, get(pointsetradar) ); ); add(map[%1].pointscount,1); if(map[%1].pointscount LT map[%1].viewpoint.count, map_addviewponits(%1); , set(map[%1].check,false); );
  21. </action>
  22. <action name="map_setradar">
  23. if(map[%1].viewpoint[%2].heading !== null, copy(plugin[get(map[%1].radar)].heading,map[%1].viewpoint[%2].heading); , set(plugin[get(map[%1].radar)].heading,0); ); copy(plugin[get(map[%1].radar)].x,map[%1].viewpoint[%2].x); copy(plugin[get(map[%1].radar)].y,map[%1].viewpoint[%2].y); copy(plugin[get(map[%1].radar)].scene,xml.scene); if(map[%1].viewpoint[%2].mask !== null, map_addradarmask(%1,get(map[%1].viewpoint[%2].x),get(map[%1].viewpoint[%2].y),get(map[%1].viewpoint[%2].mask)); copy(plugin[get(map[%1].radar)].mask,map[%1].radarmask2); if(map[%1].viewpoint[%2].mask == "", set(plugin[get(map[%1].radar)].mask,); if(plugin[get(map[%1].radarmask2)].loaded,removeplugin(get(map[%1].radarmask2))); ); , set(plugin[get(map[%1].radar)].mask,); if(plugin[get(map[%1].radarmask2)].loaded,removeplugin(get(map[%1].radarmask2))); ); if(map[%1].viewpoint[%2].scale !== null, copy(plugin[get(map[%1].radar)].scale,map[%1].viewpoint[%2].scale); , set(plugin[get(map[%1].radar)].scale,1); ); set(plugin[get(map[%1].radar)].viewpoint,%2);
  24. </action>
  25. <action name="rotateradar">
  26. if(%2 == null, set(radarmousex,get(mouse.stagex)); set(radarmousey,get(mouse.stagey)); ); sub(radarmousex,get(mouse.stagex),get(radarmousex)); sub(radarmousey,get(mouse.stagey),get(radarmousey)); set(plusminusx,1); set(plusminusy,1); if(map[%1].direction GT 0, if(map[%1].direction GT 90, set(plusminusx,-1); ); , if(map[%1].direction GT -90, set(plusminusy,-1);, set(plusminusx,-1); set(plusminusy,-1); ); ); mul(radarmousex,get(radarmousex),get(plusminusx)); mul(radarmousey,get(radarmousey),get(plusminusy)); add(map[%1].direction,get(radarmousex)); add(map[%1].direction,get(radarmousey)); if(map[%1].editmode, sub(plugin[get(map[%1].radar)].heading,get(view.hlookat),get(map[%1].direction)); copy(map[%1].viewpoint[get(plugin[get(map[%1].radar)].viewpoint)].heading,plugin[get(map[%1].radar)].heading); showtext(get(plugin[get(map[%1].radar)].heading),maponhovertext); , add(showdirection,map[%1].direction,get(view.hlookat)); add(view.hlookat,get(map[%1].direction),get(plugin[get(map[%1].radar)].heading)); ); mapradarshow(%1); set(radarmousex,get(mouse.stagex)); set(radarmousey,get(mouse.stagey)); delayedcall(0.01, if(mapradardown, rotateradar(%1,get(radarmousex),get(radarmousey)); ); );
  27. </action>
  28. <action name="mapradarshow">
  29. if(plugin[get(map[%1].radar)].scene !== xml.scene, set(plugin[get(map[%1].radar)].x,-2000); set(plugin[get(map[%1].radar)].y,0); set(plugin[get(map[%1].radar)].viewpoint,-1); ); if(map[%1].direction GT 180, sub(map[%1].direction,180); add(map[%1].direction,-180,map[%1].direction); ); if(map[%1].direction LT -180, add(map[%1].direction,180); add(map[%1].direction,180,map[%1].direction); ); copy(hlookat,map[%1].direction); copy(fov,view.fov); div(fov,2); sub(plugin[get(map[%1].radarlight)].rotate,hlookat,fov); add(hlookat,180); add(plugin[get(map[%1].radarmask)].rotate,hlookat,fov);
  30. </action>
  31. <action name="mapradarrotate">
  32. if(view.hlookat GT 180, sub(view.hlookat,180); add(view.hlookat,-180,get(view.hlookat)); ); if(view.hlookat LT -180, add(view.hlookat,180); add(view.hlookat,180,get(view.hlookat)); ); sub(map[%1].direction,get(view.hlookat),get(plugin[get(map[%1].radar)].heading)); mapradarshow(%1);
  33. </action>
  34. <action name="mapgotoscene">
  35. <!--  usage gotoscene(scenename,ath,atv,fov);  -->
  36. loadscene(%1, null, MERGE, BLEND(0.5)); if( %2 != 'null', set(view.hlookat,%2);,); if( %3 != 'null', set(view.vlookat,%3);,); if( %4 != 'null', set(view.fov,%4);,);
  37. </action>
  38. </krpano>

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.