

function mini_create()
	init_mini(1);
		create_mini(1,238,31,55,151,1001);
end;
mini1lvl16=true
function gameinput (sender,obj_id,attachedID)
MiniInterfaceHandler( sender, obj_id );


if sender == 30 then   
	if mini_start then
		StopAllEffects()
			setstatemenu()
			mini_start=false;
			StopMusic()
		return;end
		
	BlockCursor(false)
	StopEmiter("shah");
	StopEmiter("dver");
	set_visible_object(obj.dver2.id,false)
	SetCurrentLeaf("trum",16,0);
	ReturnHiddenObjects()      
	DeleteRenderTarget(2234)  					 
	leafobj={}	
	Set_Cursor(obj.shah.id,3);
	flags.start_draw = true;	
	OpenPlushes()
	mini1lvl16=false
	return;end;
-----------------------------------------------------------------------------------------------------------------------
	if sender==33 then	
		CreateWindow(CWX,CWY,"666",32222,nil,100,210);		
	end;
	
	
	
-----------------------------------------------------------------------------------------------------------------------
		
	if sender==66 then	
	reset_game_klh();
	end
	if sender == 1 then --кликнули левой кнопкой мыши на активный объект
		MiniInterfaceHandler( sender, obj_id );
		
		if obj_id == obj.mini_skip.id then
				finish_mini_game(true);		
				SetObjectPosition(1001,243,336);
				SetObjectPosition(1002,298,336);
				SetObjectPosition(1003,353,336);
				SetObjectPosition(1004,408,336);
				SetObjectPosition(1005,463,336);
				SetObjectPosition(1006,518,336);
				SetObjectPosition(1007,573,336);
				SetObjectPosition(1008,628,336);
				SetObjectPosition(1009,683,336);
				SetObjectPosition(1010,738,336);
				flags.mini1_complete = true ;
				for i=1001,1010 do
				Set_Cursor(i,3); 
				speciale_action(4,top_plush_id);
				speciale_action(4,bottom_plush_id);
				
				end;
		elseif obj_id == obj.mini_help.id then
			CreateWindow(CWX,CWY,"666",5785474,nil,100,230);
		end;
		
				
		
		
		if obj_id>=1001 and obj_id<=1010 then
				add_to_mouse(obj_id);
				mousepresed=true;
				objectid=obj_id;
				
			return;end;
			
	return;end;
	
	if sender ==35 then
	if obj_id>=1001 and obj_id<=1010 and not flags.mini1_complete then 
	setcolor(obj_id,0.5,0.5,0.5,1);
	return;end;
	return;end;
	
	if sender ==39 then
	if obj_id>=1001 and obj_id<=1010 then 
	setcolor(obj_id,1,1,1,1);
	return;end;
	
	return;end;
	
	
	if sender ==10 then
	        	mini_start=false;
	speciale_action(2,obj.zaslonka.id,true)
	speciale_action(2,obj.kluch16.id,true);	
	playeffect("103");
	flags.mini1_complete = true ;
	StartTimer(5,3);
	finish_mini_game(true);	
	BlockCursor(true)
	for i=1001,1010 do
		Set_Cursor(i,3); 
	end;
		
	return;end;
if sender ==26 then		
	RemoveWindow(8,2.8,"DestroyMyWindow")
return;end;
	
	if sender==777 then	
		clear_satelite_leaf("trum");		
	end
	
	
	if sender == 6 then	
	
	if mousepresed==true
		then
			
			RemoveFromMouse(objectid);
			check_mini_game_money(objectid,1);
			mousepresed=false;
			objectid=0;
			playeffect("102")
		end
		return; end;
		
		if sender ==36 then
		if flags.mini1_complete==true then		
		ClosePlushes();
		speciale_action(4,top_plush_id);
		speciale_action(4,bottom_plush_id);
		flags.scan=true;
	    return;end;
		return;end;
		
	
end
