mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-25 04:11:42 -04:00
fix codegen dir
This commit is contained in:
parent
070474dd18
commit
f91bad2acc
2 changed files with 63 additions and 62 deletions
|
@ -47,6 +47,7 @@ add_dependencies(CodegenRun Codegen)
|
|||
# Hacky way to supress the not generated error
|
||||
if (NOT EXISTS ${GEODE_CODEGEN_PATH}/Geode/GeneratedSource.cpp)
|
||||
make_directory(${GEODE_CODEGEN_PATH})
|
||||
make_directory(${GEODE_CODEGEN_PATH}/Geode)
|
||||
file(TOUCH ${GEODE_CODEGEN_PATH}/Geode/GeneratedSource.cpp)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -13,26 +13,26 @@ std::string Setting::getKey() const {
|
|||
return m_key;
|
||||
}
|
||||
|
||||
Result<std::shared_ptr<Setting>> Setting::parse(
|
||||
std::string const& type,
|
||||
std::string const& key,
|
||||
JsonMaybeObject<ModJson>& obj
|
||||
) {
|
||||
switch (hash(type.c_str())) {
|
||||
case hash("bool"): return BoolSetting::parse(key, obj);
|
||||
case hash("int"): return IntSetting::parse(key, obj);
|
||||
case hash("float"): return FloatSetting::parse(key, obj);
|
||||
case hash("string"): return StringSetting::parse(key, obj);
|
||||
case hash("rgb"):
|
||||
case hash("color"): return ColorSetting::parse(key, obj);
|
||||
case hash("rgba"): return ColorAlphaSetting::parse(key, obj);
|
||||
case hash("path"):
|
||||
case hash("file"): return FileSetting::parse(key, obj);
|
||||
default: return Err(
|
||||
"Setting \"" + key + "\" has unknown type \"" + type + "\""
|
||||
);
|
||||
}
|
||||
}
|
||||
// Result<std::shared_ptr<Setting>> Setting::parse(
|
||||
// std::string const& type,
|
||||
// std::string const& key,
|
||||
// JsonMaybeObject<ModJson>& obj
|
||||
// ) {
|
||||
// switch (hash(type.c_str())) {
|
||||
// case hash("bool"): return BoolSetting::parse(key, obj);
|
||||
// case hash("int"): return IntSetting::parse(key, obj);
|
||||
// case hash("float"): return FloatSetting::parse(key, obj);
|
||||
// case hash("string"): return StringSetting::parse(key, obj);
|
||||
// case hash("rgb"):
|
||||
// case hash("color"): return ColorSetting::parse(key, obj);
|
||||
// case hash("rgba"): return ColorAlphaSetting::parse(key, obj);
|
||||
// case hash("path"):
|
||||
// case hash("file"): return FileSetting::parse(key, obj);
|
||||
// default: return Err(
|
||||
// "Setting \"" + key + "\" has unknown type \"" + type + "\""
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
Result<std::shared_ptr<Setting>> Setting::parse(
|
||||
std::string const& key,
|
||||
|
@ -59,54 +59,54 @@ void Setting::valueChanged() {
|
|||
SettingChangedEvent(m_modID, shared_from_this()).post();
|
||||
}
|
||||
|
||||
SettingNode* BoolSetting::createNode(float width) {
|
||||
return BoolSettingNode::create(
|
||||
std::static_pointer_cast<BoolSetting>(shared_from_this()),
|
||||
width
|
||||
);
|
||||
}
|
||||
// SettingNode* BoolSetting::createNode(float width) {
|
||||
// return BoolSettingNode::create(
|
||||
// std::static_pointer_cast<BoolSetting>(shared_from_this()),
|
||||
// width
|
||||
// );
|
||||
// }
|
||||
|
||||
SettingNode* IntSetting::createNode(float width) {
|
||||
return IntSettingNode::create(
|
||||
std::static_pointer_cast<IntSetting>(shared_from_this()),
|
||||
width
|
||||
);
|
||||
}
|
||||
// SettingNode* IntSetting::createNode(float width) {
|
||||
// return IntSettingNode::create(
|
||||
// std::static_pointer_cast<IntSetting>(shared_from_this()),
|
||||
// width
|
||||
// );
|
||||
// }
|
||||
|
||||
SettingNode* FloatSetting::createNode(float width) {
|
||||
return FloatSettingNode::create(
|
||||
std::static_pointer_cast<FloatSetting>(shared_from_this()),
|
||||
width
|
||||
);
|
||||
}
|
||||
// SettingNode* FloatSetting::createNode(float width) {
|
||||
// return FloatSettingNode::create(
|
||||
// std::static_pointer_cast<FloatSetting>(shared_from_this()),
|
||||
// width
|
||||
// );
|
||||
// }
|
||||
|
||||
SettingNode* StringSetting::createNode(float width) {
|
||||
return StringSettingNode::create(
|
||||
std::static_pointer_cast<StringSetting>(shared_from_this()),
|
||||
width
|
||||
);
|
||||
}
|
||||
// SettingNode* StringSetting::createNode(float width) {
|
||||
// return StringSettingNode::create(
|
||||
// std::static_pointer_cast<StringSetting>(shared_from_this()),
|
||||
// width
|
||||
// );
|
||||
// }
|
||||
|
||||
SettingNode* FileSetting::createNode(float width) {
|
||||
return FileSettingNode::create(
|
||||
std::static_pointer_cast<FileSetting>(shared_from_this()),
|
||||
width
|
||||
);
|
||||
}
|
||||
// SettingNode* FileSetting::createNode(float width) {
|
||||
// return FileSettingNode::create(
|
||||
// std::static_pointer_cast<FileSetting>(shared_from_this()),
|
||||
// width
|
||||
// );
|
||||
// }
|
||||
|
||||
SettingNode* ColorSetting::createNode(float width) {
|
||||
return ColorSettingNode::create(
|
||||
std::static_pointer_cast<ColorSetting>(shared_from_this()),
|
||||
width
|
||||
);
|
||||
}
|
||||
// SettingNode* ColorSetting::createNode(float width) {
|
||||
// return ColorSettingNode::create(
|
||||
// std::static_pointer_cast<ColorSetting>(shared_from_this()),
|
||||
// width
|
||||
// );
|
||||
// }
|
||||
|
||||
SettingNode* ColorAlphaSetting::createNode(float width) {
|
||||
return ColorAlphaSettingNode::create(
|
||||
std::static_pointer_cast<ColorAlphaSetting>(shared_from_this()),
|
||||
width
|
||||
);
|
||||
}
|
||||
// SettingNode* ColorAlphaSetting::createNode(float width) {
|
||||
// return ColorAlphaSettingNode::create(
|
||||
// std::static_pointer_cast<ColorAlphaSetting>(shared_from_this()),
|
||||
// width
|
||||
// );
|
||||
// }
|
||||
|
||||
SettingChangedEvent::SettingChangedEvent(
|
||||
std::string const& modID,
|
||||
|
|
Loading…
Add table
Reference in a new issue