mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
commit
a6b74bcb80
@ -1,7 +1,9 @@
|
|||||||
|
using HarmonyLib;
|
||||||
using NewHorizons.Builder.Props;
|
using NewHorizons.Builder.Props;
|
||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Utility.DebugUtilities;
|
using NewHorizons.Utility.DebugUtilities;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -234,7 +236,7 @@ namespace NewHorizons.Utility.DebugMenu
|
|||||||
DebugNomaiTextPlacer.active = false;
|
DebugNomaiTextPlacer.active = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// spirals
|
// spirals
|
||||||
//
|
//
|
||||||
@ -526,33 +528,14 @@ namespace NewHorizons.Utility.DebugMenu
|
|||||||
{
|
{
|
||||||
var conversationsJSON = conversations
|
var conversationsJSON = conversations
|
||||||
.GroupBy(conversation => conversation.planetConfig.name)
|
.GroupBy(conversation => conversation.planetConfig.name)
|
||||||
.Select(allConversationsOnBody =>
|
.Select(allConversationsOnBody =>
|
||||||
allConversationsOnBody.Key +
|
{
|
||||||
"\n[" +
|
var json = allConversationsOnBody.Join(
|
||||||
allConversationsOnBody.Select(conversation =>
|
conversation => "\t" + JsonConvert.SerializeObject(conversation.conversation, DebugMenu.jsonSettings),
|
||||||
"\t{\n" +
|
",\n"
|
||||||
$"\t\t\"position\": {conversation.conversation.position},\n" +
|
);
|
||||||
$"\t\t\"normal\": {conversation.conversation.normal},\n" +
|
return $"{allConversationsOnBody.Key}\n[\n{json}\n]";
|
||||||
(conversation.conversation.parentPath == default ? "" : $"\t\t\"parentPath\": \"{conversation.conversation.parentPath}\",\n") +
|
});
|
||||||
(conversation.conversation.location == NomaiTextInfo.NomaiTextLocation.UNSPECIFIED ? "" : $"\t\t\"location\": {conversation.conversation.location},\n") +
|
|
||||||
(conversation.conversation.rotation == default ? "" : $"\t\t\"rotation\": {conversation.conversation.rotation},\n") +
|
|
||||||
(conversation.conversation.rename == default ? "" : $"\t\t\"rename\": \"{conversation.conversation.rename}\",\n") +
|
|
||||||
(conversation.conversation.seed == default ? "" : $"\t\t\"seed\": {conversation.conversation.seed},\n") +
|
|
||||||
(conversation.conversation.type == NomaiTextInfo.NomaiTextType.Wall ? "" : $"\t\t\"type\": \"{conversation.conversation.type}\",\n") +
|
|
||||||
$"\t\t\"xmlFile\": \"{conversation.conversation.xmlFile}\",\n" +
|
|
||||||
"\t\t\"arcInfo\": [\n" +
|
|
||||||
string.Join(",\n", conversation.spirals.Select(spiral =>
|
|
||||||
"\t\t\t{" +
|
|
||||||
$"\"position\": {spiral.spiral.position}, " +
|
|
||||||
$"\"zRotation\": {spiral.spiral.zRotation}, " +
|
|
||||||
(spiral.spiral.mirror == default ? "" : $"\"mirror\": {spiral.spiral.mirror}, ") +
|
|
||||||
(spiral.spiral.type == NomaiTextArcInfo.NomaiTextArcType.Adult ? "" : $"\"type\": \"{spiral.spiral.type}\", ") +
|
|
||||||
(spiral.spiral.variation == -1 ? "" : $"\"variation\": {spiral.spiral.variation}") +
|
|
||||||
"}"
|
|
||||||
)) +
|
|
||||||
"\t\t]"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach(string json in conversationsJSON)
|
foreach(string json in conversationsJSON)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
using HarmonyLib;
|
||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Utility.DebugUtilities;
|
using NewHorizons.Utility.DebugUtilities;
|
||||||
@ -388,9 +389,12 @@ namespace NewHorizons.Utility.DebugMenu
|
|||||||
|
|
||||||
internal override void PrintNewConfigSection(DebugMenu menu)
|
internal override void PrintNewConfigSection(DebugMenu menu)
|
||||||
{
|
{
|
||||||
foreach(var body in _dpp.GetPropsConfigByBody())
|
foreach (var body in _dpp.GetPropsConfigByBody())
|
||||||
{
|
{
|
||||||
var json = string.Join(",\n", body.Value.Select(detail => "\t"+ JsonConvert.SerializeObject(detail, DebugMenu.jsonSettings)));
|
var json = body.Value.Join(
|
||||||
|
detail => "\t" + JsonConvert.SerializeObject(detail, DebugMenu.jsonSettings),
|
||||||
|
",\n"
|
||||||
|
);
|
||||||
Logger.Log($"{body.Key.name} ({body.Value.Length})\n[\n{json}\n]");
|
Logger.Log($"{body.Key.name} ({body.Value.Length})\n[\n{json}\n]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
|
using HarmonyLib;
|
||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
|
using NewHorizons.External.Modules;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -35,16 +38,17 @@ namespace NewHorizons.Utility.DebugMenu
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetEntryPositionsJSON()
|
private string GetEntryPositionsJSON() =>
|
||||||
{
|
Resources
|
||||||
return string.Join(",\n",
|
.FindObjectsOfTypeAll<ShipLogEntryCard>()
|
||||||
Resources
|
.Join(
|
||||||
.FindObjectsOfTypeAll<ShipLogEntryCard>()
|
entry => JsonConvert.SerializeObject(new ShipLogModule.EntryPositionInfo
|
||||||
.Select(go =>
|
{
|
||||||
"{ \"id\": \"" +go.name+ "\", \"position\": {\"x\": "+go.transform.localPosition.x+", \"y\": "+go.transform.localPosition.y+" } "
|
id = entry.name,
|
||||||
)
|
position = new MVector2(entry.transform.localPosition.x, entry.transform.localPosition.y)
|
||||||
);
|
}, DebugMenu.jsonSettings),
|
||||||
}
|
",\n"
|
||||||
|
);
|
||||||
|
|
||||||
internal override void OnGUI(DebugMenu menu)
|
internal override void OnGUI(DebugMenu menu)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user