Removed deprecated graphics settings/performance menu options. Updated automated test accordingly.
Signed-off-by: Chris Galvan <chgalvan@amazon.com>monroegm-disable-blank-issue-2
parent
e7b44b7d6b
commit
2fc1062802
File diff suppressed because it is too large
Load Diff
@ -1,284 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <QDialog>
|
||||
#include <QTreeView>
|
||||
#include <QStandardItemModel>
|
||||
#include <QHeaderView>
|
||||
|
||||
#include <AzQtComponents/Components/Widgets/SpinBox.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <AzCore/std/any.h>
|
||||
|
||||
#include <ISystem.h>
|
||||
#endif
|
||||
|
||||
class QGridLayout;
|
||||
class QLabel;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class GraphicsSettingsDialog;
|
||||
}
|
||||
|
||||
// Description:
|
||||
// Status of cvar for a specifc platform and spec level
|
||||
// editedValue - current setting within Graphics Settings Dialog box
|
||||
// overwrittenValue - original setting from platform config file (set to originalValue if not found)
|
||||
// originalValue - original settings from sys_spec config file index
|
||||
|
||||
struct CVarFileStatus
|
||||
{
|
||||
AZStd::any editedValue;
|
||||
AZStd::any overwrittenValue;
|
||||
AZStd::any originalValue;
|
||||
CVarFileStatus(AZStd::any edit, AZStd::any over, AZStd::any orig) : editedValue(edit), overwrittenValue(over), originalValue(orig) {}
|
||||
};
|
||||
|
||||
// Description:
|
||||
// Status of specific cvar for Editor mapping
|
||||
// type - CVAR_INT / CVAR_FLOAT / CVAR_STRING
|
||||
// cvarGroup - source of cvar (sys_spec_particles, sys_spec_physics, etc.) or "miscellaneous" if only specified in platform config file
|
||||
// fileVals = CVarFileStatus for each spec level of a specific platform
|
||||
|
||||
struct CVarInfo
|
||||
{
|
||||
int type;
|
||||
AZStd::string cvarGroup;
|
||||
AZStd::vector<CVarFileStatus> fileVals;
|
||||
};
|
||||
|
||||
enum class GraphicsSettings
|
||||
{
|
||||
GameEffects,
|
||||
Light,
|
||||
ObjectDetail,
|
||||
Particles,
|
||||
Physics,
|
||||
PostProcessing,
|
||||
Quality,
|
||||
Shading,
|
||||
Shadows,
|
||||
Sound,
|
||||
Texture,
|
||||
TextureResolution,
|
||||
VolumetricEffects,
|
||||
Water,
|
||||
Miscellaneous,
|
||||
numSettings
|
||||
};
|
||||
|
||||
class GraphicsSettingsHeaderView;
|
||||
|
||||
class GraphicsSettingsTreeView
|
||||
: public QTreeView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GraphicsSettingsTreeView(QWidget* parent = nullptr);
|
||||
|
||||
};
|
||||
|
||||
class GraphicsSettingsModel
|
||||
: public QStandardItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GraphicsSettingsModel(QObject* parent = 0);
|
||||
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||
};
|
||||
|
||||
class GraphicsSettingsDialog
|
||||
: public QDialog,
|
||||
public ILoadConfigurationEntrySink
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
explicit GraphicsSettingsDialog(QWidget* parent = nullptr);
|
||||
virtual ~GraphicsSettingsDialog();
|
||||
|
||||
bool IsCustom(void) { return m_showCustomSpec; }
|
||||
void UnloadCustomSpec(int specLevel);
|
||||
|
||||
// ILoadConfigurationEntrySink
|
||||
void OnLoadConfigurationEntry(const char* szKey, const char* szValue, const char* szGroup) override;
|
||||
|
||||
public slots:
|
||||
//Accept and reject
|
||||
void reject() override;
|
||||
void accept() override;
|
||||
|
||||
private slots:
|
||||
//Update UIs
|
||||
void PlatformChanged(const QString& platform);
|
||||
bool CVarChanged(AZStd::any val, const char* cvarName, int specLevel);
|
||||
void CVarChanged(int i);
|
||||
void CVarChanged(double d);
|
||||
void CVarChanged(const QString& s);
|
||||
|
||||
private:
|
||||
|
||||
// The struct ParameterWidget is used to store the parameter widget
|
||||
// m_parameterName will be the name of the parameter the widget represent.
|
||||
struct ParameterWidget
|
||||
{
|
||||
ParameterWidget(QWidget* widget, QString parameterName = "");
|
||||
|
||||
QString GetToolTip() const;
|
||||
|
||||
const char* PARAMETER_TOOLTIP = "The variable will update render parameter \"%1\".";
|
||||
QWidget* m_widget;
|
||||
QString m_parameterName;
|
||||
};
|
||||
|
||||
struct CollapseGroup
|
||||
{
|
||||
QString m_groupName;
|
||||
QStandardItem* m_groupRow;
|
||||
QTreeView* m_treeView;
|
||||
bool m_isCollapsed;
|
||||
|
||||
CollapseGroup(QTreeView* treeView);
|
||||
|
||||
void ToggleCollapsed();
|
||||
};
|
||||
|
||||
void OpenCustomSpecDialog();
|
||||
void ApplyCustomSpec(const QString& customFilePath);
|
||||
bool IsCustomSpecAlreadyLoaded(const AZStd::string& filename) const;
|
||||
void SetSettingsTree(int numColumns);
|
||||
void SetCollapsed(const QModelIndex& index, bool flag);
|
||||
|
||||
enum CVarStateComparison
|
||||
{
|
||||
EDITED_OVERWRITTEN_COMPARE = 1,
|
||||
EDITED_ORIGINAL_COMPARE = 2,
|
||||
OVERWRITTEN_ORIGINAL_COMPARE = 3,
|
||||
|
||||
END_CVARSTATE_COMPARE,
|
||||
};
|
||||
|
||||
bool CheckCVarStatesForDiff(AZStd::pair<AZStd::string, CVarInfo>* it, int cfgFileIndex, CVarStateComparison cmp);
|
||||
|
||||
// Save out settings into project-level cfg files
|
||||
void SaveSystemSettings();
|
||||
|
||||
// Load in project-level cfg files for current platform
|
||||
void LoadPlatformConfigurations();
|
||||
// Build UI column for spec level of current platform
|
||||
void BuildColumn(int specLevel);
|
||||
// Initial UI building
|
||||
void BuildUI();
|
||||
// Cleaning out UI before loading new platform information
|
||||
void CleanUI();
|
||||
// Shows/hides custom spec option
|
||||
void ShowCustomSpecOption(bool show);
|
||||
// Shows/hides category labels and dropdowns
|
||||
void ShowCategories(bool show);
|
||||
// Warns about unsaved changes (returns true if accepted)
|
||||
bool SendUnsavedChangesWarning(bool cancel);
|
||||
|
||||
void LoadCVarGroupDirectory(const AZStd::string& path);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// UI help functions
|
||||
|
||||
// Setup collapsed buttons
|
||||
void SetCollapsedLayout(const QString& groupName, QStandardItem* groupItem);
|
||||
// Sets the platform entry index for the given platform
|
||||
void SetPlatformEntry(ESystemConfigPlatform platform);
|
||||
// Gets the platform enum given the platform name
|
||||
ESystemConfigPlatform GetConfigPlatformFromName(const AZStd::string& platformName);
|
||||
|
||||
////////////////////////////////////////////
|
||||
// Members
|
||||
|
||||
// Qt values
|
||||
const int INPUT_MIN_WIDTH = 100;
|
||||
const int INPUT_MIN_HEIGHT = 20;
|
||||
const int INPUT_ROW_SPAN = 1;
|
||||
const int INPUT_COLUMN_SPAN = 1;
|
||||
const int CVAR_ROW_OFFSET = 2;
|
||||
const int CVAR_VALUE_COLUMN_OFFSET = 1;
|
||||
const int PLATFORM_LABEL_ROW = 1;
|
||||
const int CVAR_LABEL_COLUMN = 1;
|
||||
|
||||
// Tool tips
|
||||
const QString SETTINGS_FILE_PATH = "Config/spec/";
|
||||
const char* CFG_FILEFILTER = "Cfg File(*.cfg);;All files(*)";
|
||||
|
||||
const int m_numSpecLevels = 4;
|
||||
|
||||
bool m_showCustomSpec;
|
||||
bool m_showCategories;
|
||||
GraphicsSettingsModel* m_graphicsSettingsModel;
|
||||
GraphicsSettingsHeaderView* m_headerView;
|
||||
int m_numColumns{ 0 };
|
||||
|
||||
const char* m_cvarGroupsFolder = "Config/CVarGroups";
|
||||
|
||||
QScopedPointer<Ui::GraphicsSettingsDialog> m_ui;
|
||||
|
||||
QVector<CollapseGroup*> m_uiCollapseGroup;
|
||||
|
||||
QVector<ParameterWidget*> m_parameterWidgets;
|
||||
|
||||
AZStd::string m_currentConfigFilename;
|
||||
size_t m_currentSpecIndex;
|
||||
|
||||
// cvar name --> pair(type, CVarStatus for each file)
|
||||
AZStd::unordered_map<AZStd::string, CVarInfo> m_cVarTracker;
|
||||
|
||||
AZStd::unordered_map<ESystemConfigPlatform, AZStd::vector<AZStd::string> > m_cfgFiles;
|
||||
|
||||
AZStd::vector<AZStd::pair<AZStd::string, ESystemConfigPlatform> > m_platformStrings;
|
||||
|
||||
struct CVarGroupInfo
|
||||
{
|
||||
QVector<QLabel*> m_platformLabels;
|
||||
QVector<QLabel*> m_cvarLabels;
|
||||
QVector<AzQtComponents::SpinBox*> m_cvarSpinBoxes;
|
||||
QVector<AzQtComponents::DoubleSpinBox*> m_cvarDoubleSpinBoxes;
|
||||
QVector<QLineEdit*> m_cvarLineEdits;
|
||||
QVector<QToolButton*> m_specFileArea;
|
||||
QVector<QWidget*> m_widgetInsertOrder;
|
||||
QStandardItem* m_treeRowItem;
|
||||
int m_currentRow;
|
||||
};
|
||||
|
||||
AZStd::unordered_map<AZStd::string, CVarGroupInfo> m_cvarGroupData;
|
||||
AZStd::vector<AZStd::string> m_cvarGroupOrder;
|
||||
|
||||
ESystemConfigPlatform m_currentPlatform;
|
||||
|
||||
int m_dirtyCVarCount;
|
||||
};
|
||||
|
||||
class GraphicsSettingsHeaderView
|
||||
: public QHeaderView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GraphicsSettingsHeaderView(GraphicsSettingsDialog* dialog, Qt::Orientation orientation, QWidget* parent = nullptr);
|
||||
|
||||
private:
|
||||
bool event(QEvent* e) override;
|
||||
void mouseMoveEvent(QMouseEvent* e) override;
|
||||
void mouseReleaseEvent(QMouseEvent* e) override;
|
||||
|
||||
GraphicsSettingsDialog* m_dialog;
|
||||
int m_index{ -1 };
|
||||
};
|
||||
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#GraphicsSettingsDialog QHeaderView::section
|
||||
{
|
||||
background: #2D2D2D;
|
||||
}
|
||||
|
||||
#GraphicsSettingsDialog QHeaderView::down-arrow
|
||||
{
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
image: url(:/Gallery/Delete.svg);
|
||||
}
|
||||
|
||||
#GraphicsSettingsDialog QHeaderView::up-arrow
|
||||
{
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
image: url(:/Gallery/Delete.svg);
|
||||
}
|
||||
@ -1,270 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>GraphicsSettingsDialog</class>
|
||||
<widget class="QDialog" name="GraphicsSettingsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1292</width>
|
||||
<height>565</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>400</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Graphics Settings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QGridLayout" name="m_generalLayout">
|
||||
<property name="horizontalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="3">
|
||||
<widget class="QWidget" name="m_platform" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QComboBox" name="m_platformEntry"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="m_selectCustomSpecButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add Resource</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="m_platformLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Platform</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="Line" name="m_lineSpacer">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>13</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="m_scrollArea">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="m_scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1272</width>
|
||||
<height>452</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="GraphicsSettingsTreeView" name="m_graphicsSettingsTreeView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="indentation">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="m_horizontalLayout">
|
||||
<item>
|
||||
<spacer name="m_horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="m_applyButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(233, 118, 17);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="m_cancelButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>line</zorder>
|
||||
<zorder>m_scrollArea</zorder>
|
||||
<zorder>line_2</zorder>
|
||||
<zorder>widget</zorder>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>GraphicsSettingsTreeView</class>
|
||||
<extends>QTreeView</extends>
|
||||
<header>GraphicsSettingsDialog.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>m_cancelButton</tabstop>
|
||||
<tabstop>m_applyButton</tabstop>
|
||||
<tabstop>m_scrollArea</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Loading…
Reference in New Issue