2022-08-03 19:21:03 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Achievements.h"
|
|
|
|
#include "Util.h"
|
|
|
|
|
|
|
|
namespace Papyrus::PapyrusFunctions
|
|
|
|
{
|
|
|
|
bool CallUnlockAchievement(RE::StaticFunctionTag* tag, RE::BSFixedString achievement)
|
|
|
|
{
|
|
|
|
if (AchievementsEnabled()) {
|
|
|
|
return SteamInstance()->setAchievementUnlocked(achievement.c_str());
|
|
|
|
} else {
|
|
|
|
RE::DebugNotification(std::format("Achievement unlocked: {}", achievement.c_str()).c_str());
|
2022-09-20 11:56:38 +00:00
|
|
|
logger::info("{}", std::format("Achievement unlocked: {}", achievement.c_str()).c_str());
|
2022-08-03 19:21:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void Bind(VM& a_vm)
|
|
|
|
{
|
|
|
|
BIND(CallUnlockAchievement);
|
2022-09-20 11:56:38 +00:00
|
|
|
logger::info("{}", "Registered CallUnlockAchievement"sv);
|
2022-08-03 19:21:03 +00:00
|
|
|
}
|
|
|
|
}
|