Exemplo n.º 1
0
void startDialog::on_ScriptEdit_clicked()
{
	EditorFrame *pMain = new EditorFrame();
	pMain->setHostWidget(this);
	pMain->setAttribute(Qt::WA_DeleteOnClose, true);

	if (!loadDataBase()) {
		nd_logerror("load database error\n");
	}

	std::string defProj = getPathFromConfig("script_root");

	if (!defProj.empty() && pMain->myInit(defProj.c_str() )) {
		this->setVisible(false);
		pMain->showMaximized();
	}
	else {
		delete pMain;
	}

}
Exemplo n.º 2
0
bool startDialog::showScriptError(const char *scriptFile, const char *nodeDescript, const char *editorWorkingPath)
{
	nd_chdir(editorWorkingPath);

	EditorFrame *pMain = new EditorFrame();
	pMain->setHostWidget(this);
	pMain->setAttribute(Qt::WA_DeleteOnClose, true);
	
	if (pMain->myInit()) {
		this->setVisible(false);

		if (!pMain->showRuntimeError(scriptFile, nodeDescript)) {
			return false;
		}
		pMain->showMaximized();
	}
	else {
		delete pMain;
		return false;
	}
	return true;
}
Exemplo n.º 3
0
int runEditor(int argc,  char *argv[])
{
	QApplication a(argc, argv);
	//workingConfigInit();
	initWorkingPath() ;

	if (__in_proj_path) {
		nd_chdir(__in_proj_path);
	}
	//load dbl data
// 	const char *package_file = apoEditorSetting::getInstant()->getValueFromSetting("game_data_package_file");
// 	if (package_file) {
// 		DBLDatabase::get_Instant()->LoadBinStream(package_file);
// 	}

	EditorFrame mainFrame;
	if (!mainFrame.myInit()) {
		QMessageBox::critical(NULL, "Error", "init setting error!");
		exit(1);
	}
	mainFrame.showMaximized();
	return a.exec();

}