﻿<krpano>

	<!-- last update for krpano 1.21.2 -->

	<!-- skin mod: take button -->
	<layer name="skin_layer">
		<layer name="skin_control_bar">
			<layer name="skin_control_bar_buttons">
				<layer name="skin_btn_take"      style="skin_base|skin_glow" url="take.png"      align="center"      x="+166" y="0"  scale="0.5" onclick="take_snapshot('screenshot',null,null,false,jpg,0.85);" visible="false" />
			</layer>
		</layer>
	</layer>

	<!-- skin mod: handle take button -->
	<!-- determine the visibility of the buttons and calculate their positions -->
	<action name="skin_arrange_buttons" scope="local">
		calc(show_selbuttons, scene.count GT 1);
		calc(show_thumbutton, skin_settings.thumbs == true);
		calc(show_mapbutton,  skin_settings.maps == true);
		calc(show_gyrobutton, plugin[skin_gyro].isavailable == true AND (view.vlookatrange == 180 OR global.lpinfo.scene === xml.scene));
		calc(show_vrbutton,   webvr.isavailable == true);
		calc(show_fsbutton,   device.fullscreensupport == true);
		calc(show_takebutton, plugin[zsnapshot].ready AND device.ios != true);

		set(lpos,6);
		set(cpos,0);
		if(show_takebutton, dec(cpos,20));
		if(show_gyrobutton, dec(cpos,20));
		if(show_vrbutton OR plugin[webvr].mobilevr_fake_support == true, dec(cpos,24));
		set(rpos,6);

		calc(show_dirbuttons, !device.mobile AND ((area.pixelwidth + 2*cpos) GT 520) );

		copy(layer[skin_btn_navi].visible, show_dirbuttons);

		copy(layer[skin_btn_prev].visible, show_selbuttons);
		copy(layer[skin_btn_next].visible, show_selbuttons);
		if(show_selbuttons, inc(lpos,44); inc(rpos,44); );

		copy(layer[skin_btn_thumbs].visible, show_thumbutton);
		copy(layer[skin_btn_thumbs].x, lpos);
		if(show_thumbutton, inc(lpos,40));

		copy(layer[skin_btn_map].visible, show_mapbutton);
		copy(layer[skin_btn_map].x, lpos);
		if(show_mapbutton, inc(lpos,40));

		if(show_dirbuttons,
			copy(layer[skin_btn_navi].x, cpos);
			inc(cpos,140);

			set(layer[skin_btn_gyro].align, center);
			copy(layer[skin_btn_gyro].visible, show_gyrobutton);
			copy(layer[skin_btn_gyro].x, cpos);
			if(show_gyrobutton, inc(cpos,48));

			set(layer[skin_btn_vr].align, center);
			copy(layer[skin_btn_vr].visible, show_vrbutton);
			copy(layer[skin_btn_vr].x, cpos);
			if(show_vrbutton, inc(cpos,50));

			set(layer[skin_btn_take].align, center);
			copy(layer[skin_btn_take].visible, show_takebutton);
			copy(layer[skin_btn_take].x, cpos);
			if(show_takebutton, inc(cpos,48));
		  ,
			set(layer[skin_btn_gyro].align, left);
			copy(layer[skin_btn_gyro].visible, show_gyrobutton);
			copy(layer[skin_btn_gyro].x, lpos);
			if(show_gyrobutton, inc(lpos,40));

			set(layer[skin_btn_vr].align, left);
			copy(layer[skin_btn_vr].visible, show_vrbutton);
			copy(layer[skin_btn_vr].x, lpos);
			if(show_vrbutton, inc(lpos,54));

			set(layer[skin_btn_take].align, left);
			copy(layer[skin_btn_take].visible, show_takebutton);
			copy(layer[skin_btn_take].x, lpos);
			if(show_takebutton, inc(lpos,48));
		);

		copy(layer[skin_btn_hide].x, rpos);
		inc(rpos,40);

		copy(layer[skin_btn_fs].visible, show_fsbutton);
		copy(layer[skin_btn_fs].x, rpos);
		if(show_fsbutton, inc(rpos,40));
	</action>

</krpano>
