for(set(i,0),i LT hotspot.count,inc(i),
if(hotspot[get(i)].tag == 'lensflare_tag_dynamic',
vonh(get(i));
);
);
load_flare_content();
if(!first_flare_settings,
copy(suma_flar, lensflares[obj].item.count);
set(first_flare_settings, true);
);
if(lensflares[obj].item.count GT 0 OR addflaremode == true,
flayer(blink_fl_lt,blink_fl_lt);
flayer(blink_fl_rt,blink_fl_rt);
flayer(blink_fl_rb,blink_fl_rb);
flayer(blink_fl_lb,blink_fl_lb);
);
set(load_gui_flar, false);
for(set(i,0), i LT lensflares[obj].item.count, inc(i),
copy(name_flare, lensflares[obj].item[get(i)].name);
copy(blink_style, lensflares[obj].item[get(i)].typ);
if(lensflares[obj].item[get(i)].scene == scene[get(xml.scene)].name,
set(load_gui_flar, true);
for(set(j,0), j LT flare_style[get(blink_style)].item.count, inc(j),
txtsplit(flare_style[get(blink_style)].item[get(j)].vars, '|', arrows);
txtadd(n, 'f1_',get(lensflares[obj].item[get(i)].name),'_',get(j));
txtadd(n0, 'f1_',get(lensflares[obj].item[get(i)].name),'_0');
copy(move, arrows[0].value);
copy(scale, arrows[1].value);
copy(alpha, arrows[2].value);
copy(zorder, arrows[3].value);
copy(flying, arrows[4].value);
copy(rscale, arrows[5].value);
copy(ralpha, arrows[6].value);
copy(ralphaminus, arrows[7].value);
copy(rmove, arrows[8].value);
copy(invr, arrows[9].value);
add_single_flare(get(n),get(i),get(j),get(blink_style),get(name_flare),get(move),get(flying),get(rscale),get(ralpha),get(ralphaminus),get(scale),get(alpha),get(zorder),get(rmove),get(invr),get(n0));
);
);
);
if(addflaremode,
show_lensfrafe_aktyw_box(get(scene[get(xml.scene)].name),get(load_gui_flar));
);
fhotspot(%1,flare);
copy(h.url, flare_style[%4].item[%3].url);
copy(h.ath, lensflares[obj].item[%5].ath);
copy(h.atv, lensflares[obj].item[%5].atv);
if(lensflares[obj].item[%5].dust_effect === null, set(lensflares[obj].item[%5].dust_effect, true));
copy(h.dust_effect, lensflares[obj].item[%5].dust_effect);
set(h.tagmini, %5);
set(h.move, %6);
set(h.rmove, %14);
copy(h.athbazowy, hotspot[%16].ath);
copy(h.atvbazowy, hotspot[%16].atv);
set(h.flying, %7);
set(h.scale, %11);
set(h.alpha, %12);
set(scaleTemp_%1, %11);
set(h._alpha, %12);
set(h.rscale, %8);
set(h.ralpha, %9);
set(h.ralphaminus, %10);
set(h.zorder, %13);
set(h.invr, %15);
set(h.tag, lensflare_tag_dynamic);
set(h.onloaded,
if(webvr.isenabled, if(!invr, vonh(get(name))));
asyncloop(loaded,
spheretoscreen(ath, atv, xposh_%1, yposh_%1);
div(xpos_%1, stagewidth, 2);
div(ypos_%1, stageheight, 2);
sub(xposg_%1, xposh_%1, xpos_%1);
sub(yposg_%1, yposh_%1, ypos_%1);
div(ox, xposg_%1, calc(move*1.4/(rmove*12)));
div(oy, yposg_%1, calc(move*1.4/(rmove*12)));
getlooktodistance(scal_%1, view.hlookat, view.vlookat, ath, atv);
spheretoscreen(athbazowy, atvbazowy, px_%1, py_%1);
sub(a_%1, px_%1, xpos_%1);
sub(b_%1, ypos_%1, py_%1);
Math.atan2(angle_%1, a_%1, b_%1);
mul(angle_%1, 180);
div(angle_%1, Math.PI);
add(angle_%1, 270);
mod(angle_%1, 360);
roundval(angle_%1);
copy(rz, angle_%1);
if(ralpha,
set(alpha_%1, calc((scal_%1/70)-ralphaminus));
if(alpha_%1 LE 0, set(alpha_%1, 0));
if(webVr.isenabled,
set(hotspot[%1].alpha, calc(alpha_%1/3));
,
set(hotspot[%1].alpha, calc(alpha_%1));
if(hotspot[%1].alpha GT 1, set(hotspot[%1].alpha, 1));
);
);
if(rscale != 1,
set(valsc_%1, calc((rscale*scal_%1)/10+scaleTemp_%1));
if(webVr.isenabled,
set(scale, calc(valsc_%1/2));
,
copy(scale, valsc_%1);
);
);
if(%3 == '1',
getlooktodistance(result_%1, view.hlookat, view.vlookat, ath, atv);
div(result1_%1, result_%1, 10);
clamp(result1_%1, 0.0, 1.0);
mod(result2_%1, result1_%1, 100);
sub(result2_%1,1);
mul(result2_%1,-1);
copy(alpha, result2_%1);
sub(alpha, 0.3);
if(result_%1 LT 7,
migaj_kurzem(get(result2_%1),get(dust_effect));
);
if(result_%1 GT 7 AND result_%1 LT 20,
migaj_kurzem(0,true);
);
);
testme(%1,get(xposh_%1),get(yposh_%1));
);
);
if(%2,
set(layer[blink_fl_lt].alpha, %1);
set(layer[blink_fl_rt].alpha, %1);
set(layer[blink_fl_rb].alpha, %1);
set(layer[blink_fl_lb].alpha, %1);
set(layer[blink_fl_ce].alpha, %1);
);
if(%3 LT 0 OR !%3,
set(ukryj_gora_%1, true);
,
set(ukryj_gora_%1, false);
);
if(%3 GT stageheight OR !%3,
set(ukryj_dol_%1, true);
,
set(ukryj_dol_%1, false);
);
if(%2 LT 0 OR !%2,
set(ukryj_lewo_%1, true);
,
set(ukryj_lewo_%1, false);
);
if(%2 GT stagewidth OR !%2,
set(ukryj_prawo_%1, true);
,
set(ukryj_prawo_%1, false);
);
if(!ukryj_gora_%1 AND !ukryj_dol_%1 AND !ukryj_lewo_%1 AND !ukryj_prawo_%1,
set(visible, true);
,
set(visible, false);
);
addlayer(%1);
layer[%1].loadstyle(%2);
copy(p, layer[%1]);
addhotspot(%1);
hotspot[%1].loadstyle(%2);
copy(h, hotspot[%1]);
if(layer[%1].loaded, removelayer(%1));
if(hotspot[%1].loaded, removehotspot(%1));
sub(i,hotspot.count,1);
if(i GE 0,loop_vonh_all(get(i),%1,%2));
if(%2 == null,
vonh(%1);
,
if(hotspot[%1].%2 == %3,
vonh(%1);
);
);
dec(i);
if(i GE 0, loop_vonh_all(get(i),%2,%3));