Skip to content

Commit

Permalink
feat: add to RegSettingCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix committed Oct 3, 2023
1 parent d73c865 commit b8c72e3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CommonLibSF/include/RE/R/RegSettingCollection.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include "RE/S/Setting.h"
#include "RE/S/SettingCollectionList.h"

namespace RE
Expand All @@ -11,5 +12,22 @@ namespace RE
SF_RTTI_VTABLE(RegSettingCollection);

virtual ~RegSettingCollection(); // 000

[[nodiscard]] static RegSettingCollection* GetSingleton()
{
REL::Relocation<RegSettingCollection**> singleton{ REL::ID(885510) };
return *singleton;
}

[[nodiscard]] Setting* GetSetting(const std::string_view a_name)
{
for (auto& setting : settings) {
if (setting->GetKey() == a_name) {
return setting;
}
}

return nullptr;
}
};
}

0 comments on commit b8c72e3

Please sign in to comment.