mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'dev' into stellar-remnants
This commit is contained in:
commit
827a0b464d
@ -11,7 +11,10 @@
|
|||||||
"FREQ_WARP_CORE": "Anti-Graviton Flux",
|
"FREQ_WARP_CORE": "Anti-Graviton Flux",
|
||||||
"FREQ_UNKNOWN": "???",
|
"FREQ_UNKNOWN": "???",
|
||||||
"ENGAGE_WARP_PROMPT": "Engage Warp To {0}",
|
"ENGAGE_WARP_PROMPT": "Engage Warp To {0}",
|
||||||
"WARP_LOCKED": "AUTOPILOT LOCKED TO:\n{0}"
|
"WARP_LOCKED": "AUTOPILOT LOCKED TO:\n{0}",
|
||||||
|
"LOCK_AUTOPILOT_WARP": "Lock Autopilot to Star System",
|
||||||
|
"RICH_PRESENCE_EXPLORING": "Exploring {0}.",
|
||||||
|
"RICH_PRESENCE_WARPING": "Warping to {0}."
|
||||||
},
|
},
|
||||||
"AchievementTranslations": {
|
"AchievementTranslations": {
|
||||||
"NH_EATEN_OUTSIDE_BRAMBLE": {
|
"NH_EATEN_OUTSIDE_BRAMBLE": {
|
||||||
|
|||||||
@ -6,9 +6,40 @@
|
|||||||
"NEW_HORIZONS_WARP_DRIVE_DIALOGUE_3": "Ensuite, bouclez votre ceinture et engagez le pilote automatique pour y aller!"
|
"NEW_HORIZONS_WARP_DRIVE_DIALOGUE_3": "Ensuite, bouclez votre ceinture et engagez le pilote automatique pour y aller!"
|
||||||
},
|
},
|
||||||
"UIDictionary": {
|
"UIDictionary": {
|
||||||
"INTERSTELLAR_MODE": "Mode Interstellaire",
|
"INTERSTELLAR_MODE": "Mode interstellaire",
|
||||||
"FREQ_STATUE": "Statue Nomaï",
|
"FREQ_STATUE": "Statue Nomaï",
|
||||||
"FREQ_WARP_CORE": "Flux Anti-Gravitonique",
|
"FREQ_WARP_CORE": "Flux Anti-Gravitonique",
|
||||||
"FREQ_UNKNOWN": "???"
|
"FREQ_UNKNOWN": "???",
|
||||||
|
"ENGAGE_WARP_PROMPT": "Engagez la distorsion vers {0}",
|
||||||
|
"WARP_LOCKED": "PILOTE AUTOMATIQUE VISÉ SUR:\n{0}",
|
||||||
|
"LOCK_AUTOPILOT_WARP": "Visez le pilote automatique",
|
||||||
|
"RICH_PRESENCE_EXPLORING": "En explorant {0}.",
|
||||||
|
"RICH_PRESENCE_WARPING": "En route vers {0}."
|
||||||
|
},
|
||||||
|
"AchievementTranslations": {
|
||||||
|
"NH_EATEN_OUTSIDE_BRAMBLE": {
|
||||||
|
"Name": "Brèche de confinement",
|
||||||
|
"Description": "Soyez mangé à l'extérieur de Sombronces."
|
||||||
|
},
|
||||||
|
"NH_MULTIPLE_SYSTEM": {
|
||||||
|
"Name": "Le voyageur",
|
||||||
|
"Description": "Visitez 5 systèmes solaires uniques d'affilée."
|
||||||
|
},
|
||||||
|
"NH_NEW_FREQ": {
|
||||||
|
"Name": "Fréquence anormale",
|
||||||
|
"Description": "Découvrez une nouvelle fréquence."
|
||||||
|
},
|
||||||
|
"NH_PROBE_LOST": {
|
||||||
|
"Name": "Connexion perdue",
|
||||||
|
"Description": "Perdez votre lance-guetteur."
|
||||||
|
},
|
||||||
|
"NH_WARP_DRIVE": {
|
||||||
|
"Name": "En désaccord avec l'histoire.",
|
||||||
|
"Description": "Utilisez le moteur de distorsion de votre fusée."
|
||||||
|
},
|
||||||
|
"NH_VESSEL_WARP": {
|
||||||
|
"Name": "En accord avec l'histoire.",
|
||||||
|
"Description": "Voyagez vers un autre système solaire avec le Vaissau."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.AchievementsPlus;
|
using NewHorizons.OtherMods.AchievementsPlus;
|
||||||
using NewHorizons.Components;
|
using NewHorizons.Components;
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
|
|||||||
@ -45,6 +45,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void FixMeteor(MeteorController meteor, PropModule.VolcanoInfo info)
|
private static void FixMeteor(MeteorController meteor, PropModule.VolcanoInfo info)
|
||||||
{
|
{
|
||||||
meteor.transform.localScale = Vector3.one * info.scale;
|
meteor.transform.localScale = Vector3.one * info.scale;
|
||||||
@ -53,24 +54,16 @@ namespace NewHorizons.Builder.Props
|
|||||||
mat.SetColor(Color1, info.stoneTint?.ToColor() ?? defaultStoneTint);
|
mat.SetColor(Color1, info.stoneTint?.ToColor() ?? defaultStoneTint);
|
||||||
mat.SetColor(EmissionColor, info.lavaTint?.ToColor() ?? defaultLavaTint);
|
mat.SetColor(EmissionColor, info.lavaTint?.ToColor() ?? defaultLavaTint);
|
||||||
|
|
||||||
var detectors = meteor.transform.Find("ConstantDetectors").gameObject;
|
GameObject.Destroy(meteor.transform.Find("ConstantDetectors").gameObject);
|
||||||
GameObject.Destroy(detectors.GetComponent<ConstantForceDetector>());
|
|
||||||
GameObject.Destroy(detectors.GetComponent<ConstantFluidDetector>());
|
var detectors = meteor.transform.Find("DynamicDetector").gameObject;
|
||||||
|
|
||||||
|
meteor._constantFluidDetector = null;
|
||||||
|
meteor._constantForceDetector = null;
|
||||||
|
|
||||||
var forceDetector = detectors.gameObject.AddComponent<DynamicForceDetector>();
|
var forceDetector = detectors.gameObject.AddComponent<DynamicForceDetector>();
|
||||||
detectors.gameObject.AddComponent<DynamicFluidDetector>();
|
|
||||||
|
|
||||||
detectors.layer = LayerMask.NameToLayer("BasicDetector");
|
meteor._owColliders = meteor.gameObject.GetComponentsInChildren<OWCollider>();
|
||||||
|
|
||||||
var sphere = detectors.AddComponent<SphereCollider>();
|
|
||||||
sphere.radius = 1;
|
|
||||||
|
|
||||||
var sphere2 = detectors.AddComponent<SphereShape>();
|
|
||||||
sphere2._collisionMode = Shape.CollisionMode.Detector;
|
|
||||||
sphere2.radius = 1;
|
|
||||||
|
|
||||||
forceDetector._collider = sphere;
|
|
||||||
forceDetector._shape = sphere2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.AchievementsPlus;
|
using NewHorizons.OtherMods.AchievementsPlus;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.AchievementsPlus;
|
using NewHorizons.OtherMods.AchievementsPlus;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.AchievementsPlus;
|
using NewHorizons.OtherMods.AchievementsPlus;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NewHorizons.Components.Achievement
|
namespace NewHorizons.Components.Achievement
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.AchievementsPlus.NH;
|
using NewHorizons.OtherMods.AchievementsPlus.NH;
|
||||||
|
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components
|
||||||
{
|
{
|
||||||
|
|||||||
@ -47,8 +47,8 @@ namespace NewHorizons.Components
|
|||||||
_centerPromptList = centerPromptList;
|
_centerPromptList = centerPromptList;
|
||||||
_upperRightPromptList = upperRightPromptList;
|
_upperRightPromptList = upperRightPromptList;
|
||||||
|
|
||||||
_detectiveModePrompt = new ScreenPrompt(InputLibrary.swapShipLogMode, "Rumor Mode", 0, ScreenPrompt.DisplayState.Normal, false);
|
_detectiveModePrompt = new ScreenPrompt(InputLibrary.swapShipLogMode, UITextLibrary.GetString(UITextType.LogRumorModePrompt), 0, ScreenPrompt.DisplayState.Normal, false);
|
||||||
_targetSystemPrompt = new ScreenPrompt(InputLibrary.markEntryOnHUD, "Lock Autopilot to Star System", 0, ScreenPrompt.DisplayState.Normal, false);
|
_targetSystemPrompt = new ScreenPrompt(InputLibrary.markEntryOnHUD, TranslationHandler.GetTranslation("LOCK_AUTOPILOT_WARP", TranslationHandler.TextType.UI), 0, ScreenPrompt.DisplayState.Normal, false);
|
||||||
|
|
||||||
GlobalMessenger<ReferenceFrame>.AddListener("TargetReferenceFrame", new Callback<ReferenceFrame>(OnTargetReferenceFrame));
|
GlobalMessenger<ReferenceFrame>.AddListener("TargetReferenceFrame", new Callback<ReferenceFrame>(OnTargetReferenceFrame));
|
||||||
|
|
||||||
|
|||||||
2
NewHorizons/External/Configs/AddonConfig.cs
vendored
2
NewHorizons/External/Configs/AddonConfig.cs
vendored
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NewHorizons.AchievementsPlus;
|
using NewHorizons.OtherMods.AchievementsPlus;
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.External.Modules.VariableSize;
|
using NewHorizons.External.Modules.VariableSize;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|||||||
@ -7,6 +7,7 @@ using NewHorizons.Components;
|
|||||||
using NewHorizons.Components.Orbital;
|
using NewHorizons.Components.Orbital;
|
||||||
using NewHorizons.Components.SizeControllers;
|
using NewHorizons.Components.SizeControllers;
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
|
using NewHorizons.OtherMods.OWRichPresence;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -455,6 +456,8 @@ namespace NewHorizons.Handlers
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RichPresenceHandler.SetUpPlanet(body.Config.name, go, sector);
|
||||||
|
|
||||||
Logger.LogVerbose($"Finished creating [{body.Config.name}]");
|
Logger.LogVerbose($"Finished creating [{body.Config.name}]");
|
||||||
|
|
||||||
return go;
|
return go;
|
||||||
|
|||||||
@ -2,6 +2,8 @@ using NewHorizons.External.Configs;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
|
|
||||||
namespace NewHorizons.Handlers
|
namespace NewHorizons.Handlers
|
||||||
{
|
{
|
||||||
public static class TranslationHandler
|
public static class TranslationHandler
|
||||||
@ -18,11 +20,6 @@ namespace NewHorizons.Handlers
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static string GetTranslation(string text, TextType type)
|
public static string GetTranslation(string text, TextType type)
|
||||||
{
|
|
||||||
return GetTranslation(text, type, out var _);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetTranslation(string text, TextType type, out TextTranslation.Language translatedLanguage)
|
|
||||||
{
|
{
|
||||||
Dictionary<TextTranslation.Language, Dictionary<string, string>> dictionary;
|
Dictionary<TextTranslation.Language, Dictionary<string, string>> dictionary;
|
||||||
var language = TextTranslation.Get().m_language;
|
var language = TextTranslation.Get().m_language;
|
||||||
@ -39,32 +36,25 @@ namespace NewHorizons.Handlers
|
|||||||
dictionary = _uiTranslationDictionary;
|
dictionary = _uiTranslationDictionary;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
translatedLanguage = TextTranslation.Language.UNKNOWN;
|
Logger.LogVerbose($"Invalid TextType {type}");
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the translated text
|
||||||
if (dictionary.TryGetValue(language, out var table))
|
if (dictionary.TryGetValue(language, out var table))
|
||||||
{
|
|
||||||
if (table.TryGetValue(text, out var translatedText))
|
if (table.TryGetValue(text, out var translatedText))
|
||||||
{
|
|
||||||
translatedLanguage = language;
|
|
||||||
return translatedText;
|
return translatedText;
|
||||||
}
|
|
||||||
}
|
Logger.LogVerbose($"Defaulting to english for {text}");
|
||||||
|
|
||||||
// Try to default to English
|
// Try to default to English
|
||||||
if (dictionary.TryGetValue(TextTranslation.Language.ENGLISH, out var englishTable))
|
if (dictionary.TryGetValue(TextTranslation.Language.ENGLISH, out var englishTable))
|
||||||
{
|
|
||||||
|
|
||||||
if (englishTable.TryGetValue(text, out var englishText))
|
if (englishTable.TryGetValue(text, out var englishText))
|
||||||
{
|
|
||||||
translatedLanguage = TextTranslation.Language.ENGLISH;
|
|
||||||
return englishText;
|
return englishText;
|
||||||
}
|
|
||||||
}
|
Logger.LogVerbose($"Defaulting to key for {text}");
|
||||||
|
|
||||||
// Default to the key
|
// Default to the key
|
||||||
translatedLanguage = TextTranslation.Language.UNKNOWN;
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NewHorizons.AchievementsPlus;
|
using NewHorizons.OtherMods.AchievementsPlus;
|
||||||
using NewHorizons.Builder.Atmosphere;
|
using NewHorizons.Builder.Atmosphere;
|
||||||
using NewHorizons.Builder.Body;
|
using NewHorizons.Builder.Body;
|
||||||
using NewHorizons.Builder.Props;
|
using NewHorizons.Builder.Props;
|
||||||
@ -10,7 +10,7 @@ using NewHorizons.Handlers;
|
|||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using NewHorizons.Utility.DebugMenu;
|
using NewHorizons.Utility.DebugMenu;
|
||||||
using NewHorizons.Utility.DebugUtilities;
|
using NewHorizons.Utility.DebugUtilities;
|
||||||
using NewHorizons.VoiceActing;
|
using NewHorizons.OtherMods.VoiceActing;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
using OWML.ModHelper;
|
using OWML.ModHelper;
|
||||||
using System;
|
using System;
|
||||||
@ -22,6 +22,7 @@ using UnityEngine;
|
|||||||
using UnityEngine.Events;
|
using UnityEngine.Events;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
|
using NewHorizons.OtherMods.OWRichPresence;
|
||||||
|
|
||||||
namespace NewHorizons
|
namespace NewHorizons
|
||||||
{
|
{
|
||||||
@ -198,6 +199,9 @@ namespace NewHorizons
|
|||||||
|
|
||||||
AchievementHandler.Init();
|
AchievementHandler.Init();
|
||||||
VoiceHandler.Init();
|
VoiceHandler.Init();
|
||||||
|
RichPresenceHandler.Init();
|
||||||
|
OnStarSystemLoaded.AddListener(RichPresenceHandler.OnStarSystemLoaded);
|
||||||
|
OnChangeStarSystem.AddListener(RichPresenceHandler.OnChangeStarSystem);
|
||||||
|
|
||||||
LoadAddonManifest("Assets/addon-manifest.json", this);
|
LoadAddonManifest("Assets/addon-manifest.json", this);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using OWML.ModHelper;
|
using OWML.ModHelper;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace NewHorizons.AchievementsPlus
|
namespace NewHorizons.OtherMods.AchievementsPlus
|
||||||
{
|
{
|
||||||
public static class AchievementHandler
|
public static class AchievementHandler
|
||||||
{
|
{
|
||||||
@ -16,30 +17,37 @@ namespace NewHorizons.AchievementsPlus
|
|||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
API = Main.Instance.ModHelper.Interaction.TryGetModApi<IAchievements>("xen.AchievementTracker");
|
try
|
||||||
|
|
||||||
if (API == null)
|
|
||||||
{
|
{
|
||||||
Logger.LogVerbose("Achievements+ isn't installed");
|
API = Main.Instance.ModHelper.Interaction.TryGetModApi<IAchievements>("xen.AchievementTracker");
|
||||||
Enabled = false;
|
|
||||||
return;
|
if (API == null)
|
||||||
|
{
|
||||||
|
Logger.LogVerbose("Achievements+ isn't installed");
|
||||||
|
Enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Enabled = true;
|
||||||
|
|
||||||
|
_achievements = new List<AchievementInfo>();
|
||||||
|
|
||||||
|
// Register base NH achievements
|
||||||
|
NH.WarpDriveAchievement.Init();
|
||||||
|
NH.VesselWarpAchievement.Init();
|
||||||
|
NH.MultipleSystemAchievement.Init();
|
||||||
|
NH.EatenOutsideBrambleAchievement.Init();
|
||||||
|
NH.NewFrequencyAchievement.Init();
|
||||||
|
NH.ProbeLostAchievement.Init();
|
||||||
|
|
||||||
|
API.RegisterTranslationsFromFiles(Main.Instance, "Assets/translations");
|
||||||
|
|
||||||
|
GlobalMessenger<string, bool>.AddListener("DialogueConditionChanged", OnDialogueConditionChanged);
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError($"Achievements+ handler failed to initialize: {ex}");
|
||||||
}
|
}
|
||||||
|
|
||||||
Enabled = true;
|
|
||||||
|
|
||||||
_achievements = new List<AchievementInfo>();
|
|
||||||
|
|
||||||
// Register base NH achievements
|
|
||||||
NH.WarpDriveAchievement.Init();
|
|
||||||
NH.VesselWarpAchievement.Init();
|
|
||||||
NH.MultipleSystemAchievement.Init();
|
|
||||||
NH.EatenOutsideBrambleAchievement.Init();
|
|
||||||
NH.NewFrequencyAchievement.Init();
|
|
||||||
NH.ProbeLostAchievement.Init();
|
|
||||||
|
|
||||||
API.RegisterTranslationsFromFiles(Main.Instance, "Assets/translations");
|
|
||||||
|
|
||||||
GlobalMessenger<string, bool>.AddListener("DialogueConditionChanged", OnDialogueConditionChanged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OnDestroy()
|
public static void OnDestroy()
|
||||||
@ -2,7 +2,7 @@ using NewHorizons.Builder.Props;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace NewHorizons.AchievementsPlus
|
namespace NewHorizons.OtherMods.AchievementsPlus
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Info for an achievement to be used with the Achievements+ mod.
|
/// Info for an achievement to be used with the Achievements+ mod.
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using OWML.ModHelper;
|
using OWML.ModHelper;
|
||||||
|
|
||||||
namespace NewHorizons.AchievementsPlus
|
namespace NewHorizons.OtherMods.AchievementsPlus
|
||||||
{
|
{
|
||||||
public interface IAchievements
|
public interface IAchievements
|
||||||
{
|
{
|
||||||
@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace NewHorizons.AchievementsPlus.NH
|
namespace NewHorizons.OtherMods.AchievementsPlus.NH
|
||||||
{
|
{
|
||||||
public static class EatenOutsideBrambleAchievement
|
public static class EatenOutsideBrambleAchievement
|
||||||
{
|
{
|
||||||
@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace NewHorizons.AchievementsPlus.NH
|
namespace NewHorizons.OtherMods.AchievementsPlus.NH
|
||||||
{
|
{
|
||||||
public static class MultipleSystemAchievement
|
public static class MultipleSystemAchievement
|
||||||
{
|
{
|
||||||
@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace NewHorizons.AchievementsPlus.NH
|
namespace NewHorizons.OtherMods.AchievementsPlus.NH
|
||||||
{
|
{
|
||||||
public static class NewFrequencyAchievement
|
public static class NewFrequencyAchievement
|
||||||
{
|
{
|
||||||
@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace NewHorizons.AchievementsPlus.NH
|
namespace NewHorizons.OtherMods.AchievementsPlus.NH
|
||||||
{
|
{
|
||||||
public static class ProbeLostAchievement
|
public static class ProbeLostAchievement
|
||||||
{
|
{
|
||||||
@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace NewHorizons.AchievementsPlus.NH
|
namespace NewHorizons.OtherMods.AchievementsPlus.NH
|
||||||
{
|
{
|
||||||
public static class VesselWarpAchievement
|
public static class VesselWarpAchievement
|
||||||
{
|
{
|
||||||
@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace NewHorizons.AchievementsPlus.NH
|
namespace NewHorizons.OtherMods.AchievementsPlus.NH
|
||||||
{
|
{
|
||||||
public static class WarpDriveAchievement
|
public static class WarpDriveAchievement
|
||||||
{
|
{
|
||||||
14
NewHorizons/OtherMods/OWRichPresence/IRichPresenceAPI.cs
Normal file
14
NewHorizons/OtherMods/OWRichPresence/IRichPresenceAPI.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NewHorizons.OtherMods.OWRichPresence
|
||||||
|
{
|
||||||
|
public interface IRichPresenceAPI
|
||||||
|
{
|
||||||
|
public void SetRichPresence(string message, int imageKey);
|
||||||
|
public void SetRichPresence(string message, string imageKey);
|
||||||
|
public void SetTriggerActivation(bool active);
|
||||||
|
public GameObject CreateTrigger(GameObject parent, string message, string imageKey);
|
||||||
|
public GameObject CreateTrigger(GameObject parent, Sector sector, string message, string imageKey);
|
||||||
|
public void SetCurrentRootPresence(string message, string imageKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
71
NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs
Normal file
71
NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
using NewHorizons.Components;
|
||||||
|
using NewHorizons.Handlers;
|
||||||
|
using NewHorizons.Utility;
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
|
|
||||||
|
namespace NewHorizons.OtherMods.OWRichPresence
|
||||||
|
{
|
||||||
|
public class RichPresenceHandler
|
||||||
|
{
|
||||||
|
public static bool Enabled { get; private set; }
|
||||||
|
|
||||||
|
private static IRichPresenceAPI API;
|
||||||
|
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
API = Main.Instance.ModHelper.Interaction.TryGetModApi<IRichPresenceAPI>("MegaPiggy.OWRichPresence");
|
||||||
|
|
||||||
|
if (API == null)
|
||||||
|
{
|
||||||
|
Logger.LogVerbose("OWRichPresence isn't installed");
|
||||||
|
Enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Enabled = true;
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError($"OWRichPresence handler failed to initialize: {ex}");
|
||||||
|
Enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetUpPlanet(string name, GameObject go, Sector sector)
|
||||||
|
{
|
||||||
|
if (!Enabled) return;
|
||||||
|
|
||||||
|
Logger.LogVerbose($"Registering {go.name} to OWRichPresence");
|
||||||
|
|
||||||
|
var localizedName = TranslationHandler.GetTranslation(name, TranslationHandler.TextType.UI);
|
||||||
|
var message = TranslationHandler.GetTranslation("RICH_PRESENCE_EXPLORING", TranslationHandler.TextType.UI).Replace("{0}", localizedName);
|
||||||
|
|
||||||
|
API.CreateTrigger(go, sector, message, name.Replace(" ", "").Replace("'", "").ToLowerInvariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void OnStarSystemLoaded(string name)
|
||||||
|
{
|
||||||
|
if (name == "SolarSystem") return;
|
||||||
|
|
||||||
|
var localizedName = ShipLogStarChartMode.UniqueIDToName(name);
|
||||||
|
var message = TranslationHandler.GetTranslation("RICH_PRESENCE_EXPLORING", TranslationHandler.TextType.UI).Replace("{0}", localizedName);
|
||||||
|
|
||||||
|
API.SetCurrentRootPresence(message, "sun");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void OnChangeStarSystem(string destination)
|
||||||
|
{
|
||||||
|
var localizedName = ShipLogStarChartMode.UniqueIDToName(destination);
|
||||||
|
var message = TranslationHandler.GetTranslation("RICH_PRESENCE_WARPING", TranslationHandler.TextType.UI).Replace("{0}", localizedName);
|
||||||
|
|
||||||
|
API.SetRichPresence(message, "newhorizons");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace NewHorizons.VoiceActing
|
namespace NewHorizons.OtherMods.VoiceActing
|
||||||
{
|
{
|
||||||
public interface IVoiceMod
|
public interface IVoiceMod
|
||||||
{
|
{
|
||||||
@ -1,8 +1,9 @@
|
|||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace NewHorizons.VoiceActing
|
namespace NewHorizons.OtherMods.VoiceActing
|
||||||
{
|
{
|
||||||
public static class VoiceHandler
|
public static class VoiceHandler
|
||||||
{
|
{
|
||||||
@ -12,17 +13,29 @@ namespace NewHorizons.VoiceActing
|
|||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
API = Main.Instance.ModHelper.Interaction.TryGetModApi<IVoiceMod>("Krevace.VoiceMod");
|
try
|
||||||
|
|
||||||
if (API == null)
|
|
||||||
{
|
{
|
||||||
Logger.LogVerbose("VoiceMod isn't installed");
|
API = Main.Instance.ModHelper.Interaction.TryGetModApi<IVoiceMod>("Krevace.VoiceMod");
|
||||||
Enabled = false;
|
|
||||||
return;
|
if (API == null)
|
||||||
|
{
|
||||||
|
Logger.LogVerbose("VoiceMod isn't installed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Enabled = true;
|
||||||
|
|
||||||
|
SetUp();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError($"VoiceMod handler failed to initialize: {ex}");
|
||||||
|
Enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Enabled = true;
|
private static void SetUp()
|
||||||
|
{
|
||||||
foreach (var mod in Main.Instance.GetDependants().Append(Main.Instance))
|
foreach (var mod in Main.Instance.GetDependants().Append(Main.Instance))
|
||||||
{
|
{
|
||||||
var folder = $"{mod.ModHelper.Manifest.ModFolderPath}voicemod";
|
var folder = $"{mod.ModHelper.Manifest.ModFolderPath}voicemod";
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NewHorizons.AchievementsPlus;
|
using NewHorizons.OtherMods.AchievementsPlus;
|
||||||
using NewHorizons.AchievementsPlus.NH;
|
using NewHorizons.OtherMods.AchievementsPlus.NH;
|
||||||
using NewHorizons.Builder.Props;
|
using NewHorizons.Builder.Props;
|
||||||
using NewHorizons.External;
|
using NewHorizons.External;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NewHorizons.AchievementsPlus;
|
using NewHorizons.OtherMods.AchievementsPlus;
|
||||||
using NewHorizons.Builder.ShipLog;
|
using NewHorizons.Builder.ShipLog;
|
||||||
using NewHorizons.Components;
|
using NewHorizons.Components;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user