Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of BekkiBoom Poster Collection 2 v1.0.1
plugins/CustomPosters/CustomPosters.dll
Decompiled 7 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CustomPosters.Data; using CustomPosters.Data.PosterLayouts; using CustomPosters.Patches; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CustomPosters")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Replaces the default posters in the ship with custom posters")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyInformationalVersion("3.0.0+b7dc58c45cd7694d9b583d85de5a4c7834a1fd46")] [assembly: AssemblyProduct("CustomPosters")] [assembly: AssemblyTitle("CustomPosters")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("3.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.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 CustomPosters { internal static class AssetManager { public static AssetBundle? Bundle { get; private set; } public static GameObject? PosterPrefab { get; private set; } public static void LoadAssets() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); string directoryName = Path.GetDirectoryName(executingAssembly.Location); string text = Path.Combine(directoryName, "customposters"); Bundle = AssetBundle.LoadFromFile(text); if ((Object)(object)Bundle == (Object)null) { Plugin.Log.LogError((object)"Failed to load AssetBundle."); return; } PosterPrefab = Bundle.LoadAsset<GameObject>("CustomPosterPrefab"); if ((Object)(object)PosterPrefab == (Object)null) { Plugin.Log.LogError((object)"Failed to load prefab from the AssetBundle."); } else { Plugin.Log.LogInfo((object)"Loaded assetbundle."); } } } [BepInPlugin("CustomPosters", "CustomPosters", "3.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private readonly Harmony _harmony = new Harmony("CustomPosters"); public static Plugin Instance { get; private set; } internal static ManualLogSource Log { get; private set; } public static PosterService Service { get; private set; } public static PosterConfig ModConfig { get; private set; } private void Awake() { Instance = this; Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"Initializing CustomPosters"); AssetManager.LoadAssets(); ModConfig = new PosterConfig(((BaseUnityPlugin)this).Config); Service = new PosterService(); ModConfig.Initialize(); Log.LogInfo((object)"Applying patches"); _harmony.PatchAll(typeof(StartOfRoundPatch)); _harmony.PatchAll(typeof(GameNetworkManagerPatch)); Log.LogInfo((object)"CustomPosters is loaded!"); } } internal class FileConfig { public ConfigEntry<bool> Enabled { get; } public ConfigEntry<int> Chance { get; } public ConfigEntry<int>? Volume { get; set; } public ConfigEntry<float>? MaxDistance { get; set; } public ConfigEntry<PosterConfig.VideoAspectRatio>? AspectRatio { get; set; } public FileConfig(ConfigEntry<bool> enabled, ConfigEntry<int> chance) { Enabled = enabled; Chance = chance; } } public class PosterConfig { [Serializable] public enum RandomizerMode { PerPack, PerPoster } [Serializable] public enum VideoAspectRatio { Stretch, FitInside, FitOutside, NoScaling } private readonly Dictionary<string, ConfigEntry<bool>> _packEnabledEntries = new Dictionary<string, ConfigEntry<bool>>(); private readonly Dictionary<string, ConfigEntry<int>> _packChanceEntries = new Dictionary<string, ConfigEntry<int>>(); private readonly Dictionary<string, FileConfig> _fileConfigs = new Dictionary<string, FileConfig>(); private readonly ConfigFile _configFile; public ConfigEntry<RandomizerMode> RandomizerModeSetting { get; private set; } public ConfigEntry<bool> PerSession { get; private set; } public ConfigEntry<bool> EnableTextureCaching { get; private set; } public ConfigEntry<bool> EnableVideoAudio { get; private set; } public PosterConfig(ConfigFile config) { _configFile = config; } public void Initialize() { //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Expected O, but got Unknown //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Expected O, but got Unknown //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Expected O, but got Unknown _configFile.SaveOnConfigSet = false; RandomizerModeSetting = _configFile.Bind<RandomizerMode>("1. Settings", "RandomizerMode", RandomizerMode.PerPack, "Controls how textures are randomized. PerPack: Selects one pack randomly for all posters. PerPoster: Randomizes textures for each poster from all enabled packs."); PerSession = _configFile.Bind<bool>("1. Settings", "PerSession", false, "When enabled, locks the randomization (PerPack or PerPoster) for the entire game session until the game is restarted. When disabled, randomization refreshes each time the lobby reloads."); EnableTextureCaching = _configFile.Bind<bool>("1. Settings", "EnableTextureCaching", false, "If true, caches textures and video paths in memory to improve performance. Disable to reduce memory usage."); EnableVideoAudio = _configFile.Bind<bool>("1. Settings", "EnableVideoAudio", false, "If true, enables audio playback for .mp4 poster videos. Disable to mute videos."); int num = 2; foreach (string posterFolder in Plugin.Service.PosterFolders) { try { string fileName = Path.GetFileName(posterFolder); string text = PackName(fileName); if (string.IsNullOrEmpty(text)) { continue; } string text2 = $"{num}. {text}"; string text3 = $"{num}. {text} - Chances"; ConfigEntry<bool> value = _configFile.Bind<bool>(text2, "Enabled", true, "Enable or disable the " + text + " pack"); _packEnabledEntries[text] = value; ConfigEntry<int> value2 = _configFile.Bind<int>(text3, "Global chance", 0, new ConfigDescription("Chance of selecting the " + text + " pack in PerPack randomization mode [0-100]. Set to 0 to use equal probability with other packs", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); _packChanceEntries[text] = value2; IEnumerable<string> filesFromPack = GetFilesFromPack(posterFolder); foreach (string item in filesFromPack) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(item); string text4 = Path.GetExtension(item).TrimStart('.').ToUpper(); string fileName2 = Path.GetFileName(item); string text5 = fileNameWithoutExtension + "-" + text4; ConfigEntry<bool> enabled = _configFile.Bind<bool>(text2, text5, true, "Enable or disable poster file " + fileName2 + " in pack " + text); ConfigEntry<int> chance = _configFile.Bind<int>(text3, text5 + " Chance", 0, new ConfigDescription("Chance of selecting poster " + fileName2 + " in PerPoster randomization mode [0-100]. Set to 0 to use equal probability with other posters.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); FileConfig fileConfig = new FileConfig(enabled, chance); if (text4 == "MP4") { fileConfig.Volume = _configFile.Bind<int>(text2, text5 + " Volume", 20, new ConfigDescription("Volume for video " + fileName2 + " (0-100).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); fileConfig.MaxDistance = _configFile.Bind<float>(text2, text5 + " MaxDistance", 4f, new ConfigDescription("Maximum distance for audio playback of video " + fileName2 + " (1.0-5.0)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 5f), Array.Empty<object>())); fileConfig.AspectRatio = _configFile.Bind<VideoAspectRatio>(text2, text5 + " AspectRatio", VideoAspectRatio.Stretch, "Aspect ratio mode for video " + fileName2 + ". [Stretch] - Stretches video to fit poster area. [FitInside] - Fits video inside poster area without cropping. [FitOutside] - Fits video outside poster area, cropping if necessary. [NoScaling] - Uses original video size without scaling."); } _fileConfigs[item] = fileConfig; } num++; } catch (Exception ex) { Plugin.Log.LogError((object)("Failed to generate config for pack at " + posterFolder + ": " + ex.Message)); } } ClearOrphanedEntries(); _configFile.Save(); _configFile.SaveOnConfigSet = true; } public bool IsPackEnabled(string packPath) { string key = PackName(Path.GetFileName(packPath)); if (_packEnabledEntries.TryGetValue(key, out ConfigEntry<bool> value)) { return value.Value; } return true; } public int GetPackChance(string packPath) { string key = PackName(Path.GetFileName(packPath)); if (_packChanceEntries.TryGetValue(key, out ConfigEntry<int> value)) { return value.Value; } return 0; } public bool IsFileEnabled(string filePath) { if (_fileConfigs.TryGetValue(Path.GetFullPath(filePath), out FileConfig value)) { return value.Enabled.Value; } return true; } public int GetFileChance(string filePath) { if (_fileConfigs.TryGetValue(Path.GetFullPath(filePath), out FileConfig value)) { return value.Chance.Value; } return 0; } public (int volume, float maxDistance, VideoAspectRatio aspectRatio) GetFileAudioSettings(string filePath) { if (_fileConfigs.TryGetValue(Path.GetFullPath(filePath), out FileConfig value)) { int item = value.Volume?.Value ?? 20; float item2 = value.MaxDistance?.Value ?? 4f; VideoAspectRatio item3 = value.AspectRatio?.Value ?? VideoAspectRatio.Stretch; return (item, item2, item3); } return (20, 4f, VideoAspectRatio.Stretch); } private static string PackName(string fullPackName) { int num = fullPackName.IndexOf('-'); if (num > 0 && num < fullPackName.Length - 1) { return fullPackName.Substring(num + 1); } return fullPackName; } private static IEnumerable<string> GetFilesFromPack(string packPath) { string packPath2 = packPath; string[] validExtensions = new string[5] { ".png", ".jpg", ".jpeg", ".bmp", ".mp4" }; List<string> list = new List<string>(); IEnumerable<string> enumerable = new string[4] { "posters", "tips", "CustomPosters/posters", "CustomPosters/tips" }.Select((string subDir) => Path.Combine(packPath2, subDir)); foreach (string item in enumerable) { if (Directory.Exists(item)) { list.AddRange(from f in Directory.GetFiles(item) where validExtensions.Contains(Path.GetExtension(f).ToLower()) select f); } } return from f in list.Distinct() select Path.GetFullPath(f); } private void ClearOrphanedEntries() { try { PropertyInfo propertyInfo = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries"); if (propertyInfo != null && propertyInfo.GetValue(_configFile) is Dictionary<ConfigDefinition, string> dictionary) { dictionary.Clear(); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not clear orphaned config entries: " + ex.Message)); } } } internal static class PosterManager { [CompilerGenerated] private sealed class <>c__DisplayClass15_0 { public Dictionary<string, List<(Texture2D texture, string filePath)>> allTextures; } [CompilerGenerated] private sealed class <>c__DisplayClass15_1 { public string[] validExtensions; public <>c__DisplayClass15_0 CS$<>8__locals1; public Func<string, bool> <>9__6; internal bool <CreateCustomPostersAsync>b__6(string f) { if (validExtensions.Contains(Path.GetExtension(f).ToLower())) { return Plugin.ModConfig.IsFileEnabled(f); } return false; } } [CompilerGenerated] private sealed class <>c__DisplayClass15_2 { public string file; public <>c__DisplayClass15_1 CS$<>8__locals2; internal void <CreateCustomPostersAsync>b__8((Texture2D? texture, string? filePath) result) { if ((Object)(object)result.texture != (Object)null && result.filePath != null) { string key = Path.GetFileNameWithoutExtension(result.filePath).ToLower(); if (!CS$<>8__locals2.CS$<>8__locals1.allTextures.ContainsKey(key)) { CS$<>8__locals2.CS$<>8__locals1.allTextures[key] = new List<(Texture2D, string)>(); } CS$<>8__locals2.CS$<>8__locals1.allTextures[key].Add((result.texture, result.filePath)); } else { Plugin.Log.LogWarning((object)("Failed to load texture from " + file)); } } } [CompilerGenerated] private sealed class <CreateCustomPostersAsync>d__15 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private <>c__DisplayClass15_0 <>8__1; private <>c__DisplayClass15_1 <>8__2; private GameObject <hangarShip>5__2; private GameObject <postersParent>5__3; private GameObject <posterPlane>5__4; private PosterData[] <posterData>5__5; private Dictionary<string, List<string>> <allVideos>5__6; private Dictionary<string, (Texture2D? texture, string filePath, bool isVideo)> <prioritizedContent>5__7; private bool <anyPosterLoaded>5__8; private List<string>.Enumerator <>7__wrap8; private List<string> <filesToLoad>5__10; private int <i>5__11; private List<string>.Enumerator <>7__wrap11; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CreateCustomPostersAsync>d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if ((uint)(num - -4) <= 1u || (uint)(num - 1) <= 1u) { try { if (num == -4 || num == 1) { try { } finally { <>m__Finally2(); } } } finally { <>m__Finally1(); } } <>8__1 = null; <>8__2 = null; <hangarShip>5__2 = null; <postersParent>5__3 = null; <posterPlane>5__4 = null; <posterData>5__5 = null; <allVideos>5__6 = null; <prioritizedContent>5__7 = null; <>7__wrap8 = default(List<string>.Enumerator); <filesToLoad>5__10 = null; <>7__wrap11 = default(List<string>.Enumerator); <>1__state = -2; } private bool MoveNext() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0b90: Unknown result type (might be due to invalid IL or missing references) //IL_0bb2: Unknown result type (might be due to invalid IL or missing references) //IL_0bb7: Unknown result type (might be due to invalid IL or missing references) //IL_0bd9: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>8__1 = new <>c__DisplayClass15_0(); CleanUpPosters(); <hangarShip>5__2 = GameObject.Find("Environment/HangarShip"); if ((Object)(object)<hangarShip>5__2 == (Object)null) { Plugin.Log.LogError((object)"HangarShip GameObject not found"); return false; } <postersParent>5__3 = new GameObject("CustomPosters"); <postersParent>5__3.transform.SetParent(<hangarShip>5__2.transform); <postersParent>5__3.transform.localPosition = Vector3.zero; <posterPlane>5__4 = GameObject.Find("Environment/HangarShip/Plane.001"); <posterData>5__5 = PosterLayoutProvider.GetLayout(); List<string> list = Plugin.Service.PosterFolders.Where((string folder) => Plugin.ModConfig.IsPackEnabled(folder)).ToList(); if (list.Count == 0) { Plugin.Log.LogWarning((object)"No enabled packs found"); if ((Object)(object)<posterPlane>5__4 != (Object)null) { <posterPlane>5__4.SetActive(true); } return false; } List<string> list2 = list.Select((string pack) => Path.GetFileName(pack)).ToList(); List<string> list4; if (Plugin.ModConfig.RandomizerModeSetting.Value == PosterConfig.RandomizerMode.PerPack) { if (!Plugin.ModConfig.PerSession.Value || _selectedPack == null || !list.Contains(_selectedPack)) { List<int> list3 = list.Select((string p) => Plugin.ModConfig.GetPackChance(p)).ToList(); if (list3.Any((int c) => c > 0)) { int num = list3.Sum(); double num2 = Plugin.Service.Rand.NextDouble() * (double)num; double num3 = 0.0; for (int i = 0; i < list.Count; i++) { num3 += (double)list3[i]; if (num2 <= num3) { _selectedPack = list[i]; break; } } if (_selectedPack == null) { _selectedPack = list[0]; } } else { _selectedPack = list[Plugin.Service.Rand.Next(list.Count)]; } string fileName = Path.GetFileName(_selectedPack); Plugin.Log.LogInfo((object)("PerPack randomization enabled. Using pack: " + fileName)); } list4 = new List<string> { _selectedPack }; } else { if (!Plugin.ModConfig.PerSession.Value) { _selectedPack = null; } list4 = list; Plugin.Log.LogInfo((object)"PerPoster - true, combining enabled packs"); } <>8__1.allTextures = new Dictionary<string, List<(Texture2D, string)>>(); <allVideos>5__6 = new Dictionary<string, List<string>>(); <>7__wrap8 = list4.GetEnumerator(); <>1__state = -3; goto IL_0693; } case 1: <>1__state = -4; goto IL_0622; case 2: <>1__state = -3; <i>5__11 += 5; goto IL_066f; case 3: { <>1__state = -1; goto IL_0cd6; } IL_0693: if (<>7__wrap8.MoveNext()) { string current = <>7__wrap8.Current; <>8__2 = new <>c__DisplayClass15_1(); <>8__2.CS$<>8__locals1 = <>8__1; string fileName2 = Path.GetFileName(current); string text = Path.Combine(current, "posters"); string text2 = Path.Combine(current, "tips"); string text3 = Path.Combine(current, "CustomPosters", "posters"); string text4 = Path.Combine(current, "CustomPosters", "tips"); <filesToLoad>5__10 = new List<string>(); <>8__2.validExtensions = new string[5] { ".png", ".jpg", ".jpeg", ".bmp", ".mp4" }; List<string> list5 = (from p in new string[4] { text, text2, text3, text4 } where Directory.Exists(p) select Path.GetFullPath(p).Replace('\\', '/')).Distinct<string>(StringComparer.OrdinalIgnoreCase).ToList(); foreach (string item5 in list5) { List<string> collection = (from f in Directory.GetFiles(item5) where <>8__2.validExtensions.Contains(Path.GetExtension(f).ToLower()) && Plugin.ModConfig.IsFileEnabled(f) select Path.GetFullPath(f).Replace('\\', '/')).ToList(); <filesToLoad>5__10.AddRange(collection); } <filesToLoad>5__10 = <filesToLoad>5__10.Distinct<string>(StringComparer.OrdinalIgnoreCase).ToList(); <i>5__11 = 0; goto IL_066f; } <>m__Finally1(); <>7__wrap8 = default(List<string>.Enumerator); <prioritizedContent>5__7 = new Dictionary<string, (Texture2D, string, bool)>(); foreach (KeyValuePair<string, List<(Texture2D, string)>> allTexture in <>8__1.allTextures) { if (allTexture.Value.Count > 1) { List<int> list6 = allTexture.Value.Select<(Texture2D, string), int>(((Texture2D texture, string filePath) t) => Plugin.ModConfig.GetFileChance(t.filePath)).ToList(); if (list6.Any((int c) => c > 0)) { int num4 = list6.Sum(); double num5 = Plugin.Service.Rand.NextDouble() * (double)num4; double num6 = 0.0; for (int j = 0; j < allTexture.Value.Count; j++) { num6 += (double)list6[j]; if (num5 <= num6) { <prioritizedContent>5__7[allTexture.Key] = (allTexture.Value[j].Item1, allTexture.Value[j].Item2, false); break; } } if (!<prioritizedContent>5__7.ContainsKey(allTexture.Key)) { <prioritizedContent>5__7[allTexture.Key] = (allTexture.Value[0].Item1, allTexture.Value[0].Item2, false); } } else { (Texture2D, string) tuple = allTexture.Value.OrderBy<(Texture2D, string), int>(((Texture2D texture, string filePath) t) => Plugin.Service.GetFilePriority(t.filePath)).First(); <prioritizedContent>5__7[allTexture.Key] = (tuple.Item1, tuple.Item2, false); } } else { <prioritizedContent>5__7[allTexture.Key] = (allTexture.Value[0].Item1, allTexture.Value[0].Item2, false); } } foreach (KeyValuePair<string, List<string>> item6 in <allVideos>5__6) { if (item6.Value.Count > 1) { List<int> list7 = item6.Value.Select((string v) => Plugin.ModConfig.GetFileChance(v)).ToList(); if (list7.Any((int c) => c > 0)) { int num7 = list7.Sum(); double num8 = Plugin.Service.Rand.NextDouble() * (double)num7; double num9 = 0.0; for (int k = 0; k < item6.Value.Count; k++) { num9 += (double)list7[k]; if (num8 <= num9) { <prioritizedContent>5__7[item6.Key] = (null, item6.Value[k], true); break; } } if (!<prioritizedContent>5__7.ContainsKey(item6.Key)) { <prioritizedContent>5__7[item6.Key] = (null, item6.Value[0], true); } } else { string item = item6.Value.OrderBy((string v) => Plugin.Service.GetFilePriority(v)).First(); <prioritizedContent>5__7[item6.Key] = (null, item, true); } } else { <prioritizedContent>5__7[item6.Key] = (null, item6.Value[0], true); } } if (<>8__1.allTextures.Count == 0 && <allVideos>5__6.Count == 0) { Plugin.Log.LogWarning((object)"No textures found in enabled packs"); if ((Object)(object)<posterPlane>5__4 != (Object)null) { <posterPlane>5__4.SetActive(true); } return false; } <anyPosterLoaded>5__8 = false; <i>5__11 = 0; goto IL_0ce8; IL_0ce8: if (<i>5__11 < <posterData>5__5.Length) { GameObject val = CreatePoster(); if (!((Object)(object)val == (Object)null)) { ((Object)val).name = <posterData>5__5[<i>5__11].Name; val.transform.SetParent(<postersParent>5__3.transform); val.transform.position = <posterData>5__5[<i>5__11].Position; val.transform.rotation = Quaternion.Euler(<posterData>5__5[<i>5__11].Rotation); val.transform.localScale = <posterData>5__5[<i>5__11].Scale; string key = <posterData>5__5[<i>5__11].Name.ToLower(); if (<prioritizedContent>5__7.TryGetValue(key, out (Texture2D, string, bool) value) && Plugin.ModConfig.IsFileEnabled(value.Item2)) { PosterRenderer posterRenderer = val.AddComponent<PosterRenderer>(); (Texture2D, string, bool) tuple2 = value; Texture2D item2 = tuple2.Item1; string item3 = tuple2.Item2; bool item4 = tuple2.Item3; MeshRenderer component = val.GetComponent<MeshRenderer>(); posterRenderer.Initialize(item2, item4 ? item3 : null, (component != null) ? ((Renderer)component).material : null); CreatedPosters.Add(val); <anyPosterLoaded>5__8 = true; } else { Plugin.Log.LogWarning((object)("No enabled texture or video found for " + <posterData>5__5[<i>5__11].Name + ". Destroying the poster")); Object.Destroy((Object)(object)val); } <>2__current = null; <>1__state = 3; return true; } goto IL_0cd6; } if (<anyPosterLoaded>5__8) { if ((Object)(object)<posterPlane>5__4 != (Object)null) { Object.Destroy((Object)(object)<posterPlane>5__4); } Transform obj = <hangarShip>5__2.transform.Find("Plane"); GameObject val2 = ((obj != null) ? ((Component)obj).gameObject : null); if ((Object)(object)val2 != (Object)null) { Object.Destroy((Object)(object)val2); } Plugin.Log.LogInfo((object)"Posters created successfully!"); } else if ((Object)(object)<posterPlane>5__4 != (Object)null) { <posterPlane>5__4.SetActive(true); Plugin.Log.LogWarning((object)"Re-enabled vanilla Plane.001 poster due to no custom posters loaded"); } return false; IL_0cd6: <i>5__11++; goto IL_0ce8; IL_066f: if (<i>5__11 < <filesToLoad>5__10.Count) { List<string> list8 = <filesToLoad>5__10.Skip(<i>5__11).Take(5).ToList(); <>7__wrap11 = list8.GetEnumerator(); <>1__state = -4; goto IL_0622; } <>8__2 = null; <filesToLoad>5__10 = null; goto IL_0693; IL_0622: while (<>7__wrap11.MoveNext()) { <>c__DisplayClass15_2 CS$<>8__locals0 = new <>c__DisplayClass15_2 { CS$<>8__locals2 = <>8__2, file = <>7__wrap11.Current }; if (Path.GetExtension(CS$<>8__locals0.file).ToLower() == ".mp4") { string key2 = Path.GetFileNameWithoutExtension(CS$<>8__locals0.file).ToLower(); if (!<allVideos>5__6.ContainsKey(key2)) { <allVideos>5__6[key2] = new List<string>(); } <allVideos>5__6[key2].Add(CS$<>8__locals0.file); Plugin.Service.CacheVideo(CS$<>8__locals0.file); continue; } <>2__current = LoadTextureAsync(CS$<>8__locals0.file, delegate((Texture2D? texture, string? filePath) result) { if ((Object)(object)result.texture != (Object)null && result.filePath != null) { string key3 = Path.GetFileNameWithoutExtension(result.filePath).ToLower(); if (!CS$<>8__locals0.CS$<>8__locals2.CS$<>8__locals1.allTextures.ContainsKey(key3)) { CS$<>8__locals0.CS$<>8__locals2.CS$<>8__locals1.allTextures[key3] = new List<(Texture2D, string)>(); } CS$<>8__locals0.CS$<>8__locals2.CS$<>8__locals1.allTextures[key3].Add((result.texture, result.filePath)); } else { Plugin.Log.LogWarning((object)("Failed to load texture from " + CS$<>8__locals0.file)); } }); <>1__state = 1; return true; } <>m__Finally2(); <>7__wrap11 = default(List<string>.Enumerator); <>2__current = null; <>1__state = 2; return true; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap8).Dispose(); } private void <>m__Finally2() { <>1__state = -3; ((IDisposable)<>7__wrap11).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <DelayedUpdateMaterialsAsync>d__16 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public StartOfRound instance; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DelayedUpdateMaterialsAsync>d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (_materialsUpdated) { return false; } <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: <>1__state = -1; HideVanillaPosterPlane(); <>2__current = ((MonoBehaviour)instance).StartCoroutine(CreateCustomPostersAsync()); <>1__state = 2; return true; case 2: <>1__state = -1; _materialsUpdated = true; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <LoadTextureAsync>d__11 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string filePath; public Action<(Texture2D? texture, string? filePath)> onComplete; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadTextureAsync>d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown if (<>1__state != 0) { return false; } <>1__state = -1; try { if (!File.Exists(filePath)) { Plugin.Log.LogError((object)("File not found: " + filePath)); onComplete?.Invoke((null, null)); return false; } Texture2D cachedTexture = Plugin.Service.GetCachedTexture(filePath); if ((Object)(object)cachedTexture != (Object)null) { onComplete?.Invoke((cachedTexture, filePath)); return false; } byte[] array = File.ReadAllBytes(filePath); Texture2D val = new Texture2D(2, 2); if (!ImageConversion.LoadImage(val, array)) { Plugin.Log.LogError((object)("Failed to load texture from " + filePath)); onComplete?.Invoke((null, null)); return false; } ((Texture)val).filterMode = (FilterMode)0; Plugin.Service.CacheTexture(filePath, val); onComplete?.Invoke((val, filePath)); } catch (Exception ex) { Plugin.Log.LogError((object)("Error loading file " + filePath + ": " + ex.Message)); onComplete?.Invoke((null, null)); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static bool _materialsUpdated = false; private static string? _selectedPack = null; private static readonly List<GameObject> CreatedPosters = new List<GameObject>(); private static int _sessionMapSeed = 0; private static bool _sessionSeedInitialized = false; public static bool IsNewLobby { get; set; } = true; public static void ResetSession() { _sessionSeedInitialized = false; _sessionMapSeed = 0; Plugin.Log.LogDebug((object)"Session randomization reset."); } public static void OnRoundStart(StartOfRound instance) { _materialsUpdated = false; if (IsNewLobby) { if (!_sessionSeedInitialized) { _sessionMapSeed = (Plugin.ModConfig.PerSession.Value ? StartOfRound.Instance.randomMapSeed : Environment.TickCount); _sessionSeedInitialized = true; Plugin.Log.LogDebug((object)$"Seed: {_sessionMapSeed}"); } int randomSeed; if (Plugin.ModConfig.PerSession.Value) { randomSeed = _sessionMapSeed; } else { randomSeed = Environment.TickCount; _selectedPack = null; } Plugin.Service.SetRandomSeed(randomSeed); } if (instance.inShipPhase) { ((MonoBehaviour)instance).StartCoroutine(DelayedUpdateMaterialsAsync(instance)); } IsNewLobby = false; } [IteratorStateMachine(typeof(<LoadTextureAsync>d__11))] private static IEnumerator LoadTextureAsync(string filePath, Action<(Texture2D? texture, string? filePath)> onComplete) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadTextureAsync>d__11(0) { filePath = filePath, onComplete = onComplete }; } private static void HideVanillaPosterPlane() { GameObject val = GameObject.Find("Environment/HangarShip/Plane.001 (Old)"); if ((Object)(object)val != (Object)null) { val.SetActive(false); return; } val = GameObject.Find("Environment/HangarShip/Plane.001"); if ((Object)(object)val != (Object)null) { val.SetActive(false); } } private static void CleanUpPosters() { foreach (GameObject createdPoster in CreatedPosters) { if ((Object)(object)createdPoster != (Object)null) { PosterRenderer component = createdPoster.GetComponent<PosterRenderer>(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } Object.Destroy((Object)(object)createdPoster); } } CreatedPosters.Clear(); } private static GameObject CreatePoster() { if ((Object)(object)AssetManager.PosterPrefab == (Object)null) { Plugin.Log.LogError((object)"Cannot create poster because PosterPrefab is not loaded."); return null; } return Object.Instantiate<GameObject>(AssetManager.PosterPrefab); } [IteratorStateMachine(typeof(<CreateCustomPostersAsync>d__15))] private static IEnumerator CreateCustomPostersAsync() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CreateCustomPostersAsync>d__15(0); } [IteratorStateMachine(typeof(<DelayedUpdateMaterialsAsync>d__16))] private static IEnumerator DelayedUpdateMaterialsAsync(StartOfRound instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DelayedUpdateMaterialsAsync>d__16(0) { instance = instance }; } public static void ChangePosterPack(string packName) { if (string.IsNullOrEmpty(packName)) { List<string> enabledPackNames = Plugin.Service.GetEnabledPackNames(); if (enabledPackNames.Count == 0) { return; } int num = enabledPackNames.FindIndex((string p) => p.Equals(_selectedPack, StringComparison.OrdinalIgnoreCase)); _selectedPack = enabledPackNames[(num + 1) % enabledPackNames.Count]; } else { if (!Plugin.Service.GetEnabledPackNames().Contains<string>(packName, StringComparer.OrdinalIgnoreCase)) { Plugin.Log.LogWarning((object)("Attempted to select invalid pack: " + packName)); return; } _selectedPack = packName; } Plugin.Service.SetRandomSeed(Environment.TickCount); Plugin.Log.LogInfo((object)("Changed poster pack to - " + _selectedPack)); _materialsUpdated = false; StartOfRound val = Object.FindObjectOfType<StartOfRound>(); if ((Object)(object)val != (Object)null && val.inShipPhase) { ((MonoBehaviour)val).StartCoroutine(DelayedUpdateMaterialsAsync(val)); } } } public class PosterRenderer : MonoBehaviour { private VideoPlayer? _videoPlayer; private AudioSource? _audioSource; private RenderTexture? _renderTexture; private float _originalVolume; private static VideoAspectRatio ConvertAspectRatio(PosterConfig.VideoAspectRatio aspectRatio) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) return (VideoAspectRatio)(aspectRatio switch { PosterConfig.VideoAspectRatio.Stretch => 5, PosterConfig.VideoAspectRatio.FitInside => 3, PosterConfig.VideoAspectRatio.FitOutside => 4, PosterConfig.VideoAspectRatio.NoScaling => 0, _ => 5, }); } public void Initialize(Texture2D? texture, string? videoPath, Material? materialTemplate) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Expected O, but got Unknown //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Expected O, but got Unknown //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Expected O, but got Unknown string videoPath2 = videoPath; if ((Object)(object)materialTemplate == (Object)null) { Plugin.Log.LogError((object)"Cannot initialize poster, material template is null."); Object.Destroy((Object)(object)((Component)this).gameObject); return; } MeshRenderer component = ((Component)this).GetComponent<MeshRenderer>(); Material val = new Material(materialTemplate); Shader val2 = Shader.Find("HDRP/Lit"); if ((Object)(object)val2 != (Object)null) { val.shader = val2; } else { Plugin.Log.LogWarning((object)"Could not find HDRP/Lit shader."); } ((Renderer)component).material = val; if (videoPath2 != null && Path.GetExtension(videoPath2).ToLower() == ".mp4") { _renderTexture = new RenderTexture(512, 512, 16); val.mainTexture = (Texture)(object)_renderTexture; _videoPlayer = ((Component)this).gameObject.AddComponent<VideoPlayer>(); _videoPlayer.url = "file://" + videoPath2; _videoPlayer.renderMode = (VideoRenderMode)2; _videoPlayer.targetTexture = _renderTexture; var (num, maxDistance, aspectRatio) = Plugin.ModConfig.GetFileAudioSettings(videoPath2); _videoPlayer.aspectRatio = ConvertAspectRatio(aspectRatio); _videoPlayer.isLooping = true; _videoPlayer.playOnAwake = false; _audioSource = ((Component)this).gameObject.AddComponent<AudioSource>(); _audioSource.spatialBlend = 1f; _audioSource.spatialize = false; _audioSource.rolloffMode = (AudioRolloffMode)2; AnimationCurve val3 = new AnimationCurve((Keyframe[])(object)new Keyframe[6] { new Keyframe(0f, 1f), new Keyframe(0.157f, 0.547f), new Keyframe(0.517f, 0.278f), new Keyframe(1.259f, 0.102f), new Keyframe(2.69f, 0.033f), new Keyframe(4f, 0f) }); _audioSource.SetCustomCurve((AudioSourceCurveType)0, val3); _audioSource.maxDistance = maxDistance; _videoPlayer.Stop(); _videoPlayer.errorReceived += (ErrorEventHandler)delegate(VideoPlayer player, string message) { Plugin.Log.LogError((object)("VideoPlayer error for " + videoPath2 + ": " + message)); }; _videoPlayer.prepareCompleted += (EventHandler)delegate(VideoPlayer player) { Plugin.Log.LogDebug((object)("Video prepared successfully: " + videoPath2)); player.Play(); }; _originalVolume = (float)num / 100f; if (Plugin.ModConfig.EnableVideoAudio.Value) { _videoPlayer.audioOutputMode = (VideoAudioOutputMode)1; _videoPlayer.SetTargetAudioSource((ushort)0, _audioSource); _audioSource.volume = _originalVolume; } else { _videoPlayer.audioOutputMode = (VideoAudioOutputMode)0; _audioSource.volume = 0f; } _videoPlayer.Prepare(); } else if ((Object)(object)texture != (Object)null) { val.mainTexture = (Texture)(object)texture; } else { Plugin.Log.LogError((object)("No valid texture or video for poster: " + ((Object)((Component)this).gameObject).name)); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Update() { if ((Object)(object)_audioSource != (Object)null && !Plugin.ModConfig.EnableVideoAudio.Value) { if (_audioSource.isPlaying) { _audioSource.Stop(); } _audioSource.volume = 0f; _audioSource.mute = true; } } private void OnDestroy() { if ((Object)(object)_renderTexture != (Object)null) { _renderTexture.Release(); Object.Destroy((Object)(object)_renderTexture); } if ((Object)(object)_videoPlayer != (Object)null && _videoPlayer.isPlaying) { _videoPlayer.Stop(); } } } public class PosterService { private readonly List<string> _posterFolders = new List<string>(); private readonly Dictionary<string, Texture2D> _textureCache = new Dictionary<string, Texture2D>(); private readonly Dictionary<string, string> _videoCache = new Dictionary<string, string>(); private readonly string[] _validExtensions = new string[5] { ".png", ".jpg", ".jpeg", ".bmp", ".mp4" }; private Random _rand; public IReadOnlyList<string> PosterFolders => _posterFolders.AsReadOnly(); public bool IsBiggerShipInstalled { get; private set; } public bool IsShipWindowsInstalled { get; private set; } public bool IsWindow2Enabled { get; private set; } public bool IsWiderShipModInstalled { get; private set; } public string WiderShipExtendedSide { get; private set; } = "Both"; public bool Is2StoryShipModInstalled { get; private set; } public bool EnableRightWindows { get; private set; } public bool EnableLeftWindows { get; private set; } public Dictionary<string, bool> ShipWindowsStates { get; private set; } = new Dictionary<string, bool>(); public Random Rand => _rand; public PosterService() { try { string pluginPath = Paths.PluginPath; HashSet<string> hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "CustomPosters", "seechela-CustomPosters" }; string[] directories = Directory.GetDirectories(pluginPath); foreach (string text in directories) { string fileName = Path.GetFileName(text); if (!fileName.Equals("plugins", StringComparison.OrdinalIgnoreCase) && !hashSet.Contains(fileName) && IsValidPosterPack(text)) { _posterFolders.Add(text); } } } catch (Exception ex) { Plugin.Log.LogError((object)ex.Message); } InitializeBiggerShip(); InitializeShipWindows(); InitializeWiderShipMod(); Initialize2StoryShipMod(); SetRandomSeed(Environment.TickCount); } private bool IsValidPosterPack(string folderPath) { string folderPath2 = folderPath; IEnumerable<string> enumerable = new string[4] { "posters", "tips", "CustomPosters/posters", "CustomPosters/tips" }.Select((string subDir) => Path.Combine(folderPath2, subDir)); foreach (string item in enumerable) { if (Directory.Exists(item) && Directory.EnumerateFiles(item, "*.*", SearchOption.TopDirectoryOnly).Any((string file) => _validExtensions.Contains(Path.GetExtension(file).ToLowerInvariant()))) { return true; } } return false; } private void InitializeBiggerShip() { IsBiggerShipInstalled = Chainloader.PluginInfos.ContainsKey("BiggerShip"); if (IsBiggerShipInstalled) { Plugin.Log.LogInfo((object)"Detected BiggerShip"); } } private void InitializeShipWindows() { IsShipWindowsInstalled = Chainloader.PluginInfos.ContainsKey("TestAccount666.ShipWindows"); if (!IsShipWindowsInstalled) { return; } string path = Path.Combine(Paths.ConfigPath, "TestAccount666.ShipWindows.cfg"); if (!File.Exists(path)) { Plugin.Log.LogWarning((object)"ShipWindows cfg not found"); return; } try { string[] array = File.ReadAllLines(path); bool flag = false; string[] array2 = array; foreach (string text in array2) { string text2 = text.Trim(); bool result; if (text2.StartsWith("[Right Window (SideRight)]")) { flag = true; } else if (flag && text2.StartsWith("[")) { flag = false; } else if (flag && text2.StartsWith("1. Enabled = ") && bool.TryParse(text2.Replace("1. Enabled = ", "").Trim(), out result)) { IsWindow2Enabled = result; Plugin.Log.LogInfo((object)$"Detected ShipWindows, Right Window - {IsWindow2Enabled}"); break; } } if (!flag && !IsWindow2Enabled) { Plugin.Log.LogDebug((object)"Right Window section not found"); } } catch (Exception ex) { Plugin.Log.LogError((object)("Failed to read ShipWindows cfg: " + ex.Message)); } } private void InitializeWiderShipMod() { IsWiderShipModInstalled = Chainloader.PluginInfos.ContainsKey("mborsh.WiderShipMod"); if (!IsWiderShipModInstalled) { return; } try { Type type = Type.GetType("WiderShipMod"); if (type == null) { ReadWiderShipConfigFile(); return; } FieldInfo field = type.GetField("ExtendedSide", BindingFlags.Static | BindingFlags.Public); if (field == null) { ReadWiderShipConfigFile(); return; } WiderShipExtendedSide = (string)field.GetValue(null); Plugin.Log.LogInfo((object)("Detected WiderShip, ES - " + WiderShipExtendedSide)); } catch (Exception) { ReadWiderShipConfigFile(); } } private void ReadWiderShipConfigFile() { string path = Path.Combine(Paths.ConfigPath, "mborsh.WiderShipMod.cfg"); if (!File.Exists(path)) { Plugin.Log.LogError((object)"WiderShipMod cfg not found, defaulting ES to 'Both'"); WiderShipExtendedSide = "Both"; return; } try { string[] array = File.ReadAllLines(path); string[] array2 = array; foreach (string text in array2) { string text2 = text.Trim(); if (text2.StartsWith("Extended Side = ", StringComparison.OrdinalIgnoreCase)) { WiderShipExtendedSide = text2.Substring("Extended Side = ".Length).Trim(); Plugin.Log.LogInfo((object)("Detected WiderShip, ES - " + WiderShipExtendedSide)); return; } } Plugin.Log.LogWarning((object)"ES not found in WiderShipMod cfg, defaulting to 'Both'"); WiderShipExtendedSide = "Both"; } catch (Exception ex) { Plugin.Log.LogError((object)("Failed to read WiderShipMod cfg: " + ex.Message + ", defaulting ES to 'Both'")); WiderShipExtendedSide = "Both"; } } private void Initialize2StoryShipMod() { Is2StoryShipModInstalled = Chainloader.PluginInfos.ContainsKey("MelanieMelicious.2StoryShip"); if (!Is2StoryShipModInstalled) { return; } try { Type type = Type.GetType("2StoryShip"); if (type == null) { Read2StoryShipConfigFile(); return; } FieldInfo field = type.GetField("EnableRightWindows", BindingFlags.Static | BindingFlags.Public); FieldInfo field2 = type.GetField("EnableLeftWindows", BindingFlags.Static | BindingFlags.Public); if (field == null || field2 == null) { Plugin.Log.LogWarning((object)"Failed to find EnableRightWindows or EnableLeftWindows fields in cfg"); Read2StoryShipConfigFile(); } else { EnableRightWindows = (bool)field.GetValue(null); EnableLeftWindows = (bool)field2.GetValue(null); Plugin.Log.LogInfo((object)$"Detected 2StoryShipMod, RW - {EnableRightWindows}, LW - {EnableLeftWindows}"); } } catch (Exception) { Read2StoryShipConfigFile(); } } private void Read2StoryShipConfigFile() { string path = Path.Combine(Paths.ConfigPath, "MelanieMelicious.2StoryShip.cfg"); if (!File.Exists(path)) { Plugin.Log.LogError((object)"2StoryShipMod cfg not found, defaulting RW and LW to true"); EnableRightWindows = true; EnableLeftWindows = true; Plugin.Log.LogInfo((object)$"Detected 2StoryShipMod, RW - {EnableRightWindows}, LW - {EnableLeftWindows}"); return; } try { string[] array = File.ReadAllLines(path); bool flag = false; bool flag2 = false; string[] array2 = array; foreach (string text in array2) { string text2 = text.Trim(); bool result2; if (text2.StartsWith("Enable Right Windows = ", StringComparison.OrdinalIgnoreCase)) { if (bool.TryParse(text2.Substring("Enable Right Windows = ".Length).Trim(), out var result)) { EnableRightWindows = result; flag = true; } } else if (text2.StartsWith("Enable Left Windows = ", StringComparison.OrdinalIgnoreCase) && bool.TryParse(text2.Substring("Enable Left Windows = ".Length).Trim(), out result2)) { EnableLeftWindows = result2; flag2 = true; } if (flag && flag2) { break; } } if (!flag || !flag2) { Plugin.Log.LogWarning((object)"One or both window settings not found in 2StoryShipMod cfg, defaulting unset values to true"); if (!flag) { EnableRightWindows = true; } if (!flag2) { EnableLeftWindows = true; } } Plugin.Log.LogInfo((object)$"Detected 2StoryShipMod, RW - {EnableRightWindows}, LW - {EnableLeftWindows}"); } catch (Exception ex) { Plugin.Log.LogError((object)("Failed to read 2StoryShipMod cfg: " + ex.Message + ", defaulting RW and LW to true")); EnableRightWindows = true; EnableLeftWindows = true; Plugin.Log.LogInfo((object)$"Detected 2StoryShipMod, RW - {EnableRightWindows}, LW - {EnableLeftWindows}"); } } public void SetRandomSeed(int seed) { _rand = new Random(seed); } public Texture2D? GetCachedTexture(string filePath) { if (!Plugin.ModConfig.EnableTextureCaching.Value) { return null; } if (_textureCache.TryGetValue(filePath, out Texture2D value)) { Plugin.Log.LogDebug((object)("Retrieved cached texture: " + filePath)); return value; } return null; } public void CacheTexture(string filePath, Texture2D texture) { if (Plugin.ModConfig.EnableTextureCaching.Value && !_textureCache.ContainsKey(filePath)) { _textureCache[filePath] = texture; } } public string? GetCachedVideo(string filePath) { if (!Plugin.ModConfig.EnableTextureCaching.Value) { return null; } if (_videoCache.TryGetValue(filePath, out string value)) { Plugin.Log.LogDebug((object)("Retrieved cached video: " + filePath)); return value; } return null; } public void CacheVideo(string filePath) { if (Plugin.ModConfig.EnableTextureCaching.Value && !_videoCache.ContainsKey(filePath)) { if (!File.Exists(filePath)) { Plugin.Log.LogError((object)("Cannot cache video, file does not exist: " + filePath)); return; } _videoCache[filePath] = filePath; Plugin.Log.LogDebug((object)("Cached video: " + filePath)); } } public void ClearCache() { foreach (Texture2D value in _textureCache.Values) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } } _textureCache.Clear(); _videoCache.Clear(); Plugin.Log.LogInfo((object)"Cleared texture and video cache"); } public List<string> GetEnabledPackNames() { List<string> list = (from f in PosterFolders where Plugin.ModConfig.IsPackEnabled(f) select Path.GetFullPath(f).Replace('\\', '/')).Distinct<string>(StringComparer.OrdinalIgnoreCase).ToList(); List<string> values = list.Select(Path.GetFileName).ToList(); Plugin.Log.LogDebug((object)("Enabled pack names: " + string.Join(", ", values))); return list; } public int GetFilePriority(string filePath) { return Path.GetExtension(filePath).ToLower() switch { ".png" => 1, ".jpg" => 2, ".jpeg" => 3, ".bmp" => 4, ".mp4" => 5, _ => int.MaxValue, } * 1000 + Rand.Next(0, 1000); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "CustomPosters"; public const string PLUGIN_NAME = "CustomPosters"; public const string PLUGIN_VERSION = "3.0.0"; } } namespace CustomPosters.Patches { [HarmonyPatch(typeof(GameNetworkManager))] internal class GameNetworkManagerPatch { [HarmonyPostfix] [HarmonyPatch("Start")] private static void OnStartPatch() { PosterManager.ResetSession(); } [HarmonyPostfix] [HarmonyPatch("StartHost")] private static void OnStartHostPatch() { PosterManager.IsNewLobby = true; } [HarmonyPostfix] [HarmonyPatch("JoinLobby")] private static void OnJoinLobbyPatch() { PosterManager.IsNewLobby = true; } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPostfix] [HarmonyPatch("Start")] private static void OnRoundStartPatch(StartOfRound __instance) { PosterManager.OnRoundStart(__instance); } } } namespace CustomPosters.Data { public struct PosterData { public Vector3 Position; public Vector3 Rotation; public Vector3 Scale; public string Name; } internal static class PosterLayoutProvider { public static PosterData[] GetLayout() { bool isShipWindowsInstalled = Plugin.Service.IsShipWindowsInstalled; bool isWindow2Enabled = Plugin.Service.IsWindow2Enabled; bool isWiderShipModInstalled = Plugin.Service.IsWiderShipModInstalled; string widerShipExtendedSide = Plugin.Service.WiderShipExtendedSide; bool is2StoryShipModInstalled = Plugin.Service.Is2StoryShipModInstalled; if (Plugin.Service.IsBiggerShipInstalled) { Plugin.Log.LogInfo((object)"Choosing layout: BiggerShip"); return BiggerShip.Get(); } if (is2StoryShipModInstalled) { if (isShipWindowsInstalled && isWiderShipModInstalled && !Plugin.Service.IsWindow2Enabled) { Plugin.Log.LogInfo((object)"Choosing layout: 2 Story Ship + ShipWindows + WiderShip (No left window)"); return TwoStoryShip_ShipWindows_WiderShip_NoLeftWindow.Get(); } if (isShipWindowsInstalled && isWiderShipModInstalled) { Plugin.Log.LogInfo((object)"Choosing layout: 2 Story Ship + ShipWindows + WiderShip"); return TwoStoryShip_ShipWindows_WiderShip.Get(); } if (isWiderShipModInstalled && !Plugin.Service.EnableLeftWindows) { Plugin.Log.LogInfo((object)"Choosing layout: 2 Story Ship + WiderShip (No left window)"); return TwoStoryShip_WiderShip_NoLeftWindow.Get(); } if (isShipWindowsInstalled) { Plugin.Log.LogInfo((object)"Choosing layout: 2 Story Ship + ShipWindows"); return TwoStoryShip_ShipWindows.Get(); } if (isWiderShipModInstalled) { Plugin.Log.LogInfo((object)"Choosing layout: 2 Story Ship + WiderShip"); return TwoStoryShip_WiderShip.Get(); } if (!Plugin.Service.EnableRightWindows && !Plugin.Service.EnableLeftWindows) { Plugin.Log.LogInfo((object)"Choosing layout: 2 Story Ship (No both windows)"); return TwoStoryShip_NoBothWindows.Get(); } if (Plugin.Service.EnableRightWindows && Plugin.Service.EnableLeftWindows) { Plugin.Log.LogInfo((object)"Choosing layout: 2 Story Ship (All windows)"); return TwoStoryShip_AllWindows.Get(); } if (!Plugin.Service.EnableRightWindows) { Plugin.Log.LogInfo((object)"Choosing layout: 2 Story Ship (No right window)"); return TwoStoryShip_NoRightWindow.Get(); } if (!Plugin.Service.EnableLeftWindows) { Plugin.Log.LogInfo((object)"Choosing layout: 2 Story Ship (No left window)"); return TwoStoryShip_NoLeftWindow.Get(); } } if (isShipWindowsInstalled && isWindow2Enabled && isWiderShipModInstalled && widerShipExtendedSide == "Left") { Plugin.Log.LogInfo((object)"Choosing layout: ShipWindows + WiderShip (Left)"); return ShipWindows_WiderShip_Left.Get(); } if (isWiderShipModInstalled) { Plugin.Log.LogInfo((object)("Choosing layout: WiderShip - " + widerShipExtendedSide)); switch (widerShipExtendedSide) { case "Both": return WiderShip_Both.Get(); case "Right": return WiderShip_Right.Get(); case "Left": return WiderShip_Left.Get(); } } if (isShipWindowsInstalled && isWindow2Enabled) { Plugin.Log.LogInfo((object)"Choosing layout: ShipWindows"); return ShipWindows.Get(); } Plugin.Log.LogInfo((object)"Choosing layout: Vanilla"); return Vanilla.Get(); } } } namespace CustomPosters.Data.PosterLayouts { internal static class BiggerShip { public static PosterData[] Get() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) return new PosterData[6] { new PosterData { Position = new Vector3(4.1886f, 2.8918f, -17.8606f), Rotation = new Vector3(0f, 169.6929f, 0f), Scale = new Vector3(0.6391f, 0.4882f, 2f), Name = "Poster1" }, new PosterData { Position = new Vector3(7.1953f, 2.4776f, -10.9097f), Rotation = Vector3.zero, Scale = new Vector3(0.7296f, 0.4896f, 1f), Name = "Poster2" }, new PosterData { Position = new Vector3(9.9186f, 2.8591f, -17.5587f), Rotation = new Vector3(0f, 180f, 0f), Scale = new Vector3(0.7487f, 1.0539f, 1f), Name = "Poster3" }, new PosterData { Position = new Vector3(6.3833f, 2.5963f, -10.9072f), Rotation = new Vector3(0f, 0f, 2.68f), Scale = new Vector3(0.7289f, 0.9989f, 1f), Name = "Poster4" }, new PosterData { Position = new Vector3(5.5286f, 2.5882f, -17.6184f), Rotation = new Vector3(0f, 169.7645f, 359.8f), Scale = new Vector3(0.5516f, 0.769f, 1f), Name = "Poster5" }, new PosterData { Position = new Vector3(2.7781f, 2.8174f, -10.4842f), Rotation = Vector3.zero, Scale = new Vector3(0.8596f, 1.2194f, 1f), Name = "CustomTips" } }; } } internal static class ShipWindows { public static PosterData[] Get() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) return new PosterData[6] { new PosterData { Position = new Vector3(4.1886f, 2.9318f, -16.8409f), Rotation = new Vector3(0f, 200.9872f, 0f), Scale = new Vector3(0.6391f, 0.4882f, 2f), Name = "Poster1" }, new PosterData { Position = new Vector3(6.4202f, 2.2577f, -10.8226f), Rotation = new Vector3(0f, 0f, 0f), Scale = new Vector3(0.7296f, 0.4896f, 1f), Name = "Poster2" }, new PosterData { Position = new Vector3(9.9186f, 2.8591f, -17.4716f), Rotation = new Vector3(0f, 180f, 356.3345f), Scale = new Vector3(0.7487f, 1.0539f, 1f), Name = "Poster3" }, new PosterData { Position = new Vector3(6.4449f, 3.0961f, -10.8221f), Rotation = new Vector3(0f, 0.026f, 2.68f), Scale = new Vector3(0.7289f, 0.9989f, 1f), Name = "Poster4" }, new PosterData { Position = new Vector3(5.5286f, 2.5882f, -17.3541f), Rotation = new Vector3(0f, 201.1556f, 359.8f), Scale = new Vector3(0.5516f, 0.769f, 1f), Name = "Poster5" }, new PosterData { Position = new Vector3(3.0647f, 2.8174f, -11.7341f), Rotation = new Vector3(0f, 0f, 358.6752f), Scale = new Vector3(0.8596f, 1.2194f, 1f), Name = "CustomTips" } }; } } internal static class ShipWindows_WiderShip_Left { public static PosterData[] Get() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) return new PosterData[6] { new PosterData { Position = new Vector3(4.6777f, 2.9007f, -19.63f), Rotation = new Vector3(0f, 118.2274f, 0f), Scale = new Vector3(0.6391f, 0.4882f, 2f), Name = "Poster1" }, new PosterData { Position = new Vector3(6.4202f, 2.2577f, -10.8226f), Rotation = new Vector3(0f, 0f, 0f), Scale = new Vector3(0.7296f, 0.4896f, 1f), Name = "Poster2" }, new PosterData { Position = new Vector3(9.7197f, 2.8151f, -17.4716f), Rotation = new Vector3(0f, 180f, 356.3345f), Scale = new Vector3(0.7487f, 1.0539f, 1f), Name = "Poster3" }, new PosterData { Position = new Vector3(6.4449f, 3.0961f, -10.8221f), Rotation = new Vector3(0f, 0.026f, 2.68f), Scale = new Vector3(0.7289f, 0.9989f, 1f), Name = "Poster4" }, new PosterData { Position = new Vector3(5.3602f, 2.5482f, -18.3793f), Rotation = new Vector3(0f, 118.0114f, 359.8f), Scale = new Vector3(0.5516f, 0.769f, 1f), Name = "Poster5" }, new PosterData { Position = new Vector3(2.8647f, 2.7774f, -11.7341f), Rotation = new Vector3(0f, 0f, 358.6752f), Scale = new Vector3(0.8596f, 1.2194f, 1f), Name = "CustomTips" } }; } } internal static class TwoStoryShip_AllWindows { public static PosterData[] Get() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) return new PosterData[6] { new PosterData { Position = new Vector3(10.1567f, 2.75f, -8.8293f), Rotation = new Vector3(0f, 0f, 0f), Scale = new Vector3(0.6391f, 0.4882f, 2f), Name = "Poster1" }, new PosterData { Position = new Vector3(9.0884f, 2.4776f, -8.8229f), Rotation = new Vector3(0f, 0f, 0f), Scale = new Vector3(0.7296f, 0.4896f, 1f), Name = "Poster2" }, new PosterData { Position = new Vector3(9.9186f, 2.8591f, -17.4716f), Rotation = new Vector3(0f, 180f, 356.3345f), Scale = new Vector3(0.7487f, 1.0539f, 1f), Name = "Poster3" }, new PosterData { Position = new Vector3(5.3599f, 2.5963f, -9.5555f), Rotation = new Vector3(0f, 308.5657f, 2.68f), Scale = new Vector3(0.7289f, 0.9989f, 1f), Name = "Poster4" }, new PosterData { Position = new Vector3(5.4549f, 2.8195f, -17.3266f), Rotation = new Vector3(0f, 200.8318f, 359.8f), Scale = new Vector3(0.5516f, 0.769f, 1f), Name = "Poster5" }, new PosterData { Position = new Vector3(2.5679f, 2.6763f, -11.7341f), Rotation = new Vector3(0f, 0f, 358.6752f), Scale = new Vector3(0.8596f, 1.2194f, 1f), Name = "CustomTips" } }; } } internal static class TwoStoryShip_NoBothWindows { public static PosterData[] Get() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) return new PosterData[6] { new PosterData { Position = new Vector3(4.0286f, 2.9318f, -16.7774f), Rotation = new Vector3(0f, 200.9872f, 0f), Scale = new Vector3(0.6391f, 0.4882f, 2f), Name = "Poster1" }, new PosterData { Position = new Vector3(6.4571f, 2.4776f, -8.8229f), Rotation = new Vector3(0f, 0f, 0f), Scale = new Vector3(0.7296f, 0.4896f, 1f), Name = "Poster2" }, new PosterData { Position = new Vector3(9.9186f, 2.8591f, -17.4716f), Rotation = new Vector3(0f, 180f, 356.3345f), Scale = new Vector3(0.7487f, 1.0539f, 1f), Name = "Poster3" }, new PosterData { Position = new Vector3(5.3599f, 2.5963f, -9.5555f), Rotation = new Vector3(0f, 308.5657f, 2.68f), Scale = new Vector3(0.7289f, 0.9989f, 1f), Name = "Poster4" }, new PosterData { Position = new Vector3(5.3282f, 2.7482f, -17.2754f), Rotation = new Vector3(0f, 202.3357f, 359.8f), Scale = new Vector3(0.5516f, 0.769f, 1f), Name = "Poster5" }, new PosterData { Position = new Vector3(2.5679f, 2.6763f, -11.7341f), Rotation = new Vector3(0f, 0f, 358.6752f), Scale = new Vector3(0.8596f, 1.2194f, 1f), Name = "CustomTips" } }; } } internal static class TwoStoryShip_NoLeftWindow { public static PosterData[] Get() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) return new PosterData[6] { new PosterData { Position = new Vector3(4.0286f, 2.9318f, -16.7774f), Rotation = new Vector3(0f, 200.9872f, 0f), Scale = new Vector3(0.6391f, 0.4882f, 2f), Name = "Poster1" }, new PosterData { Position = new Vector3(6.4571f, 2.4776f, -8.8229f), Rotation = new Vector3(0f, 0f, 0f), Scale = new Vector3(0.7296f, 0.4896f, 1f), Name = "Poster2" }, new PosterData { Position = new Vector3(9.9186f, 2.8591f, -17.4716f), Rotation = new Vector3(0f, 180f, 356.3345f), Scale = new Vector3(0.7487f, 1.0539f, 1f), Name = "Poster3" }, new PosterData { Position = new Vector3(5.3599f, 2.5963f, -9.5555f), Rotation = new Vector3(0f, 308.5657f, 2.68f), Scale = new Vector3(0.7289f, 0.9989f, 1f), Name = "Poster4" }, new PosterData { Position = new Vector3(5.3282f, 2.7482f, -17.2754f), Rotation = new Vector3(0f, 202.3357f, 359.8f), Scale = new Vector3(0.5516f, 0.769f, 1f), Name = "Poster5" }, new PosterData { Position = new Vector3(2.5679f, 2.6763f, -11.7341f), Rotation = new Vector3(0f, 0f, 358.6752f), Scale = new Vector3(0.8596f, 1.2194f, 1f), Name = "CustomTips" } }; } } internal static class TwoStoryShip_NoRightWindow { public static PosterData[] Get() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) return new PosterData[6] { new PosterData { Position = new Vector3(4.0286f, 2.9318f, -16.7774f), Rotation = new Vector3(0f, 200.9872f, 0f), Scale = new Vector3(0.6391f, 0.4882f, 2f), Name = "Poster1" }, new PosterData { Position = new Vector3(8.8499f, 2.4776f, -8.8229f), Rotation = new Vector3(0f, 0f, 0f), Scale = new Vector3(0.7296f, 0.4896f, 1f), Name = "Poster2" }, new PosterData { Position = new Vector3(9.9186f, 2.8591f, -17.4716f), Rotation = new Vector3(0f, 180f, 356.3345f), Scale = new Vector3(0.7487f, 1.0539f, 1f), Name = "Poster3" }, new PosterData { Position = new Vector3(5.3599f, 2.5963f, -9.5555f), Rotation = new Vector3(0f, 308.5657f, 2.68f), Scale = new Vector3(0.7289f, 0.9989f, 1f), Name = "Poster4" }, new PosterData { Position = new Vector3(5.3282f, 2.7482f, -17.2754f), Rotation = new Vector3(0f, 202.3357f, 359.8f), Scale = new Vector3(0.5516f, 0.769f, 1f), Name = "Poster5" }, new PosterData { Position = new Vector3(2.5679f, 2.6763f, -11.7341f), Rotation = new Vector3(0f, 0f, 358.6752f), Scale = new Vector3(0.8596f, 1.2194f, 1f), Name = "CustomTips" } }; } } internal static class TwoStoryShip_ShipWindows { public static PosterData[] Get() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) return new PosterData[6] { new PosterData { Position = new Vector3(4.0286f, 2.9318f, -16.7774f), Rotation = new Vector3(0f, 200.9872f, 0f), Scale = new Vector3(0.6391f, 0.4882f, 2f), Name = "Poster1" }, new PosterData { Position = new Vector3(8.8499f, 2.4776f, -8.8229f), Rotation = new Vector3(0f, 0f, 0f), Scale = new Vector3(0.7296f, 0.4896f, 1f), Name = "Poster2" }, new PosterData { Position = new Vector3(9.9186f, 2.8591f, -17.4716f), Rotation = new Vector3(0f, 180f, 356.3345f), Scale = new Vector3(0.7487f, 1.0539f, 1f), Name = "Poster3" }, new PosterData { Position = new Vector3(5.3599f, 2.5963f, -9.5555f), Rotation = new Vector3(0f, 308.5657f, 2.68f), Scale = new Vector3(0.7289f, 0.9989f, 1f), Name = "Poster4" }, new PosterData { Position = new Vector3(5.3282f, 2.7482f, -17.2754f), Rotation = new Vector3(0f, 202.3357f, 359.8f), Scale = new Vector3(0.5516f, 0.769f, 1f), Name = "Poster5" }, new PosterData { Position = new Vector3(2.5679f, 2.6763f, -11.7341f), Rotation = new Vector3(0f, 0f, 358.6752f), Scale = new Vector3(0.8596f, 1.2194f, 1f), Name = "CustomTips" } }; } } internal static class TwoStoryShip_ShipWindows_WiderShip { public static PosterData[] Get() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) return new PosterData[6] { new PosterData { Position = new Vector3(5.4012f, 2.9407f, -18.9355f), Rotation = new Vector3(0f, 231.1166f, 0f), Scale = new Vector3(0.6391f, 0.4882f, 2f), Name = "Poster1" }, new PosterData { Position = new Vector3(8.8869f, 2.5063f, -5.8225f), Rotation = new Vector3(0f, 0f, 0f), Scale = new Vector3(0.7296f, 0.4896f, 1f), Name = "Poster2" }, new PosterData { Position = new Vector3(10.1364f, 2.8591f, -22.4808f), Rotation = new Vector3(0f, 180f, 356.3345f), Scale = new Vector3(0.7487f, 1.0539f, 1f), Name = "Poster3" }, new PosterData { Position = new Vector3(5.9421f, 2.5963f, -7.4208f), Rotation = new Vector3(0f, 270f, 2.68f), Scale = new Vector3(0.7289f, 0.9989f, 1f), Name = "Poster4" }, new PosterData { Position = new Vector3(5.8425f, 2.5882f, -19.9712f), Rotation = new Vector3(0f, 270f, 359.8f), Scale = new Vector3(0.5516f, 0.769f, 1f), Name = "Poster5" }, new PosterData { Position = new Vector3(2.9911f, 2.541f, -11.7261f), Rotation = new Vector3(0f, 0f, 358.6752f), Scale = new Vector3(0.8596f, 1.2194f, 1f), Name = "CustomTips" } }; } } internal static class TwoStoryShip_ShipWindows_WiderShip_NoLeftWindow { public static PosterData[] Get() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or m