0

当我添加一些新目录后再次打开 cocosbuilder 项目时,它会弹出一个对话框,上面写着

目录太多

您已经创建或打开了一个项目,该项目位于具有很多子目录的目录中。请将您的项目文件与您在项目中使用的资源一起保存在一个目录中。

我知道这是因为目录太多。

但我想知道除了删除我新添加的目录之外,是否还有其他方法可以解决这个问题。

谢谢。

4

1 回答 1

2

只要你使用 github 版本,你总是可以直接在 CocosBuilder 源代码中删除警告并重新构建它。

否则,您可以在 github 上请求 MK 请求的更改。

违规代码位于CocosBuilderAppDelegate.m~1155 行附近

[[CocosBuilderAppDelegate appDelegate] modalDialogTitle:@"Too Many [...]

您必须至少在两个地方删除这条线。

- (void) checkForTooManyDirectoriesInCurrentDoc
{
    if (!currentDocument) return;

    if ([ResourceManager sharedManager].tooManyDirectoriesAdded)
    {
        // Close document if it has too many sub directories
        NSTabViewItem* item = [self tabViewItemFromDoc:currentDocument];
        [tabView removeTabViewItem:item];

        [ResourceManager sharedManager].tooManyDirectoriesAdded = NO;

        // Notify the user
        [[CocosBuilderAppDelegate appDelegate] modalDialogTitle:@"Too Many Directories" message:@"You have created or opened a file which is in a directory with very many sub directories. Please save your ccb-files in a directory together with the resources you use in your project."];
    }
}

- (BOOL) checkForTooManyDirectoriesInCurrentProject
{
    if (!projectSettings) return NO;

    if ([ResourceManager sharedManager].tooManyDirectoriesAdded)
    {
        [self closeProject];

        [ResourceManager sharedManager].tooManyDirectoriesAdded = NO;

        // Notify the user
        [[CocosBuilderAppDelegate appDelegate] modalDialogTitle:@"Too Many Directories" message:@"You have created or opened a project which is in a directory with very many sub directories. Please save your project-files in a directory together with the resources you use in your project."];
        return NO;
    }
    return YES;
}

更新:

CocosBuilder/ccBuilder/ResourceManager.h

有一个marco定义如下:

#define kCCBMaxTrackedDirectories 50

所以我们可以简单地改成50更大的数字,问题就可以解决了。

于 2013-04-09T13:27:22.073 回答