function GameScreen:InitScreen()
    self:LoadScreen()
    
    self.disable = false;
    
    self:FadeOut();
end

function GameScreen:OnKeyDown(key)
    if(key == VK_ESCAPE and clApplication.curret_win.name == self.name) then
        self:OnClick("delete_player_cancel")
    end
    if(key == VK_ENTER and clApplication.curret_win.name == self.name) then
        self:OnClick("delete_player_ok")
    end
end

function GameScreen:OnClick(item_name)
    if(self.disable) then return end

    if("delete_player_cancel" == item_name) then
        SoundPlay("sound/interface/button.ogg")
        self.disable = true;
        self:FadeIn(0.5);
        if(self.end_fun) then self:end_fun() end
        
        DelayedExec(0.7, function() 
            clScreenManager:remove_screen(self); 
        end)
    elseif("delete_player_ok" == item_name)then
        SoundPlay("sound/interface/button.ogg")
        self.disable = true;
        cpp_remove_player(cpp_get_cur_player());
        self:FadeIn(0.5);
        if(self.end_fun) then self:end_fun() end
        
        DelayedExec(0.7, function() 
            clScreenManager:remove_screen(self); 
        end)
    end
end

function GameScreen:LoadScreen()
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "quit_back_trigger", "graphics/trigger", 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
    ItemSetOpacity("quit_back_trigger", 0.85)
    
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "quit", "graphics/interface/menu/delete_player", 267, 456);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "delete_player_cancel", "graphics/interface/menu/cancel", 286, 738);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "delete_player_ok", "graphics/interface/menu/ok", 802, 732);
end
