GameScreen.textures_path = "graphics/screens/26_dessert/location/"

function GameScreen:RestoreScreen()
    ------------------------------------------------------------------------------------------------------------------------------ 
    --Первая загрузка екрана
    ------------------------------------------------------------------------------------------------------------------------------ 
    if(GetState(CURRENT_SCREEN, "ho") == "") then
        --local tip_end = function()
            
            ItemChangeOpacity(HUDScreen.name, 1.0, 0.5)
            DelayedExec(1.0, function()
                SetState(CURRENT_SCREEN, "ho", "active")
                self:StartHO();
            end, 113)
        --end
        HUDScreen:ShowTips({path = self.textures_path.."Text_26", x = 610, y = 1130, end_fun = tip_end})
    end
    ------------------------------------------------------------------------------------------------------------------------------ 
    --ХО
    ------------------------------------------------------------------------------------------------------------------------------ 
    if(GetState(CURRENT_SCREEN, "ho") == "active") then
        self:StartHO();
    end
    ------------------------------------------------------------------------------------------------------------------------------ 
    --после ХО
    ------------------------------------------------------------------------------------------------------------------------------ 
    if(GetState(CURRENT_SCREEN, "ho") == "completed") then
        clApplication:LoadLocation("027_dressmaker")
    end
  
    for found_item in string.gmatch(GetState(CURRENT_SCREEN, "found_obj"), "[_%a%d]+") do
		ItemRemove(self.name, found_item)
		ItemRemove(self.name, found_item.."_shadow")
    end 
end

function GameScreen:InitScreen()
    self:LoadScreen()
   
    ------------------------------------------------------------------------------------------------------------------------------ 
    --OTHER       
    self:SetItemSound("blue_dish", "sound/ceramic_pot.ogg");
    self:SetItemSound("metalware_05", "sound/metalware_05.ogg");
    self:SetItemSound("metalware_04", "sound/metalware_04.ogg");
    self:SetItemSound("metalware_03", "sound/metalware_03.ogg");
    self:SetItemSound("metalware_02", "sound/metalware_02.ogg");
    self:SetItemSound("metalware_01", "sound/metalware_01.ogg");
    self:SetItemSound("teapot", "sound/lamp_aroma.ogg");
    self:SetItemSound("pot", "sound/ceramic_pot_01.ogg");
    self:SetItemSound("metal_bottle", "sound/metal_basin.ogg");
self:SetItemSound("bottle_02", "sound/bottle_02.ogg");
self:SetItemSound("ceramic_pot", "sound/ceramic_pot.ogg");
self:SetItemSound("bedpan", "sound/bedpan.ogg");
self:SetItemSound("big_knife", "sound/big_knife.ogg");
          
    MusicPlay({"sound/ambient/22_24_26_ambient.ogg", "sound/music/past.ogg"} , 24) 
    
    self:AddHiddenCrystal("crystal_26_part")
    
    self:RestoreScreen()
end

function GameScreen:StartHO()    
    self.item_list = {
        {obj = {"honey", {x = 1049, y = 708}}},
        {obj = {"candy", {x = 1418, y = 563}}},
        {obj = {"icecream", {x = 1238, y = 646}}},
        {obj = {"walnuts", {x = 370, y = 998}}},
        {obj = {"cake", {x = 818, y = 1070}}},
        {obj = {"strawberry", {x = 1306, y = 922}}},      
        {obj = {"cherries", {x = 1470, y = 693}}},
        {obj = {"apple", {x = 472, y = 789}}, },
        {obj = {"pineapple", {x = 353, y = 565}}},
        {obj = {"plums", {x = 739, y = 786}}},
        {obj = {"banana", {x = 29, y = 325}}},
        {obj = {"egg", {x = 887, y = 943}}, },
     }
       
    local on_finish = function()
        HUDScreen:SetInvntoryOnlyMode()
        SetState(CURRENT_SCREEN, "ho", "completed");
        self.mini_game = nil;
        
        DelayedExec(2.0, function()
            local comics_finish = function()
             DelayedExec(1.0, function()
                    clApplication:LoadLocation("027_dressmaker")
                end, 113)
            end
            local comics = clScreenManager:add_screen("026_prince_dlg") 	
            comics.on_finish = comics_finish;
        end)    
    end       
    
    clScreenManager:add_screen("hud")                  
    self:SetMiniGame(mgt_hidden_object)   
    self.mini_game:Init(self.item_list, on_finish);
end
------------------------------------------------------------------------------------------------------
function GameScreen:LoadScreen()
	--[[---Background---]]--
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "26_dessert", "graphics/screens/26_dessert/location/26_dessert", 0, 0);
    
    self:CreateObj(OBJ_TYPE.TRIGGER, "blue_dish", "graphics/screens/26_dessert/location/blue_dish", 1423, 875);
    self:CreateObj(OBJ_TYPE.TRIGGER, "metalware_05", "graphics/screens/26_dessert/location/metalware_05", 707, 459);
    self:CreateObj(OBJ_TYPE.TRIGGER, "metalware_04", "graphics/screens/26_dessert/location/metalware_04", 618, 461);
    self:CreateObj(OBJ_TYPE.TRIGGER, "metalware_03", "graphics/screens/26_dessert/location/metalware_03", 546, 463);
    self:CreateObj(OBJ_TYPE.TRIGGER, "metalware_02", "graphics/screens/26_dessert/location/metalware_02", 478, 464);
    self:CreateObj(OBJ_TYPE.TRIGGER, "metalware_01", "graphics/screens/26_dessert/location/metalware_01", 400, 466);
    self:CreateObj(OBJ_TYPE.TRIGGER, "teapot", "graphics/screens/26_dessert/location/teapot", 934, 600);
    self:CreateObj(OBJ_TYPE.TRIGGER, "pot", "graphics/screens/26_dessert/location/pot", 499, 311);
    self:CreateObj(OBJ_TYPE.TRIGGER, "metal_bottle", "graphics/screens/26_dessert/location/metal_bottle", 169, 359);
self:CreateObj(OBJ_TYPE.TRIGGER, "bottle_02", "graphics/screens/26_dessert/location/bottle_02", 1349, 771);self:CreateObj(OBJ_TYPE.TRIGGER, "ceramic_pot", "graphics/screens/26_dessert/location/ceramic_pot", 1262, 573);self:CreateObj(OBJ_TYPE.TRIGGER, "bedpan", "graphics/screens/26_dessert/location/bedpan", 1173, 759);self:CreateObj(OBJ_TYPE.TRIGGER, "big_knife", "graphics/screens/26_dessert/location/big_knife", 277, 620);
    
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "honey", "graphics/screens/26_dessert/location/honey_part", 1079, 745);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "candy", "graphics/screens/26_dessert/location/candy_part", 1425, 597);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "icecream", "graphics/screens/26_dessert/location/icecream_part", 1261, 674);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "walnuts", "graphics/screens/26_dessert/location/walnuts_part", 365, 1029);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "cake", "graphics/screens/26_dessert/location/cake_part", 834, 1102); 
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "strawberry", "graphics/screens/26_dessert/location/strawberry_part", 1325, 948);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "cherries", "graphics/screens/26_dessert/location/cherries_part", 1492, 727);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "apple", "graphics/screens/26_dessert/location/apple_part", 501, 824);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "pineapple", "graphics/screens/26_dessert/location/pineapple_part", 369, 650);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "plums", "graphics/screens/26_dessert/location/plums_part", 765, 815);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "banana", "graphics/screens/26_dessert/location/banana_part", 56, 357);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "egg", "graphics/screens/26_dessert/location/egg_part", 914, 970);
    
    
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "crystal_26_part", "graphics/screens/26_dessert/location/crystal_26_part", 780, 364);



    clScreenManager:add_screen("hud") 
end