Merge pull request #6250 from BytesOfPiDev/issue6198
Prevent some slice-related commands from being enabled when the slice…
This commit is contained in:
@@ -104,6 +104,11 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
// Currently (December 13, 2021), this function is only used by slice editor code.
|
||||
// When the slice editor is not enabled, there are no references to the
|
||||
// HideActionWhileEntitiesDeselected function, causing a compiler warning and
|
||||
// subsequently a build error.
|
||||
#ifdef ENABLE_SLICE_EDITOR
|
||||
void HideActionWhileEntitiesDeselected(QAction* action, EEditorNotifyEvent editorNotifyEvent)
|
||||
{
|
||||
if (action == nullptr)
|
||||
@@ -127,6 +132,7 @@ namespace
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void DisableActionWhileInSimMode(QAction* action, EEditorNotifyEvent editorNotifyEvent)
|
||||
{
|
||||
@@ -374,7 +380,6 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu()
|
||||
{
|
||||
DisableActionWhileLevelChanges(fileOpenSlice, e);
|
||||
}));
|
||||
#endif
|
||||
|
||||
// Save Selected Slice
|
||||
auto saveSelectedSlice = fileMenu.AddAction(ID_FILE_SAVE_SELECTED_SLICE);
|
||||
@@ -391,7 +396,7 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu()
|
||||
{
|
||||
HideActionWhileEntitiesDeselected(saveSliceToRoot, e);
|
||||
}));
|
||||
|
||||
#endif
|
||||
// Open Recent
|
||||
m_mostRecentLevelsMenu = fileMenu.AddMenu(tr("Open Recent"));
|
||||
connect(m_mostRecentLevelsMenu, &QMenu::aboutToShow, this, &LevelEditorMenuHandler::UpdateMRUFiles);
|
||||
@@ -439,9 +444,10 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu()
|
||||
// Show Log File
|
||||
fileMenu.AddAction(ID_FILE_EDITLOGFILE);
|
||||
|
||||
#ifdef ENABLE_SLICE_EDITOR
|
||||
fileMenu.AddSeparator();
|
||||
|
||||
fileMenu.AddAction(ID_FILE_RESAVESLICES);
|
||||
#endif
|
||||
|
||||
fileMenu.AddSeparator();
|
||||
|
||||
|
||||
@@ -380,13 +380,13 @@ void CCryEditApp::RegisterActionHandlers()
|
||||
ON_COMMAND(ID_IMPORT_ASSET, OnOpenAssetImporter)
|
||||
ON_COMMAND(ID_EDIT_LEVELDATA, OnEditLevelData)
|
||||
ON_COMMAND(ID_FILE_EDITLOGFILE, OnFileEditLogFile)
|
||||
ON_COMMAND(ID_FILE_RESAVESLICES, OnFileResaveSlices)
|
||||
ON_COMMAND(ID_FILE_EDITEDITORINI, OnFileEditEditorini)
|
||||
ON_COMMAND(ID_PREFERENCES, OnPreferences)
|
||||
ON_COMMAND(ID_REDO, OnRedo)
|
||||
ON_COMMAND(ID_TOOLBAR_WIDGET_REDO, OnRedo)
|
||||
ON_COMMAND(ID_FILE_OPEN_LEVEL, OnOpenLevel)
|
||||
#ifdef ENABLE_SLICE_EDITOR
|
||||
ON_COMMAND(ID_FILE_RESAVESLICES, OnFileResaveSlices)
|
||||
ON_COMMAND(ID_FILE_NEW_SLICE, OnCreateSlice)
|
||||
ON_COMMAND(ID_FILE_OPEN_SLICE, OnOpenSlice)
|
||||
#endif
|
||||
@@ -2629,6 +2629,7 @@ void CCryEditApp::OnFileEditLogFile()
|
||||
CFileUtil::EditTextFile(CLogFile::GetLogFileName(), 0, IFileUtil::FILE_TYPE_SCRIPT);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_SLICE_EDITOR
|
||||
void CCryEditApp::OnFileResaveSlices()
|
||||
{
|
||||
AZStd::vector<AZ::Data::AssetInfo> sliceAssetInfos;
|
||||
@@ -2759,6 +2760,7 @@ void CCryEditApp::OnFileResaveSlices()
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnFileEditEditorini()
|
||||
|
||||
@@ -643,11 +643,11 @@ void MainWindow::InitActions()
|
||||
.SetStatusTip(tr("Create a new slice"));
|
||||
am->AddAction(ID_FILE_OPEN_SLICE, tr("Open Slice..."))
|
||||
.SetStatusTip(tr("Open an existing slice"));
|
||||
#endif
|
||||
am->AddAction(ID_FILE_SAVE_SELECTED_SLICE, tr("Save selected slice")).SetShortcut(tr("Alt+S"))
|
||||
.SetStatusTip(tr("Save the selected slice to the first level root"));
|
||||
am->AddAction(ID_FILE_SAVE_SLICE_TO_ROOT, tr("Save Slice to root")).SetShortcut(tr("Ctrl+Alt+S"))
|
||||
.SetStatusTip(tr("Save the selected slice to the top level root"));
|
||||
#endif
|
||||
am->AddAction(ID_FILE_SAVE_LEVEL, tr("&Save"))
|
||||
.SetShortcut(tr("Ctrl+S"))
|
||||
.SetReserved()
|
||||
@@ -677,7 +677,9 @@ void MainWindow::InitActions()
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateSelected);
|
||||
am->AddAction(ID_FILE_EXPORTOCCLUSIONMESH, tr("Export Occlusion Mesh"));
|
||||
am->AddAction(ID_FILE_EDITLOGFILE, tr("Show Log File"));
|
||||
#ifdef ENABLE_SLICE_EDITOR
|
||||
am->AddAction(ID_FILE_RESAVESLICES, tr("Resave All Slices"));
|
||||
#endif
|
||||
am->AddAction(ID_FILE_PROJECT_MANAGER_SETTINGS, tr("Edit Project Settings..."));
|
||||
am->AddAction(ID_FILE_PROJECT_MANAGER_NEW, tr("New Project..."));
|
||||
am->AddAction(ID_FILE_PROJECT_MANAGER_OPEN, tr("Open Project..."));
|
||||
|
||||
Reference in New Issue
Block a user