mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Okay John you gonna complain about more properties huh?
This commit is contained in:
parent
0120b2d646
commit
df9fc8121f
@ -9,9 +9,8 @@ namespace NewHorizons.AchievementsPlus
|
|||||||
{
|
{
|
||||||
public static class AchievementHandler
|
public static class AchievementHandler
|
||||||
{
|
{
|
||||||
public static bool Enabled { get => _enabled; }
|
public static bool Enabled { get; private set; }
|
||||||
|
|
||||||
private static bool _enabled;
|
|
||||||
private static IAchievements API;
|
private static IAchievements API;
|
||||||
|
|
||||||
private static List<AchievementInfo> _achievements;
|
private static List<AchievementInfo> _achievements;
|
||||||
@ -23,11 +22,11 @@ namespace NewHorizons.AchievementsPlus
|
|||||||
if (API == null)
|
if (API == null)
|
||||||
{
|
{
|
||||||
Logger.Log("Achievements+ isn't installed");
|
Logger.Log("Achievements+ isn't installed");
|
||||||
_enabled = false;
|
Enabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_enabled = true;
|
Enabled = true;
|
||||||
|
|
||||||
_achievements = new List<AchievementInfo>();
|
_achievements = new List<AchievementInfo>();
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ namespace NewHorizons.AchievementsPlus
|
|||||||
|
|
||||||
public static void OnDestroy()
|
public static void OnDestroy()
|
||||||
{
|
{
|
||||||
if (!_enabled) return;
|
if (!Enabled) return;
|
||||||
|
|
||||||
GlobalMessenger<string, bool>.RemoveListener("DialogueConditionChanged", OnDialogueConditionChanged);
|
GlobalMessenger<string, bool>.RemoveListener("DialogueConditionChanged", OnDialogueConditionChanged);
|
||||||
}
|
}
|
||||||
@ -55,7 +54,7 @@ namespace NewHorizons.AchievementsPlus
|
|||||||
{
|
{
|
||||||
if (addon.achievements == null) return;
|
if (addon.achievements == null) return;
|
||||||
|
|
||||||
if (!_enabled) return;
|
if (!Enabled) return;
|
||||||
|
|
||||||
foreach (var achievement in addon.achievements)
|
foreach (var achievement in addon.achievements)
|
||||||
{
|
{
|
||||||
@ -69,21 +68,21 @@ namespace NewHorizons.AchievementsPlus
|
|||||||
|
|
||||||
public static void Earn(string unique_id)
|
public static void Earn(string unique_id)
|
||||||
{
|
{
|
||||||
if (!_enabled) return;
|
if (!Enabled) return;
|
||||||
|
|
||||||
API.EarnAchievement(unique_id);
|
API.EarnAchievement(unique_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Register(string unique_id, bool secret, ModBehaviour mod)
|
public static void Register(string unique_id, bool secret, ModBehaviour mod)
|
||||||
{
|
{
|
||||||
if (!_enabled) return;
|
if (!Enabled) return;
|
||||||
|
|
||||||
API.RegisterAchievement(unique_id, secret, mod);
|
API.RegisterAchievement(unique_id, secret, mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OnLearnSignal()
|
public static void OnLearnSignal()
|
||||||
{
|
{
|
||||||
if (!_enabled) return;
|
if (!Enabled) return;
|
||||||
|
|
||||||
foreach (var achievement in _achievements.Where(x => x.signalIDs != null))
|
foreach (var achievement in _achievements.Where(x => x.signalIDs != null))
|
||||||
{
|
{
|
||||||
@ -93,7 +92,7 @@ namespace NewHorizons.AchievementsPlus
|
|||||||
|
|
||||||
public static void OnRevealFact()
|
public static void OnRevealFact()
|
||||||
{
|
{
|
||||||
if (!_enabled) return;
|
if (!Enabled) return;
|
||||||
|
|
||||||
foreach (var achievement in _achievements.Where(x => x.factIDs != null))
|
foreach (var achievement in _achievements.Where(x => x.factIDs != null))
|
||||||
{
|
{
|
||||||
@ -105,7 +104,7 @@ namespace NewHorizons.AchievementsPlus
|
|||||||
|
|
||||||
public static void OnSetCondition()
|
public static void OnSetCondition()
|
||||||
{
|
{
|
||||||
if (!_enabled) return;
|
if (!Enabled) return;
|
||||||
|
|
||||||
foreach (var achievement in _achievements.Where(x => x.conditionIDs != null))
|
foreach (var achievement in _achievements.Where(x => x.conditionIDs != null))
|
||||||
{
|
{
|
||||||
@ -115,7 +114,7 @@ namespace NewHorizons.AchievementsPlus
|
|||||||
|
|
||||||
private static void CheckAchievement(AchievementInfo achievement)
|
private static void CheckAchievement(AchievementInfo achievement)
|
||||||
{
|
{
|
||||||
if (!_enabled) return;
|
if (!Enabled) return;
|
||||||
|
|
||||||
if (API.HasAchievement(achievement.ID)) return;
|
if (API.HasAchievement(achievement.ID)) return;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user