Refactor settings types to use scripting API
This commit is contained in:
@@ -5,14 +5,13 @@
|
||||
#include "Engine/Core/Config/Settings.h"
|
||||
#include "Engine/Serialization/JsonTools.h"
|
||||
#include "VirtualInput.h"
|
||||
#include "Input.h"
|
||||
|
||||
/// <summary>
|
||||
/// Input settings container.
|
||||
/// </summary>
|
||||
/// <seealso cref="SettingsBase{InputSettings}" />
|
||||
class InputSettings : public SettingsBase<InputSettings>
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API InputSettings : public SettingsBase
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(InputSettings);
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
@@ -27,19 +26,14 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
// [SettingsBase]
|
||||
void Apply() override
|
||||
{
|
||||
Input::ActionMappings = ActionMappings;
|
||||
Input::AxisMappings = AxisMappings;
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the instance of the settings asset (default value if missing). Object returned by this method is always loaded with valid data to use.
|
||||
/// </summary>
|
||||
static InputSettings* Get();
|
||||
|
||||
// [SettingsBase]
|
||||
void Apply() override;
|
||||
|
||||
void RestoreDefault() override
|
||||
{
|
||||
ActionMappings.Resize(0);
|
||||
AxisMappings.Resize(0);
|
||||
}
|
||||
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) final override
|
||||
{
|
||||
const auto actionMappings = stream.FindMember("ActionMappings");
|
||||
|
||||
Reference in New Issue
Block a user