using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Microsoft.CodeAnalysis;
using Mirror;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Conversation Starters")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Go Go Gadget Conversation Starters")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyInformationalVersion("1.2.0")]
[assembly: AssemblyProduct("Conversation Starters")]
[assembly: AssemblyTitle("Conversation Starters")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace ConversationCards
{
[BepInPlugin("com.gogogadgetjustice.bigtalk", "Conversation Cards", "1.0.0")]
public class Plugin : BasePlugin
{
public const string PluginGuid = "com.gogogadgetjustice.bigtalk";
public const string PluginName = "Conversation Cards";
public const string PluginVersion = "1.0.0";
public static ManualLogSource Log;
public override void Load()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Expected O, but got Unknown
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Expected O, but got Unknown
Log = ((BasePlugin)this).Log;
ManualLogSource log = Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(13, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("Conversation Cards");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" v");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.0.0");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" loading...");
}
log.LogInfo(val);
ClassInjector.RegisterTypeInIl2Cpp<DebugHotkeys>();
ClassInjector.RegisterTypeInIl2Cpp<OnScreenMessage>();
Harmony val2 = new Harmony("com.gogogadgetjustice.bigtalk");
val2.PatchAll();
SpawnTestHost();
ManualLogSource log2 = Log;
val = new BepInExInfoLogInterpolatedStringHandler(8, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("Conversation Cards");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" loaded.");
}
log2.LogInfo(val);
}
private void SpawnTestHost()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
GameObject val = new GameObject("ConversationCards_TestHost");
Object.DontDestroyOnLoad((Object)(object)val);
val.AddComponent<DebugHotkeys>();
val.AddComponent<OnScreenMessage>();
}
}
public enum QuestionCategory
{
Normal,
BigTalk,
Magic,
LoveThirtySix
}
public static class Questions
{
public static readonly Dictionary<QuestionCategory, List<string>> Pools = new Dictionary<QuestionCategory, List<string>>
{
[QuestionCategory.Normal] = new List<string>
{
"What's a small thing that made you happy this week?", "If you could instantly master one skill, what would it be?", "What's a place you've never been but really want to visit?", "What's the best piece of advice you've ever gotten?", "What's a hobby you'd pick up if time/money weren't an issue?", "What's your comfort movie or show?", "What's a food you used to hate but love now (or vice versa)?", "Who's someone who changed how you see the world?", "What's a goal you're working toward right now?", "What's a song that instantly puts you in a good mood?",
"This is nice. Did you know Bigger Talk has even more questions at ko-fi.com/gogogadgetjustice ?", "What's a chore you don't mind doing?", "What's a simple pleasure you think everyone should experience?", "What's a place you've visited that you'd never go back to?", "What's a chore you don't mind doing?", "What's a simple pleasure you think everyone should experience?", "What's a place you've visited that you'd never go back to?", "Have you been watching or reading anything good lately?", "What is your absolute favorite way to spend a day?", "What is the most interesting random fact you know?"
},
[QuestionCategory.BigTalk] = new List<string>
{
"What's a belief you hold that most people would disagree with?", "What are you most afraid of, deep down?", "What does a meaningful life look like to you?", "What's a regret you still carry?", "What value do you refuse to compromise on?", "When do you feel most like yourself?", "What's something you've changed your mind about?", "What do you think happens after we die?", "What's a truth you've learned the hard way?", "What are you still trying to forgive yourself for?",
"What's a memory that always brings you peace?", "How has your definition of love changed over time?", "What do you want people to remember about you most?", "When was the last time you felt truly understood?", "What part of your childhood do you miss the most?", "What's a hard choice you had to make that shaped who you are?", "If you could send a message to your younger self, what would it say?", "What does emotional safety mean to you in a relationship?", "What's a dream you gave up on that you still think about?", "What's something you need to let go of to move forward?",
"Do you support creatives? Did you know Bigger Talk has even more questions at ko-fi.com/gogogadgetjustice ?"
},
[QuestionCategory.Magic] = new List<string>
{
"What are your personal bad and good omens?", "Your curse can only be broken by a task you're uniquely bad at. What is it?", "What magical ability would you never tell anyone you had?", "A genie grants your wish with malicious literalism. What do you wish for, and how do you word it to survive?", "The local river spirit demands tribute. What do you toss in the water?", "Every time you lie, you hiccup glitter. How's your week going?", "There's a library of every book never written. What's the first one you check out?", "You can hear the thoughts of one species of animal. Which do you pick, and what are you afraid they'd say?", "An enchanted mirror can show you as you'll be in ten years. What do you hope you see?", "What mythical creature do you think you could actually beat in a fight?",
"What's your favorite monster or cryptid?", "If you had to haunt one specific building forever, which one are you choosing?", "If you had to guard a dungeon room, what riddle are you asking intruders?", "Which fantasy landscape would you absolutely hate hiking through?", "If you could summon one specific item out of thin air, but it’s always lukewarm, what is it?", "Why are we talking about wizards? Did you know we can get custom questions over at ko-fi.com/gogogadgetjustice?", "You can teleport, but only to locations where you felt happiest. Where are your top three travel destinations?", "You have a magic compass that points to whatever makes your day better. Where is it pointing right now?", "What mythical creature do you think you could actually beat in a fight?", "You’re the Chosen One, but your prophecy is aggressively mundane. What is your 'great and terrible destiny'?"
},
[QuestionCategory.LoveThirtySix] = new List<string>
{
"Given the choice of anyone in the world, whom would you want as a dinner guest?", "Would you like to be famous? In what way?", "Before making a telephone call, why do/don't you ever rehearse what you are going to say?", "What would constitute a 'perfect' day for you?", "When did you last sing to yourself? To someone else?", "If you lived to 90, would you rather keep the mind or the body of a 30-year-old for the final 60 years of your life?", "Do you have a secret hunch about how you will die?", "Name three things you all appear to have in common.", "For what in your life do you feel most grateful?", "If you could change anything about the way you were raised, what would it be?",
"Take four minutes and share your life story in as much detail as possible.", "If you could wake up tomorrow having gained any one quality or ability, what would it be?", "Is there something that you've dreamed of doing for a long time? Why haven't you done it?", "What is the greatest accomplishment of your life?", "What do you value most in a friendship?", "What is your most treasured memory?", "What is your most terrible memory?", "If you knew that in one year you would die suddenly, would you change anything about the way you are now living? Why?", "What does friendship mean to you?", "What roles do love and affection play in your life?",
"Alternate sharing something you consider a positive characteristic of each other. Share a total of five items.", "How close and warm is your family? Do you feel your childhood was happier than most other people's?", "How do you feel about your relationship with your mother?", "Make three true 'we' statements each. For instance, 'We are both in this room feeling...'", "Complete this sentence: 'I wish I had someone with whom I could share...'", "If you were going to become a close friends, please share what would be important for him or her to know.", "Share with your partner an embarrassing moment in your life.", "When did you last cry in front of another person? By yourself?", "Tell your partner something that you like about them already.", "What, if anything, is too serious to be joked about?",
"If you died tonight suddenly, what do you most regret not telling someone? Why haven't you yet?", "Your house catches fire. Everyone is safe, but you can rescue just one final item. What would it be and why?", "Of all the people in your family, whose death would you find most disturbing? Why?", "Share a personal problem and ask our advice. Also, ask everyone to reflect back how you seem to be feeling about it.", "Are we feeling closer? Should we consider getting custom questions over at ko-fi.com/gogogadgetjustice ?"
}
};
public static List<string> Draw(QuestionCategory category, int count)
{
List<string> collection = Pools[category];
List<string> list = new List<string>();
List<string> list2 = new List<string>(collection);
Random random = new Random();
for (int num = list2.Count - 1; num > 0; num--)
{
int num2 = random.Next(num + 1);
List<string> list3 = list2;
int index = num;
int index2 = num2;
string value = list2[num2];
string value2 = list2[num];
list3[index] = value;
list2[index2] = value2;
}
for (int i = 0; i < count; i++)
{
list.Add(list2[i % list2.Count]);
}
return list;
}
}
public static class CardVisuals
{
public static List<PeckEffectTextInput> FindExistingSignInputs()
{
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Expected O, but got Unknown
List<PeckEffectTextInput> list = new List<PeckEffectTextInput>();
Il2CppArrayBase<PeckEffectTextInput> val = Resources.FindObjectsOfTypeAll<PeckEffectTextInput>();
foreach (PeckEffectTextInput item in val)
{
if (!((Object)(object)item == (Object)null))
{
Scene scene = ((Component)item).gameObject.scene;
if (((Scene)(ref scene)).name != null)
{
list.Add(item);
}
}
}
ManualLogSource log = Plugin.Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(53, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[ConversationCards] Found ");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(list.Count);
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" existing sign(s) in scene.");
}
log.LogInfo(val2);
return list;
}
public static List<PeckEffectTextInput> FindUsableSignInputs()
{
List<PeckEffectTextInput> list = FindExistingSignInputs();
List<PeckEffectTextInput> list2 = new List<PeckEffectTextInput>();
foreach (PeckEffectTextInput item in list)
{
if (((Object)((Component)item).gameObject).name.IndexOf("spare", StringComparison.OrdinalIgnoreCase) < 0)
{
list2.Add(item);
}
}
return list2;
}
}
public static class SignBridge
{
public static bool SetSignText(PeckEffectTextInput sign, string text)
{
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Expected O, but got Unknown
if ((Object)(object)sign == (Object)null)
{
Plugin.Log.LogWarning((object)"[ConversationCards] SetSignText: sign component is null.");
return false;
}
string localAuthorIdentifier = GetLocalAuthorIdentifier();
sign.CmdSendNewText(text, localAuthorIdentifier);
ManualLogSource log = Plugin.Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(48, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ConversationCards] Set sign text: \"");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(text);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\" (author: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(localAuthorIdentifier);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")");
}
log.LogInfo(val);
return true;
}
private static string GetLocalAuthorIdentifier()
{
NetworkIdentity localPlayer = NetworkClient.localPlayer;
if ((Object)(object)localPlayer == (Object)null)
{
return "";
}
string name = ((Object)((Component)localPlayer).gameObject).name;
Match match = Regex.Match(name, "\\d{15,20}");
return match.Success ? match.Value : "";
}
}
public static class ChatBridge
{
public static void SendToChat(string message)
{
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Expected O, but got Unknown
NetworkIdentity localPlayer = NetworkClient.localPlayer;
if ((Object)(object)localPlayer == (Object)null)
{
Plugin.Log.LogWarning((object)"[ConversationCards] No local player identity yet - can't send chat message.");
return;
}
PlayerNetworking component = ((Component)localPlayer).GetComponent<PlayerNetworking>();
if ((Object)(object)component == (Object)null)
{
Plugin.Log.LogWarning((object)"[ConversationCards] Local player has no PlayerNetworking component.");
return;
}
component.CmdSendTextChatMessage(message);
ManualLogSource log = Plugin.Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(36, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ConversationCards] Sent to chat: \"");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(message);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\"");
}
log.LogInfo(val);
OnScreenMessage.Show(message);
}
}
public class OnScreenMessage : MonoBehaviour
{
private static string _currentMessage = "";
private static float _hideAt;
public OnScreenMessage(IntPtr ptr)
: base(ptr)
{
}
public static void Show(string message)
{
_currentMessage = message;
_hideAt = Time.time + 6f;
}
private void OnGUI()
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Expected O, but got Unknown
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
if (!string.IsNullOrEmpty(_currentMessage) && !(Time.time > _hideAt))
{
int num = 500;
int num2 = (Screen.width - num) / 2;
int num3 = 400;
GUI.Box(new Rect((float)num2, (float)num3, (float)num, 60f), "");
GUIStyle val = new GUIStyle(GUI.skin.label)
{
fontSize = 20,
alignment = (TextAnchor)4,
wordWrap = true
};
GUI.Label(new Rect((float)(num2 + 10), (float)(num3 + 5), (float)(num - 20), 50f), "[Card] " + _currentMessage, val);
}
}
}
public class DebugHotkeys : MonoBehaviour
{
private QuestionCategory _currentCategory = QuestionCategory.Normal;
public DebugHotkeys(IntPtr ptr)
: base(ptr)
{
}
private void Update()
{
if (Input.GetKeyDown((KeyCode)99))
{
SendCategoryQuestionToChat();
}
if (Input.GetKeyDown((KeyCode)288))
{
DumpComponentsUnderCrosshair();
}
if (Input.GetKeyDown((KeyCode)98))
{
_currentCategory = QuestionCategory.BigTalk;
Plugin.Log.LogInfo((object)"[ConversationCards] Category set: Big Talk");
}
if (Input.GetKeyDown((KeyCode)110))
{
_currentCategory = QuestionCategory.Normal;
Plugin.Log.LogInfo((object)"[ConversationCards] Category set: Normal");
}
if (Input.GetKeyDown((KeyCode)109))
{
_currentCategory = QuestionCategory.Magic;
Plugin.Log.LogInfo((object)"[ConversationCards] Category set: Magic");
}
if (Input.GetKeyDown((KeyCode)108))
{
_currentCategory = QuestionCategory.LoveThirtySix;
Plugin.Log.LogInfo((object)"[ConversationCards] Category set: Love/36 Questions");
}
if (Input.GetKeyDown((KeyCode)120))
{
AssignQuestionsToUsableSigns();
}
if (Input.GetKeyDown((KeyCode)290))
{
SceneDumper.DumpSceneObjects();
}
}
private void SendCategoryQuestionToChat()
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
List<string> list = Questions.Draw(_currentCategory, 1);
string message = list[0];
ManualLogSource log = Plugin.Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(56, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ConversationCards] F6: sending question from category ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<QuestionCategory>(_currentCategory);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(".");
}
log.LogInfo(val);
ChatBridge.SendToChat(message);
}
private void AssignQuestionsToUsableSigns()
{
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Expected O, but got Unknown
List<PeckEffectTextInput> list = CardVisuals.FindUsableSignInputs();
if (list.Count == 0)
{
Plugin.Log.LogWarning((object)"[ConversationCards] F8: no usable signs found in scene.");
return;
}
List<string> list2 = Questions.Draw(_currentCategory, list.Count);
for (int i = 0; i < list.Count; i++)
{
SignBridge.SetSignText(list[i], list2[i]);
}
ManualLogSource log = Plugin.Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(61, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ConversationCards] F8: assigned ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(list.Count);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" question(s) from category ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<QuestionCategory>(_currentCategory);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(".");
}
log.LogInfo(val);
}
private void TeleportUsableSignsToPlayer()
{
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Expected O, but got Unknown
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
Camera main = Camera.main;
if ((Object)(object)main == (Object)null)
{
Plugin.Log.LogWarning((object)"[ConversationCards] '=' pressed but Camera.main is null.");
return;
}
List<PeckEffectTextInput> list = CardVisuals.FindUsableSignInputs();
if (list.Count == 0)
{
Plugin.Log.LogWarning((object)"[ConversationCards] '=' pressed but no usable signs found in scene.");
return;
}
Vector3 val = ((Component)main).transform.position + ((Component)main).transform.forward * 2f;
float num = 0.8f;
Vector3 val2 = default(Vector3);
bool flag = default(bool);
for (int i = 0; i < list.Count; i++)
{
float num2 = (float)Math.PI * 2f / (float)list.Count * (float)i;
((Vector3)(ref val2))..ctor(Mathf.Cos(num2) * num, 0f, Mathf.Sin(num2) * num);
Vector3 val3 = val + val2;
((Component)list[i]).transform.position = val3;
((Component)list[i]).transform.rotation = Quaternion.identity;
ManualLogSource log = Plugin.Log;
BepInExInfoLogInterpolatedStringHandler val4 = new BepInExInfoLogInterpolatedStringHandler(38, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("[ConversationCards] '=': moved \"");
((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(((Object)((Component)list[i]).gameObject).name);
((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("\" to ");
((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<Vector3>(val3);
((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(".");
}
log.LogInfo(val4);
}
}
private void DumpComponentsUnderCrosshair()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Expected O, but got Unknown
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Expected O, but got Unknown
Camera main = Camera.main;
if ((Object)(object)main == (Object)null)
{
Plugin.Log.LogWarning((object)"[ConversationCards] F7 pressed but Camera.main is null.");
return;
}
RaycastHit val = default(RaycastHit);
if (!Physics.Raycast(((Component)main).transform.position, ((Component)main).transform.forward, ref val, 5f))
{
Plugin.Log.LogWarning((object)"[ConversationCards] F7: raycast hit nothing within 5m - look directly at the object.");
return;
}
GameObject gameObject = ((Component)((RaycastHit)(ref val)).collider).gameObject;
ManualLogSource log = Plugin.Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(34, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[ConversationCards] F7 hit: \"");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)gameObject).name);
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("\" at ");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Vector3>(((RaycastHit)(ref val)).point);
}
log.LogInfo(val2);
DumpComponentsOf(gameObject, "");
Transform parent = gameObject.transform.parent;
int num = 0;
while ((Object)(object)parent != (Object)null && num < 4)
{
ManualLogSource log2 = Plugin.Log;
val2 = new BepInExInfoLogInterpolatedStringHandler(34, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[ConversationCards] Parent[");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num);
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("]: \"");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)parent).name);
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("\"");
}
log2.LogInfo(val2);
DumpComponentsOf(((Component)parent).gameObject, " ");
parent = parent.parent;
num++;
}
}
private void DumpComponentsOf(GameObject go, string indent)
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected O, but got Unknown
Il2CppArrayBase<Component> components = go.GetComponents<Component>();
bool flag = default(bool);
foreach (Component item in components)
{
if (!((Object)(object)item == (Object)null))
{
ManualLogSource log = Plugin.Log;
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(22, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ConversationCards] ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(indent);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("- ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(GetRealIl2CppTypeName(item));
}
log.LogInfo(val);
}
}
}
private static string GetRealIl2CppTypeName(Component c)
{
try
{
IntPtr intPtr = IL2CPP.Il2CppObjectBaseToPtrNotNull((Il2CppObjectBase)(object)c);
IntPtr intPtr2 = IL2CPP.il2cpp_object_get_class(intPtr);
string text = Marshal.PtrToStringAnsi(IL2CPP.il2cpp_class_get_namespace(intPtr2));
string text2 = Marshal.PtrToStringAnsi(IL2CPP.il2cpp_class_get_name(intPtr2));
return string.IsNullOrEmpty(text) ? text2 : (text + "." + text2);
}
catch (Exception ex)
{
return ((object)c).GetType().FullName + " (native lookup failed: " + ex.Message + ")";
}
}
}
public static class SceneDumper
{
public static void DumpSceneObjects()
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Expected O, but got Unknown
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Expected O, but got Unknown
Il2CppArrayBase<GameObject> val = Resources.FindObjectsOfTypeAll<GameObject>();
Dictionary<string, int> dictionary = new Dictionary<string, int>();
foreach (GameObject item in val)
{
Scene scene = item.scene;
if (((Scene)(ref scene)).name != null && ((Object)item).name.IndexOf("collider", StringComparison.OrdinalIgnoreCase) < 0)
{
Collider component = item.GetComponent<Collider>();
Rigidbody component2 = item.GetComponent<Rigidbody>();
if (!((Object)(object)component == (Object)null) && !((Object)(object)component2 == (Object)null))
{
dictionary.TryGetValue(((Object)item).name, out var value);
dictionary[((Object)item).name] = value + 1;
}
}
}
ManualLogSource log = Plugin.Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(70, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[ConversationCards] Scanned scene - ");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(dictionary.Count);
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" distinct prop-like name(s) found:");
}
log.LogInfo(val2);
foreach (KeyValuePair<string, int> item2 in dictionary)
{
ManualLogSource log2 = Plugin.Log;
val2 = new BepInExInfoLogInterpolatedStringHandler(16, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" CANDIDATE: ");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(item2.Key);
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" x");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(item2.Value);
}
log2.LogInfo(val2);
}
Plugin.Log.LogInfo((object)"[ConversationCards] Dump complete.");
}
}
}