Skip to content

Commit 42e7f33

Browse files
committed
Fix crash on linux version on creating projects
create_dialog_derived.cpp + Fit() to make sure it displays correctly + add correct command to create a project globals.h ~ fix linux using the mac path for loading templates interface_derived.cpp + Fit()
1 parent 478bd7b commit 42e7f33

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

source/create_dialog_derived.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ CreateProjectDialogD::CreateProjectDialogD(wxWindow* parent, const vector<editor
3838

3939
//populate the template chooser
4040
loadTemplates(editors[0]);
41+
42+
this->Fit();
4143
}
4244

4345
/**
@@ -86,7 +88,7 @@ void CreateProjectDialogD::OnCreate(wxCommandEvent& event){
8688
string fullTemplate = "\"" + executableTemplatesPath + templatePrefix + "." + templateName + "\"";
8789
string command = "\"" + executablePath + "\" -createproject " + fullProj + " -cloneFromTemplate " + fullTemplate;
8890
#elif defined __linux__
89-
string command = "";
91+
string command = "\"" + executablePath + "\" -createproject \"" + projPath + dirsep + projName + "\" -cloneFromTemplate \"" + executableTemplatesPath + templatePrefix + "." + templateName + "\"";
9092
#endif
9193
//TODO: return this command to what summoned this dialog
9294
project p = {projName,e.name,"",projPath + dirsep + projName};

source/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ struct editor{
121121
static const string defaultInstall = getpwuid(getuid())->pw_dir +string("/Unity/Hub/Editor");
122122
//TODO: make this a preference?
123123
static const string hubDefault = "/Applications/Unity Hub.app";
124-
static const string templatesDir = "Unity.app/Contents/Resources/PackageManager/ProjectTemplates/";
124+
static const string templatesDir = "Editor/Data/Resources/PackageManager/ProjectTemplates/";
125125

126126
#else
127127
//disalow compilation for unsupported platforms

source/interface_derived.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ MainFrameDerived::MainFrameDerived() : MainFrame(NULL){
8686

8787
//show current version in titlebar
8888
this->SetLabel("Unity Hub Native " + AppVersion);
89+
90+
this->Fit();
8991
}
9092

9193
/**

0 commit comments

Comments
 (0)