showlog();
set(hsp_name,%1);
set(hsp_type,%2);
txtadd(iconUrl,'',%4);
txtreplace(iconUrl,'|',',');
if(%2 LE 1,
set(hotspot[get(hsp_name)].type,'image');
set(hotspot[get(hsp_name)].url,get(iconUrl));
);
ifnot(%2 LE 1, set(hotspot[get(hsp_name)].type, 'text'));
set(hotspot[get(hsp_name)].name,%1);
set(hotspot[get(hsp_name)].hotspottype,%2);
set(hotspot[get(hsp_name)].hotspottitle,%3);
set(hotspot[get(hsp_name)].hotspotStyle,%10);
set(hotspot[get(hsp_name)].hotlink,%7);
set(hotspot[get(hsp_name)].ath,%5);
set(hotspot[get(hsp_name)].atv,%6);
set(hotspot[get(hsp_name)].visible,true);
set(hotspot[get(hsp_name)].alpha,1);
set(hotspot[get(hsp_name)].scale,1);
set(hotspot[get(hsp_name)].autoalpha,false);
set(hotspot[get(hsp_name)].distorted,false);
set(hotspot[get(hsp_name)].border,false);
set(hotspot[get(hsp_name)].onclick,'js(__krfn.utils.linkopen(%7,%1));');
set(hotspot[get(hsp_name)].ondown,dragJQhotspot(););
set(hotspot[get(hsp_name)].onup,js(console.log('0');__krfn.angle.updateHotSpotData(get(xml.scene),get(name),get(ath),get(atv))));
txtsplit(%10,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber,framewidth);
set(hotspot[get(hsp_name)].pos,pos);
txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();add_tooltip_dot();");
if(%2 LE 2,
set(hotspot[get(hsp_name)].height,%8);
set(hotspot[get(hsp_name)].width,%8);
set(hotspot[get(hsp_name)].crop,'');
if(%2 == 0,
txtreplace(iconUrl,'.svg','.png');
trace('system::',get(iconUrl));
set(hotspot[get(hsp_name)].url,get(iconUrl));
set(hotspot[get(hsp_name)].frameNumber,60);
set(hotspot[get(hsp_name)].duration,1);
set(hotspot[get(hsp_name)].frameRate,calc(1.0 / 60));
set(hotspot[get(hsp_name)].framewidth,84);
);
if(%2 == 2,
trace('ser_frame::',get(framewidth));
set(hotspot[get(hsp_name)].url,get(iconUrl));
set(hotspot[get(hsp_name)].framewidth,get(framewidth));
set(hotspot[get(hsp_name)].frameNumber,get(frameNumber));
crop_animation_r_stop(get(hsp_name));
);
if(%2 == 3,
set(hotspot[get(hsp_name)].height,80);
set(hotspot[get(hsp_name)].width,1);
set(hotspot[get(hsp_name)].padding,0);
set(hotspot[get(hsp_name)].background,false);
txtadd(line,'');
copy(hotspot[get(hsp_name)].html,line);
set_label_dir(get(hsp_name),get(lineDirection),0);
);
txtadd(hotspot[get(hsp_name)].onloaded,"do_crop_animation(get(framewidth),get(framewidth),get(frameRate));"););
trace('last_add::',hotspot[get(hsp_name)].onloaded);
addhotspot(get(hsp_name));
registerattribute(xframes, calc((imagewidth / %1) BOR 0));
registerattribute(yframes, calc((imageheight / %2) BOR 0));
registerattribute(frames, calc(xframes * yframes));
registerattribute(frame, 0);
registerattribute(animatiedOn, 1);
registerattribute(frameRate, %3);
trace('imagewidth::',imagewidth,'::imageheight::',imageheight);
set(crop, '0|0|%1|%2');
clearinterval(calc('crop_anim_' + name));
if(%3 == '' OR frameRate == 0 OR isNaN(frameRate),
set(frameRate,calc(1.0 / 60));
trace('没有frameRate',get(calc(1.0 / 60)));
trace('没有frameRate-1',get(frameRate));
);
trace('params::1::',%1,'::2::',%2,'::3::',%3,':frameRate:',get(frameRate));
trace('xframes1::',get(xframes),'::yframes1::',get(yframes));
if(frameRate GE 0,
setinterval(
calc('crop_anim_' + name),
get(frameRate),
if(loaded,
inc(frame);
if(frame GE frames, if(onlastframe !== null, onlastframe() ); set(frame,0); );
mod(xpos,frame, xframes);
div(ypos, frame, xframes);
Math.floor(ypos);
mul(xpos, %1);
mul(ypos, %2);
calc(crop, xpos +'|' + ypos + '|%1|%2');
if(animatiedOn == 0,
calc(stopAniCrop,'0|0|'+imagewidth+'|'+imageheight +'|');
set(crop, stopAniCrop);
);,
clearinterval(calc('crop_anim_' + name));
);
);
);
set(cur,%1);
tolower(cur, cur);
set(curIn, calc('crop_anim_r_' + cur));
clearinterval(curIn);
txtadd(cur,'',%1);
tolower(cur, cur);
txtadd(frameRate,'',%2);
txtadd(framewidth,'',%3);
txtadd(frameNumber,'',%4);
copy(frames, hotspot[get(cur)].frames);
copy(xframes, hotspot[get(cur)].xframes);
copy(yframes, hotspot[get(cur)].yframes);
copy(animatiedOn, hotspot[get(cur)].animatiedOn);
set(frame,0);
set(curIn, calc('crop_anim_r_' + cur));
clearinterval(curIn);
if(get(frameRate) GE 0,
setinterval(curIn,
get(frameRate),
inc(frame);
copy(on, hotspot[get(cur)].on);
if(frame GE frames, set(frame,0); );
mod(xpos,frame, xframes);
div(ypos, frame, xframes);
Math.floor(ypos);
mul(xpos, framewidth);
mul(ypos,framewidth);
trace('frame-1::',get(animatiedOn));
calc(crop, xpos +'|' + ypos + '|'+framewidth +'|' + framewidth);
if(frames == -1,
copy(hotspot[get(hsp_name)].crop,'0|0|204|204');
);
copy(hotspot[get(hsp_name)].crop,crop);
);
);
txtadd(tooltipname, 'tooltip_', get(name));
txtsplit(hotspotStyle,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber);
txtadd(pName, get(name));
addlayer(get(tooltipname));
txtadd(layer[get(tooltipname)].parent, 'hotspot[', get(name), ']');
set(layer[get(tooltipname)].autowidth, true);
set(layer[get(tooltipname)].width,'prop');
set(layer[get(tooltipname)].autoheight,true);
set(layer[get(tooltipname)].edge,center);
set(layer[get(tooltipname)].background,false);
set(layer[get(tooltipname)].pos,pos);
set(layer[get(tooltipname)].padding,0);
set(layer[get(tooltipname)].type,'html');
set(layer[get(tooltipname)].url,'%SWFPATH%/plugins/textfield.swf');
set(layer[get(tooltipname)].border,false);
set(layer[get(tooltipname)].align,center);
copy(layer[get(tooltipname)].hotlink, hotspot[get(name)].hotlink);
set(layer[get(tooltipname)].ondown,'dragJQlayer();');
set(layer[get(tooltipname)].onclick,JQlayerClick);
set(layer[get(tooltipname)].onup,js(console.log('1');__krfn.angle.updateHotSpotData(get(xml.scene),get(hsName),get(ath),get(atv))));
txtadd(labelCode, '','
',get(hotspottitle),'
');
if(get(hotspottype) LE 2,
delayedcall(0.1,
txtadd(tooltipname, 'tooltip_', get(name));
set_label_pos(get(tooltipname),get(pos));
);
);
if(get(hotspottype) == 3,
set(layer[get(tooltipname)].direction,get(lineDirection));
delayedcall(0.2,txtadd(tooltipname, 'tooltip_', get(name)); set_label_dir(get(tooltipname),get(layer[get(tooltipname)].direction),1); );
);
copy(layer[get(tooltipname)].html, labelCode);
txtadd(tooldot, 'tooldot_', get(name));
addlayer(get(tooldot));
txtadd(layer[get(tooldot)].parent, 'hotspot[', get(name), ']');
set(layer[get(tooldot)].width,10);
set(layer[get(tooldot)].height,10);
set(layer[get(tooldot)].padding,0);
set(layer[get(tooldot)].align,center);
set(layer[get(tooldot)].type,'text');
set(layer[get(tooldot)].background,false);
txtadd(dborderColor,'rgba(255,255,255,0.5)');
txtadd(dot,'');
copy(layer[get(tooldot)].html,dot);
set(layer[get(tooldot)].backgroundcolor,get(borderColor));
set(layer[get(tooldot)].backgroundalpha,0.9);
set(layer[get(tooldot)].bgroundedge,5);
set(layer[get(tooldot)].onclick,JQlayerClick);
set(layer[get(tooldot)].ondown,'dragJQlayer();');
set(layer[get(tooldot)].visible,false);
set(layer[get(tooldot)].onup,js(console.log('2');__krfn.angle.updateHotSpotData(get(xml.scene),get(hsName),get(ath),get(atv))));
if(get(hotspottype) == 3,
set(layer[get(tooldot)].visible,true);
set_label_dir(get(tooldot),get(lineDirection),2);
);
txtadd(dirItem,'',%1);
txtadd(lineDirection,'',%2);
txtadd(dir,'',%3);
if(
get(dir)==1,
copy(labelWidth,layer[get(dirItem)].width);
copy(labelHeight,layer[get(dirItem)].height);
);
if(
get(lineDirection) == 'right-top',
if(get(dir)==0,set(hotspot[get(dirItem)].rotate,35));
if(get(dir)==1,add(allHeight,labelHeight,80);div(allHeight,2);mul(allHeight,-1);set(layer[get(dirItem)].rotate,0);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,get(allHeight));set(layer[get(dirItem)].rotate,-35););
if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
);
if(
get(lineDirection) == 'right-center',
if(get(dir)==0,set(hotspot[get(dirItem)].rotate,90););
if(get(dir)==1,
set(layer[get(dirItem)].rotate,-90);
add(allWidth,labelWidth,80);
div(allWidth,2);
mul(allWidth,-1);
trace('allWidth::',get(allWidth));
set(layer[get(dirItem)].x,0);
set(layer[get(dirItem)].y,get(allWidth));
);
if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
);
if(
get(lineDirection) == 'right-bottom',
if(get(dir)==0,set(hotspot[get(dirItem)].rotate,-35));
if(get(dir)==1,add(allHeight,labelHeight,80);div(allHeight,2);mul(allHeight,1);set(layer[get(dirItem)].rotate,0);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,get(allHeight));set(layer[get(dirItem)].rotate,35););
if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
);
if(
get(lineDirection) == 'center-top',
if(get(dir)==0,
set(hotspot[get(dirItem)].rotate,0);
);
if(get(dir)==1,add(allHeight,labelHeight,80);div(allHeight,2);mul(allHeight,-1);set(layer[get(dirItem)].rotate,0);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,get(allHeight)););
if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
);
if(get(lineDirection) == 'center-bottom',
if(get(dir)==0,set(hotspot[get(dirItem)].rotate,0));
if(get(dir)==1,add(allHeight,labelHeight,80);div(allHeight,2);mul(allHeight,1);
set(layer[get(dirItem)].rotate,0);
set(layer[get(dirItem)].x,0);
set(layer[get(dirItem)].y,get(allHeight));
);
if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
);
if( get(lineDirection) == 'left-top',
if(get(dir)==0,set(hotspot[get(dirItem)].rotate,-35));
if(get(dir)==1,add(allHeight,labelHeight,80);div(allHeight,2);mul(allHeight,-1);set(layer[get(dirItem)].rotate,0);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,get(allHeight));set(layer[get(dirItem)].rotate,35););
if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
);
if(
get(lineDirection) == 'left-center',
if(get(dir)==0,set(hotspot[get(dirItem)].rotate,90));
if(get(dir)==1,
set(layer[get(dirItem)].rotate,-90);
add(allWidth,labelWidth,80);
div(allWidth,2);
trace('allWidth::',get(allWidth));
set(layer[get(dirItem)].x,0);
set(layer[get(dirItem)].y,get(allWidth));
);
if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
);
if(
get(lineDirection) == 'left-bottom',
if(get(dir)==0,set(hotspot[get(dirItem)].rotate,35));
if(get(dir)==1,add(allHeight,labelHeight,80);div(allHeight,2);mul(allHeight,1);set(layer[get(dirItem)].rotate,0);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,get(allHeight));set(layer[get(dirItem)].rotate,-35););
if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
);
set(posName,%1);
set(pos,%2);
copy(hp,posName);
txtreplace(hp,'tooltip_','');
copy(hwidth, hotspot[get(hp)].width);
copy(hheight, hotspot[get(hp)].height);
copy(lwidth, layer[get(posName)].width);
copy(lheight, layer[get(posName)].height);
if(
pos == 'top',
add(all,lheight,hheight);
div(dpy,all,2);
add(lastPy,dpy,5);
trace('dpy::',dpy);
mul(lastPy, -1);
set(layer[get(posName)].align,center);
set(layer[get(posName)].y,get(lastPy));
set(layer[get(posName)].x,0);
);
if(
pos == 'bottom',
add(all,lheight,hheight);
div(dpy,all,2);
add(lastPy,dpy,5);
mul(lastPy, 1);
set(layer[get(posName)].align,center);
set(layer[get(posName)].y,get(lastPy));
set(layer[get(posName)].x,0);
);
if(
pos == 'left',
add(all,lwidth,hwidth);
div(dpx,all,2);
add(lastPx,dpx,10);
mul(lastPx, -1);
set(layer[get(posName)].align,center);
set(layer[get(posName)].x,get(lastPx));
set(layer[get(posName)].y,0);
);
if(
pos == 'right',
add(all,lwidth,hwidth);
div(dpx,all,2);
add(lastPx,dpx,10);
mul(lastPx, 1);
set(layer[get(posName)].align,center);
set(layer[get(posName)].x,get(lastPx));
set(layer[get(posName)].y,0);
);
set(delHotspot,%1);
removehotspot(%1,true);
txtadd(delHotspotLabel,'tooltip_',get(delHotspot));
txtadd(delHotspotdot,'tooldot_',get(delHotspot));
removelayer(get(delHotspotLabel));
removelayer(get(delHotspotdot));
set(canclHotspot,%1);
crop_animation_r_stop(%1);
showlog();
set(hsp_name,%1);
set(hsp_type,%2);
set(dImage,'static/panoassets/images/hotspot/image_place_holder.png');
txtadd(hsLabel, 'tooltip_', %1);
txtadd(hsDot, 'tooldot_', %1);
set(hotspot[get(hsp_name)].hotspottype,%2);
set(hotspot[get(hsp_name)].keep,true);
set(hotspot[get(hsp_name)].hotspottitle,%3);
set(hotspot[get(hsp_name)].hotlink,%7);
set(hotspot[get(hsp_name)].hotspotStyle,%10);
copy(hotspot[get(hsp_name)].borderWidth,false);
copy(layer[get(hsLabel)].borderWidth,false);
copy(layer[get(hsDot)].borderWidth,false);
set(hotspot[get(hsp_name)].background,false);
txtsplit(%10,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber,framewidth);
txtadd(labelCode, '');
copy(layer[get(hsLabel)].html, labelCode);
copy(layer[get(hsLabel)].pos, pos);
trace('editJQHotspot',%1,'::type::',%3);
if(get(hsp_type) == 3,
trace('edit3::',get(hsp_name));
set(hotspot[get(hsp_name)].animatiedOn,0);
copy(hotspot[get(hsp_name)].rotate,0);
copy(layer[get(hsLabel)].rotate,0);
set(hotspot[get(hsp_name)].type,"text");
set(hotspot[get(hsp_name)].width,1);
set(hotspot[get(hsp_name)].width,1);
set(hotspot[get(hsp_name)].height,80);
set(hotspot[get(hsp_name)].padding,0);
txtadd(line,'');
copy(hotspot[get(hsp_name)].html,line);
set_label_dir(get(hsp_name),get(lineDirection),0);
set_label_dir(get(hsLabel),get(lineDirection),1);
set_label_dir(get(hsDot),get(lineDirection),2);
);
if(get(hsp_type) LE 2,
trace('edit2::',get(hsp_name));
txtadd(iconUrl,'',%4);
txtreplace(iconUrl,'|',',');
trace('iconUrl::',iconUrl);
set(hotspot[get(hsp_name)].height,%8);
set(hotspot[get(hsp_name)].width,%8);
delayedcall(0.1,txtadd(tooltipname, 'tooltip_', get(hsp_name)); set_label_pos(get(tooltipname),get(layer[get(tooltipname)].pos)););
indexoftxt(index, get(iconUrl), 'image_place_holder.png');
if(get(index) GT -1,trace('place-holder');
set(hotspot[get(hsp_name)].animatiedOn,0);
trace('默认图::');
delayedcall(0.2, set(hotspot[get(hsp_name)].crop,'0|0|204|204'););
);
ifnot(get(index) GT -1,trace('place-holder');set(hotspot[get(hsp_name)].animatiedOn,1););
if(get(hsp_type) == 0,
txtreplace(iconUrl,'.svg','.png');
trace('system::',get(iconUrl));
set(hotspot[get(hsp_name)].url,get(iconUrl));
set(hotspot[get(hsp_name)].animatiedOn,1);
);
if(get(hsp_type) == 1,
set(hotspot[get(hsp_name)].animatiedOn,0);
);
if(get(hsp_type) == 2,
set(hotspot[get(hsp_name)].visible,true);
calc(frameRate, duration / frameNumber);
trace('frameRate::',get(frameRate));
trace('frameNumber::',get(frameNumber));
trace('framewidth::',get(framewidth));
trace('duration::',get(duration));
if(!isNaN(frameRate) AND frameRate GT 0,set(hotspot[get(hsp_name)].frameRate,get(frameRate)));
if(!isNaN(framewidth) AND framewidth GT 0,set(hotspot[get(hsp_name)].framewidth,get(framewidth)));
if(!isNaN(frameNumber) AND frameNumber GT 0,set(hotspot[get(hsp_name)].frameNumber,get(frameNumber)));
);
set(hotspot[get(hsp_name)].url,get(iconUrl));
set(hotspot[get(hsp_name)].rotate,0);
set(layer[get(hsLabel)].rotate,0);
trace('last_edit::',hotspot[get(hsp_name)].onloaded);
);
txtadd(hsName, '', get(name));
txtreplace(hsName, 'tooltip_', '');
txtreplace(hsName, 'tooldot_', '');
copy(hath, hotspot[get(hsName)].ath);
copy(hatv, hotspot[get(hsName)].atv);
spheretoscreen(hath, hatv, hotspotcenterx, hotspotcentery, 'l');
sub(drag_adjustx,mouse.stagex, hotspotcenterx);
sub(drag_adjusty,mouse.stagey, hotspotcentery);
asyncloop(
pressed,
sub(dx, mouse.stagex, drag_adjustx);
sub(dy, mouse.stagey, drag_adjusty);
screentosphere(dx, dy, ath, atv);
copy(hotspot[get(hsName)].ath, ath);
copy(hotspot[get(hsName)].atv, atv);,
set(global.ath,get(ath));
set(global.atv,get(atv));
);
txtadd(clickName, '', get(name));
txtreplace(clickName, 'tooltip_', '');
txtreplace(clickName, 'tooldot_', '');
js(__krfn.utils.linkopen(get(hotlink),get(clickName)));
trace('dragJQhotspot::',ath,atv);
spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, 'l');
sub(drag_adjustx,mouse.stagex, hotspotcenterx);
sub(drag_adjusty,mouse.stagey, hotspotcentery);
asyncloop(
pressed,
sub(dx, mouse.stagex, drag_adjustx);
sub(dy, mouse.stagey, drag_adjusty);
screentosphere(dx, dy, ath, atv);
);