Skip to content

Commit

Permalink
support all AE versions
Browse files Browse the repository at this point in the history
initialize gmst strings once
  • Loading branch information
powerof3 committed Oct 2, 2022
1 parent 51228f7 commit fb84bfd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions src/Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

namespace UI
{
namespace CrossHair
namespace gmst
{
const char* get_string(const char* a_setting)
{
return RE::GameSettingCollection::GetSingleton()->GetSetting(a_setting)->GetString();
}
}

namespace CrossHair
{
enum : std::uint32_t
{
Expand All @@ -21,10 +29,8 @@ namespace UI

static std::string get_owned_tag()
{
std::string tag{ " (" };
tag.append(RE::GameSettingCollection::GetSingleton()->GetSetting("sOwned")->GetString());
tag.append(")");
return tag;
static std::string tag = std::string(" (").append(gmst::get_string("sOwned")).append(")");
return tag;
}
};

Expand Down Expand Up @@ -116,8 +122,7 @@ namespace UI
{
static std::string get_To_tag()
{
auto tag = std::string(RE::GameSettingCollection::GetSingleton()->GetSetting("sTo")->GetString());
tag.append(" ");
static std::string tag = std::string(gmst::get_string("sTo")).append(" ");
return tag;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern "C" DLLEXPORT constinit auto SKSEPlugin_Version = []() {
v.PluginName("SimpleActivateSKSE");
v.AuthorName("powerofthree");
v.UsesAddressLibrary();
v.UsesUpdatedStructs();
v.UsesNoStructs();
v.CompatibleVersions({ SKSE::RUNTIME_LATEST });

return v;
Expand Down

0 comments on commit fb84bfd

Please sign in to comment.