mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add fallback key to rich presence
This commit is contained in:
parent
d6479df127
commit
a98b2dd2f2
@ -466,7 +466,7 @@ namespace NewHorizons.Handlers
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
RichPresenceHandler.SetUpPlanet(body.Config.name, go, sector);
|
RichPresenceHandler.SetUpPlanet(body.Config.name, go, sector, body.Config.Star != null, body.Config.Atmosphere != null);
|
||||||
|
|
||||||
Logger.LogVerbose($"Finished creating [{body.Config.name}]");
|
Logger.LogVerbose($"Finished creating [{body.Config.name}]");
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,14 @@ namespace NewHorizons.OtherMods.OWRichPresence
|
|||||||
public void SetTriggerActivation(bool active);
|
public void SetTriggerActivation(bool active);
|
||||||
public GameObject CreateTrigger(GameObject parent, string message, string imageKey);
|
public GameObject CreateTrigger(GameObject parent, string message, string imageKey);
|
||||||
public GameObject CreateTrigger(GameObject parent, Sector sector, string message, string imageKey);
|
public GameObject CreateTrigger(GameObject parent, Sector sector, string message, string imageKey);
|
||||||
|
public GameObject CreateTrigger(GameObject parent, string message, string imageKey, string fallback);
|
||||||
|
public GameObject CreateTrigger(GameObject parent, Sector sector, string message, string imageKey, string fallback);
|
||||||
|
public void CreateTriggerVolume(OWTriggerVolume triggerVolume, string message, string imageKey);
|
||||||
|
public void CreateTriggerVolume(OWTriggerVolume triggerVolume, string message, string imageKey, string fallback);
|
||||||
|
public GameObject CreateTriggerVolume(GameObject parent, float radius, string message, string imageKey);
|
||||||
|
public GameObject CreateTriggerVolume(GameObject parent, float radius, string message, string imageKey, string fallback);
|
||||||
|
public GameObject CreateTriggerVolume(GameObject parent, Vector3 localPosition, float radius, string message, string imageKey);
|
||||||
|
public GameObject CreateTriggerVolume(GameObject parent, Vector3 localPosition, float radius, string message, string imageKey, string fallback);
|
||||||
public void SetCurrentRootPresence(string message, string imageKey);
|
public void SetCurrentRootPresence(string message, string imageKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ namespace NewHorizons.OtherMods.OWRichPresence
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetUpPlanet(string name, GameObject go, Sector sector)
|
public static void SetUpPlanet(string name, GameObject go, Sector sector, bool isStar = false, bool hasAtmosphere = false)
|
||||||
{
|
{
|
||||||
if (!Enabled) return;
|
if (!Enabled) return;
|
||||||
|
|
||||||
@ -47,7 +47,11 @@ namespace NewHorizons.OtherMods.OWRichPresence
|
|||||||
var localizedName = TranslationHandler.GetTranslation(name, TranslationHandler.TextType.UI);
|
var localizedName = TranslationHandler.GetTranslation(name, TranslationHandler.TextType.UI);
|
||||||
var message = TranslationHandler.GetTranslation("RICH_PRESENCE_EXPLORING", TranslationHandler.TextType.UI).Replace("{0}", localizedName);
|
var message = TranslationHandler.GetTranslation("RICH_PRESENCE_EXPLORING", TranslationHandler.TextType.UI).Replace("{0}", localizedName);
|
||||||
|
|
||||||
API.CreateTrigger(go, sector, message, name.Replace(" ", "").Replace("'", "").Replace("-", "").ToLowerInvariant());
|
string fallbackKey = "defaultplanet";
|
||||||
|
if (isStar) fallbackKey = "defaultstar";
|
||||||
|
else if (hasAtmosphere) fallbackKey = "defaultplanetatmosphere";
|
||||||
|
|
||||||
|
API.CreateTrigger(go, sector, message, name.Replace(" ", "").Replace("'", "").Replace("-", "").ToLowerInvariant(), fallbackKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OnStarSystemLoaded(string name)
|
public static void OnStarSystemLoaded(string name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user