Files
o3de/Code/Sandbox/Editor/PreferencesStdPages.cpp
T
amzn-hdoke bf29b27937 Add AWSAttribution feature (#1164)
* LYN-3601: Provide skeleton classes for AWS Attribution (#31)

Provide skeleton classes for AWS Attribution, along with some basic unit tests

* Add AWS Attribution UI and settings (#56)

* Adding AWS Attributions UX and corresponding editor preference s setting

* Fix serialized field description

* Fixed update frequency to be  a day

* Handling editor startup with default values for AWSAttribution

* Add missing header and remove AWSCoreSystemComponentMock fron test

* Generate and post AWSAttribution metric (#69)

* Adding AWS Attribution Api service job

* Adding support for config endpoint override

* Update Api endpoint formatting, fix default region

* Remove extra header

* Fixes for link issues

* Fix Unittest namespace

* Instantiating AWSAttributionSystemComponent in AWS.Editor module

* Update AttributionMetric with engine version and AWS enabled gems (#77)

* Update AttributionMetric with engine version and AWS enabled gems

* Fix warnings

* Undoing accidental change

* Saving level PrefabLevel_OpensLevelWithEntities

* Remove overriding editorprefrences.setreg

* Revert "Saving level PrefabLevel_OpensLevelWithEntities"

This reverts commit 529af70c55ece70fc6bc29ceb83bef60413713a3.

* Move AWS preferences to its own temp settings file

* Undo accidental file add

* Add missing string params in warning messages

Co-authored-by: Pip Potter <61438964+lmbr-pip@users.noreply.github.com>
2021-06-04 20:48:35 -07:00

104 lines
3.3 KiB
C++

/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#include "EditorDefs.h"
#include "PreferencesStdPages.h"
#include <AzToolsFramework/Entity/EditorEntityHelpers.h>
// Editor
#include "EditorPreferencesPageGeneral.h"
#include "EditorPreferencesPageFiles.h"
#include "EditorPreferencesPageViewportGeneral.h"
#include "EditorPreferencesPageViewportGizmo.h"
#include "EditorPreferencesPageViewportMovement.h"
#include "EditorPreferencesPageViewportDebug.h"
#include "EditorPreferencesPageExperimentalLighting.h"
#include "EditorPreferencesPageAWS.h"
//////////////////////////////////////////////////////////////////////////
// Implementation of ClassDesc for standard Editor preferences.
//////////////////////////////////////////////////////////////////////////
CStdPreferencesClassDesc::CStdPreferencesClassDesc()
: m_refCount(0)
{
m_pageCreators = {
[](){ return new CEditorPreferencesPage_General(); },
[](){ return new CEditorPreferencesPage_Files(); },
[](){ return new CEditorPreferencesPage_ViewportGeneral(); },
[](){ return new CEditorPreferencesPage_ViewportMovement(); },
[](){ return new CEditorPreferencesPage_ViewportGizmo(); },
[](){ return new CEditorPreferencesPage_ViewportDebug(); }
};
m_pageCreators.push_back([]() { return new CEditorPreferencesPage_ExperimentalLighting(); });
if (AzToolsFramework::IsComponentWithServiceRegistered(AZ_CRC_CE("AWSCoreEditorService")))
{
m_pageCreators.push_back([]() { return new CEditorPreferencesPage_AWS(); });
}
}
HRESULT CStdPreferencesClassDesc::QueryInterface(const IID& riid, void** ppvObj)
{
if (riid == __uuidof(IPreferencesPageCreator))
{
*ppvObj = (IPreferencesPageCreator*)this;
return S_OK;
}
return E_NOINTERFACE;
}
//////////////////////////////////////////////////////////////////////////
ULONG CStdPreferencesClassDesc::AddRef()
{
m_refCount++;
return m_refCount;
};
//////////////////////////////////////////////////////////////////////////
ULONG CStdPreferencesClassDesc::Release()
{
ULONG refs = --m_refCount;
if (m_refCount <= 0)
{
delete this;
}
return refs;
}
//////////////////////////////////////////////////////////////////////////
REFGUID CStdPreferencesClassDesc::ClassID()
{
// {95FE3251-796C-4e3b-82F0-AD35F7FFA267}
static const GUID guid = {
0x95fe3251, 0x796c, 0x4e3b, { 0x82, 0xf0, 0xad, 0x35, 0xf7, 0xff, 0xa2, 0x67 }
};
return guid;
}
//////////////////////////////////////////////////////////////////////////
int CStdPreferencesClassDesc::GetPagesCount()
{
return m_pageCreators.size();
}
IPreferencesPage* CStdPreferencesClassDesc::CreateEditorPreferencesPage(int index)
{
return (index >= m_pageCreators.size()) ? nullptr : m_pageCreators[index]();
}