Skip to content

Commit

Permalink
1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pkmniako committed Feb 14, 2023
1 parent 9a50e1e commit 5b95348
Show file tree
Hide file tree
Showing 13 changed files with 150 additions and 7 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ This mod also includes some laser sail parts that require custom code to work. Y

## Changelog

- **1.0.2**
- Story Mode
- Added a pop-out window on new saves to indicate what to do to start the story
- Added other pop-outs
- Rephrased a clue due to imprecision
- Fixes
- Lower the terrain quality of C4-2 to avoid some clipping.
- **1.0.1**
- Fixes
- Made parallax configuration for C2-1 less laggy
Expand Down
3 changes: 2 additions & 1 deletion gamedata/OtherWorldsReboot/Bundles/Credits.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ISLAND_CLR.dds and ISLAND_NRM.dds from https://polyhaven.com/a/rocks_ground_06, licensed under CC0
ISLAND_CLR.dds and ISLAND_NRM.dds from https://polyhaven.com/a/rocks_ground_06, licensed under CC0
Bundled fonts obtained from Google Fonts
Binary file modified gamedata/OtherWorldsReboot/Bundles/otherworlds_linux
Binary file not shown.
Binary file modified gamedata/OtherWorldsReboot/Bundles/otherworlds_mac
Binary file not shown.
Binary file modified gamedata/OtherWorldsReboot/Bundles/otherworlds_win
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
PQS
{
minLevel = 2
maxLevel = 11
maxLevel = 9
mapMaxHeight = 60000
minDetailDistance = 6
maxQuadLengthsPerFrame = 0.03
Expand Down
Binary file modified gamedata/OtherWorldsReboot/Plugins/OtherWorldsProgram.dll
Binary file not shown.
7 changes: 7 additions & 0 deletions gamedata/OtherWorldsReboot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ As optional mods, you can use *Enviromental Visual Enhancments*, *Scatterer* and

## Changelog

- **1.0.2**
- Story Mode
- Added a pop-out window on new saves to indicate what to do to start the story
- Added other pop-outs
- Rephrased a clue due to imprecision
- Fixes
- Lower the terrain quality of C4-2 to avoid some clipping.
- **1.0.1**
- Fixes
- Made parallax configuration for C2-1 less laggy
Expand Down
12 changes: 11 additions & 1 deletion src/OtherWorldsProgram/LOC/OWP_LOC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,21 @@ public static void LoadData(string lang) {
//TODO: Different languages

if(lang.Equals("en_en")) {
//Popouts
data.Add("Popout_First_Header", "Kerbal Space Agency\nDepartment of Interstellar Studies &\nSprite II Mission Team");
data.Add("Popout_First_Body", "\n<DATE>\n\nTo the chief of the the Kerbal Space Agency:\n\n\nThe Team for the Sprite II Mission would like to recommend the agency to highly prioritize the exploration of the Cercani exoplanetary system. Our team members have gone through every process or event that could explain the PRP-2611 signal, with the only coherent answer being an artificial origin [1].\n\nTo help future missions, we also calculated the location for the smaller signal PRP-2611B, assuming a tidally locked Vassa, at 15.58 latitude and -174.58 longitude [2]. We added these coordinates to the tracking station's system.\n\nWe know that the efforts by the Department of Interstellar Studies to communicate with this hypothetical alien species have yielded no results, but we believe this doesn't rule out an artificial origin, and in fact, it's to be expected.\n\nBest regards, Mare Kerman, head of the Sprite II Mission Team.");
data.Add("Popout_First_Refs", "[1] Origins of PRP-2611, an artificial source?; DIS; Sprite II Team\n[2] Orbital analysis & PRP-2611: DIS: Sprite II Team");
data.Add("Popout_Second_Body", "\n<DATE>\n\nTo the chief of the the Kerbal Space Agency:\n\n\nThe finding of the artifact at Vassa has been such monumental news. All the team is extremely happy, and in fact, wants to keep helping with the agencies other missions using their knowledge they gained from the Sprite II Mission.\n\nWe have taken the liberty to reverse engineer the artifact itself by using the descriptions and measurements the kerbals took while on the exoplanet, and we have made, in collaboration with Intervision, a replica. This way, we can have a backup in case the original one is lost.\n\nIntervision wanted to take all the praise though, so we made them stick some Sprite II stickers on the recreation. You will find a stock of these on the VAB's Cargo Section.\n\nBest regards, Mare Kerman, head of the Sprite II Mission Team.");
data.Add("Popout_Third_Body", "\n<DATE>\n\nTo the chief of the the Kerbal Space Agency:\n\n\nWe write to inform we have colaborated once again with Intervision to make a new recreation of another alien artifact, the one that was found on Pequar.\n\nThe weak signal, that the original item produced, was picked up as very noisy data in the readouts that were published on the scientific journal 'Skies of stars', but we were able to filter it to find out the patterns that it emmitted. Like the last recreation, this one's objective is to serve as a back up if the original one is lost... or blows up. Like last time, we added a stock of them to the Vehicle Assembly Building's Cargo Section.\n\nThis time, we haven't been able to convince Intervision to add the stickers to the recreation.\n\nBest regards, Mare Kerman, head of the Sprite II Mission Team.");
data.Add("Popout_SecondThird_Body", "\n<DATE>\n\nTo the chief of the the Kerbal Space Agency:\n\n\nChief, I'm going to ignore formal language in this letter. We can't believe all the findings that have happened on the Cercani system. To know that our mission kickstarted the discovery of intelligent alien life is an honour we will cherish for all of our lives.\n\nWe've been so hyped by the discoveries that we started working with some friends we know from Intervision, the guys that make the laser sails. Between them, us, and the measurements of the original artifacts found on Cercani, we've been able to reverse engineer both of them, and produce replicas that will serve as backups in case the originals are lost.\n\nWe sneaked into the Cargo section of the VAB to leave some of them there.\n\nBest regards, Mare Kerman, head of the Sprite II Mission Team.");
data.Add("Empty", "");

//Story
data.Add("Intro_Waypoint_Vassa", "Radio Signal PRP-2611 B");
data.Add("Intro_Waypoint_C2-1", "Radio Signal PRP-2611");

data.Add("Signal_Troni_1_Name","SOS CD301Y2");
data.Add("Signal_Troni_1_Dial","#(switchanim=1,showui=true,timenext=2.0) New Journal, Day 1031. I'm the first one to ever land on this planet,#(timenext=0.75) and the results are fascinating.#(timenext=2.5) #(clear=1)The ground on the night side of this world looks just#(cameraui=false) like that of an icy moon orbiting a distant gas giant. If I had suddenly woken up here one day, I would think I was in one of those moons, really.#(timenext=3.0) #(clear=1)This place is really nice though, A permanent clear sky perfect for gazing upon the stars, no annoying atmosphere, and enough gravity where you could see yourself making a nice place where to live,#(timenext=1.5) of course if you ignore everything else about the planet that wants to kill you.#(timenext=3.0) #(clear=1,switchanim=2)I don't want to be here for much longer. Going here takes a lot of fuel, so I have to go back to the gas giant to refuel, then I will make a place where to live, at least for some time, at the <b>moon that orbits backwards</b>, specifically around <b>24 degrees north</b> and <b>20 degrees west from where the gas giant stands in the middle of the sky</b>.#(timenext=4.0) #(close=short)");
data.Add("Signal_Troni_1_Dial","#(switchanim=1,showui=true,timenext=2.0) New Journal, Day 1031. I'm the first one to ever land on this planet,#(timenext=0.75) and the results are fascinating.#(timenext=2.5) #(clear=1)The ground on the night side of this world looks just#(cameraui=false) like that of an icy moon orbiting a distant gas giant. If I had suddenly woken up here one day, I would think I was in one of those moons, really.#(timenext=3.0) #(clear=1)This place is really nice though, A permanent clear sky perfect for gazing upon the stars, no annoying atmosphere, and enough gravity where you could see yourself making a nice place where to live,#(timenext=1.5) of course if you ignore everything else about the planet that wants to kill you.#(timenext=3.0) #(clear=1,switchanim=2)I don't want to be here for much longer. Going here takes a lot of fuel, so I have to go back to the gas giant to refuel, then I will make a place where to live, at least for some time, at the <b>moon that orbits backwards</b>, specifically <b>in the second biggest plateau</b>, and <b>24 degrees north</b>.#(timenext=0.5) I want to do some sky photography.#(timenext=4.0) #(close=short)");

data.Add("Signal_Vassa_1_Name","SOS CD8Y0");
data.Add("Signal_Vassa_1_Dial","#(timenext=1.0) Last Travels Log, I'm lost#(timenext=4.0) #(switchanim=1,showui=true,clear=1) I've been a week stuck in this planet and I'm pretty sure this is <b>Sunset Bay</b>...#(switchanim=2,cameraui=false,timenext=2.0) but as if nothing was ever here.#(timenext=2.0) #(switchanim=3,clear=1)The spacecraft #(switchanim=0)is severely damaged, with multiple leaks that I have to fix.#(timenext=2.0) #(clear=1)Following the Program's policy, in case of being stranded in any star system, I have to setup emergency signals across the system.#(timenext=2.0) #(clear=1)One of them has to be powerful enough for its signal to reach other stars, while also being on a fast-rotating body.#(timenext=4.0) #(switchanim=4,clear=1)I know a perfect place for that.#(timenext=4.0) #(close=short)");
Expand Down
12 changes: 11 additions & 1 deletion src/OtherWorldsProgram/OWP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Progress Data

public static bool artifact1Spawned = false;
public static bool artifact2Spawned = false;
public static bool popout1shown = false, popout1shownNow = false;
public static bool popout2shown = false, popout2shownNow = false;

/*
Object-tracking data
Expand Down Expand Up @@ -217,7 +219,8 @@ public void OnDisable() {

private void _OnNewSaveFile() {
Debug.Log("[Other Worlds] Running new savefile routine...");
OWP_PlanetManager.SpawnCustomWaypoints();
OWP_PlanetManager.SpawnCustomWaypoints();
OWP_Popout.OnFirstKSC();
}

/*
Expand All @@ -229,6 +232,8 @@ public override void OnSave(ConfigNode node) {
node.AddValue("owProgress", progress);
node.AddValue("a1s", artifact1Spawned);
node.AddValue("a2s", artifact2Spawned);
node.AddValue("popout1shown", popout1shown);
node.AddValue("popout2shown", popout2shown);
node.AddValue("newSaveChecksDone", !runNewSavefileRoutine);
}

Expand All @@ -245,6 +250,11 @@ public override void OnLoad(ConfigNode node) {
if(node.HasValue("a2s"))
artifact2Spawned = Boolean.Parse(node.GetValue("a2s"));

if(node.HasValue("popout1shown"))
popout1shown = Boolean.Parse(node.GetValue("popout1shown"));
if(node.HasValue("popout2shown"))
popout2shown = Boolean.Parse(node.GetValue("popout2shown"));

if(node.HasValue("newSaveChecksDone"))
runNewSavefileRoutine = !Boolean.Parse(node.GetValue("newSaveChecksDone"));
else
Expand Down
2 changes: 2 additions & 0 deletions src/OtherWorldsProgram/OWP_EventsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ private void OnGameSceneSwitchRequested(GameEvents.FromToAction<GameScenes, Game
//Debug.Log("[Other Worlds] OnGameSceneSwitchRequested()");
OWP_Ending.StopCutscene();
OWP_Music.StopMusic();
OWP_Popout.OnSceneChange();
}
private void OnSceneConfirmExit(GameScenes scenes) {
OWP_LocPillar.ResetCircling();
Expand All @@ -93,6 +94,7 @@ private void OnVesselSwitch(Vessel orig, Vessel target) {
private void OnEditorShowPartList() {
OnSceneConfirmExit(GameScenes.FLIGHT);
OWP.SetPartVisibilityOnEditor();
OWP_Popout.OnEnterEditor();
}

private void OnFlightReady() {
Expand Down
6 changes: 3 additions & 3 deletions src/OtherWorldsProgram/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: KSPAssembly("Other Worlds Program", 1, 0, 1)]
[assembly: KSPAssembly("Other Worlds Program", 1, 0, 2)]

[assembly: AssemblyTitle("Other Worlds Program - Addon for Other Worlds Reboot")]
[assembly: AssemblyDescription("Addon to control hand-made elements of the Other Worlds mod")]
[assembly: AssemblyProduct("Niako_Mod_OtherWorldsProgram")]
[assembly: AssemblyCopyright("Copyright © pkmniako 2022, ARR")]
[assembly: ComVisible(false)]
[assembly: Guid("FAE04EC0-301F-11D3-BF4B-00C04F79EFBC")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
106 changes: 106 additions & 0 deletions src/OtherWorldsProgram/UI/OWP_Popout.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
using System;
using System.Collections.Generic;

using UnityEngine;
using UnityEngine.UI;

using KSP.UI.Screens;
using KSP.Localization;
using FinePrint;

namespace NiakoKerbalMods
{
namespace OtherWorldsProgram
{
public class OWP_Popout : MonoBehaviour {
/*
Monobehaviour
*/
public Button buttonClose;
public GameObject main;

public void DeletePopout() {
Destroy(main);
}

/*
Static Methods
*/

public static OWP_Popout instance;
private const string PREFAB_PATH = "assets/otherworlds/ui/letter/owletterui.prefab";

public static void OnSceneChange() {
//Called when on a scene change. Used to delete the UI.
if(instance == null) return;
instance.DeletePopout();
}

public static void OnFirstKSC() {
//Runs the first time you see the KSC screen on a savefile, called from OWP
string date = KSPUtil.PrintDate(Planetarium.GetUniversalTime(), false) + ".";
SpawnPopout(
OWP_LOC.Get("Popout_First_Header"),
OWP_LOC.Get("Popout_First_Body").Replace("<DATE>", date),
OWP_LOC.Get("Popout_First_Refs")
);
}

public static void OnEnterEditor() {
bool show1 = !OWP.popout1shown && OWP.GetProgressBit(28) && !OWP.popout1shownNow;
bool show2 = !OWP.popout2shown && OWP.GetProgressBit(29) && !OWP.popout2shownNow;

if(show1) { OWP.popout1shown = true; OWP.popout1shownNow = true; }
if(show2) { OWP.popout2shown = true; OWP.popout2shownNow = true; }

string loc = "";
if(show1 && show2) {
loc = "SecondThird";
} else if(show1) {
loc = "Second";
} else if(show2) {
loc = "Third";
} else {
return;
}

string date = KSPUtil.PrintDate(Planetarium.GetUniversalTime(), false) + ".";

SpawnPopout(
OWP_LOC.Get("Popout_First_Header"),
OWP_LOC.Get($"Popout_{loc}_Body").Replace("<DATE>", date),
OWP_LOC.Get("Empty")
);
}

public static void SpawnPopout(string header, string body, string references) {
if(instance != null) {
instance.DeletePopout();
instance = null;
}

GameObject ui = OWP.LoadAsset<GameObject>(PREFAB_PATH);
ui.transform.SetParent(MainCanvasUtil.MainCanvas.transform);
ui.AddComponent<OWP_DraggableUI>(); //Add Drag MonoBehaivour to LaserUI
ui.SetActive(true);

if(ui == null) {
Debug.LogError($"[Other Worlds] Couldn't instantiate '{PREFAB_PATH}'. Check Asset Bundle. Popout spawn cancelled.");
return;
}

instance = ui.AddComponent<OWP_Popout>();

ui.transform.Find("Header").GetComponent<Text>().text = header;
ui.transform.Find("Body").GetComponent<Text>().text = body;
ui.transform.Find("References").GetComponent<Text>().text = references;

instance.buttonClose = ui.transform.Find("ButtonClose").GetComponent<Button>();
instance.buttonClose.onClick.AddListener(instance.DeletePopout);
instance.main = ui;

Debug.Log("[Other Worlds] Spawned Popout");
}
}
}
}

0 comments on commit 5b95348

Please sign in to comment.