mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 00:25:44 +00:00
Add generic property matchers for menus
This commit is contained in:
parent
77603a2617
commit
2aa0eb2a8c
@ -11,7 +11,9 @@ namespace menu
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
bool m_fullscreen;
|
bool m_full_screen;
|
||||||
|
bool m_screen_space;
|
||||||
|
bool m_decoration;
|
||||||
|
|
||||||
std::vector<std::unique_ptr<CommonItemDef>> m_items;
|
std::vector<std::unique_ptr<CommonItemDef>> m_items;
|
||||||
};
|
};
|
||||||
|
16
src/ObjLoading/Parsing/Menu/Domain/CommonMenuTypes.h
Normal file
16
src/ObjLoading/Parsing/Menu/Domain/CommonMenuTypes.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace menu
|
||||||
|
{
|
||||||
|
union CommonColor
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
double r;
|
||||||
|
double g;
|
||||||
|
double b;
|
||||||
|
double a;
|
||||||
|
};
|
||||||
|
double array[4];
|
||||||
|
};
|
||||||
|
}
|
@ -1,35 +1,12 @@
|
|||||||
#include "FunctionPropertySequences.h"
|
#include "FunctionPropertySequences.h"
|
||||||
|
|
||||||
|
#include "GenericStringPropertySequence.h"
|
||||||
#include "Parsing/Menu/MenuMatcherFactory.h"
|
#include "Parsing/Menu/MenuMatcherFactory.h"
|
||||||
|
|
||||||
using namespace menu;
|
using namespace menu;
|
||||||
|
|
||||||
namespace menu::function_properties
|
namespace menu::function_properties
|
||||||
{
|
{
|
||||||
class SequenceName final : public MenuFileParser::sequence_t
|
|
||||||
{
|
|
||||||
static constexpr auto CAPTURE_NAME = 1;
|
|
||||||
|
|
||||||
public:
|
|
||||||
SequenceName()
|
|
||||||
{
|
|
||||||
const MenuMatcherFactory create(this);
|
|
||||||
|
|
||||||
AddMatchers({
|
|
||||||
create.KeywordIgnoreCase("name"),
|
|
||||||
create.Text().Capture(CAPTURE_NAME)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const override
|
|
||||||
{
|
|
||||||
assert(state->m_current_function);
|
|
||||||
|
|
||||||
const auto nameValue = MenuMatcherFactory::TokenTextValue(result.NextCapture(CAPTURE_NAME));
|
|
||||||
state->m_current_function->m_name = nameValue;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace function_properties;
|
using namespace function_properties;
|
||||||
@ -41,5 +18,8 @@ FunctionPropertySequences::FunctionPropertySequences(std::vector<std::unique_ptr
|
|||||||
|
|
||||||
void FunctionPropertySequences::AddSequences(FeatureLevel featureLevel)
|
void FunctionPropertySequences::AddSequences(FeatureLevel featureLevel)
|
||||||
{
|
{
|
||||||
AddSequence(std::make_unique<SequenceName>());
|
AddSequence(std::make_unique<GenericStringPropertySequence>("name", [](const MenuFileParserState* state, const std::string& value)
|
||||||
|
{
|
||||||
|
state->m_current_function->m_name = value;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
#include "GenericBoolPropertySequence.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuMatcherFactory.h"
|
||||||
|
|
||||||
|
using namespace menu;
|
||||||
|
|
||||||
|
GenericBoolPropertySequence::GenericBoolPropertySequence(std::string keywordName, callback_t setCallback)
|
||||||
|
: m_set_callback(std::move(setCallback))
|
||||||
|
{
|
||||||
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
|
AddMatchers({
|
||||||
|
create.KeywordIgnoreCase(std::move(keywordName)),
|
||||||
|
create.Integer().Capture(CAPTURE_VALUE)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenericBoolPropertySequence::ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const
|
||||||
|
{
|
||||||
|
if (m_set_callback)
|
||||||
|
{
|
||||||
|
const auto value = result.NextCapture(CAPTURE_VALUE).IntegerValue();
|
||||||
|
m_set_callback(state, value > 0);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuFileParser.h"
|
||||||
|
|
||||||
|
namespace menu
|
||||||
|
{
|
||||||
|
class GenericBoolPropertySequence final : public MenuFileParser::sequence_t
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using callback_t = std::function<void(MenuFileParserState* state, bool value)>;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static constexpr auto CAPTURE_VALUE = 1;
|
||||||
|
|
||||||
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
GenericBoolPropertySequence(std::string keywordName, callback_t setCallback);
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
#include "GenericColorPropertySequence.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuMatcherFactory.h"
|
||||||
|
|
||||||
|
using namespace menu;
|
||||||
|
|
||||||
|
GenericColorPropertySequence::GenericColorPropertySequence(std::string keywordName, callback_t setCallback)
|
||||||
|
: m_set_callback(std::move(setCallback))
|
||||||
|
{
|
||||||
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
|
AddMatchers({
|
||||||
|
create.KeywordIgnoreCase(std::move(keywordName)),
|
||||||
|
create.Numeric().Capture(CAPTURE_R),
|
||||||
|
create.Numeric().Capture(CAPTURE_G),
|
||||||
|
create.Numeric().Capture(CAPTURE_B),
|
||||||
|
create.Numeric().Capture(CAPTURE_A)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenericColorPropertySequence::ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const
|
||||||
|
{
|
||||||
|
if (m_set_callback)
|
||||||
|
{
|
||||||
|
CommonColor color{};
|
||||||
|
color.r = MenuMatcherFactory::TokenNumericFloatingPointValue(result.NextCapture(CAPTURE_R));
|
||||||
|
color.g = MenuMatcherFactory::TokenNumericFloatingPointValue(result.NextCapture(CAPTURE_G));
|
||||||
|
color.b = MenuMatcherFactory::TokenNumericFloatingPointValue(result.NextCapture(CAPTURE_B));
|
||||||
|
color.a = MenuMatcherFactory::TokenNumericFloatingPointValue(result.NextCapture(CAPTURE_A));
|
||||||
|
|
||||||
|
m_set_callback(state, color);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuFileParser.h"
|
||||||
|
#include "Parsing/Menu/Domain/CommonMenuTypes.h"
|
||||||
|
|
||||||
|
namespace menu
|
||||||
|
{
|
||||||
|
class GenericColorPropertySequence final : public MenuFileParser::sequence_t
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using callback_t = std::function<void(MenuFileParserState* state, CommonColor value)>;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static constexpr auto CAPTURE_R = 1;
|
||||||
|
static constexpr auto CAPTURE_G = 2;
|
||||||
|
static constexpr auto CAPTURE_B = 3;
|
||||||
|
static constexpr auto CAPTURE_A = 4;
|
||||||
|
|
||||||
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
GenericColorPropertySequence(std::string keywordName, callback_t setCallback);
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
#include "GenericFloatingPointPropertySequence.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuMatcherFactory.h"
|
||||||
|
|
||||||
|
using namespace menu;
|
||||||
|
|
||||||
|
GenericFloatingPointPropertySequence::GenericFloatingPointPropertySequence(std::string keywordName, callback_t setCallback)
|
||||||
|
: m_set_callback(std::move(setCallback))
|
||||||
|
{
|
||||||
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
|
AddMatchers({
|
||||||
|
create.KeywordIgnoreCase(std::move(keywordName)),
|
||||||
|
create.Numeric().Capture(CAPTURE_VALUE)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenericFloatingPointPropertySequence::ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const
|
||||||
|
{
|
||||||
|
if (m_set_callback)
|
||||||
|
{
|
||||||
|
const auto value = MenuMatcherFactory::TokenNumericFloatingPointValue(result.NextCapture(CAPTURE_VALUE));
|
||||||
|
m_set_callback(state, value);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuFileParser.h"
|
||||||
|
|
||||||
|
namespace menu
|
||||||
|
{
|
||||||
|
class GenericFloatingPointPropertySequence final : public MenuFileParser::sequence_t
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using callback_t = std::function<void(MenuFileParserState* state, double value)>;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static constexpr auto CAPTURE_VALUE = 1;
|
||||||
|
|
||||||
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
GenericFloatingPointPropertySequence(std::string keywordName, callback_t setCallback);
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
#include "GenericIntPropertySequence.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuMatcherFactory.h"
|
||||||
|
|
||||||
|
using namespace menu;
|
||||||
|
|
||||||
|
GenericIntPropertySequence::GenericIntPropertySequence(std::string keywordName, callback_t setCallback)
|
||||||
|
: m_set_callback(std::move(setCallback))
|
||||||
|
{
|
||||||
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
|
AddMatchers({
|
||||||
|
create.KeywordIgnoreCase(std::move(keywordName)),
|
||||||
|
create.Integer().Capture(CAPTURE_VALUE)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenericIntPropertySequence::ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const
|
||||||
|
{
|
||||||
|
if (m_set_callback)
|
||||||
|
{
|
||||||
|
const auto value = result.NextCapture(CAPTURE_VALUE).IntegerValue();
|
||||||
|
m_set_callback(state, value);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuFileParser.h"
|
||||||
|
|
||||||
|
namespace menu
|
||||||
|
{
|
||||||
|
class GenericIntPropertySequence final : public MenuFileParser::sequence_t
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using callback_t = std::function<void(MenuFileParserState* state, int value)>;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static constexpr auto CAPTURE_VALUE = 1;
|
||||||
|
|
||||||
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
GenericIntPropertySequence(std::string keywordName, callback_t setCallback);
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
#include "GenericKeywordPropertySequence.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuMatcherFactory.h"
|
||||||
|
|
||||||
|
using namespace menu;
|
||||||
|
|
||||||
|
GenericKeywordPropertySequence::GenericKeywordPropertySequence(std::string keywordName, callback_t setCallback)
|
||||||
|
: m_set_callback(std::move(setCallback))
|
||||||
|
{
|
||||||
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
|
AddMatchers({
|
||||||
|
create.KeywordIgnoreCase(std::move(keywordName)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenericKeywordPropertySequence::ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const
|
||||||
|
{
|
||||||
|
if(m_set_callback)
|
||||||
|
{
|
||||||
|
m_set_callback(state);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuFileParser.h"
|
||||||
|
|
||||||
|
namespace menu
|
||||||
|
{
|
||||||
|
class GenericKeywordPropertySequence final : public MenuFileParser::sequence_t
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using callback_t = std::function<void(MenuFileParserState* state)>;
|
||||||
|
|
||||||
|
private:
|
||||||
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
GenericKeywordPropertySequence(std::string keywordName, callback_t setCallback);
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
#include "GenericStringPropertySequence.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuMatcherFactory.h"
|
||||||
|
|
||||||
|
using namespace menu;
|
||||||
|
|
||||||
|
GenericStringPropertySequence::GenericStringPropertySequence(std::string keywordName, callback_t setCallback)
|
||||||
|
: m_set_callback(std::move(setCallback))
|
||||||
|
{
|
||||||
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
|
AddMatchers({
|
||||||
|
create.KeywordIgnoreCase(std::move(keywordName)),
|
||||||
|
create.Text().Capture(CAPTURE_VALUE)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenericStringPropertySequence::ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const
|
||||||
|
{
|
||||||
|
if (m_set_callback)
|
||||||
|
{
|
||||||
|
const auto& value = MenuMatcherFactory::TokenTextValue(result.NextCapture(CAPTURE_VALUE));
|
||||||
|
m_set_callback(state, value);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
#include "Parsing/Menu/MenuFileParser.h"
|
||||||
|
|
||||||
|
namespace menu
|
||||||
|
{
|
||||||
|
class GenericStringPropertySequence final : public MenuFileParser::sequence_t
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using callback_t = std::function<void(MenuFileParserState* state, const std::string& value)>;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static constexpr auto CAPTURE_VALUE = 1;
|
||||||
|
|
||||||
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
GenericStringPropertySequence(std::string keywordName, callback_t setCallback);
|
||||||
|
};
|
||||||
|
}
|
@ -1,35 +1,12 @@
|
|||||||
#include "ItemPropertySequences.h"
|
#include "ItemPropertySequences.h"
|
||||||
|
|
||||||
|
#include "GenericStringPropertySequence.h"
|
||||||
#include "Parsing/Menu/MenuMatcherFactory.h"
|
#include "Parsing/Menu/MenuMatcherFactory.h"
|
||||||
|
|
||||||
using namespace menu;
|
using namespace menu;
|
||||||
|
|
||||||
namespace menu::item_properties
|
namespace menu::item_properties
|
||||||
{
|
{
|
||||||
class SequenceName final : public MenuFileParser::sequence_t
|
|
||||||
{
|
|
||||||
static constexpr auto CAPTURE_NAME = 1;
|
|
||||||
|
|
||||||
public:
|
|
||||||
SequenceName()
|
|
||||||
{
|
|
||||||
const MenuMatcherFactory create(this);
|
|
||||||
|
|
||||||
AddMatchers({
|
|
||||||
create.KeywordIgnoreCase("name"),
|
|
||||||
create.Text().Capture(CAPTURE_NAME)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const override
|
|
||||||
{
|
|
||||||
assert(state->m_current_item);
|
|
||||||
|
|
||||||
const auto nameValue = MenuMatcherFactory::TokenTextValue(result.NextCapture(CAPTURE_NAME));
|
|
||||||
state->m_current_item->m_name = nameValue;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace item_properties;
|
using namespace item_properties;
|
||||||
@ -41,5 +18,8 @@ ItemPropertySequences::ItemPropertySequences(std::vector<std::unique_ptr<MenuFil
|
|||||||
|
|
||||||
void ItemPropertySequences::AddSequences(FeatureLevel featureLevel)
|
void ItemPropertySequences::AddSequences(FeatureLevel featureLevel)
|
||||||
{
|
{
|
||||||
AddSequence(std::make_unique<SequenceName>());
|
AddSequence(std::make_unique<GenericStringPropertySequence>("name", [](const MenuFileParserState* state, const std::string& value)
|
||||||
|
{
|
||||||
|
state->m_current_item->m_name = value;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
@ -1,36 +1,14 @@
|
|||||||
#include "MenuPropertySequences.h"
|
#include "MenuPropertySequences.h"
|
||||||
|
|
||||||
|
#include "GenericBoolPropertySequence.h"
|
||||||
|
#include "GenericKeywordPropertySequence.h"
|
||||||
|
#include "GenericStringPropertySequence.h"
|
||||||
#include "Parsing/Menu/MenuMatcherFactory.h"
|
#include "Parsing/Menu/MenuMatcherFactory.h"
|
||||||
|
|
||||||
using namespace menu;
|
using namespace menu;
|
||||||
|
|
||||||
namespace menu::menu_properties
|
namespace menu::menu_properties
|
||||||
{
|
{
|
||||||
class SequenceName final : public MenuFileParser::sequence_t
|
|
||||||
{
|
|
||||||
static constexpr auto CAPTURE_NAME = 1;
|
|
||||||
|
|
||||||
public:
|
|
||||||
SequenceName()
|
|
||||||
{
|
|
||||||
const MenuMatcherFactory create(this);
|
|
||||||
|
|
||||||
AddMatchers({
|
|
||||||
create.KeywordIgnoreCase("name"),
|
|
||||||
create.Text().Capture(CAPTURE_NAME)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const override
|
|
||||||
{
|
|
||||||
assert(state->m_current_menu);
|
|
||||||
|
|
||||||
const auto nameValue = MenuMatcherFactory::TokenTextValue(result.NextCapture(CAPTURE_NAME));
|
|
||||||
state->m_current_menu->m_name = nameValue;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class SequenceFullScreen final : public MenuFileParser::sequence_t
|
class SequenceFullScreen final : public MenuFileParser::sequence_t
|
||||||
{
|
{
|
||||||
static constexpr auto CAPTURE_VALUE = 1;
|
static constexpr auto CAPTURE_VALUE = 1;
|
||||||
@ -52,7 +30,7 @@ namespace menu::menu_properties
|
|||||||
assert(state->m_current_menu);
|
assert(state->m_current_menu);
|
||||||
|
|
||||||
const auto value = MenuMatcherFactory::TokenNumericIntValue(result.NextCapture(CAPTURE_VALUE));
|
const auto value = MenuMatcherFactory::TokenNumericIntValue(result.NextCapture(CAPTURE_VALUE));
|
||||||
state->m_current_menu->m_fullscreen = value > 0;
|
state->m_current_menu->m_full_screen = value > 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -66,6 +44,20 @@ MenuPropertySequences::MenuPropertySequences(std::vector<std::unique_ptr<MenuFil
|
|||||||
|
|
||||||
void MenuPropertySequences::AddSequences(FeatureLevel featureLevel)
|
void MenuPropertySequences::AddSequences(FeatureLevel featureLevel)
|
||||||
{
|
{
|
||||||
AddSequence(std::make_unique<SequenceName>());
|
AddSequence(std::make_unique<GenericStringPropertySequence>("name", [](const MenuFileParserState* state, const std::string& value)
|
||||||
AddSequence(std::make_unique<SequenceFullScreen>());
|
{
|
||||||
|
state->m_current_menu->m_name = value;
|
||||||
|
}));
|
||||||
|
AddSequence(std::make_unique<GenericBoolPropertySequence>("fullScreen", [](const MenuFileParserState* state, const bool value)
|
||||||
|
{
|
||||||
|
state->m_current_menu->m_full_screen = value;
|
||||||
|
}));
|
||||||
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("screenSpace", [](const MenuFileParserState* state)
|
||||||
|
{
|
||||||
|
state->m_current_menu->m_screen_space = true;
|
||||||
|
}));
|
||||||
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("decoration", [](const MenuFileParserState* state)
|
||||||
|
{
|
||||||
|
state->m_current_menu->m_decoration = true;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user