Add a feature to change the game over dialogue that appears when the autopilot leaves a planet early because all players have died.
Currently, players have no feedback indicating whether their changes to the ScrapProtection config are functioning as intended other than when they respawn in the ship after the game over animation.
I already made a mod to test the possibility of implementing this feature. Here's a code snippet on how I made it work:
static int scrapMode = Plugin.CFg.scrapMode;
//0 = SAVE_NONE, 1 = SAVE_COIN, 2 = SAVE_ALL
[HarmonyPatch("gameOverAnimation")]
[HarmonyPrefix]
static void GameOverDialogueChange(ref DialogueSegment[] ___gameOverDialogue)
{
if (scrapMode == 0)
{
Plugin.Log.LogInfo("No text were changed.");
}
else if (scrapMode == 1)
{
Plugin.Log.LogInfo("Changed text to SAVE_COIN mode.");
___gameOverDialogue[1].bodyText = "The autopilot will now attempt to fly to the closest safe spaceport. Some of your items have been lost.";
}
else if (scrapMode == 2)
{
Plugin.Log.LogInfo("Changed text to SAVE_ALL mode.");
___gameOverDialogue[1].bodyText = "The autopilot will now attempt to fly to the closest safe spaceport. None of your items have been lost.";
}
}
Add a feature to change the game over dialogue that appears when the autopilot leaves a planet early because all players have died.
Currently, players have no feedback indicating whether their changes to the ScrapProtection config are functioning as intended other than when they respawn in the ship after the game over animation.
I already made a mod to test the possibility of implementing this feature. Here's a code snippet on how I made it work: