Blank star chart log page in ship log

This commit is contained in:
Nick J. Connors 2022-01-05 19:07:20 -05:00
parent d4c6a5e315
commit 97901c9ee7
4 changed files with 99 additions and 23 deletions

View File

@ -211,7 +211,7 @@ namespace NewHorizons.Builder.Body
whiteHoleVolume._fluidVolume = whiteHoleFluidVolume;
whiteHoleVolume._whiteHoleBody = OWRB;
whiteHoleVolume._whiteHoleProxyShadowSuperGroup = body.GetComponent<ProxyShadowCasterSuperGroup>();
whiteHoleVolumeGO.GetComponent<SphereCollider>().radius = size;
whiteHoleVolume.enabled = true;

View File

@ -1,40 +1,60 @@
using System;
using NewHorizons.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Logger = NewHorizons.Utility.Logger;
namespace NewHorizons.Builder.General
{
public static class ShipLogBuilder
{
public static ShipLogDetectiveMode StarChartMode;
public static ShipLogStarChartMode ShipLogStarChartMode;
public static void Init()
{
/*
Logger.Log("Fuck");
var shipLogRoot = GameObject.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas");
var starChartLog = GameObject.Instantiate(shipLogRoot.transform.Find("DetectiveMode"), shipLogRoot.transform);
starChartLog.transform.name = "StarChartMode";
Logger.Log("Fuck");
var starChartLog = new GameObject("StarChartMode");
starChartLog.SetActive(false);
starChartLog.transform.parent = shipLogRoot.transform;
starChartLog.transform.localScale = Vector3.one * 0.5f;
Logger.Log("Fuck");
ShipLogStarChartMode = starChartLog.AddComponent<ShipLogStarChartMode>();
Logger.Log("Fuck");
var reticleImage = GameObject.Instantiate(GameObject.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/DetectiveMode/ReticleImage (1)/"), starChartLog.transform);
Logger.Log("Fuck");
var scaleRoot = new GameObject("ScaleRoot");
scaleRoot.transform.parent = starChartLog.transform;
scaleRoot.transform.localScale = Vector3.one;
Logger.Log("Fuck");
var panRoot = new GameObject("PanRoot");
panRoot.transform.parent = scaleRoot.transform;
panRoot.transform.localScale = Vector3.one;
Logger.Log("Fuck");
CreateCard("Test", panRoot.transform);
}
var cardRoot = starChartLog.transform.Find("ScaleRoot").Find("PanRoot");
foreach(Transform child in cardRoot)
public static GameObject _cardTemplate = null;
public static void CreateCard(string name, Transform parent)
{
if(_cardTemplate == null)
{
GameObject.Destroy(child.gameObject);
Logger.Log("Fuck");
var panRoot = GameObject.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/DetectiveMode/ScaleRoot/PanRoot");
Logger.Log("Fuck");
_cardTemplate = GameObject.Instantiate(panRoot.GetComponentInChildren<ShipLogEntryCard>().gameObject);
Logger.Log("Fuck");
_cardTemplate.SetActive(false);
}
var cardPrefab = GameObject.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/DetectiveMode/ScaleRoot/PanRoot/TH_VILLAGE");
var detectiveMode = GameObject.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/DetectiveMode/");
var mapMode = GameObject.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/MapMode/");
StarChartMode = starChartLog.GetComponent<ShipLogDetectiveMode>();
StarChartMode._cardDict = new Dictionary<string, ShipLogEntryCard>();
StarChartMode._cardList = new List<ShipLogEntryCard>();
StarChartMode._centerPromptList = detectiveMode.GetComponent<ShipLogDetectiveMode>()._centerPromptList;
*/
var newCard = GameObject.Instantiate(_cardTemplate, parent);
Logger.Log("Fuck");
newCard.transform.Find("EntryCardRoot/NameBackground/Name").GetComponent<UnityEngine.UI.Text>().text = name;
}
}
}

View File

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NewHorizons.Components
{
public class ShipLogStarChartMode : ShipLogMode
{
public override bool AllowCancelInput()
{
return true;
}
public override bool AllowModeSwap()
{
return true;
}
public override void EnterMode(string entryID = "", List<ShipLogFact> revealQueue = null)
{
}
public override void ExitMode()
{
}
public override string GetFocusedEntryID()
{
return "0";
}
public override void Initialize(ScreenPromptList centerPromptList, ScreenPromptList upperRightPromptList, OWAudioSource oneShotSource)
{
}
public override void OnEnterComputer()
{
}
public override void OnExitComputer()
{
}
public override void UpdateMode()
{
}
}
}

View File

@ -345,7 +345,7 @@ namespace NewHorizons.Utility
if (__instance._exiting
|| OWInput.GetInputMode() != InputMode.ShipComputer
|| __instance._currentMode.AllowCancelInput() && OWInput.IsNewlyPressed(InputLibrary.cancel, InputMode.All)
|| ShipLogBuilder.StarChartMode == null)
|| ShipLogBuilder.ShipLogStarChartMode == null)
return true;
__instance._exitPrompt.SetVisibility(__instance._currentMode.AllowCancelInput());
@ -358,8 +358,8 @@ namespace NewHorizons.Utility
__instance._currentMode = (flag ? __instance._detectiveMode : __instance._mapMode);
if (currentMode.Equals(__instance._mapMode))
__instance._currentMode = ShipLogBuilder.StarChartMode;
else if (currentMode.Equals(ShipLogBuilder.StarChartMode))
__instance._currentMode = ShipLogBuilder.ShipLogStarChartMode;
else if (currentMode.Equals(ShipLogBuilder.ShipLogStarChartMode))
__instance._currentMode = __instance._detectiveMode;
else
__instance._currentMode = __instance._mapMode;