Files
UnrealEngineUWP/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_Settings.h
ben marsh 7c46cc6b4c Integrating live coding feature (aka Live++) into UE4.
Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.

Changes vs standalone Live++ version:

* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.

Known issues:

* Does not currently support class layout changes / object reinstancing

#rb none
[FYI] Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira

#ROBOMERGE-OWNER: ryan.gerleve
#ROBOMERGE-AUTHOR: ben.marsh
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/... via CL 5309051
#ROBOMERGE-BOT: ENGINE (Main -> Dev-Networking)

[CL 5326306 by ben marsh in Dev-Networking branch]
2019-03-06 18:19:24 -05:00

176 lines
3.9 KiB
C++

// Copyright 2011-2019 Molecular Matters GmbH, all rights reserved.
#pragma once
#include "CoreTypes.h"
#include "LC_Types.h"
#include "LC_Platform.h"
namespace settings
{
unsigned int GetLoadedUserSettingsCount(void);
unsigned int GetLoadedProjectSettingsCount(void);
}
// base
class Setting
{
public:
struct Type
{
enum Enum
{
BOOLEAN,
INTEGER,
INTEGER_PROXY,
STRING,
SHORTCUT
};
};
explicit Setting(Type::Enum type);
LC_DISABLE_COPY(Setting);
LC_DISABLE_ASSIGNMENT(Setting);
Type::Enum GetType(void) const;
private:
const Type::Enum m_type;
};
// real settings
class SettingBool : public Setting
{
public:
SettingBool(const wchar_t* group, const wchar_t* name, const wchar_t* shortDescription, const wchar_t* description, bool initialValue);
LC_DISABLE_COPY(SettingBool);
LC_DISABLE_ASSIGNMENT(SettingBool);
void SetValue(bool value);
void SetValueWithoutSaving(bool value);
const wchar_t* GetName(void) const;
const wchar_t* GetShortDescription(void) const;
const wchar_t* GetDescription(void) const;
bool GetValue(void) const;
bool GetPreviousValue(void) const;
bool GetInitialValue(void) const;
private:
const wchar_t* m_group;
const wchar_t* m_name;
const wchar_t* m_shortDescription;
const wchar_t* m_description;
bool m_value;
bool m_previousValue;
bool m_initialValue;
};
class SettingInt : public Setting
{
public:
SettingInt(const wchar_t* group, const wchar_t* name, const wchar_t* shortDescription, const wchar_t* description, int initialValue);
LC_DISABLE_COPY(SettingInt);
LC_DISABLE_ASSIGNMENT(SettingInt);
void SetValue(int value);
void SetValueWithoutSaving(int value);
const wchar_t* GetName(void) const;
const wchar_t* GetShortDescription(void) const;
const wchar_t* GetDescription(void) const;
int GetValue(void) const;
int GetPreviousValue(void) const;
int GetInitialValue(void) const;
private:
const wchar_t* m_group;
const wchar_t* m_name;
const wchar_t* m_shortDescription;
const wchar_t* m_description;
int m_value;
int m_previousValue;
int m_initialValue;
};
class SettingString : public Setting
{
public:
SettingString(const wchar_t* group, const wchar_t* name, const wchar_t* shortDescription, const wchar_t* description, const wchar_t* initialValue);
LC_DISABLE_COPY(SettingString);
LC_DISABLE_ASSIGNMENT(SettingString);
void SetValue(const wchar_t* value);
void SetValueWithoutSaving(const wchar_t* value);
const wchar_t* GetName(void) const;
const wchar_t* GetShortDescription(void) const;
const wchar_t* GetDescription(void) const;
const wchar_t* GetValue(void) const;
private:
const wchar_t* m_group;
const wchar_t* m_name;
const wchar_t* m_shortDescription;
const wchar_t* m_description;
std::wstring m_value;
};
// proxy settings
class SettingIntProxy : public Setting
{
struct Mapping
{
std::wstring str;
int value;
};
public:
explicit SettingIntProxy(SettingInt* setting);
LC_DISABLE_COPY(SettingIntProxy);
LC_DISABLE_ASSIGNMENT(SettingIntProxy);
SettingIntProxy& AddMapping(const wchar_t* str, int value);
const wchar_t* MapIntToString(int value) const;
int MapStringToInt(const wchar_t* str) const;
SettingInt* GetSetting(void);
size_t GetMappingCount(void) const;
const wchar_t* GetMappingString(size_t index) const;
int GetMappingInt(size_t index) const;
private:
SettingInt* m_setting;
types::vector<Mapping> m_mappings;
};
class SettingShortcut : public Setting
{
public:
SettingShortcut(const wchar_t* group, const wchar_t* name, const wchar_t* shortDescription, const wchar_t* description, int initialValue);
LC_DISABLE_COPY(SettingShortcut);
LC_DISABLE_ASSIGNMENT(SettingShortcut);
void SetValue(int value);
void SetValueWithoutSaving(int value);
const wchar_t* GetName(void) const;
const wchar_t* GetShortDescription(void) const;
const wchar_t* GetDescription(void) const;
int GetValue(void) const;
private:
const wchar_t* m_group;
const wchar_t* m_name;
const wchar_t* m_shortDescription;
const wchar_t* m_description;
int m_value;
};