void VisibilityToolPanel::SaveTexture() { FilePath currentPath = FileSystem::Instance()->GetUserDocumentsPath(); QString filePath = QtFileDialog::getSaveFileName(NULL, QString(ResourceEditor::VISIBILITY_TOOL_SAVE_CAPTION.c_str()), QString(currentPath.GetAbsolutePathname().c_str()), QString(ResourceEditor::VISIBILITY_TOOL_FILE_FILTER.c_str())); FilePath selectedPathname = PathnameToDAVAStyle(filePath); if(!selectedPathname.IsEmpty()) { GetActiveScene()->visibilityToolSystem->SaveTexture(selectedPathname); } }
void CommandSaveTextureVisibilityTool::Execute() { String currentPath = FileSystem::Instance()->GetUserDocumentsPath(); QString filePath = QFileDialog::getSaveFileName(NULL, QString("Save texture"), QString(currentPath.c_str()), QString("PNG image (*.png)")); String selectedPathname = PathnameToDAVAStyle(filePath); if(selectedPathname.length() > 0) { SceneEditorScreenMain *screen = dynamic_cast<SceneEditorScreenMain *>(UIScreenManager::Instance()->GetScreen()); if(screen) { screen->VisibilityToolSaveTexture(selectedPathname); } } }
void CommandSaveTextureCustomColors::Execute() { SceneEditorScreenMain *screen = dynamic_cast<SceneEditorScreenMain *>(UIScreenManager::Instance()->GetScreen()); if(!screen) return; FilePath selectedPathname = screen->CustomColorsGetCurrentSaveFileName(); if(selectedPathname.IsEmpty()) { selectedPathname = SceneDataManager::Instance()->SceneGetActive()->GetScenePathname().GetDirectory(); } QString filePath = QFileDialog::getSaveFileName(NULL, QString("Save texture"), QString(selectedPathname.GetAbsolutePathname().c_str()), QString("PNG image (*.png)")); selectedPathname = PathnameToDAVAStyle(filePath); if(!selectedPathname.IsEmpty()) screen->CustomColorsSaveTexture(selectedPathname); }