打开CocosBuilder项目时,目录太多

时间:2013-04-08 11:32:13

标签: cocosbuilder

当我添加一些新目录后再次打开cocosbuilder项目时,会弹出一个对话框,显示

  

目录太多

     

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

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

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

感谢。

1 个答案:

答案 0 :(得分:2)

如果使用github版本,您可以直接在CocosBuilder源代码中删除警告并重建它。

否则你可以在github上请求更改requested by 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更改为更大的数字,就可以解决问题。

相关问题