mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-06 16:37:42 +00:00
Set item type features when setting type
This commit is contained in:
parent
ef1ad18332
commit
dd8a9bf374
@ -9,6 +9,16 @@
|
|||||||
|
|
||||||
namespace menu
|
namespace menu
|
||||||
{
|
{
|
||||||
|
enum class CommonItemFeatureType
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
LISTBOX,
|
||||||
|
EDIT_FIELD,
|
||||||
|
MULTI_VALUE,
|
||||||
|
ENUM_DVAR,
|
||||||
|
NEWS_TICKER
|
||||||
|
};
|
||||||
|
|
||||||
class CommonItemDef
|
class CommonItemDef
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -33,6 +43,7 @@ namespace menu
|
|||||||
bool m_auto_wrapped;
|
bool m_auto_wrapped;
|
||||||
bool m_horizontal_scroll;
|
bool m_horizontal_scroll;
|
||||||
int m_type;
|
int m_type;
|
||||||
|
CommonItemFeatureType m_feature_type;
|
||||||
int m_border;
|
int m_border;
|
||||||
double m_border_size;
|
double m_border_size;
|
||||||
int m_owner_draw;
|
int m_owner_draw;
|
||||||
|
@ -52,7 +52,7 @@ FunctionScopeSequences::FunctionScopeSequences(std::vector<std::unique_ptr<MenuF
|
|||||||
void FunctionScopeSequences::AddSequences(FeatureLevel featureLevel)
|
void FunctionScopeSequences::AddSequences(FeatureLevel featureLevel)
|
||||||
{
|
{
|
||||||
AddSequence(std::make_unique<SequenceCloseBlock>());
|
AddSequence(std::make_unique<SequenceCloseBlock>());
|
||||||
AddSequence(std::make_unique<GenericStringPropertySequence>("name", [](const MenuFileParserState* state, const std::string& value)
|
AddSequence(std::make_unique<GenericStringPropertySequence>("name", [](const MenuFileParserState* state, const TokenPos&, const std::string& value)
|
||||||
{
|
{
|
||||||
state->m_current_function->m_name = value;
|
state->m_current_function->m_name = value;
|
||||||
}));
|
}));
|
||||||
|
@ -12,7 +12,7 @@ GenericBoolPropertySequence::GenericBoolPropertySequence(std::string keywordName
|
|||||||
const MenuMatcherFactory create(this);
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
AddMatchers({
|
AddMatchers({
|
||||||
create.KeywordIgnoreCase(std::move(keywordName)),
|
create.KeywordIgnoreCase(std::move(keywordName)).Capture(CAPTURE_FIRST_TOKEN),
|
||||||
create.Integer().Capture(CAPTURE_VALUE)
|
create.Integer().Capture(CAPTURE_VALUE)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -22,6 +22,6 @@ void GenericBoolPropertySequence::ProcessMatch(MenuFileParserState* state, Seque
|
|||||||
if (m_set_callback)
|
if (m_set_callback)
|
||||||
{
|
{
|
||||||
const auto value = result.NextCapture(CAPTURE_VALUE).IntegerValue();
|
const auto value = result.NextCapture(CAPTURE_VALUE).IntegerValue();
|
||||||
m_set_callback(state, value > 0);
|
m_set_callback(state, result.NextCapture(CAPTURE_FIRST_TOKEN).GetPos(), value > 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,11 @@ namespace menu
|
|||||||
class GenericBoolPropertySequence final : public MenuFileParser::sequence_t
|
class GenericBoolPropertySequence final : public MenuFileParser::sequence_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using callback_t = std::function<void(MenuFileParserState* state, bool value)>;
|
using callback_t = std::function<void(MenuFileParserState* state, const TokenPos& pos, bool value)>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto CAPTURE_VALUE = 1;
|
static constexpr auto CAPTURE_FIRST_TOKEN = 1;
|
||||||
|
static constexpr auto CAPTURE_VALUE = 2;
|
||||||
|
|
||||||
const callback_t m_set_callback;
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ GenericColorPropertySequence::GenericColorPropertySequence(std::string keywordNa
|
|||||||
const MenuMatcherFactory create(this);
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
AddMatchers({
|
AddMatchers({
|
||||||
create.KeywordIgnoreCase(std::move(keywordName)),
|
create.KeywordIgnoreCase(std::move(keywordName)).Capture(CAPTURE_FIRST_TOKEN),
|
||||||
create.Numeric().Capture(CAPTURE_R),
|
create.Numeric().Capture(CAPTURE_R),
|
||||||
create.Numeric().Capture(CAPTURE_G),
|
create.Numeric().Capture(CAPTURE_G),
|
||||||
create.Numeric().Capture(CAPTURE_B),
|
create.Numeric().Capture(CAPTURE_B),
|
||||||
@ -30,6 +30,6 @@ void GenericColorPropertySequence::ProcessMatch(MenuFileParserState* state, Sequ
|
|||||||
color.b = MenuMatcherFactory::TokenNumericFloatingPointValue(result.NextCapture(CAPTURE_B));
|
color.b = MenuMatcherFactory::TokenNumericFloatingPointValue(result.NextCapture(CAPTURE_B));
|
||||||
color.a = MenuMatcherFactory::TokenNumericFloatingPointValue(result.NextCapture(CAPTURE_A));
|
color.a = MenuMatcherFactory::TokenNumericFloatingPointValue(result.NextCapture(CAPTURE_A));
|
||||||
|
|
||||||
m_set_callback(state, color);
|
m_set_callback(state, result.NextCapture(CAPTURE_FIRST_TOKEN).GetPos(), color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,13 +11,14 @@ namespace menu
|
|||||||
class GenericColorPropertySequence final : public MenuFileParser::sequence_t
|
class GenericColorPropertySequence final : public MenuFileParser::sequence_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using callback_t = std::function<void(MenuFileParserState* state, CommonColor value)>;
|
using callback_t = std::function<void(MenuFileParserState* state, const TokenPos& pos, CommonColor value)>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto CAPTURE_R = 1;
|
static constexpr auto CAPTURE_FIRST_TOKEN = 1;
|
||||||
static constexpr auto CAPTURE_G = 2;
|
static constexpr auto CAPTURE_R = 2;
|
||||||
static constexpr auto CAPTURE_B = 3;
|
static constexpr auto CAPTURE_G = 3;
|
||||||
static constexpr auto CAPTURE_A = 4;
|
static constexpr auto CAPTURE_B = 4;
|
||||||
|
static constexpr auto CAPTURE_A = 5;
|
||||||
|
|
||||||
const callback_t m_set_callback;
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ std::unique_ptr<GenericExpressionPropertySequence> GenericExpressionPropertySequ
|
|||||||
|
|
||||||
const MenuMatcherFactory create(result.get());
|
const MenuMatcherFactory create(result.get());
|
||||||
result->AddMatchers({
|
result->AddMatchers({
|
||||||
create.KeywordIgnoreCase(std::move(keyword)),
|
create.KeywordIgnoreCase(std::move(keyword)).Capture(CAPTURE_FIRST_TOKEN),
|
||||||
create.Label(MenuCommonMatchers::LABEL_EXPRESSION),
|
create.Label(MenuCommonMatchers::LABEL_EXPRESSION),
|
||||||
create.Optional(create.Char(';'))
|
create.Optional(create.Char(';'))
|
||||||
});
|
});
|
||||||
@ -37,7 +37,7 @@ std::unique_ptr<GenericExpressionPropertySequence> GenericExpressionPropertySequ
|
|||||||
keywordMatchers.emplace_back(create.KeywordIgnoreCase(std::move(keyword)));
|
keywordMatchers.emplace_back(create.KeywordIgnoreCase(std::move(keyword)));
|
||||||
|
|
||||||
result->AddMatchers({
|
result->AddMatchers({
|
||||||
create.And(std::move(keywordMatchers)),
|
create.And(std::move(keywordMatchers)).Capture(CAPTURE_FIRST_TOKEN),
|
||||||
create.Label(MenuCommonMatchers::LABEL_EXPRESSION),
|
create.Label(MenuCommonMatchers::LABEL_EXPRESSION),
|
||||||
create.Optional(create.Char(';'))
|
create.Optional(create.Char(';'))
|
||||||
});
|
});
|
||||||
@ -51,12 +51,12 @@ std::unique_ptr<GenericExpressionPropertySequence> GenericExpressionPropertySequ
|
|||||||
|
|
||||||
const MenuMatcherFactory create(result.get());
|
const MenuMatcherFactory create(result.get());
|
||||||
result->AddMatchers({
|
result->AddMatchers({
|
||||||
create.KeywordIgnoreCase(std::move(keyword)),
|
create.KeywordIgnoreCase(std::move(keyword)).Capture(CAPTURE_FIRST_TOKEN),
|
||||||
create.Or({
|
create.Or({
|
||||||
create.And({
|
create.And({
|
||||||
create.KeywordIgnoreCase("when"),
|
create.KeywordIgnoreCase("when"),
|
||||||
create.Char('('),
|
create.Char('('),
|
||||||
create.Label(MenuCommonMatchers::LABEL_EXPRESSION).Capture(CAPTURE_VALUE),
|
create.Label(MenuCommonMatchers::LABEL_EXPRESSION),
|
||||||
create.Char(')')
|
create.Char(')')
|
||||||
}),
|
}),
|
||||||
create.Label(MenuCommonMatchers::LABEL_EXPRESSION)
|
create.Label(MenuCommonMatchers::LABEL_EXPRESSION)
|
||||||
@ -72,6 +72,6 @@ void GenericExpressionPropertySequence::ProcessMatch(MenuFileParserState* state,
|
|||||||
if (m_set_callback)
|
if (m_set_callback)
|
||||||
{
|
{
|
||||||
auto expression = MenuCommonMatchers::ProcessExpression(state, result);
|
auto expression = MenuCommonMatchers::ProcessExpression(state, result);
|
||||||
m_set_callback(state, std::move(expression));
|
m_set_callback(state, result.NextCapture(CAPTURE_FIRST_TOKEN).GetPos(), std::move(expression));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,10 @@ namespace menu
|
|||||||
class GenericExpressionPropertySequence final : public MenuFileParser::sequence_t
|
class GenericExpressionPropertySequence final : public MenuFileParser::sequence_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using callback_t = std::function<void(MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)>;
|
using callback_t = std::function<void(MenuFileParserState* state, const TokenPos& pos, std::unique_ptr<ICommonExpression> value)>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto CAPTURE_VALUE = 1;
|
static constexpr auto CAPTURE_FIRST_TOKEN = 1;
|
||||||
|
|
||||||
const callback_t m_set_callback;
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ GenericFloatingPointPropertySequence::GenericFloatingPointPropertySequence(std::
|
|||||||
const MenuMatcherFactory create(this);
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
AddMatchers({
|
AddMatchers({
|
||||||
create.KeywordIgnoreCase(std::move(keywordName)),
|
create.KeywordIgnoreCase(std::move(keywordName)).Capture(CAPTURE_FIRST_TOKEN),
|
||||||
create.Numeric().Capture(CAPTURE_VALUE)
|
create.Numeric().Capture(CAPTURE_VALUE)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -22,6 +22,6 @@ void GenericFloatingPointPropertySequence::ProcessMatch(MenuFileParserState* sta
|
|||||||
if (m_set_callback)
|
if (m_set_callback)
|
||||||
{
|
{
|
||||||
const auto value = MenuMatcherFactory::TokenNumericFloatingPointValue(result.NextCapture(CAPTURE_VALUE));
|
const auto value = MenuMatcherFactory::TokenNumericFloatingPointValue(result.NextCapture(CAPTURE_VALUE));
|
||||||
m_set_callback(state, value);
|
m_set_callback(state, result.NextCapture(CAPTURE_FIRST_TOKEN).GetPos(), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,11 @@ namespace menu
|
|||||||
class GenericFloatingPointPropertySequence final : public MenuFileParser::sequence_t
|
class GenericFloatingPointPropertySequence final : public MenuFileParser::sequence_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using callback_t = std::function<void(MenuFileParserState* state, double value)>;
|
using callback_t = std::function<void(MenuFileParserState* state, const TokenPos& pos, double value)>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto CAPTURE_VALUE = 1;
|
static constexpr auto CAPTURE_FIRST_TOKEN = 1;
|
||||||
|
static constexpr auto CAPTURE_VALUE = 2;
|
||||||
|
|
||||||
const callback_t m_set_callback;
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ GenericIntPropertySequence::GenericIntPropertySequence(std::string keywordName,
|
|||||||
const MenuMatcherFactory create(this);
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
AddMatchers({
|
AddMatchers({
|
||||||
create.KeywordIgnoreCase(std::move(keywordName)),
|
create.KeywordIgnoreCase(std::move(keywordName)).Capture(CAPTURE_FIRST_TOKEN),
|
||||||
create.Integer().Capture(CAPTURE_VALUE)
|
create.Integer().Capture(CAPTURE_VALUE)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -22,6 +22,6 @@ void GenericIntPropertySequence::ProcessMatch(MenuFileParserState* state, Sequen
|
|||||||
if (m_set_callback)
|
if (m_set_callback)
|
||||||
{
|
{
|
||||||
const auto value = result.NextCapture(CAPTURE_VALUE).IntegerValue();
|
const auto value = result.NextCapture(CAPTURE_VALUE).IntegerValue();
|
||||||
m_set_callback(state, value);
|
m_set_callback(state, result.NextCapture(CAPTURE_FIRST_TOKEN).GetPos(), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,11 @@ namespace menu
|
|||||||
class GenericIntPropertySequence final : public MenuFileParser::sequence_t
|
class GenericIntPropertySequence final : public MenuFileParser::sequence_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using callback_t = std::function<void(MenuFileParserState* state, int value)>;
|
using callback_t = std::function<void(MenuFileParserState* state, const TokenPos& pos, int value)>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto CAPTURE_VALUE = 1;
|
static constexpr auto CAPTURE_FIRST_TOKEN = 1;
|
||||||
|
static constexpr auto CAPTURE_VALUE = 2;
|
||||||
|
|
||||||
const callback_t m_set_callback;
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
@ -12,14 +12,14 @@ GenericKeywordPropertySequence::GenericKeywordPropertySequence(std::string keywo
|
|||||||
const MenuMatcherFactory create(this);
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
AddMatchers({
|
AddMatchers({
|
||||||
create.KeywordIgnoreCase(std::move(keywordName)),
|
create.KeywordIgnoreCase(std::move(keywordName)).Capture(CAPTURE_FIRST_TOKEN),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericKeywordPropertySequence::ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const
|
void GenericKeywordPropertySequence::ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const
|
||||||
{
|
{
|
||||||
if(m_set_callback)
|
if (m_set_callback)
|
||||||
{
|
{
|
||||||
m_set_callback(state);
|
m_set_callback(state, result.NextCapture(CAPTURE_FIRST_TOKEN).GetPos());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,9 +10,11 @@ namespace menu
|
|||||||
class GenericKeywordPropertySequence final : public MenuFileParser::sequence_t
|
class GenericKeywordPropertySequence final : public MenuFileParser::sequence_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using callback_t = std::function<void(MenuFileParserState* state)>;
|
using callback_t = std::function<void(MenuFileParserState* state, const TokenPos& pos)>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static constexpr auto CAPTURE_FIRST_TOKEN = 1;
|
||||||
|
|
||||||
const callback_t m_set_callback;
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -12,7 +12,7 @@ GenericMenuEventHandlerSetPropertySequence::GenericMenuEventHandlerSetPropertySe
|
|||||||
const MenuMatcherFactory create(this);
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
AddMatchers({
|
AddMatchers({
|
||||||
create.KeywordIgnoreCase(std::move(keywordName)),
|
create.KeywordIgnoreCase(std::move(keywordName)).Capture(CAPTURE_FIRST_TOKEN),
|
||||||
create.Char('{')
|
create.Char('{')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -24,6 +24,6 @@ void GenericMenuEventHandlerSetPropertySequence::ProcessMatch(MenuFileParserStat
|
|||||||
auto newEventHandlerSet = std::make_unique<CommonEventHandlerSet>();
|
auto newEventHandlerSet = std::make_unique<CommonEventHandlerSet>();
|
||||||
state->m_current_event_handler_set = newEventHandlerSet.get();
|
state->m_current_event_handler_set = newEventHandlerSet.get();
|
||||||
state->m_current_nested_event_handler_set = newEventHandlerSet.get();
|
state->m_current_nested_event_handler_set = newEventHandlerSet.get();
|
||||||
m_set_callback(state, std::move(newEventHandlerSet));
|
m_set_callback(state, result.NextCapture(CAPTURE_FIRST_TOKEN).GetPos(), std::move(newEventHandlerSet));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,10 @@ namespace menu
|
|||||||
class GenericMenuEventHandlerSetPropertySequence final : public MenuFileParser::sequence_t
|
class GenericMenuEventHandlerSetPropertySequence final : public MenuFileParser::sequence_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using callback_t = std::function<void(MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)>;
|
using callback_t = std::function<void(MenuFileParserState* state, const TokenPos& pos, std::unique_ptr<CommonEventHandlerSet> value)>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto CAPTURE_VALUE = 1;
|
static constexpr auto CAPTURE_FIRST_TOKEN = 1;
|
||||||
|
|
||||||
const callback_t m_set_callback;
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ GenericStringPropertySequence::GenericStringPropertySequence(std::string keyword
|
|||||||
const MenuMatcherFactory create(this);
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
AddMatchers({
|
AddMatchers({
|
||||||
create.KeywordIgnoreCase(std::move(keywordName)),
|
create.KeywordIgnoreCase(std::move(keywordName)).Capture(CAPTURE_FIRST_TOKEN),
|
||||||
create.Text().Capture(CAPTURE_VALUE)
|
create.Text().Capture(CAPTURE_VALUE)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -22,6 +22,6 @@ void GenericStringPropertySequence::ProcessMatch(MenuFileParserState* state, Seq
|
|||||||
if (m_set_callback)
|
if (m_set_callback)
|
||||||
{
|
{
|
||||||
const auto& value = MenuMatcherFactory::TokenTextValue(result.NextCapture(CAPTURE_VALUE));
|
const auto& value = MenuMatcherFactory::TokenTextValue(result.NextCapture(CAPTURE_VALUE));
|
||||||
m_set_callback(state, value);
|
m_set_callback(state, result.NextCapture(CAPTURE_FIRST_TOKEN).GetPos(), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,11 @@ namespace menu
|
|||||||
class GenericStringPropertySequence final : public MenuFileParser::sequence_t
|
class GenericStringPropertySequence final : public MenuFileParser::sequence_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using callback_t = std::function<void(MenuFileParserState* state, const std::string& value)>;
|
using callback_t = std::function<void(MenuFileParserState* state, const TokenPos& pos, const std::string& value)>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto CAPTURE_VALUE = 1;
|
static constexpr auto CAPTURE_FIRST_TOKEN = 1;
|
||||||
|
static constexpr auto CAPTURE_VALUE = 2;
|
||||||
|
|
||||||
const callback_t m_set_callback;
|
const callback_t m_set_callback;
|
||||||
|
|
||||||
|
@ -119,10 +119,11 @@ namespace menu::item_scope_sequences
|
|||||||
class SequenceMultiTokenBlock final : public MenuFileParser::sequence_t
|
class SequenceMultiTokenBlock final : public MenuFileParser::sequence_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using callback_t = std::function<void(MenuFileParserState* state, std::vector<std::string> value)>;
|
using callback_t = std::function<void(MenuFileParserState* state, const TokenPos& pos, std::vector<std::string> value)>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto CAPTURE_VALUE = 1;
|
static constexpr auto CAPTURE_FIRST_TOKEN = 1;
|
||||||
|
static constexpr auto CAPTURE_VALUE = 2;
|
||||||
|
|
||||||
callback_t m_set_callback;
|
callback_t m_set_callback;
|
||||||
|
|
||||||
@ -133,7 +134,7 @@ namespace menu::item_scope_sequences
|
|||||||
const MenuMatcherFactory create(this);
|
const MenuMatcherFactory create(this);
|
||||||
|
|
||||||
AddMatchers({
|
AddMatchers({
|
||||||
create.KeywordIgnoreCase(std::move(keyName)),
|
create.KeywordIgnoreCase(std::move(keyName)).Capture(CAPTURE_FIRST_TOKEN),
|
||||||
create.Char('{'),
|
create.Char('{'),
|
||||||
create.Optional(create.And({
|
create.Optional(create.And({
|
||||||
create.Text().Capture(CAPTURE_VALUE),
|
create.Text().Capture(CAPTURE_VALUE),
|
||||||
@ -158,13 +159,67 @@ namespace menu::item_scope_sequences
|
|||||||
values.emplace_back(MenuMatcherFactory::TokenTextValue(result.NextCapture(CAPTURE_VALUE)));
|
values.emplace_back(MenuMatcherFactory::TokenTextValue(result.NextCapture(CAPTURE_VALUE)));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_set_callback(state, std::move(values));
|
m_set_callback(state, result.NextCapture(CAPTURE_FIRST_TOKEN).GetPos(), std::move(values));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace item_scope_sequences;
|
using namespace item_scope_sequences;
|
||||||
|
|
||||||
|
class ItemScopeOperations
|
||||||
|
{
|
||||||
|
inline static const CommonItemFeatureType IW4_FEATURE_TYPE_BY_TYPE[0x18]
|
||||||
|
{
|
||||||
|
CommonItemFeatureType::EDIT_FIELD, // ITEM_TYPE_TEXT
|
||||||
|
CommonItemFeatureType::NONE, // ITEM_TYPE_BUTTON
|
||||||
|
CommonItemFeatureType::NONE, // ITEM_TYPE_RADIOBUTTON
|
||||||
|
CommonItemFeatureType::NONE, // ITEM_TYPE_CHECKBOX
|
||||||
|
CommonItemFeatureType::EDIT_FIELD, // ITEM_TYPE_EDITFIELD
|
||||||
|
CommonItemFeatureType::NONE, // ITEM_TYPE_COMBO
|
||||||
|
CommonItemFeatureType::LISTBOX, // ITEM_TYPE_LISTBOX
|
||||||
|
CommonItemFeatureType::NONE, // ITEM_TYPE_MODEL
|
||||||
|
CommonItemFeatureType::NONE, // ITEM_TYPE_OWNERDRAW
|
||||||
|
CommonItemFeatureType::EDIT_FIELD, // ITEM_TYPE_NUMERICFIELD
|
||||||
|
CommonItemFeatureType::EDIT_FIELD, // ITEM_TYPE_SLIDER
|
||||||
|
CommonItemFeatureType::EDIT_FIELD, // ITEM_TYPE_YESNO
|
||||||
|
CommonItemFeatureType::MULTI_VALUE, // ITEM_TYPE_MULTI
|
||||||
|
CommonItemFeatureType::ENUM_DVAR, // ITEM_TYPE_DVARENUM
|
||||||
|
CommonItemFeatureType::EDIT_FIELD, // ITEM_TYPE_BIND
|
||||||
|
CommonItemFeatureType::NONE, // ITEM_TYPE_MENUMODEL
|
||||||
|
CommonItemFeatureType::EDIT_FIELD, // ITEM_TYPE_VALIDFILEFIELD
|
||||||
|
CommonItemFeatureType::EDIT_FIELD, // ITEM_TYPE_DECIMALFIELD
|
||||||
|
CommonItemFeatureType::EDIT_FIELD, // ITEM_TYPE_UPREDITFIELD
|
||||||
|
CommonItemFeatureType::NONE, // ITEM_TYPE_GAME_MESSAGE_WINDOW
|
||||||
|
CommonItemFeatureType::NEWS_TICKER, // ITEM_TYPE_NEWS_TICKER
|
||||||
|
CommonItemFeatureType::NONE, // ITEM_TYPE_TEXT_SCROLL
|
||||||
|
CommonItemFeatureType::EDIT_FIELD, // ITEM_TYPE_EMAILFIELD
|
||||||
|
CommonItemFeatureType::EDIT_FIELD // ITEM_TYPE_PASSWORDFIELD
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
static void SetItemType(CommonItemDef& item, const FeatureLevel featureLevel, const TokenPos& pos, const int type)
|
||||||
|
{
|
||||||
|
if (type < 0)
|
||||||
|
throw ParsingException(pos, "Invalid item type");
|
||||||
|
|
||||||
|
item.m_type = type;
|
||||||
|
|
||||||
|
switch (featureLevel)
|
||||||
|
{
|
||||||
|
case FeatureLevel::IW4:
|
||||||
|
if (static_cast<unsigned>(type) >= std::extent_v<decltype(IW4_FEATURE_TYPE_BY_TYPE)>)
|
||||||
|
throw ParsingException(pos, "Invalid item type");
|
||||||
|
item.m_feature_type = IW4_FEATURE_TYPE_BY_TYPE[static_cast<unsigned>(type)];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FeatureLevel::IW5:
|
||||||
|
default:
|
||||||
|
assert(false);
|
||||||
|
throw ParsingException(pos, "Unimplemented item types for feature level");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
ItemScopeSequences::ItemScopeSequences(std::vector<std::unique_ptr<MenuFileParser::sequence_t>>& allSequences, std::vector<MenuFileParser::sequence_t*>& scopeSequences)
|
ItemScopeSequences::ItemScopeSequences(std::vector<std::unique_ptr<MenuFileParser::sequence_t>>& allSequences, std::vector<MenuFileParser::sequence_t*>& scopeSequences)
|
||||||
: AbstractScopeSequenceHolder(allSequences, scopeSequences)
|
: AbstractScopeSequenceHolder(allSequences, scopeSequences)
|
||||||
{
|
{
|
||||||
@ -173,285 +228,285 @@ ItemScopeSequences::ItemScopeSequences(std::vector<std::unique_ptr<MenuFileParse
|
|||||||
void ItemScopeSequences::AddSequences(FeatureLevel featureLevel)
|
void ItemScopeSequences::AddSequences(FeatureLevel featureLevel)
|
||||||
{
|
{
|
||||||
AddSequence(std::make_unique<SequenceCloseBlock>());
|
AddSequence(std::make_unique<SequenceCloseBlock>());
|
||||||
AddSequence(std::make_unique<GenericStringPropertySequence>("name", [](const MenuFileParserState* state, const std::string& value)
|
AddSequence(std::make_unique<GenericStringPropertySequence>("name", [](const MenuFileParserState* state, const TokenPos&, const std::string& value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_name = value;
|
state->m_current_item->m_name = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericStringPropertySequence>("text", [](const MenuFileParserState* state, const std::string& value)
|
AddSequence(std::make_unique<GenericStringPropertySequence>("text", [](const MenuFileParserState* state, const TokenPos&, const std::string& value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_text = value;
|
state->m_current_item->m_text = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("textsavegame", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("textsavegame", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_text_save_game = true;
|
state->m_current_item->m_text_save_game = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("textcinematicsubtitle", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("textcinematicsubtitle", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_text_cinematic_subtitle = true;
|
state->m_current_item->m_text_cinematic_subtitle = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericStringPropertySequence>("group", [](const MenuFileParserState* state, const std::string& value)
|
AddSequence(std::make_unique<GenericStringPropertySequence>("group", [](const MenuFileParserState* state, const TokenPos&, const std::string& value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_group = value;
|
state->m_current_item->m_group = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<SequenceRect>());
|
AddSequence(std::make_unique<SequenceRect>());
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("style", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("style", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_style = value;
|
state->m_current_item->m_style = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("decoration", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("decoration", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_decoration = true;
|
state->m_current_item->m_decoration = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("autowrapped", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("autowrapped", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_auto_wrapped = true;
|
state->m_current_item->m_auto_wrapped = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("horizontalscroll", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("horizontalscroll", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_horizontal_scroll = true;
|
state->m_current_item->m_horizontal_scroll = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("type", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("type", [](const MenuFileParserState* state, const TokenPos& pos, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_type = value;
|
ItemScopeOperations::SetItemType(*state->m_current_item, state->m_feature_level, pos, value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("border", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("border", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_border = value;
|
state->m_current_item->m_border = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("borderSize", [](const MenuFileParserState* state, const double value)
|
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("borderSize", [](const MenuFileParserState* state, const TokenPos&, const double value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_border_size = value;
|
state->m_current_item->m_border_size = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("ownerdraw", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("ownerdraw", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_owner_draw = value;
|
state->m_current_item->m_owner_draw = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("align", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("align", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_align = value;
|
state->m_current_item->m_align = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("textalign", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("textalign", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_text_align = value;
|
state->m_current_item->m_text_align = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("textalignx", [](const MenuFileParserState* state, const double value)
|
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("textalignx", [](const MenuFileParserState* state, const TokenPos&, const double value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_text_align_x = value;
|
state->m_current_item->m_text_align_x = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("textaligny", [](const MenuFileParserState* state, const double value)
|
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("textaligny", [](const MenuFileParserState* state, const TokenPos&, const double value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_text_align_y = value;
|
state->m_current_item->m_text_align_y = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("textscale", [](const MenuFileParserState* state, const double value)
|
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("textscale", [](const MenuFileParserState* state, const TokenPos&, const double value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_text_scale = value;
|
state->m_current_item->m_text_scale = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("textstyle", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("textstyle", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_text_style = value;
|
state->m_current_item->m_text_style = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("textfont", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("textfont", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_text_font = value;
|
state->m_current_item->m_text_font = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericColorPropertySequence>("backcolor", [](const MenuFileParserState* state, const CommonColor value)
|
AddSequence(std::make_unique<GenericColorPropertySequence>("backcolor", [](const MenuFileParserState* state, const TokenPos&, const CommonColor value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_back_color = value;
|
state->m_current_item->m_back_color = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericColorPropertySequence>("forecolor", [](const MenuFileParserState* state, const CommonColor value)
|
AddSequence(std::make_unique<GenericColorPropertySequence>("forecolor", [](const MenuFileParserState* state, const TokenPos&, const CommonColor value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_fore_color = value;
|
state->m_current_item->m_fore_color = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericColorPropertySequence>("bordercolor", [](const MenuFileParserState* state, const CommonColor value)
|
AddSequence(std::make_unique<GenericColorPropertySequence>("bordercolor", [](const MenuFileParserState* state, const TokenPos&, const CommonColor value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_border_color = value;
|
state->m_current_item->m_border_color = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericColorPropertySequence>("outlinecolor", [](const MenuFileParserState* state, const CommonColor value)
|
AddSequence(std::make_unique<GenericColorPropertySequence>("outlinecolor", [](const MenuFileParserState* state, const TokenPos&, const CommonColor value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_outline_color = value;
|
state->m_current_item->m_outline_color = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericColorPropertySequence>("disablecolor", [](const MenuFileParserState* state, const CommonColor value)
|
AddSequence(std::make_unique<GenericColorPropertySequence>("disablecolor", [](const MenuFileParserState* state, const TokenPos&, const CommonColor value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_disable_color = value;
|
state->m_current_item->m_disable_color = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericColorPropertySequence>("glowcolor", [](const MenuFileParserState* state, const CommonColor value)
|
AddSequence(std::make_unique<GenericColorPropertySequence>("glowcolor", [](const MenuFileParserState* state, const TokenPos&, const CommonColor value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_glow_color = value;
|
state->m_current_item->m_glow_color = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericStringPropertySequence>("background", [](const MenuFileParserState* state, const std::string& value)
|
AddSequence(std::make_unique<GenericStringPropertySequence>("background", [](const MenuFileParserState* state, const TokenPos&, const std::string& value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_background = value;
|
state->m_current_item->m_background = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericStringPropertySequence>("focusSound", [](const MenuFileParserState* state, const std::string& value)
|
AddSequence(std::make_unique<GenericStringPropertySequence>("focusSound", [](const MenuFileParserState* state, const TokenPos&, const std::string& value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_focus_sound = value;
|
state->m_current_item->m_focus_sound = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("ownerdrawFlag", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("ownerdrawFlag", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_owner_draw_flags |= value;
|
state->m_current_item->m_owner_draw_flags |= value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericStringPropertySequence>("dvarTest", [](const MenuFileParserState* state, const std::string& value)
|
AddSequence(std::make_unique<GenericStringPropertySequence>("dvarTest", [](const MenuFileParserState* state, const TokenPos&, const std::string& value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_dvar_test = value;
|
state->m_current_item->m_dvar_test = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<SequenceMultiTokenBlock>("enableDvar", [](const MenuFileParserState* state, std::vector<std::string> value)
|
AddSequence(std::make_unique<SequenceMultiTokenBlock>("enableDvar", [](const MenuFileParserState* state, const TokenPos&, std::vector<std::string> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_enable_dvar = std::move(value);
|
state->m_current_item->m_enable_dvar = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<SequenceMultiTokenBlock>("disableDvar", [](const MenuFileParserState* state, std::vector<std::string> value)
|
AddSequence(std::make_unique<SequenceMultiTokenBlock>("disableDvar", [](const MenuFileParserState* state, const TokenPos&, std::vector<std::string> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_disable_dvar = std::move(value);
|
state->m_current_item->m_disable_dvar = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<SequenceMultiTokenBlock>("showDvar", [](const MenuFileParserState* state, std::vector<std::string> value)
|
AddSequence(std::make_unique<SequenceMultiTokenBlock>("showDvar", [](const MenuFileParserState* state, const TokenPos&, std::vector<std::string> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_show_dvar = std::move(value);
|
state->m_current_item->m_show_dvar = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<SequenceMultiTokenBlock>("hideDvar", [](const MenuFileParserState* state, std::vector<std::string> value)
|
AddSequence(std::make_unique<SequenceMultiTokenBlock>("hideDvar", [](const MenuFileParserState* state, const TokenPos&, std::vector<std::string> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_hide_dvar = std::move(value);
|
state->m_current_item->m_hide_dvar = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<SequenceMultiTokenBlock>("focusDvar", [](const MenuFileParserState* state, std::vector<std::string> value)
|
AddSequence(std::make_unique<SequenceMultiTokenBlock>("focusDvar", [](const MenuFileParserState* state, const TokenPos&, std::vector<std::string> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_focus_dvar = std::move(value);
|
state->m_current_item->m_focus_dvar = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("gamemsgwindowindex", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("gamemsgwindowindex", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_game_message_window_index = value;
|
state->m_current_item->m_game_message_window_index = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("gamemsgwindowmode", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("gamemsgwindowmode", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_game_message_window_mode = value;
|
state->m_current_item->m_game_message_window_mode = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<SequenceDecodeEffect>());
|
AddSequence(std::make_unique<SequenceDecodeEffect>());
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywordAndBool("visible", [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywordAndBool("visible", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_visible_expression = std::move(value);
|
state->m_current_item->m_visible_expression = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywordAndBool("disabled", [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywordAndBool("disabled", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_disabled_expression = std::move(value);
|
state->m_current_item->m_disabled_expression = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "disabled"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "disabled"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_disabled_expression = std::move(value);
|
state->m_current_item->m_disabled_expression = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "text"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "text"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_text_expression = std::move(value);
|
state->m_current_item->m_text_expression = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "material"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "material"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_material_expression = std::move(value);
|
state->m_current_item->m_material_expression = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "material"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "material"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_material_expression = std::move(value);
|
state->m_current_item->m_material_expression = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "X"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "X"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_rect_x_exp = std::move(value);
|
state->m_current_item->m_rect_x_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "Y"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "Y"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_rect_y_exp = std::move(value);
|
state->m_current_item->m_rect_y_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "W"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "W"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_rect_w_exp = std::move(value);
|
state->m_current_item->m_rect_w_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "H"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "H"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_rect_h_exp = std::move(value);
|
state->m_current_item->m_rect_h_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "forecolor", "R"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "forecolor", "R"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_forecolor_expressions.m_r_exp = std::move(value);
|
state->m_current_item->m_forecolor_expressions.m_r_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "forecolor", "G"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "forecolor", "G"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_forecolor_expressions.m_g_exp = std::move(value);
|
state->m_current_item->m_forecolor_expressions.m_g_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "forecolor", "B"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "forecolor", "B"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_forecolor_expressions.m_b_exp = std::move(value);
|
state->m_current_item->m_forecolor_expressions.m_b_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "forecolor", "A"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "forecolor", "A"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_forecolor_expressions.m_a_exp = std::move(value);
|
state->m_current_item->m_forecolor_expressions.m_a_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "forecolor", "RGB"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "forecolor", "RGB"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_forecolor_expressions.m_rgb_exp = std::move(value);
|
state->m_current_item->m_forecolor_expressions.m_rgb_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "glowcolor", "R"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "glowcolor", "R"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_glowcolor_expressions.m_r_exp = std::move(value);
|
state->m_current_item->m_glowcolor_expressions.m_r_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "glowcolor", "G"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "glowcolor", "G"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_glowcolor_expressions.m_g_exp = std::move(value);
|
state->m_current_item->m_glowcolor_expressions.m_g_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "glowcolor", "B"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "glowcolor", "B"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_glowcolor_expressions.m_b_exp = std::move(value);
|
state->m_current_item->m_glowcolor_expressions.m_b_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "glowcolor", "A"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "glowcolor", "A"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_glowcolor_expressions.m_a_exp = std::move(value);
|
state->m_current_item->m_glowcolor_expressions.m_a_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "glowcolor", "RGB"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "glowcolor", "RGB"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_glowcolor_expressions.m_rgb_exp = std::move(value);
|
state->m_current_item->m_glowcolor_expressions.m_rgb_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "backcolor", "R"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "backcolor", "R"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_backcolor_expressions.m_r_exp = std::move(value);
|
state->m_current_item->m_backcolor_expressions.m_r_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "backcolor", "G"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "backcolor", "G"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_backcolor_expressions.m_g_exp = std::move(value);
|
state->m_current_item->m_backcolor_expressions.m_g_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "backcolor", "B"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "backcolor", "B"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_backcolor_expressions.m_b_exp = std::move(value);
|
state->m_current_item->m_backcolor_expressions.m_b_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "backcolor", "A"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "backcolor", "A"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_backcolor_expressions.m_a_exp = std::move(value);
|
state->m_current_item->m_backcolor_expressions.m_a_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "backcolor", "RGB"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "backcolor", "RGB"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_backcolor_expressions.m_rgb_exp = std::move(value);
|
state->m_current_item->m_backcolor_expressions.m_rgb_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("onFocus", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("onFocus", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_on_focus = std::move(value);
|
state->m_current_item->m_on_focus = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("leaveFocus", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("leaveFocus", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_on_leave_focus = std::move(value);
|
state->m_current_item->m_on_leave_focus = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("mouseEnter", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("mouseEnter", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_on_mouse_enter = std::move(value);
|
state->m_current_item->m_on_mouse_enter = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("mouseExit", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("mouseExit", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_on_mouse_exit = std::move(value);
|
state->m_current_item->m_on_mouse_exit = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("mouseEnterText", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("mouseEnterText", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_on_mouse_enter_text = std::move(value);
|
state->m_current_item->m_on_mouse_enter_text = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("mouseExitText", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("mouseExitText", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_on_mouse_exit_text = std::move(value);
|
state->m_current_item->m_on_mouse_exit_text = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("action", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("action", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_on_action = std::move(value);
|
state->m_current_item->m_on_action = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("accept", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("accept", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_item->m_on_accept = std::move(value);
|
state->m_current_item->m_on_accept = std::move(value);
|
||||||
}));
|
}));
|
||||||
|
@ -140,152 +140,152 @@ void MenuScopeSequences::AddSequences(FeatureLevel featureLevel)
|
|||||||
{
|
{
|
||||||
AddSequence(std::make_unique<SequenceCloseBlock>());
|
AddSequence(std::make_unique<SequenceCloseBlock>());
|
||||||
AddSequence(std::make_unique<SequenceItemDef>());
|
AddSequence(std::make_unique<SequenceItemDef>());
|
||||||
AddSequence(std::make_unique<GenericStringPropertySequence>("name", [](const MenuFileParserState* state, const std::string& value)
|
AddSequence(std::make_unique<GenericStringPropertySequence>("name", [](const MenuFileParserState* state, const TokenPos&, const std::string& value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_name = value;
|
state->m_current_menu->m_name = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericBoolPropertySequence>("fullScreen", [](const MenuFileParserState* state, const bool value)
|
AddSequence(std::make_unique<GenericBoolPropertySequence>("fullScreen", [](const MenuFileParserState* state, const TokenPos&, const bool value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_full_screen = value;
|
state->m_current_menu->m_full_screen = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("screenSpace", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("screenSpace", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_screen_space = true;
|
state->m_current_menu->m_screen_space = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("decoration", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("decoration", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_decoration = true;
|
state->m_current_menu->m_decoration = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<SequenceRect>());
|
AddSequence(std::make_unique<SequenceRect>());
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("style", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("style", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_style = value;
|
state->m_current_menu->m_style = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("border", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("border", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_border = value;
|
state->m_current_menu->m_border = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("borderSize", [](const MenuFileParserState* state, const double value)
|
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("borderSize", [](const MenuFileParserState* state, const TokenPos&, const double value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_border_size = value;
|
state->m_current_menu->m_border_size = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericColorPropertySequence>("backcolor", [](const MenuFileParserState* state, const CommonColor value)
|
AddSequence(std::make_unique<GenericColorPropertySequence>("backcolor", [](const MenuFileParserState* state, const TokenPos&, const CommonColor value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_back_color = value;
|
state->m_current_menu->m_back_color = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericColorPropertySequence>("forecolor", [](const MenuFileParserState* state, const CommonColor value)
|
AddSequence(std::make_unique<GenericColorPropertySequence>("forecolor", [](const MenuFileParserState* state, const TokenPos&, const CommonColor value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_fore_color = value;
|
state->m_current_menu->m_fore_color = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericColorPropertySequence>("bordercolor", [](const MenuFileParserState* state, const CommonColor value)
|
AddSequence(std::make_unique<GenericColorPropertySequence>("bordercolor", [](const MenuFileParserState* state, const TokenPos&, const CommonColor value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_border_color = value;
|
state->m_current_menu->m_border_color = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericColorPropertySequence>("focuscolor", [](const MenuFileParserState* state, const CommonColor value)
|
AddSequence(std::make_unique<GenericColorPropertySequence>("focuscolor", [](const MenuFileParserState* state, const TokenPos&, const CommonColor value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_focus_color = value;
|
state->m_current_menu->m_focus_color = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericStringPropertySequence>("background", [](const MenuFileParserState* state, const std::string& value)
|
AddSequence(std::make_unique<GenericStringPropertySequence>("background", [](const MenuFileParserState* state, const TokenPos&, const std::string& value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_background = value;
|
state->m_current_menu->m_background = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("ownerdraw", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("ownerdraw", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_owner_draw = value;
|
state->m_current_menu->m_owner_draw = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("ownerdrawFlag", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("ownerdrawFlag", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_owner_draw_flags |= value;
|
state->m_current_menu->m_owner_draw_flags |= value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("outOfBoundsClick", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("outOfBoundsClick", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_out_of_bounds_click = true;
|
state->m_current_menu->m_out_of_bounds_click = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericStringPropertySequence>("soundLoop", [](const MenuFileParserState* state, const std::string& value)
|
AddSequence(std::make_unique<GenericStringPropertySequence>("soundLoop", [](const MenuFileParserState* state, const TokenPos&, const std::string& value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_sound_loop = value;
|
state->m_current_menu->m_sound_loop = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("popup", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("popup", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_popup = true;
|
state->m_current_menu->m_popup = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("fadeClamp", [](const MenuFileParserState* state, const double value)
|
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("fadeClamp", [](const MenuFileParserState* state, const TokenPos&, const double value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_fade_clamp = value;
|
state->m_current_menu->m_fade_clamp = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericIntPropertySequence>("fadeCycle", [](const MenuFileParserState* state, const int value)
|
AddSequence(std::make_unique<GenericIntPropertySequence>("fadeCycle", [](const MenuFileParserState* state, const TokenPos&, const int value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_fade_cycle = value;
|
state->m_current_menu->m_fade_cycle = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("fadeAmount", [](const MenuFileParserState* state, const double value)
|
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("fadeAmount", [](const MenuFileParserState* state, const TokenPos&, const double value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_fade_amount = value;
|
state->m_current_menu->m_fade_amount = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("fadeInAmount", [](const MenuFileParserState* state, const double value)
|
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("fadeInAmount", [](const MenuFileParserState* state, const TokenPos&, const double value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_fade_in_amount = value;
|
state->m_current_menu->m_fade_in_amount = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("blurWorld", [](const MenuFileParserState* state, const double value)
|
AddSequence(std::make_unique<GenericFloatingPointPropertySequence>("blurWorld", [](const MenuFileParserState* state, const TokenPos&, const double value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_blur_radius = value;
|
state->m_current_menu->m_blur_radius = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("legacySplitScreenScale", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("legacySplitScreenScale", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_legacy_split_screen_scale = true;
|
state->m_current_menu->m_legacy_split_screen_scale = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("hiddenDuringScope", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("hiddenDuringScope", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_hidden_during_scope = true;
|
state->m_current_menu->m_hidden_during_scope = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("hiddenDuringFlashbang", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("hiddenDuringFlashbang", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_hidden_during_flashbang = true;
|
state->m_current_menu->m_hidden_during_flashbang = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("hiddenDuringUI", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("hiddenDuringUI", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_hidden_during_ui = true;
|
state->m_current_menu->m_hidden_during_ui = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericStringPropertySequence>("allowedBinding", [](const MenuFileParserState* state, const std::string& value)
|
AddSequence(std::make_unique<GenericStringPropertySequence>("allowedBinding", [](const MenuFileParserState* state, const TokenPos&, const std::string& value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_allowed_binding = value;
|
state->m_current_menu->m_allowed_binding = value;
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericKeywordPropertySequence>("textOnlyFocus", [](const MenuFileParserState* state)
|
AddSequence(std::make_unique<GenericKeywordPropertySequence>("textOnlyFocus", [](const MenuFileParserState* state, const TokenPos&)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_text_only_focus = true;
|
state->m_current_menu->m_text_only_focus = true;
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywordAndBool("visible", [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywordAndBool("visible", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_visible_expression = std::move(value);
|
state->m_current_menu->m_visible_expression = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "X"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "X"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_rect_x_exp = std::move(value);
|
state->m_current_menu->m_rect_x_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "Y"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "Y"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_rect_y_exp = std::move(value);
|
state->m_current_menu->m_rect_y_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "W"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "W"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_rect_w_exp = std::move(value);
|
state->m_current_menu->m_rect_w_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "H"}, [](const MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)
|
AddSequence(GenericExpressionPropertySequence::WithKeywords({"exp", "rect", "H"}, [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<ICommonExpression> value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_rect_h_exp = std::move(value);
|
state->m_current_menu->m_rect_h_exp = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("onOpen", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("onOpen", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_on_open = std::move(value);
|
state->m_current_menu->m_on_open = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("onClose", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("onClose", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_on_close = std::move(value);
|
state->m_current_menu->m_on_close = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("onRequestClose", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("onRequestClose", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_on_request_close = std::move(value);
|
state->m_current_menu->m_on_request_close = std::move(value);
|
||||||
}));
|
}));
|
||||||
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("onESC", [](const MenuFileParserState* state, std::unique_ptr<CommonEventHandlerSet> value)
|
AddSequence(std::make_unique<GenericMenuEventHandlerSetPropertySequence>("onESC", [](const MenuFileParserState* state, const TokenPos&, std::unique_ptr<CommonEventHandlerSet> value)
|
||||||
{
|
{
|
||||||
state->m_current_menu->m_on_esc = std::move(value);
|
state->m_current_menu->m_on_esc = std::move(value);
|
||||||
}));
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user