if (isdesktop, setControlMode(get(tour_controlmodemousetype)););
setControlMode(drag2d);
setControlMode(moveto);
set(control.mousetype, %1);
set(tour_controlmodemousetype, %1);
events.dispatch(oncontrolmodechanged);
txtadd(real_message_id, get(tour_language), "_", %2);
set(%1, get(data[get(real_message_id)].content));
set(tour_displayspots, false);
set(nb_spots, get(hotspot.count));
if (nb_spots != 0, hidepanospotsaction(); );
events.dispatch(hotspots_visibility_changed);
set(tour_displayspots, true);
set(nb_spots, get(hotspot.count));
if (nb_spots != 0, showpanospotsaction(); );
events.dispatch(hotspots_visibility_changed);
set(nb_spots, get(hotspot.count));
if (nb_spots != 0,
if (tour_displayspots, showpanospotsaction(); , hidepanospotsaction(); );
);
events.dispatch(onPanoStart);
ifnot (tour_firststartactiondone,
events.dispatch(onTourStart);
set(tour_firststartactiondone, true);
);
interruptAnimation();
if (xml.scene != %1, loadscene(%1, NULL, MERGE, BLEND(1)); );
if (%1 != findscene, sub(i, scene.count, 1));
copy(scenenamei, scene[get(i)].name);
dec(i);
if (scenenamei == xml.scene,
if (i GE 0,
mainloadscene(get(scene[get(i)].name));
,
sub(lasti, scene.count, 1);
mainloadscene(get(scene[get(lasti)].name));
);
,
if(i GE 0, loadPreviousScene(findscene));
);
if (%1 != findscene, set(i,0));
copy(scenenamei, scene[get(i)].name);
inc(i);
if (scenenamei == xml.scene,
if (i LT scene.count,
mainloadscene(get(scene[get(i)].name));
,
mainloadscene(get(scene[0].name)); );
,
if(i LT scene.count, loadNextScene(findscene));
);
set(tour_autorotateenabled, true );
set(autorotate.enabled, true);
set(tour_autorotation_pausecounter, 0);
events.dispatch(onstartautorotation);
set(tour_autorotateenabled, false);
set(autorotate.enabled, false);
events.dispatch(onstopautorotation);
if(tour_autorotateenabled,
set(autorotate.enabled, false);
inc(tour_autorotation_pausecounter);
events.dispatch(onpauseautorotation);
);
if(tour_autorotateenabled,
if (tour_autorotation_pausecounter GT 0,
if(%1 == forceresume,
set(tour_autorotation_pausecounter, 0);
,
dec(tour_autorotation_pausecounter);
);
if(tour_autorotation_pausecounter == 0,
set(autorotate.enabled, true);
events.dispatch(onresumeautorotation);
);
);
);
set(tour_autotourenabled, true);startautorotation();
events.dispatch(onstartautotour);
set(tour_autotourenabled, false);stopautorotation();
events.dispatch(onstopautotour);
txtadd(tour_deeplinkingvars, "s=", get(xml.scene));
Math.round(viewhlookat, view.hlookat);
mod(viewhlookat, 360);
if (viewhlookat GT 180,
sub(viewhlookat, 360);
,
if (viewhlookat LT -180, add(viewhlookat, 360));
);
Math.round(viewvlookat, view.vlookat);
Math.round(viewfov , view.fov);
txtadd(tour_deeplinkingvars, get(tour_deeplinkingvars), "&h=", get(viewhlookat));
txtadd(tour_deeplinkingvars, get(tour_deeplinkingvars), "&v=", get(viewvlookat));
txtadd(tour_deeplinkingvars, get(tour_deeplinkingvars), "&f=", get(viewfov));
if (tour_stopsequence == false,
if (stopspotsequence == false,
inc(hotspot[%1].frame,1,get(hotspot[%1].lastframe),0);
mul(hotspot[%1].ypos,hotspot[%1].frame,hotspot[%1].frameheight);
txtadd(hotspot[%1].crop,'0|',get(hotspot[%1].ypos),'|',get(hotspot[%1].framewidth),'|',get(hotspot[%1].frameheight));
delayedcall(%2, animate(%1,%2) );
);
);
set(tour_stopsequence, false);
set(stopspotsequence , false);
animate(get(name) , %1);
set(stopspotsequence, true);
setdefaultanimatedspotframe();
txtadd(defaultcrop, "0|0|", get(framewidth), "|", get(frameheight));
set(crop, get(defaultcrop));
ifnot (tour_stopsequence === undefined,
set(tour_stopsequence, true);
wait(0.1);
);
if (tooltip !== null,
getmessage(currentTooltipText, get(tooltip));
if (%2 == null,
set(tooltipCurrentTextfieldLayer, "panotourTooltipDefaultText");
,
if(%2 == "",
set(tooltipCurrentTextfieldLayer, "panotourTooltipDefaultText");
,
set(tooltipCurrentTextfieldLayer, %2);
);
);
ifnot (currentTooltipText == "",
tooltipTextSettingsUpdate(%1, %3, %4);
set(tooltipHtmlText, get(currentTooltipText));
escape(tooltipHtmlText);
set(layer[get(tooltipCurrentTextfieldLayer)].html, get(tooltipHtmlText));
set(layer[get(tooltipCurrentTextfieldLayer)].visible, true);
div(halfWidth, layer[get(tooltipCurrentTextfieldLayer)].width, 2);
if(%1 != "center",
sub(leftMargin, get(mouse.x), get(halfWidth));
add(rightMargin, get(mouse.x), get(halfWidth));
,
set(leftMargin, 0);
set(rightMargin, 0);
);
indexoftxt(alignedOnRight, %1, right, 0);
indexoftxt(alignedOnLeft, %1, left, 0);
if(%3 == "right",
if(alignedOnRight != -1,
set(rightMargin, 0);
);
);
if(%3 == "left",
if(alignedOnLeft != -1,
set(leftMargin, 0);
);
);
set(totalHeight, get(layer[get(tooltipCurrentTextfieldLayer)].height));
if(%1 != "center",
sub(topMargin, get(mouse.y), get(totalHeight));
if(%3 == "top",
add(bottomMargin, get(mouse.y), get(totalHeight));
,
set(bottomMargin, get(mouse.y));
);
,
set(topMargin, 0);
set(bottomMargin, 0);
);
indexoftxt(alignedOnBottom, %1, bottom, 0);
indexoftxt(alignedOnTop, %1, top, 0);
if(%3 == "top",
if(alignedOnTop != -1,
set(topMargin, 0);
);
);
if(%3 == "bottom",
if(alignedOnBottom != -1,
set(bottomMargin, 0);
);
);
if(leftMargin LT 0,
set(tooltipPositionX, get(halfWidth));
if(%1 == "hotspot",
if(topMargin LT 0,
set(layer[get(tooltipCurrentTextfieldLayer)].align, topleft);
,
if(bottomMargin GT stageheight,
set(layer[get(tooltipCurrentTextfieldLayer)].align, bottomleft);
,
set(layer[get(tooltipCurrentTextfieldLayer)].align, left);
);
);
);
,
if(rightMargin GT stagewidth,
sub(tooltipPositionX, get(stagewidth), get(halfWidth));
if(%1 == "hotspot",
if(topMargin LT 0,
set(layer[get(tooltipCurrentTextfieldLayer)].align, topright);
,
if(bottomMargin GT stageheight,
set(layer[get(tooltipCurrentTextfieldLayer)].align, bottomright);
,
set(layer[get(tooltipCurrentTextfieldLayer)].align, right);
);
);
);
,
if(alignedOnRight != -1,
sub(tooltipPositionX, stagewidth, get(mouse.x));
,
if(alignedOnLeft != -1,
set(tooltipPositionX, get(mouse.x));
,
div(tooltipPositionX, stagewidth, 2);
sub(tooltipPositionX, get(mouse.x), get(tooltipPositionX));
);
);
);
);
set(layer[get(tooltipCurrentTextfieldLayer)].x, get(tooltipPositionX));
if(topMargin LT 0,
set(tooltipPositionY, get(totalHeight));
if(%1 == "hotspot",
if(leftMargin LT 0,
set(layer[get(tooltipCurrentTextfieldLayer)].align, topleft);
,
if(rightMargin GT stagewidth,
set(layer[get(tooltipCurrentTextfieldLayer)].align, topright);
,
set(layer[get(tooltipCurrentTextfieldLayer)].align, top);
);
);
);
,
if(bottomMargin GT stageheight,
sub(tooltipPositionY, get(stageheight), get(totalHeight));
if(%1 == "hotspot",
if(leftMargin LT 0,
set(layer[get(tooltipCurrentTextfieldLayer)].align, bottomleft);
,
if(rightMargin GT stagewidth,
set(layer[get(tooltipCurrentTextfieldLayer)].align, bottomright);
,
set(layer[get(tooltipCurrentTextfieldLayer)].align, bottom);
);
);
);
,
if(alignedOnBottom != -1,
sub(tooltipPositionY, stageheight, get(mouse.y));
,
if(alignedOnTop != -1,
set(tooltipPositionY, get(mouse.y));
,
div(tooltipPositionY, stageheight, 2);
sub(tooltipPositionY, get(mouse.y), get(tooltipPositionY));
);
);
);
);
set(layer[get(tooltipCurrentTextfieldLayer)].y, get(tooltipPositionY));
);
);
set(layer[get(tooltipCurrentTextfieldLayer)].visible, false);
set(layer[get(tooltipCurrentTextfieldLayer)].html, '');
if(get(tooltipCurrentTextfieldLayer) != "",
if (%1 == "hotspot",
set(layer[get(tooltipCurrentTextfieldLayer)].align, center);
,
set(layer[get(tooltipCurrentTextfieldLayer)].align, %1);
);
if (%3 == null,
set(layer[get(tooltipCurrentTextfieldLayer)].width, 200);
,
set(layer[get(tooltipCurrentTextfieldLayer)].width, %3);
);
if (%2 == null,
set(layer[get(tooltipCurrentTextfieldLayer)].edge, "bottom");
,
set(layer[get(tooltipCurrentTextfieldLayer)].edge, %2);
);
set(layer[get(tooltipCurrentTextfieldLayer)].zorder, 99);
);
if(keycode==17,set(tour_ctrlPressed,true );,if(keycode==107,set(fov_moveforce,-1);,if(keycode==109,set(fov_moveforce,+1);,if(tour_ctrlPressed==true,if(keycode==96,lookto(get(panoview.h),get(panoview.v),get(panoview.fov)););););););
if(keycode==17,set(tour_ctrlPressed,false);,if(keycode==107,set(fov_moveforce, 0);,if(keycode==109,set(fov_moveforce, 0););););