Domanda

When I open a cocosbuilder project again after I adding some new directories, it pops up a dialog that says

Too Many Directories

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.

I know it is because there are too many directories.

But I wonder if there is any other method that can solves this problem except removing my new added directories.

Thanks.

È stato utile?

Soluzione

You could always remove the warning directly in CocosBuilder source and rebuilt it, provided that you use the github version.

Otherwise you could petition for the change requested by MK on github.

The offending code is located in CocosBuilderAppDelegate.m, around line ~1155

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

You will have to remove this line in at least two places.

- (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;
}

Update:

In CocosBuilder/ccBuilder/ResourceManager.h

There is a marco defined as below:

#define kCCBMaxTrackedDirectories 50

So we can simply change 50 to a larger number, and the problem can be solved.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top