Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/geode-sdk/docs into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Apr 19, 2024
2 parents f05c67b + e8d4669 commit 78a117c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mods/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ class MySettingValue : public SettingValue {
// you are free to do whatever!

public:
// Make sure to have a public constructor!
// Typically you always have these first two args,
// since Mod::addCustomSetting expects them.
MySettingValue(std::string const& key, std::string const& mod, T someValue)
: SettingValue(key, mod), m_someMember(someValue) {}

bool load(matjson::Value const& json) override {
// load the value of the setting from json,
// returning true if loading was succesful
Expand Down

0 comments on commit 78a117c

Please sign in to comment.