Giter Site home page Giter Site logo

Comments (5)

dualface avatar dualface commented on June 6, 2024

I make some changes now, please wait a moment.

YuLei Liao (dualface)
qeeplay.com

在 2013-2-10,18:46,Gaël Gillard [email protected] 写道:

Why I try to open a projet in the meny (as cmd + o), the window to select a folder doesn't open.


Reply to this email directly or view it on GitHub..

from quick-cocos2d-x.

Swatto avatar Swatto commented on June 6, 2024

Ok great ! Thanks for your investment and your reaction to respond 👍

from quick-cocos2d-x.

dualface avatar dualface commented on June 6, 2024

FIXED.

Please checkout README.md, add Xcode source trees: QUICK_COCOS2DX_ROOT

from quick-cocos2d-x.

Swatto avatar Swatto commented on June 6, 2024

The bin and the xcode project after build doesn't open the window to select a folder doesn't open for me.

I juste see a CCLOG for that action in your code in AppController.mm :

-(IBAction) openWorkingDirectory:(id)sender
{
    CCLOG("openWorkdingDirectory");
}

I don't know how you can do the script to rerun the initialize but here's the code that you can use to know if the selection of the user is a directory or not and get the path :

-(IBAction) openWorkingDirectory:(id)sender
{
    CCLOG("openWorkdingDirectory");
    NSOpenPanel* panel = [NSOpenPanel openPanel];
    [panel setCanChooseDirectories:YES];
    [panel setCanCreateDirectories:YES];
    [panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result){
        if (result == NSFileHandlingPanelOKButton) {
            NSArray* urls = [panel URLs];
            for (NSURL *url in urls) {
                // First, check if the URL is a file URL, as opposed to a web address, etc.
                if (url.isFileURL) {
                    BOOL isDir = NO;
                    // Verify that the file exists
                    // and is indeed a directory (isDirectory is an out parameter)
                    if ([[NSFileManager defaultManager] fileExistsAtPath: url.path isDirectory: &isDir]
                        && isDir) {
                        // Here you can be certain the url exists and is a directory
                        // Create the code to rerun the initialize with that path
                        CCLOG("the path is a directory");
                    }
                }
            }
        }
    }];
}

from quick-cocos2d-x.

 avatar commented on June 6, 2024

@Swatto You can set the ivar " workingDir" to the url.path and run restart from the app

from quick-cocos2d-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.