|
@@ -165,6 +165,7 @@ namespace AtomSampleViewer
|
|
|
entry.m_componentDescriptor = T::CreateDescriptor();
|
|
|
entry.m_parentMenuName = menuName;
|
|
|
entry.m_fullName = entry.m_parentMenuName + '/' + entry.m_sampleName;
|
|
|
+ entry.m_contentWarning = T::ContentWarning;
|
|
|
|
|
|
return entry;
|
|
|
}
|
|
@@ -333,8 +334,6 @@ namespace AtomSampleViewer
|
|
|
m_exampleEntity = aznew AZ::Entity();
|
|
|
|
|
|
m_entityContextId = AzFramework::EntityContextId::CreateNull();
|
|
|
-
|
|
|
- memset(m_alphanumericNumbersDown, 0, s_alphanumericCount);
|
|
|
}
|
|
|
|
|
|
SampleComponentManager::~SampleComponentManager()
|
|
@@ -556,16 +555,6 @@ namespace AtomSampleViewer
|
|
|
{
|
|
|
screenshotRequest = true;
|
|
|
}
|
|
|
-
|
|
|
- for (size_t i = 0; i < m_availableSamples.size(); ++i)
|
|
|
- {
|
|
|
- if (m_alphanumericNumbersDown[i] && i < s_alphanumericCount && m_isSampleSupported[i])
|
|
|
- {
|
|
|
- m_sampleChangeRequest = true;
|
|
|
- m_selectedSampleIndex = static_cast<int32_t>(i);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
// Request a frame capture only once per key press, even if the keys are held down for multiple ticks.
|
|
@@ -705,14 +694,6 @@ namespace AtomSampleViewer
|
|
|
m_escapeDown = true;
|
|
|
}
|
|
|
|
|
|
- for (size_t i = 0; i < samplesAvailableCount; ++i)
|
|
|
- {
|
|
|
- if ((i < s_alphanumericCount) && (inputChannelId == sampleInputMapping[i]))
|
|
|
- {
|
|
|
- m_alphanumericNumbersDown[i] = true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
break;
|
|
|
}
|
|
|
case AzFramework::InputChannel::State::Ended:
|
|
@@ -742,14 +723,6 @@ namespace AtomSampleViewer
|
|
|
m_escapeDown = false;
|
|
|
}
|
|
|
|
|
|
- for (size_t i = 0; i < samplesAvailableCount; ++i)
|
|
|
- {
|
|
|
- if ((i < s_alphanumericCount) && (inputChannelId == sampleInputMapping[i]))
|
|
|
- {
|
|
|
- m_alphanumericNumbersDown[i] = false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
@@ -852,6 +825,7 @@ namespace AtomSampleViewer
|
|
|
|
|
|
m_scriptManager->TickImGui();
|
|
|
|
|
|
+ m_contentWarningDialog.TickPopup();
|
|
|
}
|
|
|
|
|
|
void SampleComponentManager::ShowMenuBar()
|
|
@@ -928,35 +902,37 @@ namespace AtomSampleViewer
|
|
|
SampleEntry& sample = m_availableSamples[index];
|
|
|
const char* sampleName = sample.m_sampleName.c_str();
|
|
|
bool enabled = m_isSampleSupported[index];
|
|
|
- if (index < s_alphanumericCount)
|
|
|
+
|
|
|
+ if (ImGui::MenuItem(sampleName, nullptr, false, enabled))
|
|
|
{
|
|
|
- const AZStd::string hotkeyName = AZStd::string::format("Ctrl-%d: ", (index + 1) % 10);
|
|
|
+ Utils::ReportScriptableAction("OpenSample('%s')", sample.m_sampleName.c_str());
|
|
|
|
|
|
- if (ImGui::MenuItem(sampleName, hotkeyName.c_str(), false, enabled))
|
|
|
+ if (sample.m_contentWarning.empty())
|
|
|
{
|
|
|
- m_selectedSampleIndex = index;
|
|
|
m_sampleChangeRequest = true;
|
|
|
+ m_selectedSampleIndex = index;
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (ImGui::MenuItem(sampleName, nullptr, false, enabled))
|
|
|
+ else
|
|
|
{
|
|
|
- m_selectedSampleIndex = index;
|
|
|
- m_sampleChangeRequest = true;
|
|
|
+ m_contentWarningDialog.OpenPopupConfirmation(
|
|
|
+ "Sample Content Warning",
|
|
|
+ sample.m_contentWarning,
|
|
|
+ [this, index]() {
|
|
|
+ m_sampleChangeRequest = true;
|
|
|
+ m_selectedSampleIndex = index;
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
ImGui::EndMenu();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (m_sampleChangeRequest)
|
|
|
- {
|
|
|
- Utils::ReportScriptableAction("OpenSample('%s')", m_availableSamples[m_selectedSampleIndex].m_sampleName.c_str());
|
|
|
- }
|
|
|
-
|
|
|
ImGui::EndMenu();
|
|
|
}
|
|
|
#ifdef AZ_PROFILE_TELEMETRY
|
|
@@ -972,13 +948,27 @@ namespace AtomSampleViewer
|
|
|
|
|
|
if (ImGui::BeginMenu("Automation"))
|
|
|
{
|
|
|
+ const char* AutomationContentWarningTitle = "Sample Content Warning";
|
|
|
+ const char* AutomationContentWarning = "Running automated scripts will trigger flashing images that could cause seizures or other adverse effects in photosensitive individuals.";
|
|
|
+
|
|
|
if (ImGui::MenuItem("Run Script..."))
|
|
|
{
|
|
|
- m_scriptManager->OpenScriptRunnerDialog();
|
|
|
+ m_contentWarningDialog.OpenPopupConfirmation(
|
|
|
+ AutomationContentWarningTitle,
|
|
|
+ AutomationContentWarning,
|
|
|
+ [this]() {
|
|
|
+ m_scriptManager->OpenScriptRunnerDialog();
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
if (ImGui::MenuItem("Run Precommit Wizard..."))
|
|
|
{
|
|
|
- m_scriptManager->OpenPrecommitWizard();
|
|
|
+ m_contentWarningDialog.OpenPopupConfirmation(
|
|
|
+ AutomationContentWarningTitle,
|
|
|
+ AutomationContentWarning,
|
|
|
+ [this]() {
|
|
|
+ m_scriptManager->OpenPrecommitWizard();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
ImGui::EndMenu();
|