From f688019e01722bb7eded53a3ca6beddcfa76a896 Mon Sep 17 00:00:00 2001 From: Daioutzu <54756730+Daioutzu@users.noreply.github.com> Date: Fri, 6 Nov 2020 23:36:07 +0000 Subject: [PATCH 01/11] Added support for new DLCs Added - Doombox, Switch and Latch DLCs --- TextureMod/ShowcaseStudio.cs | 191 ++++++++++++++++++----------------- TextureMod/TextureChanger.cs | 8 +- TextureMod/TextureMod.cs | 6 +- TextureMod/TextureMod.csproj | 150 +++++++++++++-------------- 4 files changed, 184 insertions(+), 171 deletions(-) diff --git a/TextureMod/ShowcaseStudio.cs b/TextureMod/ShowcaseStudio.cs index dcbcf01..4a4d575 100644 --- a/TextureMod/ShowcaseStudio.cs +++ b/TextureMod/ShowcaseStudio.cs @@ -1,11 +1,7 @@ -using System; +using LLScreen; +using System; using System.Collections.Generic; -using System.Linq; using UnityEngine; -using GameplayEntities; -using LLScreen; -using LLGUI; -using LLHandlers; namespace TextureMod { @@ -56,8 +52,9 @@ private void OnGUI() { GUI.skin.box.fontSize = 18; GUI.Window(777, new Rect(10, 10, Screen.width / 7, Screen.height - 20), new GUI.WindowFunction(AnimationSelectionWindow), "Showcase Studio", CustomStyle.windStyle); - if (showControls) GUI.Window(778, new Rect(20 + (Screen.width/7), 10, 10 + ((Screen.width / 7)*2), Screen.height/3), new GUI.WindowFunction(ControlsWindow), "Controls", CustomStyle.windStyle); - } else + if (showControls) GUI.Window(778, new Rect(20 + (Screen.width / 7), 10, 10 + ((Screen.width / 7) * 2), Screen.height / 3), new GUI.WindowFunction(ControlsWindow), "Controls", CustomStyle.windStyle); + } + else { if (SUS != null && !hideGUI) { @@ -67,12 +64,23 @@ private void OnGUI() } } + bool initCustomStyle = false; + + void Start() + { + + } + private void Update() { if (SUS == null) { SUS = FindObjectOfType(); - CustomStyle.InitStyle(); + if (initCustomStyle == false) + { + CustomStyle.InitStyle(); + initCustomStyle = true; + } } else { @@ -258,7 +266,7 @@ private void FixedUpdate() characterModel.transform.Rotate(Vector3.right * speed); characterModel.transform.Rotate(Vector3.forward * speed); } - if (Input.GetKey(KeyCode.W)) + if (Input.GetKey(KeyCode.W)) { characterModel.transform.Rotate(-Vector3.right * speed); characterModel.transform.Rotate(-Vector3.forward * speed); @@ -284,97 +292,98 @@ private void FixedUpdate() private void AnimationSelectionWindow(int winID) { GUILayout.BeginVertical(); - GUILayout.Space(30); - GUILayout.Box("General Options"); - GUILayout.BeginHorizontal(); - GUILayout.Label("Show controls: "); - if (GUILayout.Button(showControls.ToString())) - { - showControls = !showControls; - } - GUILayout.EndHorizontal(); - GUILayout.BeginHorizontal(); - GUILayout.Label("Skin Name: "); - GUILayout.Label(skinName); - GUILayout.EndHorizontal(); - - GUILayout.BeginHorizontal(); - GUILayout.Label("Skin Refresh: "); - if (!refreshMode) GUILayout.Label("Off"); - else GUILayout.Label("On [" + refreshTimer.ToString() + "]"); - GUILayout.EndHorizontal(); + GUILayout.Space(30); + GUILayout.Box("General Options"); + GUILayout.BeginHorizontal(); + GUILayout.Label("Show controls: "); + if (GUILayout.Button(showControls.ToString())) + { + showControls = !showControls; + } + GUILayout.EndHorizontal(); + GUILayout.BeginHorizontal(); + GUILayout.Label("Skin Name: "); + GUILayout.Label(skinName); + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + GUILayout.Label("Skin Refresh: "); + if (!refreshMode) GUILayout.Label("Off"); + else GUILayout.Label("On [" + refreshTimer.ToString() + "]"); + GUILayout.EndHorizontal(); + + GUILayout.Space(20); + + GUILayout.Box("BG and Lighting Options"); + GUILayout.BeginHorizontal(); + GUILayout.Label("Enable Lighting: "); + if (GUILayout.Button(enableLight.ToString())) + { + enableLight = !enableLight; + } + GUILayout.EndHorizontal(); - GUILayout.Space(20); + GUILayout.BeginHorizontal(); + GUILayout.Label("Show BG Color select: "); + if (GUILayout.Button(bgColorSelection.ToString())) + { + bgColorSelection = !bgColorSelection; + } + GUILayout.EndHorizontal(); - GUILayout.Box("BG and Lighting Options"); - GUILayout.BeginHorizontal(); - GUILayout.Label("Enable Lighting: "); - if (GUILayout.Button(enableLight.ToString())) - { - enableLight = !enableLight; - } - GUILayout.EndHorizontal(); + if (bgColorSelection) + { + GUILayout.Label("RGB: [" + bgR.ToString() + ", " + bgG.ToString() + ", " + bgB.ToString() + "]"); + bgR = (byte)GUILayout.HorizontalSlider(bgR, 0f, 255f); + bgG = (byte)GUILayout.HorizontalSlider(bgG, 0f, 255f); + bgB = (byte)GUILayout.HorizontalSlider(bgB, 0f, 255f); + } - GUILayout.BeginHorizontal(); - GUILayout.Label("Show BG Color select: "); - if (GUILayout.Button(bgColorSelection.ToString())) - { - bgColorSelection = !bgColorSelection; - } - GUILayout.EndHorizontal(); - - if (bgColorSelection) - { - GUILayout.Label("RGB: [" + bgR.ToString() + ", " + bgG.ToString() + ", " + bgB.ToString() + "]" ); - bgR = (byte)GUILayout.HorizontalSlider(bgR, 0f, 255f); - bgG = (byte)GUILayout.HorizontalSlider(bgG, 0f, 255f); - bgB = (byte)GUILayout.HorizontalSlider(bgB, 0f, 255f); - } + GUILayout.Space(20); - GUILayout.Space(20); + GUILayout.Box("Animation Options"); + GUILayout.BeginHorizontal(); + GUILayout.Label("Current Animation:"); + GUILayout.Label(currentAnimation); + GUILayout.EndHorizontal(); - GUILayout.Box("Animation Options"); - GUILayout.BeginHorizontal(); - GUILayout.Label("Current Animation:"); - GUILayout.Label(currentAnimation); - GUILayout.EndHorizontal(); - - GUILayout.BeginHorizontal(); - if (characterModel != null) - { - Animation anim = characterModel.gameObject.GetComponentInChildren(); - GUILayout.Label("Animation time:"); - GUILayout.Label(Decimal.Round((decimal)animationTime, 2) + "s / " + Decimal.Round((decimal)anim[currentAnimation].length, 2).ToString() + "s"); - } - GUILayout.EndHorizontal(); + GUILayout.BeginHorizontal(); + if (characterModel != null) + { + Animation anim = characterModel.gameObject.GetComponentInChildren(); + GUILayout.Label("Animation time:"); + GUILayout.Label(Decimal.Round((decimal)animationTime, 2) + "s / " + Decimal.Round((decimal)anim[currentAnimation].length, 2).ToString() + "s"); + } + GUILayout.EndHorizontal(); - GUILayout.BeginHorizontal(); - GUILayout.Label("Play Animation"); - if (GUILayout.Button(animate.ToString())) - { - animate = !animate; - } - GUILayout.EndHorizontal(); + GUILayout.BeginHorizontal(); + GUILayout.Label("Play Animation"); + if (GUILayout.Button(animate.ToString())) + { + animate = !animate; + } + GUILayout.EndHorizontal(); - if (animate) - { - GUILayout.Space(5); - GUILayout.Label("Animation speed: " + Decimal.Round((decimal)animationSpeed).ToString() + " FPS"); - animationSpeed = GUILayout.HorizontalSlider(animationSpeed, 0f, 60f); - GUILayout.Space(5); - } else - { - GUILayout.Space(5); - GUILayout.Label("Animation step:"); - animationPos = GUILayout.HorizontalSlider(animationPos, 0f, 1f); - GUILayout.Space(5); - } + if (animate) + { + GUILayout.Space(5); + GUILayout.Label("Animation speed: " + Decimal.Round((decimal)animationSpeed).ToString() + " FPS"); + animationSpeed = GUILayout.HorizontalSlider(animationSpeed, 0f, 60f); + GUILayout.Space(5); + } + else + { + GUILayout.Space(5); + GUILayout.Label("Animation step:"); + animationPos = GUILayout.HorizontalSlider(animationPos, 0f, 1f); + GUILayout.Space(5); + } - animSelectionPos = GUILayout.BeginScrollView(animSelectionPos, false, true); - if (animList.Count > 0) selectedGridAnim = GUILayout.SelectionGrid(selectedGridAnim, animList.ToArray(), 1); + animSelectionPos = GUILayout.BeginScrollView(animSelectionPos, false, true); + if (animList.Count > 0) selectedGridAnim = GUILayout.SelectionGrid(selectedGridAnim, animList.ToArray(), 1); - currentAnimation = animList[selectedGridAnim]; + currentAnimation = animList[selectedGridAnim]; GUILayout.EndScrollView(); GUILayout.EndVertical(); diff --git a/TextureMod/TextureChanger.cs b/TextureMod/TextureChanger.cs index ee28391..7a40175 100644 --- a/TextureMod/TextureChanger.cs +++ b/TextureMod/TextureChanger.cs @@ -35,7 +35,7 @@ public class TextureChanger : MonoBehaviour private List playersInCurrentGame = new List(); - public Color32[] originalDNAColors = new Color32[AOIOFOIHOCJ.outfitOutlineColors.Length]; + public Color32[] originalDNAColors = new Color32[BagPlayer.outfitOutlineColors.Length]; #endregion #region Config Fields @@ -1370,6 +1370,12 @@ private CharacterVariant GetVariantFromFileName(Character localPlayerC, string n case Character.GRAF: foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Toxic") proceed = true; break; + case Character.ROBOT: + foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Switch") proceed = true; + break; + case Character.CROC: + foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Latch") proceed = true; + break; default: proceed = false; break; diff --git a/TextureMod/TextureMod.cs b/TextureMod/TextureMod.cs index 38b355d..e29c25b 100644 --- a/TextureMod/TextureMod.cs +++ b/TextureMod/TextureMod.cs @@ -14,7 +14,7 @@ public class TextureMod : MonoBehaviour private static TextureMod instance = null; public static TextureMod Instance { get { return instance; } } public static void Initialize() { GameObject gameObject = new GameObject("TextureMod"); TextureMod modscript = gameObject.AddComponent(); DontDestroyOnLoad(gameObject); instance = modscript; } - private const string modVersion = "v1.4.0"; + private const string modVersion = "v1.4.1"; private const string repositoryOwner = "MrGentle"; private const string repositoryName = "LLBMM-TextureMod"; @@ -79,8 +79,10 @@ private void CheckIfPLayerHasDLC() if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1244880))) ownedDLCs.Add("Dice"); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1204070))) ownedDLCs.Add("Raptor"); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1174410))) ownedDLCs.Add("Dust&Ashes"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(991870))) ownedDLCs.Add("Doombox"); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(991870)) || AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1399791))) ownedDLCs.Add("Doombox"); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1269880))) ownedDLCs.Add("Toxic"); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431702))) ownedDLCs.Add("Switch"); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431710))) ownedDLCs.Add("Latch"); } } } diff --git a/TextureMod/TextureMod.csproj b/TextureMod/TextureMod.csproj index 73f724c..92fb384 100644 --- a/TextureMod/TextureMod.csproj +++ b/TextureMod/TextureMod.csproj @@ -33,21 +33,21 @@ False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\Assembly-CSharp.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\Assembly-CSharp.dll + + + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\Assembly-CSharp-firstpass.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\ModMenu.dll - - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\ModMenu.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\Rewired_Core.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\Rewired_Core.dll - - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\Rewired_Windows_Lib.dll + + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\Rewired_Windows.dll @@ -59,252 +59,248 @@ False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\TextMeshPro.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\TextMeshPro.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AccessibilityModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AIModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AIModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AnimationModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ARModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ARModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AssetBundleModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AudioModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AudioModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.BaselibModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.BaselibModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ClothModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ClothModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ClusterInputModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ClusterRendererModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.CoreModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.CoreModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.CrashReportingModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.DirectorModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.FileSystemHttpModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.FileSystemHttpModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.GameCenterModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.GridModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.GridModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.HotReloadModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ImageConversionModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.IMGUIModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.InputModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.InputModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.JSONSerializeModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.LocalizationModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.Networking.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.Networking.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ParticleSystemModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.PerformanceReportingModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.Physics2DModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.PhysicsModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ProfilerModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ScreenCaptureModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SharedInternalsModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SpatialTracking.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SpatialTracking.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SpriteMaskModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SpriteShapeModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.StreamingModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.StyleSheetsModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.StyleSheetsModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SubstanceModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TerrainModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TextCoreModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TextRenderingModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TilemapModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.Timeline.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.Timeline.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TimelineModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TimelineModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TLSModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TLSModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UI.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UI.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UIElementsModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UIModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UIModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UmbraModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UNETModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UNETModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityAnalyticsModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityConnectModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VehiclesModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VFXModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VFXModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VideoModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VideoModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VRModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VRModule.dll False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.WindModule.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.WindModule.dll - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.XRModule.dll - - - False - F:\Games\SteamLibrary\steamapps\common\LLBlaze\LLBlaze_Data\Managed\XboxOneCommonImport.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.XRModule.dll From 06a9812154fc9ca907ca56505de177f31403a8eb Mon Sep 17 00:00:00 2001 From: Daioutzu <54756730+Daioutzu@users.noreply.github.com> Date: Tue, 1 Dec 2020 22:41:59 +0000 Subject: [PATCH 02/11] Toxic Tanks + Sonata and Grid DLC skins Toxic now can have custom colours for her Tanks and Effects. Support for Grid's Effects while using a DLC skin have been added. Switched reposistry owner to Daiouzu to reflect up-to-date mod status. --- TextureMod/TextureChanger.cs | 154 ++++++++++++++++++++--------------- TextureMod/TextureMod.cs | 8 +- TextureMod/TextureMod.csproj | 3 + 3 files changed, 97 insertions(+), 68 deletions(-) diff --git a/TextureMod/TextureChanger.cs b/TextureMod/TextureChanger.cs index 7a40175..298b629 100644 --- a/TextureMod/TextureChanger.cs +++ b/TextureMod/TextureChanger.cs @@ -1,11 +1,11 @@ -using System; +using GameplayEntities; +using LLGUI; +using LLHandlers; +using LLScreen; +using System; using System.Collections.Generic; using System.Linq; using UnityEngine; -using GameplayEntities; -using LLScreen; -using LLGUI; -using LLHandlers; namespace TextureMod { @@ -126,7 +126,7 @@ private void OnGUI() else content = new GUIContent(localTexName + " (Refresh " + "[" + reloadCustomSkinTimer + "]" + ")"); GUI.skin.box.alignment = TextAnchor.MiddleCenter; GUI.skin.box.fontSize = 22; - if (InLobby(GameType.Any)) + if (InLobby(GameType.Any)) { if (UIScreen.currentScreens[1] == null) { @@ -138,12 +138,12 @@ private void OnGUI() break; case GameMode._1v1: if (localLobbyPlayer == ALDOKEMAOMB.BJDPHEHJJJK(0)) GUI.Box(new Rect(Screen.width / 10, Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); //Check if local player is the player with ID 0 - else GUI.Box(new Rect((Screen.width / 20)*12.95f, Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); + else GUI.Box(new Rect((Screen.width / 20) * 12.95f, Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); break; case GameMode.FREE_FOR_ALL: case GameMode.COMPETITIVE: - if (localLobbyPlayer == ALDOKEMAOMB.BJDPHEHJJJK(0)) GUI.Box(new Rect(0 + Screen.width/250, Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); - else GUI.Box(new Rect((Screen.width/4) + (Screen.width / 250), Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); + if (localLobbyPlayer == ALDOKEMAOMB.BJDPHEHJJJK(0)) GUI.Box(new Rect(0 + Screen.width / 250, Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); + else GUI.Box(new Rect((Screen.width / 4) + (Screen.width / 250), Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); break; } } @@ -217,11 +217,14 @@ private void FixedUpdate() private void Update() { +#if DEBUG if (Input.GetKeyDown(KeyCode.PageDown)) { InitLocalPlayer(); InitOpponentPlayer(); - } + } +#endif + #region Set MMI Config Vars if (TextureMod.Instance.MMI != null) { @@ -304,7 +307,7 @@ private void Update() { if (r.name == "meshNurse_MainRenderer") { - foreach(Material m in r.materials) + foreach (Material m in r.materials) { rendererNames = rendererNames + m.name + ", "; } @@ -332,7 +335,8 @@ private void Update() rendererNames = rendererNames + r.name + ", "; } md.AddToWindow("Ball", "Name of renderers", rendererNames); - } catch { } + } + catch { } try { @@ -340,7 +344,7 @@ private void Update() string rendererNames = ""; foreach (VisualEntity ve in ves) { - rendererNames = rendererNames + ve.name + ", "; + rendererNames = rendererNames + ve.name + ", "; } md.AddToWindow("Effects", "VisualEntities", rendererNames); } @@ -361,7 +365,7 @@ private void Update() } - + #endregion @@ -390,7 +394,7 @@ private void Update() } } - if (newSkinToApply ) + if (newSkinToApply) { if (!cancelOpponentSkin) { @@ -430,7 +434,7 @@ private void Update() else initLocalPlayer = true; localPlayerChar = localLobbyPlayer.DOFCCEDJODB; localPlayerCharVar = localLobbyPlayer.AIINAIDBHJI; - + } LLButton[] buttons = FindObjectsOfType(); @@ -492,7 +496,7 @@ private void Update() else { if (setNextSkin) localTex = GetLoadedTexture(localLobbyPlayer.DOFCCEDJODB, localTex, false, false); - if (setPreviousSkin) localTex = GetLoadedTexture(localLobbyPlayer.DOFCCEDJODB, localTex , true, false); + if (setPreviousSkin) localTex = GetLoadedTexture(localLobbyPlayer.DOFCCEDJODB, localTex, true, false); } localLobbyPlayerModel.PlayCamAnim(); @@ -744,7 +748,8 @@ private void Update() SetUnlocksCharacterModel(localTex); } catch { } - } else if (Input.GetKeyDown(previousSkin)) + } + else if (Input.GetKeyDown(previousSkin)) { try { @@ -766,7 +771,8 @@ private void Update() intervalMode = true; reloadCustomSkinTimer = skinReloadIntervalInFrames; } - } else intervalMode = false; + } + else intervalMode = false; try { @@ -858,7 +864,7 @@ public bool InMenu() } public bool InLobby(GameType gt) { - switch(gt) + switch (gt) { case GameType.Online: if (gameState == (JOFJHDJHJGI)5) @@ -878,7 +884,7 @@ public bool InLobby(GameType gt) public bool InGame(GameType gt) { switch (gt) - { + { case GameType.Online: if (JOMBNFKIHIC.GDNFJCCCKDM && gameState == (JOFJHDJHJGI)19) { return true; } @@ -948,7 +954,7 @@ public CharacterModel GetLobbyCharacterModel(int playerNr) { CharacterModel retmodel = null; ScreenPlayers screenPlayers = FindObjectOfType(); - foreach(PlayersSelection playersSelection in screenPlayers.playerSelections) + foreach (PlayersSelection playersSelection in screenPlayers.playerSelections) { if (playersSelection.playerNr == playerNr) { @@ -983,7 +989,7 @@ public void AssignTextureToCharacterModelRenderers(CharacterModel model, Texture r.material.SetTexture("_MainTex", tex); } - + } } catch { } @@ -1043,6 +1049,14 @@ private string AssignTextureToHud(PlayerEntity playerEntity, Texture tex) foreach (Renderer r in rs) { r.material.SetTexture("_MainTex", tex); + if (playerEntity.character == Character.GRAF) + { + CharacterVariant variant = playerEntity.variant; + if (variant == CharacterVariant.MODEL_ALT3 || variant == CharacterVariant.MODEL_ALT4) + { + AssignNurseToxicCanistersToRenderer(r, (Texture2D)tex); + } + } } } ret = ghpi.lbName.text; @@ -1083,7 +1097,8 @@ private void AssignSkinToWinnerModel() try { if (ps.winnerCharacter == localPlayerChar && ps.winnerCharacterVariant == localPlayerCharVar) AssignTextureToCharacterModelRenderers(ps.winnerModel, localTex); - } catch (Exception ex) { Debug.Log("Winner Model: " + ex); } + } + catch (Exception ex) { Debug.Log("Winner Model: " + ex); } } if (opponentCustomTexture != null) @@ -1091,7 +1106,8 @@ private void AssignSkinToWinnerModel() try { if (ps.winnerCharacter == opponentCustomSkinCharacter && ps.winnerCharacterVariant == opponentCustomSkinCharacterVariant) AssignTextureToCharacterModelRenderers(ps.winnerModel, opponentCustomTexture); - } catch (Exception ex) { Debug.Log("Winner Model: " + ex); } + } + catch (Exception ex) { Debug.Log("Winner Model: " + ex); } } } } @@ -1101,7 +1117,7 @@ private void SetUnlocksCharacterModel(Texture2D tex) CharacterModel[] cms = FindObjectsOfType(); if (cms.Length > 0) { - foreach(CharacterModel cm in cms) + foreach (CharacterModel cm in cms) { cm.SetSilhouette(false); AssignTextureToCharacterModelRenderers(cm, tex); @@ -1133,7 +1149,7 @@ private void InitOpponentPlayer() initOpponentPlayer = false; } - private Texture2D GetLoadedTexture(Character c, Texture2D currentTexture , bool previous, bool random) + private Texture2D GetLoadedTexture(Character c, Texture2D currentTexture, bool previous, bool random) { Texture2D ret = null; var texname = ""; @@ -1192,7 +1208,8 @@ private Texture2D GetLoadedTexture(Character c, Texture2D currentTexture , bool } } } - } else + } + else { if (currentTexture == null && TextureMod.Instance.tl.characterTextures[c].ElementAt(0).Value != null) { @@ -1209,7 +1226,7 @@ private Texture2D GetLoadedTexture(Character c, Texture2D currentTexture , bool KeyValuePair firstSkin = TextureMod.Instance.tl.characterTextures[c].First(); KeyValuePair lastSkin = TextureMod.Instance.tl.characterTextures[c].Last(); - for (int i = TextureMod.Instance.tl.characterTextures[c].Count-1; i != -1; i--) + for (int i = TextureMod.Instance.tl.characterTextures[c].Count - 1; i != -1; i--) { KeyValuePair pair = TextureMod.Instance.tl.characterTextures[c].ElementAt(i); if (retnext == true) @@ -1284,7 +1301,8 @@ private Texture2D GetLoadedTextureForUnlocksModel(Texture2D currentTexture, bool } } } - } else + } + else { if (currentTexture == null && TextureMod.Instance.tl.characterTextures[sus.character].ElementAt(0).Value != null) { @@ -1353,7 +1371,7 @@ private CharacterVariant GetVariantFromFileName(Character localPlayerC, string n { var proceed = false; - switch(localPlayerC) + switch (localPlayerC) { case Character.PONG: foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Dice") proceed = true; @@ -1376,8 +1394,14 @@ private CharacterVariant GetVariantFromFileName(Character localPlayerC, string n case Character.CROC: foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Latch") proceed = true; break; + case Character.BOOM: + foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Sonata") proceed = true; + break; + case Character.ELECTRO: + foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Grid") proceed = true; + break; default: - proceed = false; + proceed = false; break; } @@ -1390,7 +1414,8 @@ private CharacterVariant GetVariantFromFileName(Character localPlayerC, string n if (cv == CharacterVariant.MODEL_ALT3) return CharacterVariant.MODEL_ALT4; else return CharacterVariant.MODEL_ALT3; } - } else + } + else { if (localPlayerC != c) return CharacterVariant.DEFAULT; else @@ -1399,7 +1424,8 @@ private CharacterVariant GetVariantFromFileName(Character localPlayerC, string n else return CharacterVariant.DEFAULT; } } - } else + } + else { if (localPlayerC != c) return CharacterVariant.DEFAULT; else @@ -1457,13 +1483,13 @@ public void MakeTextureGrayscale(Texture2D tex) public void AshesIngameEffects() { if (localGamePlayerEntity != null && localTex != null) if (localGamePlayerEntity.character == Character.BAG) AssignAshesOutlineColor(localGamePlayerEntity, localTex); - else if (opponentPlayerEntity != null && opponentCustomTexture != null) if (opponentPlayerEntity.character == Character.BAG) AssignAshesOutlineColor(opponentPlayerEntity, opponentCustomTexture); + else if (opponentPlayerEntity != null && opponentCustomTexture != null) if (opponentPlayerEntity.character == Character.BAG) AssignAshesOutlineColor(opponentPlayerEntity, opponentCustomTexture); } public void AssignAshesOutlineColor(PlayerEntity pe, Texture2D tex) { - Color c = new Color(1,1,1,1); + Color c = new Color(1, 1, 1, 1); switch (pe.variant) { case CharacterVariant.DEFAULT: c = tex.GetPixel(58, 438); break; @@ -1474,7 +1500,7 @@ public void AssignAshesOutlineColor(PlayerEntity pe, Texture2D tex) case CharacterVariant.MODEL_ALT4: c = tex.GetPixel(113, 334); break; } - foreach(Renderer r in pe.skinRenderers) + foreach (Renderer r in pe.skinRenderers) { if (r.name != "mesh1Outline" && r.name != "mesh1MetalOutline" && r.name != "mesh1TenguOutline" && r.name.Contains("Outline")) r.material.color = c; } @@ -1540,7 +1566,7 @@ public void AssignSkinColorToCandySplash() { Texture2D tex = null; CandyPlayer[] cps = FindObjectsOfType(); - foreach(CandyPlayer cp in cps) + foreach (CandyPlayer cp in cps) { if (cp.player.CJFLMDNNMIE == localGamePlayerEntity.player.CJFLMDNNMIE && localTex != null) { @@ -1575,7 +1601,8 @@ public void GridIngameEffects() { if (mainBall.GetLastPlayerHitter() == localGamePlayerEntity && localTex != null) AssignGridSpecialColor(localGamePlayerEntity, localTex); if (mainBall.GetLastPlayerHitter() == opponentPlayerEntity && opponentCustomTexture != null) AssignGridSpecialColor(opponentPlayerEntity, opponentCustomTexture); - } else + } + else { if (localGamePlayerEntity.GetCurrentAbilityState().name.Contains("ELECTROCHARGE") && localTex != null) AssignGridSpecialColor(localGamePlayerEntity, localTex); if (opponentPlayerEntity.GetCurrentAbilityState().name.Contains("ELECTROCHARGE") && opponentCustomTexture != null) AssignGridSpecialColor(opponentPlayerEntity, opponentCustomTexture); @@ -1584,14 +1611,11 @@ public void GridIngameEffects() public void AssignGridSpecialColor(PlayerEntity pe, Texture2D tex) { - Color c = new Color(1, 1, 1, 1); - switch (pe.variant) - { - case CharacterVariant.DEFAULT: c = tex.GetPixel(451, 454); break; - case CharacterVariant.ALT0: c = tex.GetPixel(451, 454); break; - case CharacterVariant.MODEL_ALT: c = tex.GetPixel(452, 454); break; - case CharacterVariant.MODEL_ALT2: c = tex.GetPixel(452, 454); break; - } + Color pixelColor = new Color(1, 1, 1, 1); + + //Gets the pixel color from the skin texture at a certain location based on if it's a DLC skin or Normal/Model_Alt + pixelColor = (pe.variant <= CharacterVariant.MODEL_ALT2) ? tex.GetPixel(451, 454) : tex.GetPixel(442, 484); + VisualEntity[] ves = FindObjectsOfType(); foreach (VisualEntity ve in ves) @@ -1606,7 +1630,7 @@ public void AssignGridSpecialColor(PlayerEntity pe, Texture2D tex) m2.mainTexture = gridStartBG; Material[] mArray = new Material[] { m1, m2 }; r.materials = mArray; - r.materials[0].color = c; + r.materials[0].color = pixelColor; } } @@ -1615,7 +1639,7 @@ public void AssignGridSpecialColor(PlayerEntity pe, Texture2D tex) foreach (Renderer r in ve.GetComponentsInChildren()) { r.material.mainTexture = gridArrive; - r.materials[0].color = c; + r.materials[0].color = pixelColor; } } @@ -1624,7 +1648,7 @@ public void AssignGridSpecialColor(PlayerEntity pe, Texture2D tex) foreach (Renderer r in ve.GetComponentsInChildren()) { r.material.mainTexture = gridTrail; - r.materials[0].color = c; + r.materials[0].color = pixelColor; } } } @@ -1712,13 +1736,19 @@ public void AssignOmegaDoomboxSmearsAndArmsToRenderer(Renderer r, Texture2D tex) public void ToxicIngameEffects() { - if (localGamePlayerEntity != null && localTex != null) if (localGamePlayerEntity.character == Character.GRAF && localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT2 || localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT3) AssignNurseToxicCanistersIngame(localGamePlayerEntity, localTex); - else if (opponentPlayerEntity != null && opponentCustomTexture != null) if (opponentPlayerEntity.character == Character.GRAF && opponentPlayerEntity.variant == CharacterVariant.MODEL_ALT2 || opponentPlayerEntity.variant == CharacterVariant.MODEL_ALT3) AssignNurseToxicCanistersIngame(opponentPlayerEntity, opponentCustomTexture); + if (localGamePlayerEntity != null && localTex != null) + { + if (localGamePlayerEntity.character == Character.GRAF && localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT3 || localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT4) AssignNurseToxicCanistersIngame(localGamePlayerEntity, localTex); + } + if (opponentPlayerEntity != null && opponentCustomTexture != null) + { + if (opponentPlayerEntity.character == Character.GRAF && opponentPlayerEntity.variant == CharacterVariant.MODEL_ALT3 || opponentPlayerEntity.variant == CharacterVariant.MODEL_ALT4) AssignNurseToxicCanistersIngame(opponentPlayerEntity, opponentCustomTexture); + } } public void AssignNurseToxicCanistersIngame(PlayerEntity pe, Texture2D tex) { - + Color light = tex.GetPixel(158, 414); Color shad = tex.GetPixel(158, 406); @@ -1726,7 +1756,7 @@ public void AssignNurseToxicCanistersIngame(PlayerEntity pe, Texture2D tex) Color bright2 = tex.GetPixel(158, 389); Color alpha = tex.GetPixel(158, 380); - + VisualEntity ve = pe.gameObject.GetComponent(); if (ve != null) { @@ -1738,10 +1768,10 @@ public void AssignNurseToxicCanistersIngame(PlayerEntity pe, Texture2D tex) { foreach (Material m in r.materials) { - if (m.name.Contains("grafNurseGlassMat")) + if (m.name.Contains("grafNurseGlass")) { m.SetColor("_LitColor", new Color(light.r, light.g, light.b, bright1.r)); - m.SetColor("_ShadowColor", new Color(shad.r, shad.b, shad.g, bright2.r)); + m.SetColor("_ShadowColor", new Color(shad.r, shad.g, shad.b, bright2.r)); m.SetFloat("_Transparency", alpha.r); } } @@ -1764,10 +1794,10 @@ public void AssignNurseToxicCanistersToRenderer(Renderer r, Texture2D tex) foreach (Material m in r.materials) { - if (m.name.Contains("grafNurseGlassMat")) + if (m.name.Contains("grafNurseGlass")) { m.SetColor("_LitColor", new Color(light.r, light.g, light.b, bright1.r)); - m.SetColor("_ShadowColor", new Color(shad.r, shad.b, shad.g, bright2.r)); + m.SetColor("_ShadowColor", new Color(shad.r, shad.g, shad.b, bright2.r)); m.SetFloat("_Transparency", alpha.r); } } @@ -1784,13 +1814,7 @@ public void AssignToxicEffectColors(int playerId, Texture2D tex, CharacterVarian Color32 c = tex.GetPixel(258, 345); c.a = byte.MaxValue; toxic.GetVisual("paintBlobVisual").mainRenderer.material.color = c; - switch (cv) - { - case CharacterVariant.DEFAULT: toxic.outfitEffectColors[0] = c; break; - case CharacterVariant.ALT0: toxic.outfitEffectColors[1] = c; break; - case CharacterVariant.MODEL_ALT: toxic.outfitEffectColors[9] = c; break; - case CharacterVariant.MODEL_ALT2: toxic.outfitEffectColors[10] = c; break; - } + toxic.outfitEffectColors[(int)cv] = c; } } } diff --git a/TextureMod/TextureMod.cs b/TextureMod/TextureMod.cs index e29c25b..80652ce 100644 --- a/TextureMod/TextureMod.cs +++ b/TextureMod/TextureMod.cs @@ -14,8 +14,8 @@ public class TextureMod : MonoBehaviour private static TextureMod instance = null; public static TextureMod Instance { get { return instance; } } public static void Initialize() { GameObject gameObject = new GameObject("TextureMod"); TextureMod modscript = gameObject.AddComponent(); DontDestroyOnLoad(gameObject); instance = modscript; } - private const string modVersion = "v1.4.1"; - private const string repositoryOwner = "MrGentle"; + private const string modVersion = "1.4.3"; + private const string repositoryOwner = "Daioutzu"; private const string repositoryName = "LLBMM-TextureMod"; public string debug = ""; @@ -81,8 +81,10 @@ private void CheckIfPLayerHasDLC() if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1174410))) ownedDLCs.Add("Dust&Ashes"); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(991870)) || AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1399791))) ownedDLCs.Add("Doombox"); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1269880))) ownedDLCs.Add("Toxic"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431702))) ownedDLCs.Add("Switch"); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431710))) ownedDLCs.Add("Latch"); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431701))) ownedDLCs.Add("Grid"); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431702))) ownedDLCs.Add("Switch"); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1399790))) ownedDLCs.Add("Sonata"); } } } diff --git a/TextureMod/TextureMod.csproj b/TextureMod/TextureMod.csproj index 92fb384..1b1f446 100644 --- a/TextureMod/TextureMod.csproj +++ b/TextureMod/TextureMod.csproj @@ -321,4 +321,7 @@ + + Xcopy $(TargetPath) "C:\Users\Dazer\Desktop\LLBMM 1.3.1\mods\$(ProjectName)" /y + \ No newline at end of file From 63df1ed4040b3e0fb35add3224264c4b8053d3c8 Mon Sep 17 00:00:00 2001 From: Daioutzu <54756730+Daioutzu@users.noreply.github.com> Date: Mon, 21 Dec 2020 23:59:27 +0000 Subject: [PATCH 03/11] Custom Parry Toggle Added Added to Mod Settings is an option to disable the custom parries made for TextureMod --- TextureMod/EffectChanger.cs | 124 ++++++++++++++++--------------- TextureMod/ModMenuIntegration.cs | 1 + TextureMod/TextureMod.cs | 2 +- 3 files changed, 65 insertions(+), 62 deletions(-) diff --git a/TextureMod/EffectChanger.cs b/TextureMod/EffectChanger.cs index a2f2663..93ff7d3 100644 --- a/TextureMod/EffectChanger.cs +++ b/TextureMod/EffectChanger.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; +using GameplayEntities; using System.Linq; using UnityEngine; -using GameplayEntities; -using LLScreen; -using LLGUI; -using LLHandlers; namespace TextureMod @@ -43,6 +38,8 @@ public class EffectChanger : MonoBehaviour byte parryThirdColorR = 0; byte parryThirdColorG = 0; byte parryThirdColorB = 0; + + bool enableCustomParry; #endregion @@ -70,6 +67,8 @@ private void FixedUpdate() if (MMI == null) MMI = TextureMod.Instance.MMI; if (TextureMod.Instance.tc.InMenu()) { + enableCustomParry = MMI.GetTrueFalse(MMI.configBools["(bool)enableCustomParryAndClash"]); + parryFirstColorR = (byte)MMI.GetSliderValue("(slider)parryFirstColorR"); parryFirstColorG = (byte)MMI.GetSliderValue("(slider)parryFirstColorG"); parryFirstColorB = (byte)MMI.GetSliderValue("(slider)parryFirstColorB"); @@ -86,38 +85,19 @@ private void FixedUpdate() private void Update() { - MeshRenderer[] mrs = FindObjectsOfType(); - foreach (MeshRenderer mr in mrs) - { - if (mr.name == "parryVisual") - { - mr.material.mainTexture = parryActiveBG; - Material m1 = mr.material; - Material m2 = new Material(mr.material.shader); - Material m3 = new Material(mr.material.shader); - m2.mainTexture = parryActiveMG; - m3.mainTexture = parryActiveFG; - Material[] mArray = new Material[] { m1, m2, m3 }; - mr.materials = mArray; - mr.materials[0].color = new Color32(parryFirstColorR, parryFirstColorG, parryFirstColorB, 255); - mr.materials[1].color = new Color32(parrySecondColorR, parrySecondColorG, parrySecondColorB, 255); - mr.materials[2].color = new Color32(parryThirdColorR, parryThirdColorG, parryThirdColorB, 255); - } - } - - VisualEntity[] ves = FindObjectsOfType(); - foreach(VisualEntity ve in ves) + if (enableCustomParry == true) { - if (ve.name == "parryEnd") + MeshRenderer[] mrs = FindObjectsOfType(); + foreach (MeshRenderer mr in mrs) { - foreach (Renderer mr in ve.GetComponentsInChildren()) + if (mr.name == "parryVisual") { - mr.material.mainTexture = parryEndBG; + mr.material.mainTexture = parryActiveBG; Material m1 = mr.material; Material m2 = new Material(mr.material.shader); Material m3 = new Material(mr.material.shader); - m2.mainTexture = parryEndMG; - m3.mainTexture = parryEndFG; + m2.mainTexture = parryActiveMG; + m3.mainTexture = parryActiveFG; Material[] mArray = new Material[] { m1, m2, m3 }; mr.materials = mArray; mr.materials[0].color = new Color32(parryFirstColorR, parryFirstColorG, parryFirstColorB, 255); @@ -126,37 +106,59 @@ private void Update() } } - - if (ve.name == "parrySuccess") + VisualEntity[] ves = FindObjectsOfType(); + foreach (VisualEntity ve in ves) { - Renderer mr = ve.GetComponentsInChildren().First(); - mr.material.mainTexture = parrySuccessBG; - Material m1 = mr.material; - Material m2 = new Material(mr.material.shader); - Material m3 = new Material(mr.material.shader); - m2.CopyPropertiesFromMaterial(m1); - m3.CopyPropertiesFromMaterial(m1); - m2.mainTexture = parrySuccessMG; - m3.mainTexture = parrySuccessFG; - Material[] mArray = new Material[] { m1, m2, m3 }; - mr.materials = mArray; - mr.materials[0].color = new Color32(parryFirstColorR, parryFirstColorG, parryFirstColorB, 255); - mr.materials[1].color = new Color32(parrySecondColorR, parrySecondColorG, parrySecondColorB, 255); - mr.materials[2].color = new Color32(parryThirdColorR, parryThirdColorG, parryThirdColorB, 255); - } + if (ve.name == "parryEnd") + { + foreach (Renderer mr in ve.GetComponentsInChildren()) + { + mr.material.mainTexture = parryEndBG; + Material m1 = mr.material; + Material m2 = new Material(mr.material.shader); + Material m3 = new Material(mr.material.shader); + m2.mainTexture = parryEndMG; + m3.mainTexture = parryEndFG; + Material[] mArray = new Material[] { m1, m2, m3 }; + mr.materials = mArray; + mr.materials[0].color = new Color32(parryFirstColorR, parryFirstColorG, parryFirstColorB, 255); + mr.materials[1].color = new Color32(parrySecondColorR, parrySecondColorG, parrySecondColorB, 255); + mr.materials[2].color = new Color32(parryThirdColorR, parryThirdColorG, parryThirdColorB, 255); + } + } - if (ve.name == "clashEffect") - { - Renderer mr = ve.GetComponentsInChildren().First(); - mr.material.mainTexture = clashBG; - Material m1 = mr.material; - Material m2 = new Material(mr.material.shader); - m2.CopyPropertiesFromMaterial(m1); - m2.mainTexture = clashFG; - Material[] mArray = new Material[] { m1, m2 }; - mr.materials = mArray; - mr.materials[0].color = new Color32(parryFirstColorR, parryFirstColorG, parryFirstColorB, 255); - mr.materials[1].color = new Color32(parryThirdColorR, parryThirdColorG, parryThirdColorB, 255); + + if (ve.name == "parrySuccess") + { + Renderer mr = ve.GetComponentsInChildren().First(); + mr.material.mainTexture = parrySuccessBG; + Material m1 = mr.material; + Material m2 = new Material(mr.material.shader); + Material m3 = new Material(mr.material.shader); + m2.CopyPropertiesFromMaterial(m1); + m3.CopyPropertiesFromMaterial(m1); + m2.mainTexture = parrySuccessMG; + m3.mainTexture = parrySuccessFG; + Material[] mArray = new Material[] { m1, m2, m3 }; + mr.materials = mArray; + mr.materials[0].color = new Color32(parryFirstColorR, parryFirstColorG, parryFirstColorB, 255); + mr.materials[1].color = new Color32(parrySecondColorR, parrySecondColorG, parrySecondColorB, 255); + mr.materials[2].color = new Color32(parryThirdColorR, parryThirdColorG, parryThirdColorB, 255); + } + + if (ve.name == "clashEffect") + { + Renderer mr = ve.GetComponentsInChildren().First(); + mr.material.mainTexture = clashBG; + Material m1 = mr.material; + Material m2 = new Material(mr.material.shader); + m2.CopyPropertiesFromMaterial(m1); + m2.mainTexture = clashFG; + Material[] mArray = new Material[] { m1, m2 }; + mr.materials = mArray; + mr.materials[0].color = new Color32(parryFirstColorR, parryFirstColorG, parryFirstColorB, 255); + mr.materials[1].color = new Color32(parryThirdColorR, parryThirdColorG, parryThirdColorB, 255); + } } } } diff --git a/TextureMod/ModMenuIntegration.cs b/TextureMod/ModMenuIntegration.cs index ad1072e..42ade72 100644 --- a/TextureMod/ModMenuIntegration.cs +++ b/TextureMod/ModMenuIntegration.cs @@ -90,6 +90,7 @@ private void InitConfig() AddToWriteQueue("(bool)showDebugInfo", "false"); AddToWriteQueue("(gap)3", "2"); AddToWriteQueue("(header)h4", "Parry Color:"); + AddToWriteQueue("(bool)enableCustomParryAndClash", "true"); AddToWriteQueue("(slider)parryFirstColorR", "2|0|255"); AddToWriteQueue("(slider)parryFirstColorG", "205|0|255"); AddToWriteQueue("(slider)parryFirstColorB", "239|0|255"); diff --git a/TextureMod/TextureMod.cs b/TextureMod/TextureMod.cs index 80652ce..bb1ab33 100644 --- a/TextureMod/TextureMod.cs +++ b/TextureMod/TextureMod.cs @@ -14,7 +14,7 @@ public class TextureMod : MonoBehaviour private static TextureMod instance = null; public static TextureMod Instance { get { return instance; } } public static void Initialize() { GameObject gameObject = new GameObject("TextureMod"); TextureMod modscript = gameObject.AddComponent(); DontDestroyOnLoad(gameObject); instance = modscript; } - private const string modVersion = "1.4.3"; + private const string modVersion = "1.4.4"; private const string repositoryOwner = "Daioutzu"; private const string repositoryName = "LLBMM-TextureMod"; From 39de66aa5d79ced4f8703518ed811bf26803174b Mon Sep 17 00:00:00 2001 From: Daioutzu <54756730+Daioutzu@users.noreply.github.com> Date: Mon, 28 Dec 2020 15:45:58 +0000 Subject: [PATCH 04/11] Added Jet's DLC skin --- TextureMod/TextureChanger.cs | 4 +++- TextureMod/TextureMod.cs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/TextureMod/TextureChanger.cs b/TextureMod/TextureChanger.cs index 298b629..093430b 100644 --- a/TextureMod/TextureChanger.cs +++ b/TextureMod/TextureChanger.cs @@ -1400,10 +1400,12 @@ private CharacterVariant GetVariantFromFileName(Character localPlayerC, string n case Character.ELECTRO: foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Grid") proceed = true; break; + case Character.SKATE: + foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Jet") proceed = true; + break; default: proceed = false; break; - } if (proceed) diff --git a/TextureMod/TextureMod.cs b/TextureMod/TextureMod.cs index bb1ab33..5d8bff8 100644 --- a/TextureMod/TextureMod.cs +++ b/TextureMod/TextureMod.cs @@ -14,7 +14,7 @@ public class TextureMod : MonoBehaviour private static TextureMod instance = null; public static TextureMod Instance { get { return instance; } } public static void Initialize() { GameObject gameObject = new GameObject("TextureMod"); TextureMod modscript = gameObject.AddComponent(); DontDestroyOnLoad(gameObject); instance = modscript; } - private const string modVersion = "1.4.4"; + private const string modVersion = "1.4.5"; private const string repositoryOwner = "Daioutzu"; private const string repositoryName = "LLBMM-TextureMod"; @@ -85,6 +85,7 @@ private void CheckIfPLayerHasDLC() if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431701))) ownedDLCs.Add("Grid"); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431702))) ownedDLCs.Add("Switch"); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1399790))) ownedDLCs.Add("Sonata"); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431711))) ownedDLCs.Add("Jet"); } } } From 2d20fc84fdf4f576d8e8f432b27f69774ecc19d4 Mon Sep 17 00:00:00 2001 From: Daioutzu <54756730+Daioutzu@users.noreply.github.com> Date: Wed, 30 Dec 2020 16:46:09 +0000 Subject: [PATCH 05/11] Update Jet's Bubble Effect Assigning Jet's Bubble effect colour now varies depending on the costume being used. --- TextureMod/TextureChanger.cs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/TextureMod/TextureChanger.cs b/TextureMod/TextureChanger.cs index 093430b..797cbd9 100644 --- a/TextureMod/TextureChanger.cs +++ b/TextureMod/TextureChanger.cs @@ -1826,12 +1826,26 @@ public void AssignToxicEffectColors(int playerId, Texture2D tex, CharacterVarian #region Jet Effects public void JetIngameEffects() { - if (mainBall.GetLastPlayerHitter() == localGamePlayerEntity && localTex != null) AssignBubbleVisual(localTex); - if (mainBall.GetLastPlayerHitter() == opponentPlayerEntity && opponentCustomTexture != null) AssignBubbleVisual(opponentCustomTexture); + if (mainBall.GetLastPlayerHitter() == localGamePlayerEntity && localTex != null) AssignBubbleVisual(localGamePlayerEntity.variant, localTex); + if (mainBall.GetLastPlayerHitter() == opponentPlayerEntity && opponentCustomTexture != null) AssignBubbleVisual(opponentPlayerEntity.variant, opponentCustomTexture); } - public void AssignBubbleVisual(Texture2D tex) + public void AssignBubbleVisual(CharacterVariant variant, Texture2D tex) { + Color pixelColor = new Color(0, 1, 1); + if (variant <= CharacterVariant.ALT6) + { + pixelColor = tex.GetPixel(59, 326); + } + else if (variant == CharacterVariant.MODEL_ALT || variant == CharacterVariant.MODEL_ALT2) + { + pixelColor = tex.GetPixel(59, 306); + } + else if (variant == CharacterVariant.MODEL_ALT3 || variant == CharacterVariant.MODEL_ALT4) + { + pixelColor = tex.GetPixel(59, 388); + } + MeshRenderer[] mrs = FindObjectsOfType(); foreach (MeshRenderer mr in mrs) { @@ -1843,7 +1857,7 @@ public void AssignBubbleVisual(Texture2D tex) m2.mainTexture = bubbleFG; Material[] mArray = new Material[] { m1, m2 }; mr.materials = mArray; - mr.materials[0].color = tex.GetPixel(59, 326); break; + mr.materials[0].color = pixelColor; break; } } @@ -1860,7 +1874,7 @@ public void AssignBubbleVisual(Texture2D tex) m2.mainTexture = bubblePopBG; Material[] mArray = new Material[] { m1, m2 }; r.materials = mArray; - r.materials[1].color = tex.GetPixel(59, 326); break; + r.materials[1].color = pixelColor; break; } } } From 68bd36c69833dbba92e97e9c7dace417b250745f Mon Sep 17 00:00:00 2001 From: Daioutzu <54756730+Daioutzu@users.noreply.github.com> Date: Sat, 30 Jan 2021 23:50:13 +0000 Subject: [PATCH 06/11] Added Candyman DLC --- TextureMod/TextureChanger.cs | 3 +++ TextureMod/TextureHelper.cs | 13 +++++++------ TextureMod/TextureMod.cs | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/TextureMod/TextureChanger.cs b/TextureMod/TextureChanger.cs index 797cbd9..42878d8 100644 --- a/TextureMod/TextureChanger.cs +++ b/TextureMod/TextureChanger.cs @@ -1403,6 +1403,9 @@ private CharacterVariant GetVariantFromFileName(Character localPlayerC, string n case Character.SKATE: foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Jet") proceed = true; break; + case Character.CANDY: + foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Candyman") proceed = true; + break; default: proceed = false; break; diff --git a/TextureMod/TextureHelper.cs b/TextureMod/TextureHelper.cs index f543fec..0603f74 100644 --- a/TextureMod/TextureHelper.cs +++ b/TextureMod/TextureHelper.cs @@ -1,14 +1,14 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; -using System.IO; namespace TextureMod { - class TextureHelper + static class TextureHelper { public static Texture2D LoadPNG(string _path, string _fileName) //Loads a png from a file and returns it (Loads the asset into memory, do only load it once) { @@ -17,11 +17,11 @@ class TextureHelper Debug.Log("Could not find " + _path + _fileName); return null; } - Texture2D tex = null; + Texture2D tex; byte[] fileData; fileData = File.ReadAllBytes(_path + _fileName); - tex = new Texture2D(2, 2); + tex = new Texture2D(2, 2, TextureFormat.ARGB32, false); tex.LoadImage(fileData); //This resizes the texture width and height return tex; @@ -34,16 +34,17 @@ class TextureHelper Debug.Log("Could not find " + _path); return null; } - Texture2D tex = null; + Texture2D tex; byte[] fileData; fileData = File.ReadAllBytes(_path); - tex = new Texture2D(2, 2); + tex = new Texture2D(2, 2, TextureFormat.ARGB32, false); tex.LoadImage(fileData); //This resizes the texture width and height return tex; } + public static Texture2D ReloadSkin(Character _character, Texture2D _texture) { TextureLoader TL = TextureMod.Instance.tl; diff --git a/TextureMod/TextureMod.cs b/TextureMod/TextureMod.cs index 5d8bff8..2fbc4a8 100644 --- a/TextureMod/TextureMod.cs +++ b/TextureMod/TextureMod.cs @@ -86,6 +86,7 @@ private void CheckIfPLayerHasDLC() if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431702))) ownedDLCs.Add("Switch"); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1399790))) ownedDLCs.Add("Sonata"); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431711))) ownedDLCs.Add("Jet"); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431712))) ownedDLCs.Add("Candyman"); } } } From 423022ecc62fc2aebb134dec1db5390f00aac9ec Mon Sep 17 00:00:00 2001 From: Daioutzu <54756730+Daioutzu@users.noreply.github.com> Date: Sat, 30 Jan 2021 23:58:27 +0000 Subject: [PATCH 07/11] Texture discolouration fixed by MrGentle --- TextureMod/TextureHelper.cs | 272 ++++++++++++++++++++++++++++++++---- 1 file changed, 246 insertions(+), 26 deletions(-) diff --git a/TextureMod/TextureHelper.cs b/TextureMod/TextureHelper.cs index 0603f74..3f5eb08 100644 --- a/TextureMod/TextureHelper.cs +++ b/TextureMod/TextureHelper.cs @@ -1,50 +1,57 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; +using System.IO; namespace TextureMod { - static class TextureHelper + class TextureHelper { - public static Texture2D LoadPNG(string _path, string _fileName) //Loads a png from a file and returns it (Loads the asset into memory, do only load it once) + public static Texture2D LoadPNG(string _path, string _fileName = "") //Loads a png from a file and returns it (Loads the asset into memory, do only load it once) { - if (!File.Exists(_path + _fileName)) + var fullPath = _path + _fileName; + if (!File.Exists(fullPath)) { - Debug.Log("Could not find " + _path + _fileName); + Debug.Log("Could not find " + fullPath); return null; } - Texture2D tex; - byte[] fileData; - - fileData = File.ReadAllBytes(_path + _fileName); - tex = new Texture2D(2, 2, TextureFormat.ARGB32, false); - tex.LoadImage(fileData); //This resizes the texture width and height - - return tex; - } + Texture2D tex = null; - public static Texture2D LoadPNG(string _path) //Loads a png from a file and returns it (Loads the asset into memory, do only load it once) - { - if (!File.Exists(_path)) + byte[] spriteBytes; + using (var fileStream = File.OpenRead(fullPath)) + using (var reader = new BinaryReader(fileStream)) { - Debug.Log("Could not find " + _path); - return null; + var png = PNGTools.ReadPNGFile(reader); + for (int i = png.chunks.Count - 1; i >= 0; i--) + { + var c = png.chunks[i]; + if (c.type == EChunkType.gAMA || + c.type == EChunkType.pHYs || + c.type == EChunkType.sRBG) + { + png.chunks.RemoveAt(i); + } + } + using (var mem = new MemoryStream()) + { + PNGTools.WritePNGFile(png, new BinaryWriter(mem)); + spriteBytes = mem.ToArray(); + } } - Texture2D tex; - byte[] fileData; - fileData = File.ReadAllBytes(_path); - tex = new Texture2D(2, 2, TextureFormat.ARGB32, false); - tex.LoadImage(fileData); //This resizes the texture width and height + tex = new Texture2D(512, 512, TextureFormat.RGBA32, true, false); + tex.LoadImage(spriteBytes); //This resizes the texture width and height + tex.filterMode = FilterMode.Trilinear; + tex.anisoLevel = 9; + tex.mipMapBias = -0.5f; + return tex; } - public static Texture2D ReloadSkin(Character _character, Texture2D _texture) { TextureLoader TL = TextureMod.Instance.tl; @@ -91,4 +98,217 @@ public static Texture2D ReloadSkin(Character _character, Texture2D _texture) return newTex; } } -} + + public enum EChunkType : uint + { + IHDR = 0x49484452, + sRBG = 0x73524742, + gAMA = 0x67414D41, + cHRM = 0x6348524D, + pHYs = 0x70485973, + IDAT = 0x49444154, + IEND = 0x49454E44, + } + + public class PNGFile + { + public static ulong m_Signature = 0x89504E470D0A1A0AU; // + public ulong Signature; + public List chunks; + public int FindChunk(EChunkType aType, int aStartIndex = 0) + { + if (chunks == null) + return -1; + for (int i = aStartIndex; i < chunks.Count; i++) + { + if (chunks[i].type == aType) + return i; + } + return -1; + } + } + + public class PNGChunk + { + public uint length; + public EChunkType type; + public byte[] data; + public uint crc; + public uint CalcCRC() + { + var crc = PNGTools.UpdateCRC(0xFFFFFFFF, (uint)type); + crc = PNGTools.UpdateCRC(crc, data); + return crc ^ 0xFFFFFFFF; + } + } + + public class PNGTools + { + static uint[] crc_table = new uint[256]; + static PNGTools() + { + for (int n = 0; n < 256; n++) + { + uint c = (uint)n; + for (int k = 0; k < 8; k++) + { + if ((c & 1) > 0) + c = 0xedb88320 ^ (c >> 1); + else + c = c >> 1; + } + crc_table[n] = c; + } + } + + public static uint UpdateCRC(uint crc, byte aData) + { + return crc_table[(crc ^ aData) & 0xff] ^ (crc >> 8); + } + + public static uint UpdateCRC(uint crc, uint aData) + { + crc = crc_table[(crc ^ ((aData >> 24) & 0xFF)) & 0xff] ^ (crc >> 8); + crc = crc_table[(crc ^ ((aData >> 16) & 0xFF)) & 0xff] ^ (crc >> 8); + crc = crc_table[(crc ^ ((aData >> 8) & 0xFF)) & 0xff] ^ (crc >> 8); + crc = crc_table[(crc ^ (aData & 0xFF)) & 0xff] ^ (crc >> 8); + return crc; + } + + + public static uint UpdateCRC(uint crc, byte[] buf) + { + for (int n = 0; n < buf.Length; n++) + crc = crc_table[(crc ^ buf[n]) & 0xff] ^ (crc >> 8); + return crc; + } + + public static uint CalculateCRC(byte[] aBuf) + { + return UpdateCRC(0xffffffff, aBuf) ^ 0xffffffff; + } + public static List ReadChunks(BinaryReader aReader) + { + var res = new List(); + while (aReader.BaseStream.Position < aReader.BaseStream.Length - 4) + { + var chunk = new PNGChunk(); + chunk.length = aReader.ReadUInt32BE(); + if (aReader.BaseStream.Position >= aReader.BaseStream.Length - 4 - chunk.length) + break; + res.Add(chunk); + chunk.type = (EChunkType)aReader.ReadUInt32BE(); + chunk.data = aReader.ReadBytes((int)chunk.length); + chunk.crc = aReader.ReadUInt32BE(); + + uint crc = chunk.CalcCRC(); + + if ((chunk.crc ^ crc) != 0) + Debug.Log("Chunk CRC wrong. Got 0x" + chunk.crc.ToString("X8") + " expected 0x" + crc.ToString("X8")); + if (chunk.type == EChunkType.IEND) + break; + } + return res; + } + + public static PNGFile ReadPNGFile(BinaryReader aReader) + { + if (aReader == null || aReader.BaseStream.Position >= aReader.BaseStream.Length - 8) + return null; + var file = new PNGFile(); + file.Signature = aReader.ReadUInt64BE(); + file.chunks = ReadChunks(aReader); + return file; + } + public static void WritePNGFile(PNGFile aFile, BinaryWriter aWriter) + { + aWriter.WriteUInt64BE(PNGFile.m_Signature); + foreach (var chunk in aFile.chunks) + { + aWriter.WriteUInt32BE((uint)chunk.data.Length); + aWriter.WriteUInt32BE((uint)chunk.type); + aWriter.Write(chunk.data); + aWriter.WriteUInt32BE(chunk.crc); + } + } + + public static void SetPPM(PNGFile aFile, uint aXPPM, uint aYPPM) + { + int pos = aFile.FindChunk(EChunkType.pHYs); + PNGChunk chunk; + if (pos > 0) + { + chunk = aFile.chunks[pos]; + if (chunk.data == null || chunk.data.Length < 9) + throw new System.Exception("PNG: pHYs chunk data size is too small. It should be at least 9 bytes"); + } + else + { + chunk = new PNGChunk(); + chunk.type = EChunkType.pHYs; + chunk.length = 9; + chunk.data = new byte[9]; + aFile.chunks.Insert(1, chunk); + } + var data = chunk.data; + data[0] = (byte)((aXPPM >> 24) & 0xFF); + data[1] = (byte)((aXPPM >> 16) & 0xFF); + data[2] = (byte)((aXPPM >> 8) & 0xFF); + data[3] = (byte)((aXPPM) & 0xFF); + + data[4] = (byte)((aYPPM >> 24) & 0xFF); + data[5] = (byte)((aYPPM >> 16) & 0xFF); + data[6] = (byte)((aYPPM >> 8) & 0xFF); + data[7] = (byte)((aYPPM) & 0xFF); + + data[8] = 1; + chunk.crc = chunk.CalcCRC(); + } + + public static byte[] ChangePPM(byte[] aPNGData, uint aXPPM, uint aYPPM) + { + PNGFile file; + using (var stream = new MemoryStream(aPNGData)) + using (var reader = new BinaryReader(stream)) + { + file = ReadPNGFile(reader); + } + SetPPM(file, aXPPM, aYPPM); + using (var stream = new MemoryStream()) + using (var writer = new BinaryWriter(stream)) + { + WritePNGFile(file, writer); + return stream.ToArray(); + } + } + public static byte[] ChangePPI(byte[] aPNGData, float aXPPI, float aYPPI) + { + return ChangePPM(aPNGData, (uint)(aXPPI * 39.3701f), (uint)(aYPPI * 39.3701f)); + } + } + + public static class BinaryReaderWriterExt + { + public static uint ReadUInt32BE(this BinaryReader aReader) + { + return ((uint)aReader.ReadByte() << 24) | ((uint)aReader.ReadByte() << 16) + | ((uint)aReader.ReadByte() << 8) | ((uint)aReader.ReadByte()); + } + public static ulong ReadUInt64BE(this BinaryReader aReader) + { + return (ulong)aReader.ReadUInt32BE() << 32 | aReader.ReadUInt32BE(); + } + public static void WriteUInt32BE(this BinaryWriter aWriter, uint aValue) + { + aWriter.Write((byte)((aValue >> 24) & 0xFF)); + aWriter.Write((byte)((aValue >> 16) & 0xFF)); + aWriter.Write((byte)((aValue >> 8) & 0xFF)); + aWriter.Write((byte)((aValue) & 0xFF)); + } + public static void WriteUInt64BE(this BinaryWriter aWriter, ulong aValue) + { + aWriter.WriteUInt32BE((uint)(aValue >> 32)); + aWriter.WriteUInt32BE((uint)(aValue)); + } + } +} \ No newline at end of file From b9db3857b9109bf2c319851a040b21bcea1f4444 Mon Sep 17 00:00:00 2001 From: Daioutzu <54756730+Daioutzu@users.noreply.github.com> Date: Sun, 31 Jan 2021 00:00:01 +0000 Subject: [PATCH 08/11] Forgot the version number lol --- TextureMod/TextureMod.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TextureMod/TextureMod.cs b/TextureMod/TextureMod.cs index 2fbc4a8..8d69bf6 100644 --- a/TextureMod/TextureMod.cs +++ b/TextureMod/TextureMod.cs @@ -14,7 +14,7 @@ public class TextureMod : MonoBehaviour private static TextureMod instance = null; public static TextureMod Instance { get { return instance; } } public static void Initialize() { GameObject gameObject = new GameObject("TextureMod"); TextureMod modscript = gameObject.AddComponent(); DontDestroyOnLoad(gameObject); instance = modscript; } - private const string modVersion = "1.4.5"; + private const string modVersion = "1.4.6"; private const string repositoryOwner = "Daioutzu"; private const string repositoryName = "LLBMM-TextureMod"; From d818d675d9bcfbdb7c74dec18f2ac4dc5ab72fbb Mon Sep 17 00:00:00 2001 From: Daioutzu <54756730+Daioutzu@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:30:09 +0000 Subject: [PATCH 09/11] Candy, Jet and Sonata Stuff --- TextureMod/CustomSkin.cs | 60 ++++ TextureMod/ShowcaseStudio.cs | 197 +++++------ TextureMod/TextureChanger.cs | 630 ++++++++++++++++++----------------- TextureMod/TextureHelper.cs | 41 ++- TextureMod/TextureLoader.cs | 121 ++++--- TextureMod/TextureMod.cs | 52 +-- TextureMod/TextureMod.csproj | 4 +- 7 files changed, 621 insertions(+), 484 deletions(-) create mode 100644 TextureMod/CustomSkin.cs diff --git a/TextureMod/CustomSkin.cs b/TextureMod/CustomSkin.cs new file mode 100644 index 0000000..a1142ef --- /dev/null +++ b/TextureMod/CustomSkin.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace TextureMod +{ +#if DEBUG + public class CustomSkin + { + public CustomSkin() { } + public CustomSkin(ModelVariant _variant, string _name, string _author, string _filePath) + { + SkinTexture = TextureHelper.LoadPNG(_filePath); + Name = SkinTexture.name = _name; + Variant = _variant; + Author = _author; + } + + public void Reset() + { + SkinTexture = null; + Variant = ModelVariant.None; + Author = ""; + Name = ""; + } + + public Texture2D SkinTexture { get; private set; } + public ModelVariant Variant { get; private set; } + public string Author { get; private set; } + public string Name { get; private set; } + + public bool VariantMatch(CharacterVariant characterVariant) + { + switch (Variant) + { + case ModelVariant.Default: + return characterVariant < CharacterVariant.STATIC_ALT; + case ModelVariant.Alternative: + return characterVariant == CharacterVariant.MODEL_ALT || characterVariant == CharacterVariant.MODEL_ALT2; + case ModelVariant.DLC: + return characterVariant == CharacterVariant.MODEL_ALT3 || characterVariant == CharacterVariant.MODEL_ALT4; + default: + return false; + } + } + + public enum ModelVariant + { + None, + Default, + Alternative, + DLC, + } + } +#endif +} diff --git a/TextureMod/ShowcaseStudio.cs b/TextureMod/ShowcaseStudio.cs index 4a4d575..874c0e4 100644 --- a/TextureMod/ShowcaseStudio.cs +++ b/TextureMod/ShowcaseStudio.cs @@ -1,4 +1,5 @@ -using LLScreen; +using LLHandlers; +using LLScreen; using System; using System.Collections.Generic; using UnityEngine; @@ -26,7 +27,7 @@ public class ShowcaseStudio : MonoBehaviour Camera lightControllerCam; GameObject lightController; CharacterModel characterModel; - Shader mainShader; + Shader mainShader = Shader.Find("LethalLeague/GameplayOpaque"); Vector3 originalCharacterRendPos; bool enableLight = true; bool bgColorSelection = false; @@ -64,127 +65,127 @@ private void OnGUI() } } - bool initCustomStyle = false; - void Start() { - + CustomStyle.InitStyle(); } - private void Update() + void ShowStudio() { - if (SUS == null) - { - SUS = FindObjectOfType(); - if (initCustomStyle == false) - { - CustomStyle.InitStyle(); - initCustomStyle = true; - } - } - else + showUI = !showUI; + GameObject[] gos = FindObjectsOfType(); + if (!showUI) { - if (mainShader == null) mainShader = Shader.Find("LethalLeague/GameplayOpaque"); + originalCharacterRendPos = SUS.characterRenderer.transform.position; + SUS.characterRenderer.transform.position = new Vector3(0, 0, 0); - if (Input.GetKeyDown(showcaseStudioHideHud)) hideGUI = !hideGUI; - - Renderer[] rends = FindObjectsOfType(); - foreach (Renderer r in rends) + foreach (GameObject go in gos) { - if (r.material.shader != mainShader && r.name.Contains("Effect")) r.material.shader = mainShader; - } + if (go.name.Contains("btFirst")) gameObjects.Add(go); + if (go.name.Contains("btQuit")) gameObjects.Add(go); + if (go.name.Contains("btPose")) gameObjects.Add(go); - if (Input.GetKeyDown(enterShowcaseStudio) || (!showUI && (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Mouse1)))) - { - showUI = !showUI; - GameObject[] gos = FindObjectsOfType(); - if (!showUI) + if (go.name.Contains("characterCamera")) { + go.GetComponent().enabled = false; + } - originalCharacterRendPos = SUS.characterRenderer.transform.position; - SUS.characterRenderer.transform.position = new Vector3(0, 0, 0); + if (go.name.Contains("cameraController")) + { + cameraController = new GameObject("cameraControllerGentle"); + cameraController.transform.position = new Vector3(-2.5f, -302f, -4.4f); + cameraController.transform.eulerAngles = new Vector3(3f, 132f, 0f); + camControllerCam = cameraController.AddComponent(); + cameraController.GetComponent().enabled = true; + cameraController.AddComponent(); + } - foreach (GameObject go in gos) + if (go.name.Contains("characterLight")) + { + lightController = new GameObject("lightControllerGentle"); + foreach (GameObject go2 in gos) { - if (go.name.Contains("btFirst")) gameObjects.Add(go); - if (go.name.Contains("btQuit")) gameObjects.Add(go); - if (go.name.Contains("btPose")) gameObjects.Add(go); - - if (go.name.Contains("characterCamera")) + if (go2.name.Contains("characterCamera")) { - go.GetComponent().enabled = false; + lightController.transform.position = go2.transform.position; + lightController.transform.rotation = go2.transform.rotation; } + } + Light l = lightController.AddComponent(); + Light cl = go.GetComponent(); + l.type = cl.type; + l.color = cl.color; + lightControllerCam = lightController.AddComponent(); + lightController.AddComponent(); + go.GetComponent().enabled = false; + } + } - if (go.name.Contains("cameraController")) - { - cameraController = new GameObject("cameraControllerGentle"); - cameraController.transform.position = new Vector3(-2.5f, -302f, -4.4f); - cameraController.transform.eulerAngles = new Vector3(3f, 132f, 0f); - camControllerCam = cameraController.AddComponent(); - cameraController.GetComponent().enabled = true; - cameraController.AddComponent(); - } + for (var i = 0; i < gameObjects.Count; i++) gameObjects[i].SetActive(false); - if (go.name.Contains("characterLight")) - { - lightController = new GameObject("lightControllerGentle"); - foreach (GameObject go2 in gos) - { - if (go2.name.Contains("characterCamera")) - { - lightController.transform.position = go2.transform.position; - lightController.transform.rotation = go2.transform.rotation; - } - } - Light l = lightController.AddComponent(); - Light cl = go.GetComponent(); - l.type = cl.type; - l.color = cl.color; - lightControllerCam = lightController.AddComponent(); - lightController.AddComponent(); - go.GetComponent().enabled = false; - } - } + if (characterModel == null) characterModel = SUS.previewModel; + else + { + Animation anim = characterModel.gameObject.GetComponentInChildren(); + var idleIndex = 0; + foreach (AnimationState state in anim) + { + animList.Add(state.name); + if (state.name == "idle") selectedGridAnim = idleIndex; + idleIndex++; + } + } + } + else //If showui + { + SUS.characterRenderer.transform.position = originalCharacterRendPos; + for (var i = 0; i < gameObjects.Count; i++) gameObjects[i].SetActive(true); + gameObjects.Clear(); + animList.Clear(); - for (var i = 0; i < gameObjects.Count; i++) gameObjects[i].SetActive(false); + if (lightController != null) Destroy(lightController); + if (cameraController != null) Destroy(cameraController); - if (characterModel == null) characterModel = SUS.previewModel; - else - { - Animation anim = characterModel.gameObject.GetComponentInChildren(); - var idleIndex = 0; - foreach (AnimationState state in anim) - { - animList.Add(state.name); - if (state.name == "idle") selectedGridAnim = idleIndex; - idleIndex++; - } - } + foreach (GameObject go in gos) + { + if (go.name.Contains("characterCamera")) + { + go.GetComponent().enabled = true; } - else //If showui + + if (go.name.Contains("characterLight")) { - SUS.characterRenderer.transform.position = originalCharacterRendPos; - for (var i = 0; i < gameObjects.Count; i++) gameObjects[i].SetActive(true); - gameObjects.Clear(); - animList.Clear(); + go.GetComponent().enabled = true; + } + } + } + } - if (lightController != null) Destroy(lightController); - if (cameraController != null) Destroy(cameraController); + private void Update() + { - foreach (GameObject go in gos) - { - if (go.name.Contains("characterCamera")) - { - go.GetComponent().enabled = true; - } + if (SUS == null) + { + if (UIScreen.currentScreens[1]?.screenType == ScreenType.UNLOCKS_SKINS) + { + SUS = UIScreen.currentScreens[1] as ScreenUnlocksSkins; + } + } + else + { - if (go.name.Contains("characterLight")) - { - go.GetComponent().enabled = true; - } - } - } + if (Input.GetKeyDown(showcaseStudioHideHud)) hideGUI = !hideGUI; + + Renderer[] rends = FindObjectsOfType(); + foreach (Renderer r in rends) + { + if (r.material.shader != mainShader && r.name.Contains("Effect")) r.material.shader = mainShader; + } + + if (Input.GetKeyDown(enterShowcaseStudio) || (!showUI && (Controller.all.GetButtonDown(InputAction.ESC) || Controller.all.GetButtonDown(InputAction.BACK) || Controller.all.GetButtonDown(InputAction.OK) || Input.GetKeyDown(KeyCode.Mouse1)))) + { + ShowStudio(); } if (characterModel == null) characterModel = SUS.previewModel; diff --git a/TextureMod/TextureChanger.cs b/TextureMod/TextureChanger.cs index 42878d8..990e72f 100644 --- a/TextureMod/TextureChanger.cs +++ b/TextureMod/TextureChanger.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text; using UnityEngine; namespace TextureMod @@ -13,8 +14,8 @@ public class TextureChanger : MonoBehaviour { #region General Fields public static string resourceFolder = Application.dataPath.Replace("/", @"\") + @"\Managed\TextureModResources\Images\"; - private JOFJHDJHJGI gameState; - private GameMode currentGameMode; + private JOFJHDJHJGI gameState => DNPFJHMAIBP.HHMOGKIMBNM(); + private GameMode currentGameMode => JOMBNFKIHIC.GIGAKBJGFDI.PNJOKAICMNN; public string[] debug = new string[20]; public bool doSkinPost = false; public int postTimer = 0; @@ -57,7 +58,7 @@ public class TextureChanger : MonoBehaviour public ALDOKEMAOMB localLobbyPlayer = null; private CharacterModel localLobbyPlayerModel = null; private PlayerEntity localGamePlayerEntity = null; - public string localPlayerName = ""; + public int localPlayerNr = -1; public Character localPlayerChar = Character.NONE; public CharacterVariant localPlayerCharVar = CharacterVariant.CORPSE; public Texture2D localTex = null; @@ -72,7 +73,7 @@ public class TextureChanger : MonoBehaviour public ALDOKEMAOMB opponentPlayer = null; private CharacterModel opponentLobbyCharacterModel = null; private PlayerEntity opponentPlayerEntity = null; - public string opponentPlayerName = ""; + public int opponentPlayerNr = -1; public Character opponentCustomSkinCharacter = Character.NONE; public CharacterVariant opponentCustomSkinCharacterVariant = CharacterVariant.CORPSE; public Texture2D opponentCustomTexture = null; @@ -118,6 +119,7 @@ private void Start() private void OnGUI() { + if (localTex != null) //Show skin nametags { GUI.skin.box.wordWrap = false; @@ -214,18 +216,8 @@ private void FixedUpdate() if (reloadCustomSkinTimer > 0) reloadCustomSkinTimer--; } //POST and GET requests - private void Update() + void ModMenuInit() { - -#if DEBUG - if (Input.GetKeyDown(KeyCode.PageDown)) - { - InitLocalPlayer(); - InitOpponentPlayer(); - } -#endif - - #region Set MMI Config Vars if (TextureMod.Instance.MMI != null) { var mmi = TextureMod.Instance.MMI; @@ -243,11 +235,19 @@ private void Update() skinReloadIntervalInFrames = mmi.GetSliderValue("(slider)skinReloadIntervalInFrames"); assignFirstSkinOnCharacterSelection = mmi.GetTrueFalse(mmi.configBools["(bool)assignFirstSkinOnCharacterSelection"]); } - #endregion - #region Set Static Vars - gameState = DNPFJHMAIBP.HHMOGKIMBNM(); - currentGameMode = JOMBNFKIHIC.GIGAKBJGFDI.PNJOKAICMNN; - #endregion + } + + private void Update() + { +#if DEBUG + if (Input.GetKeyDown(KeyCode.PageDown)) + { + InitLocalPlayer(); + InitOpponentPlayer(); + } +#endif + + ModMenuInit(); #region Set Debug Vars if (showDebugInfo) { @@ -272,7 +272,7 @@ private void Update() try { md.AddToWindow("Local Player", "Lobby Player", localLobbyPlayer.ToString()); } catch { md.AddToWindow("Local Player", "Lobby Player", "null"); } try { md.AddToWindow("Local Player", "Lobby Player Model", localLobbyPlayerModel.ToString()); } catch { md.AddToWindow("Local Player", "Lobby Player Model", "null"); } try { md.AddToWindow("Local Player", "Game PlayerEntity", localGamePlayerEntity.ToString()); } catch { md.AddToWindow("Local Player", "Game PlayerEntity", "null"); } - try { md.AddToWindow("Local Player", "Name", localPlayerName.ToString()); } catch { } + try { md.AddToWindow("Local Player", "Name", localPlayerNr.ToString()); } catch { } try { md.AddToWindow("Local Player", "Character", localPlayerChar.ToString()); } catch { } try { md.AddToWindow("Local Player", "Variant", localPlayerCharVar.ToString()); } catch { } try { md.AddToWindow("Local Player", "Custom Texture", localTex.ToString()); } catch { md.AddToWindow("Local Player", "Custom Texture", "null"); } @@ -320,7 +320,7 @@ private void Update() try { md.AddToWindow("Remote Player", "Lobby Player", opponentPlayer.ToString()); } catch { md.AddToWindow("Remote Player", "Lobby Player", "null"); } try { md.AddToWindow("Remote Player", "Lobby Player Model", opponentLobbyCharacterModel.ToString()); } catch { md.AddToWindow("Remote Player", "Lobby Player Model", "null"); } try { md.AddToWindow("Remote Player", "Game PlayerEntity", opponentPlayerEntity.ToString()); } catch { md.AddToWindow("Remote Player", "Game PlayerEntity", "null"); } - try { md.AddToWindow("Remote Player", "Name", opponentPlayerName.ToString()); } catch { } + try { md.AddToWindow("Remote Player", "Name", opponentPlayerNr.ToString()); } catch { } try { md.AddToWindow("Remote Player", "Customskin Character", opponentCustomSkinCharacter.ToString()); } catch { } try { md.AddToWindow("Remote Player", "Customskin Variant", opponentCustomSkinCharacterVariant.ToString()); } catch { } try { md.AddToWindow("Remote Player", "Custom Texture", opponentCustomTexture.ToString()); } catch { md.AddToWindow("Remote Player", "Custom Texture", "null"); } @@ -422,6 +422,7 @@ private void Update() if (localLobbyPlayer != null && randomizedChar == false) // Determine and assign skin to local player { + //Player.Selected - Has the Player selected their character yet. if (localLobbyPlayer.CHNGAKOIJFE) { var setNextSkin = false; @@ -434,7 +435,6 @@ private void Update() else initLocalPlayer = true; localPlayerChar = localLobbyPlayer.DOFCCEDJODB; localPlayerCharVar = localLobbyPlayer.AIINAIDBHJI; - } LLButton[] buttons = FindObjectsOfType(); @@ -444,6 +444,19 @@ private void Update() if (useOnlySetKey == false) { + if (UIScreen.currentScreens[0]?.screenType == ScreenType.PLAYERS) + { + ScreenPlayers screenPlayers = UIScreen.currentScreens[0] as ScreenPlayers; + if (localLobbyPlayer.GDEMBCKIDMA.GetButtonDown(InputAction.EXPRESS_RIGHT)) + { + setNextSkin = true; + } + else if (localLobbyPlayer.GDEMBCKIDMA.GetButtonDown(InputAction.EXPRESS_LEFT)) + { + setPreviousSkin = true; + } + } + if (Input.GetKey(holdKey1) && buttons.Length > 0) { foreach (LLButton b in buttons) b.SetActive(false); //Deactivate buttons @@ -481,6 +494,7 @@ private void Update() localLobbyPlayer.LALEEFJMMLH = randomChar; localTex = GetLoadedTexture(randomChar, localTex, false, true); + if (InLobby(GameType.Online)) { gameStatesOnlineLobby.EMFKKOJEIPN(localLobbyPlayer.CJFLMDNNMIE, true); //Set Ready @@ -589,7 +603,7 @@ private void Update() } AssignTextureToIngameCharacter(localGamePlayerEntity, localTex); - localPlayerName = AssignTextureToHud(localGamePlayerEntity, localTex); + localPlayerNr = AssignTextureToHud(localGamePlayerEntity, localTex); } } } @@ -681,7 +695,7 @@ private void Update() if (localTex != null) { AssignTextureToIngameCharacter(localGamePlayerEntity, localTex); - localPlayerName = AssignTextureToHud(localGamePlayerEntity, localTex); + localPlayerNr = AssignTextureToHud(localGamePlayerEntity, localTex); } } if (InGame(GameType.Online)) @@ -692,7 +706,7 @@ private void Update() else { AssignTextureToIngameCharacter(opponentPlayerEntity, opponentCustomTexture); - opponentPlayerName = AssignTextureToHud(opponentPlayerEntity, opponentCustomTexture); + opponentPlayerNr = AssignTextureToHud(opponentPlayerEntity, opponentCustomTexture); } } } @@ -701,8 +715,8 @@ private void Update() { AssignSkinToWinnerModel(); - if (localTex != null) { AssignTextureToPostGameHud(localPlayerName, localTex); } - if (opponentCustomTexture != null) AssignTextureToPostGameHud(opponentPlayerName, opponentCustomTexture); + if (localTex != null) { AssignTextureToPostGameHud(localPlayerNr, localTex); } + if (opponentCustomTexture != null) AssignTextureToPostGameHud(opponentPlayerNr, opponentCustomTexture); } else { @@ -717,25 +731,25 @@ private void Update() if (InMenu()) { sendCancelRequestToServer = true; - if (UIScreen.currentScreens[1] != null) + if (UIScreen.currentScreens[1]?.screenType != ScreenType.UNLOCKS_SKINS) { - if (UIScreen.currentScreens[1].screenType != ScreenType.UNLOCKS_SKINS) - { - InitLocalPlayer(); - } + InitLocalPlayer(); } InitOpponentPlayer(); } if (UIScreen.currentScreens[1] != null) { - if (UIScreen.currentScreens[1].screenType == ScreenType.UNLOCKS_SKINS) + if (UIScreen.currentScreens[1]?.screenType == ScreenType.UNLOCKS_SKINS) { if (siluetteTimer > 0) { - CharacterModel[] cms = FindObjectsOfType(); - foreach (CharacterModel cm in cms) cm.SetSilhouette(false); - if (localTex != null) SetUnlocksCharacterModel(localTex); + CharacterModel characterModel = (UIScreen.currentScreens[1] as ScreenUnlocksSkins).previewModel; + if (localTex != null) + { + characterModel.SetSilhouette(false); + AssignTextureToCharacterModelRenderers(characterModel, localTex); + } } if (Input.GetKey(holdKey1)) @@ -800,7 +814,7 @@ private void Update() } } } - else if (UIScreen.currentScreens[1].screenType == ScreenType.UNLOCKS_CHARACTERS) + else if (UIScreen.currentScreens[1]?.screenType == ScreenType.UNLOCKS_CHARACTERS) { localTex = null; intervalMode = false; @@ -812,27 +826,23 @@ private void Update() if (InGame(GameType.Any)) { - if (mainBall == null) mainBall = BallHandler.instance.GetBall(0); - if (playersInCurrentGame.Count == 0) playersInCurrentGame = GetCharactersInGame(); - else + mainBall = mainBall ?? BallHandler.instance.GetBall(0); + //Player.AllInMatch + ALDOKEMAOMB.ICOCPAFKCCE((ALDOKEMAOMB player) => { - foreach (Character character in playersInCurrentGame) + switch (player.DOFCCEDJODB) { - switch (character) - { - case Character.CANDY: CandymanIngameEffects(); break; - case Character.BAG: AshesIngameEffects(); break; - case Character.GRAF: ToxicIngameEffects(); break; - case Character.ELECTRO: GridIngameEffects(); break; - case Character.SKATE: JetIngameEffects(); break; - } + case Character.CANDY: CandymanIngameEffects(); break; + case Character.BAG: AshesIngameEffects(); break; + case Character.GRAF: ToxicIngameEffects(); break; + case Character.ELECTRO: GridIngameEffects(); break; + case Character.SKATE: JetIngameEffects(); break; } - } + }); } else { mainBall = null; - if (playersInCurrentGame.Count > 0) playersInCurrentGame.Clear(); } } @@ -854,11 +864,9 @@ public List GetCharactersInGame() public bool InMenu() { - if (UIScreen.currentScreens[0] != null) + if (UIScreen.currentScreens[0]?.screenType == ScreenType.MENU) { - if (UIScreen.currentScreens[0].screenType == ScreenType.MENU) - { return true; } - else { return false; } + return true; } else return false; } @@ -886,15 +894,15 @@ public bool InGame(GameType gt) switch (gt) { case GameType.Online: - if (JOMBNFKIHIC.GDNFJCCCKDM && gameState == (JOFJHDJHJGI)19) + if (JOMBNFKIHIC.GDNFJCCCKDM && gameState == (JOFJHDJHJGI)19 && UIScreen.loadingScreenActive == false) { return true; } break; case GameType.Offline: - if ((!JOMBNFKIHIC.GDNFJCCCKDM) && gameState == (JOFJHDJHJGI)19) + if ((!JOMBNFKIHIC.GDNFJCCCKDM) && gameState == (JOFJHDJHJGI)19 && UIScreen.loadingScreenActive == false) { return true; } break; case GameType.Any: - if ((!JOMBNFKIHIC.GDNFJCCCKDM || JOMBNFKIHIC.GDNFJCCCKDM) && gameState == (JOFJHDJHJGI)19) + if ((!JOMBNFKIHIC.GDNFJCCCKDM || JOMBNFKIHIC.GDNFJCCCKDM) && gameState == (JOFJHDJHJGI)19 && UIScreen.loadingScreenActive == false) { return true; } break; } @@ -973,23 +981,8 @@ public void AssignTextureToCharacterModelRenderers(CharacterModel model, Texture { foreach (Renderer r in rs) { - switch (model.character) - { - case Character.BAG: - AssignAshesOutlineColorToRenderer(r, model.characterVariant, tex); - break; - case Character.BOSS: - if (model.characterVariant == CharacterVariant.MODEL_ALT3 || model.characterVariant == CharacterVariant.MODEL_ALT4) AssignDoomBoxVisualizerColorToRenderer(r, tex); - else if (model.characterVariant == CharacterVariant.MODEL_ALT || model.characterVariant == CharacterVariant.MODEL_ALT2) AssignOmegaDoomboxSmearsAndArmsToRenderer(r, tex); - break; - case Character.GRAF: - if (model.characterVariant == CharacterVariant.MODEL_ALT3 || model.characterVariant == CharacterVariant.MODEL_ALT4) AssignNurseToxicCanistersToRenderer(r, tex); - break; - } - - r.material.SetTexture("_MainTex", tex); + AssignTextureToRenderer(r, tex); } - } } catch { } @@ -1014,28 +1007,20 @@ private void AssignTextureToIngameCharacter(PlayerEntity playerEntity, Texture2D { foreach (Renderer r in ve.skinRenderers) { - if (!r.gameObject.name.EndsWith("Outline")) - { - r.material.SetTexture("_MainTex", tex); - } + AssignTextureToRenderer(r, tex); } if (playerEntity.character == Character.GRAF) { AssignToxicEffectColors(playerEntity.player.CJFLMDNNMIE, tex, playerEntity.variant); } - else if (playerEntity.character == Character.BOSS) - { - if (playerEntity.variant == CharacterVariant.MODEL_ALT3 || playerEntity.variant == CharacterVariant.MODEL_ALT4) AssignDoomBoxVisualizerColorIngame(playerEntity, tex); - else if (playerEntity.variant == CharacterVariant.MODEL_ALT || playerEntity.variant == CharacterVariant.MODEL_ALT2) AssignOmegaDoomboxSmearsAndArmsIngame(playerEntity, tex); - } } } } - private string AssignTextureToHud(PlayerEntity playerEntity, Texture tex) + private int AssignTextureToHud(PlayerEntity playerEntity, Texture tex) { - string ret = ""; + int ret = -1; GameHudPlayerInfo[] ghpis = FindObjectsOfType(); if (ghpis.Length > 0) { @@ -1048,66 +1033,141 @@ private string AssignTextureToHud(PlayerEntity playerEntity, Texture tex) { foreach (Renderer r in rs) { - r.material.SetTexture("_MainTex", tex); - if (playerEntity.character == Character.GRAF) - { - CharacterVariant variant = playerEntity.variant; - if (variant == CharacterVariant.MODEL_ALT3 || variant == CharacterVariant.MODEL_ALT4) - { - AssignNurseToxicCanistersToRenderer(r, (Texture2D)tex); - } - } + AssignTextureToRenderer(r, tex); } } - ret = ghpi.lbName.text; + ret = ghpi.shownPlayer.CJFLMDNNMIE; } } } return ret; } - private void AssignTextureToPostGameHud(string playerName, Texture tex) + private void AssignTextureToPostGameHud(int playerNr, Texture tex) { PostScreen ps = FindObjectOfType(); PostSceenPlayerBar[] pspbs = ps.playerBarsByPlayer; + if (pspbs.Length > 0) { - foreach (PostSceenPlayerBar pspb in pspbs) + Renderer[] rs = pspbs[playerNr].gameObject.transform.GetComponentsInChildren(); + if (rs.Length > 0) { - try + foreach (Renderer r in rs) { - if (pspb.btPlayerName.GetText() == playerName) + AssignTextureToRenderer(r, tex, playerNr); + } + } + } + } + + void AssignTextureToRenderer(Renderer r, Texture tex, int playerIndex = -1, PlayerEntity playerEntity = null) + { + Character character = Character.NONE; + CharacterVariant characterVariant = CharacterVariant.DEFAULT; + playerEntity = playerEntity ?? r.transform.GetComponentInParent(); + + if (playerEntity != null) + { + character = playerEntity.character; + characterVariant = playerEntity.variant; + } + else + { + GameHudPlayerInfo playerHud = r.transform.GetComponentInParent(); + if (playerHud != null) + { + character = playerHud.shownPlayer.DOFCCEDJODB; + characterVariant = playerHud.shownPlayer.AIINAIDBHJI; + } + else + { + CharacterModel characterModel = r.transform.GetComponentInParent(); + if (characterModel != null) + { + character = characterModel.character; + characterVariant = characterModel.characterVariant; + } + else + { + if (playerIndex > -1) { - Renderer[] rs = pspb.gameObject.transform.GetComponentsInChildren(); - if (rs.Length > 0) foreach (Renderer r in rs) r.material.SetTexture("_MainTex", tex); + ALDOKEMAOMB player = ALDOKEMAOMB.MNOLFHGAIMC(playerIndex); + character = player.DOFCCEDJODB; + characterVariant = player.AIINAIDBHJI; } } - catch { } + } + } + + if (!r.gameObject.name.EndsWith("Outline")) + { + string materialTexName = r.material.mainTexture?.name ?? ""; + if (characterVariant == CharacterVariant.STATIC_ALT && r.material.name.Contains("ScreenSpaceNoise")) + { + AOOJOMIECLD modelValues = JPLELOFJOOH.NEBGBODHHCG(character, characterVariant != CharacterVariant.STATIC_ALT ? characterVariant : CharacterVariant.DEFAULT); + r.material = modelValues.DMAMFHLFOJF(0, false); + } + + if (!materialTexName.Contains("Silhouett") && materialTexName != "") + { + r.material.SetTexture("_MainTex", tex); + } + } + + if (character == Character.GRAF) + { + if (characterVariant == CharacterVariant.MODEL_ALT3 || characterVariant == CharacterVariant.MODEL_ALT4) + { + AssignNurseToxicCanisters(r, (Texture2D)tex); + } + } + else if (character == Character.SKATE) + { + if (characterVariant == CharacterVariant.MODEL_ALT || characterVariant == CharacterVariant.MODEL_ALT2) + { + AssignJetScubaVisor(r, (Texture2D)tex); + } + } + else if (character == Character.BOSS) + { + if (characterVariant == CharacterVariant.MODEL_ALT || characterVariant == CharacterVariant.MODEL_ALT2) + { + AssignOmegaDoomboxSmearsAndArms(r, (Texture2D)tex); + } + else if (characterVariant == CharacterVariant.MODEL_ALT3 || characterVariant == CharacterVariant.MODEL_ALT4) + { + AssignVisualizer(character, r, (Texture2D)tex); + } + } + else if (character == Character.BAG) + { + AssignAshesOutlineColor(r, characterVariant, (Texture2D)tex); + } + else if (character == Character.BOOM) + { + if (characterVariant == CharacterVariant.MODEL_ALT3 || characterVariant == CharacterVariant.MODEL_ALT4) + { + AssignVisualizer(character, r, (Texture2D)tex); } } } private void AssignSkinToWinnerModel() { - PostScreen ps = FindObjectOfType(); - if (ps != null) + + if (UIScreen.currentScreens[0]?.screenType == ScreenType.GAME_RESULTS) { + PostScreen ps = UIScreen.currentScreens[0] as PostScreen; + if (localTex != null) { - try - { - if (ps.winnerCharacter == localPlayerChar && ps.winnerCharacterVariant == localPlayerCharVar) AssignTextureToCharacterModelRenderers(ps.winnerModel, localTex); - } - catch (Exception ex) { Debug.Log("Winner Model: " + ex); } + if (ps.winnerCharacter == localPlayerChar && ps.winnerCharacterVariant == localPlayerCharVar) AssignTextureToCharacterModelRenderers(ps.winnerModel, localTex); } if (opponentCustomTexture != null) { - try - { - if (ps.winnerCharacter == opponentCustomSkinCharacter && ps.winnerCharacterVariant == opponentCustomSkinCharacterVariant) AssignTextureToCharacterModelRenderers(ps.winnerModel, opponentCustomTexture); - } - catch (Exception ex) { Debug.Log("Winner Model: " + ex); } + if (ps.winnerCharacter == opponentCustomSkinCharacter && ps.winnerCharacterVariant == opponentCustomSkinCharacterVariant) AssignTextureToCharacterModelRenderers(ps.winnerModel, opponentCustomTexture); } } } @@ -1130,7 +1190,7 @@ private void InitLocalPlayer() localLobbyPlayer = null; localLobbyPlayerModel = null; localGamePlayerEntity = null; - localPlayerName = ""; + localPlayerNr = -1; localTex = null; doSkinPost = false; postTimer = 0; @@ -1142,13 +1202,14 @@ private void InitOpponentPlayer() opponentPlayer = null; opponentLobbyCharacterModel = null; opponentPlayerEntity = null; - opponentPlayerName = ""; + opponentPlayerNr = -1; opponentCustomTexture = null; doSkinGet = false; getTimer = 0; initOpponentPlayer = false; } + private Texture2D GetLoadedTexture(Character c, Texture2D currentTexture, bool previous, bool random) { Texture2D ret = null; @@ -1262,41 +1323,42 @@ private Texture2D GetLoadedTexture(Character c, Texture2D currentTexture, bool p private Texture2D GetLoadedTextureForUnlocksModel(Texture2D currentTexture, bool previous) { - Texture2D ret = null; + Texture2D texture = null; var texname = ""; ScreenUnlocksSkins sus = FindObjectOfType(); if (sus != null) { + var curCharactersTextures = TextureMod.Instance.tl.characterTextures[sus.character]; if (previous) { - if (currentTexture == null && TextureMod.Instance.tl.characterTextures[sus.character].ElementAt(0).Value != null) + if (currentTexture == null && curCharactersTextures.ElementAt(0).Value != null) { - sus.ShowCharacter(sus.character, GetVariantFromFileName(sus.character, TextureMod.Instance.tl.characterTextures[sus.character].Last().Key), false); - texname = TextureMod.Instance.tl.characterTextures[sus.character].Last().Key; - ret = TextureMod.Instance.tl.characterTextures[sus.character].Last().Value; + sus.ShowCharacter(sus.character, GetVariantFromFileName(sus.character, curCharactersTextures.Last().Key), false); + texname = curCharactersTextures.Last().Key; + texture = curCharactersTextures.Last().Value; } else { bool retnext = false; - for (int i = TextureMod.Instance.tl.characterTextures[sus.character].Count - 1; i != -1; i--) + for (int i = curCharactersTextures.Count - 1; i != -1; i--) { - KeyValuePair pair = TextureMod.Instance.tl.characterTextures[sus.character].ElementAt(i); + KeyValuePair pair = curCharactersTextures.ElementAt(i); if (retnext == true) { sus.ShowCharacter(sus.character, GetVariantFromFileName(sus.character, pair.Key), false); texname = pair.Key; - ret = pair.Value; + texture = pair.Value; break; } else if (retnext == false && currentTexture == pair.Value) { retnext = true; - if (currentTexture == TextureMod.Instance.tl.characterTextures[sus.character].First().Value) + if (currentTexture == curCharactersTextures.First().Value) { - sus.ShowCharacter(sus.character, GetVariantFromFileName(sus.character, TextureMod.Instance.tl.characterTextures[sus.character].Last().Key), false); - texname = TextureMod.Instance.tl.characterTextures[sus.character].Last().Key; - ret = TextureMod.Instance.tl.characterTextures[sus.character].Last().Value; + sus.ShowCharacter(sus.character, GetVariantFromFileName(sus.character, curCharactersTextures.Last().Key), false); + texname = curCharactersTextures.Last().Key; + texture = curCharactersTextures.Last().Value; } } } @@ -1304,32 +1366,32 @@ private Texture2D GetLoadedTextureForUnlocksModel(Texture2D currentTexture, bool } else { - if (currentTexture == null && TextureMod.Instance.tl.characterTextures[sus.character].ElementAt(0).Value != null) + if (currentTexture == null && curCharactersTextures.ElementAt(0).Value != null) { - sus.ShowCharacter(sus.character, GetVariantFromFileName(sus.character, TextureMod.Instance.tl.characterTextures[sus.character].ElementAt(0).Key), false); - texname = TextureMod.Instance.tl.characterTextures[sus.character].ElementAt(0).Key; - ret = TextureMod.Instance.tl.characterTextures[sus.character].ElementAt(0).Value; + sus.ShowCharacter(sus.character, GetVariantFromFileName(sus.character, curCharactersTextures.ElementAt(0).Key), false); + texname = curCharactersTextures.ElementAt(0).Key; + texture = curCharactersTextures.ElementAt(0).Value; } else { bool retnext = false; - foreach (KeyValuePair pair in TextureMod.Instance.tl.characterTextures[sus.character]) + foreach (KeyValuePair pair in curCharactersTextures) { if (retnext == true) { sus.ShowCharacter(sus.character, GetVariantFromFileName(sus.character, pair.Key), false); texname = pair.Key; - ret = pair.Value; + texture = pair.Value; break; } else if (retnext == false && currentTexture == pair.Value) { retnext = true; - if (currentTexture == TextureMod.Instance.tl.characterTextures[sus.character].Last().Value) + if (currentTexture == curCharactersTextures.Last().Value) { - sus.ShowCharacter(sus.character, GetVariantFromFileName(sus.character, TextureMod.Instance.tl.characterTextures[sus.character].ElementAt(0).Key), false); - texname = TextureMod.Instance.tl.characterTextures[sus.character].ElementAt(0).Key; - ret = TextureMod.Instance.tl.characterTextures[sus.character].ElementAt(0).Value; + sus.ShowCharacter(sus.character, GetVariantFromFileName(sus.character, curCharactersTextures.ElementAt(0).Key), false); + texname = curCharactersTextures.ElementAt(0).Key; + texture = curCharactersTextures.ElementAt(0).Value; } } } @@ -1342,7 +1404,7 @@ private Texture2D GetLoadedTextureForUnlocksModel(Texture2D currentTexture, bool siluetteTimer = 5; localTexName = texname; - return ret; + return texture; } private string CleanTextureName(string texname) @@ -1371,44 +1433,12 @@ private CharacterVariant GetVariantFromFileName(Character localPlayerC, string n { var proceed = false; - switch (localPlayerC) + foreach (Character DLC in TextureMod.ownedDLCs) { - case Character.PONG: - foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Dice") proceed = true; - break; - case Character.KID: - foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Raptor") proceed = true; - break; - case Character.BAG: - foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Dust&Ashes") proceed = true; - break; - case Character.BOSS: - foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Doombox") proceed = true; - break; - case Character.GRAF: - foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Toxic") proceed = true; - break; - case Character.ROBOT: - foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Switch") proceed = true; - break; - case Character.CROC: - foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Latch") proceed = true; - break; - case Character.BOOM: - foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Sonata") proceed = true; - break; - case Character.ELECTRO: - foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Grid") proceed = true; - break; - case Character.SKATE: - foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Jet") proceed = true; - break; - case Character.CANDY: - foreach (string DLC in TextureMod.ownedDLCs) if (DLC == "Candyman") proceed = true; - break; - default: - proceed = false; - break; + if (DLC == localPlayerC) + { + proceed = true; + } } if (proceed) @@ -1484,6 +1514,20 @@ public void MakeTextureGrayscale(Texture2D tex) } #endregion + #region Ball Effects + private void SetBallColors() + { + Color color = Color.grey; + mainBall.GetVisual("main").renderers[2].materials[0].color = color; + mainBall.SetColorOutlinesColor(color); + for (int i = 0; i < mainBall.GetVisual("main2D").meshRendererTrail.Length; i++) + { + color.a = mainBall.GetVisual("main2D").meshRendererTrail[i].material.color.a; + mainBall.GetVisual("main2D").meshRendererTrail[i].material.color = color; + } + } + #endregion + #region Dust&Ashes Effects public void AshesIngameEffects() { @@ -1494,24 +1538,13 @@ public void AshesIngameEffects() public void AssignAshesOutlineColor(PlayerEntity pe, Texture2D tex) { - Color c = new Color(1, 1, 1, 1); - switch (pe.variant) - { - case CharacterVariant.DEFAULT: c = tex.GetPixel(58, 438); break; - case CharacterVariant.ALT0: c = tex.GetPixel(58, 438); break; - case CharacterVariant.MODEL_ALT: c = tex.GetPixel(69, 298); break; - case CharacterVariant.MODEL_ALT2: c = tex.GetPixel(69, 298); break; - case CharacterVariant.MODEL_ALT3: c = tex.GetPixel(113, 334); break; - case CharacterVariant.MODEL_ALT4: c = tex.GetPixel(113, 334); break; - } - foreach (Renderer r in pe.skinRenderers) { - if (r.name != "mesh1Outline" && r.name != "mesh1MetalOutline" && r.name != "mesh1TenguOutline" && r.name.Contains("Outline")) r.material.color = c; + AssignAshesOutlineColor(r, pe.variant, tex); } } - public void AssignAshesOutlineColorToRenderer(Renderer r, CharacterVariant variant, Texture2D tex) + public void AssignAshesOutlineColor(Renderer r, CharacterVariant variant, Texture2D tex) { Color c = new Color(1, 1, 1, 1); switch (variant) @@ -1528,6 +1561,7 @@ public void AssignAshesOutlineColorToRenderer(Renderer r, CharacterVariant varia } #endregion + #region Candyman Effects public void CandymanIngameEffects() { @@ -1548,57 +1582,75 @@ public void AssignSkinToCandyball(BallEntity ball, PlayerEntity pe, Texture2D te { if (tex == null) { - VisualEntity pve = pe.gameObject.GetComponent(); - tex = (Texture2D)pve.skinRenderers.First().material.mainTexture; + tex = (Texture2D)pe.skinRenderers.First().material.mainTexture; } - VisualEntity ve = ball.gameObject.GetComponentInChildren(); - foreach (Renderer r in ve.skinRenderers) - { - if (r.name == "mesh001_MainRenderer" || r.name == "mesh001Strait_MainRenderer") - { - r.material.mainTexture = tex; - } - } + ball.GetVisual($"candyBall{(int)pe.variant}Visual").mainRenderer.material.mainTexture = tex; } + int lastCandyBallPlayerIndex = -1; public void AssignSkinColorToCandySplash() { - VisualEntity[] ves = FindObjectsOfType(); - foreach (VisualEntity v in ves) + EffectEntity[] effects = FindObjectsOfType(); + if (mainBall.ballData.ballState == BallState.CANDYBALL) { - if (v.name == "candySplash") + lastCandyBallPlayerIndex = mainBall.GetLastPlayerHitter().playerIndex; + } + + if (effects != null) + { + for (int i = 0; i < effects.Length; i++) { - Texture2D tex = null; - CandyPlayer[] cps = FindObjectsOfType(); - foreach (CandyPlayer cp in cps) + EffectEntity effect = effects[i]; + + if (effect.effectData.graphicName == "candySplash") { - if (cp.player.CJFLMDNNMIE == localGamePlayerEntity.player.CJFLMDNNMIE && localTex != null) - { - if (localGamePlayerEntity.GetCurrentAbilityState().name.Contains("CROUCH") && (localGamePlayerEntity.moveableData.onLeftWallApprox || localGamePlayerEntity.moveableData.onRightWallApprox) && !localGamePlayerEntity.moveableData.velocity.HCBCKAHGJCA(IBGCBLLKIHA.DBOMOJGKIFI)) tex = localTex; - if (mainBall.ballData.ballState == BallState.CANDYBALL && mainBall.GetLastPlayerHitter() == localGamePlayerEntity) tex = localTex; - } + Texture2D tex = CheckPlayerOrMainBallSplashEffect(localGamePlayerEntity, effect, localTex) ?? CheckPlayerOrMainBallSplashEffect(opponentPlayerEntity, effect, localTex) ?? null; - if (opponentPlayerEntity != null && opponentCustomTexture != null && tex == null) + if (tex != null) { - if (cp.player.CJFLMDNNMIE == opponentPlayerEntity.player.CJFLMDNNMIE && opponentCustomTexture != null) + SetCandySplashEffect(effects[i], tex); + for (int j = 0; j < effects.Length; j++) { - if ((opponentPlayerEntity.moveableData.onLeftWallApprox || opponentPlayerEntity.moveableData.onRightWallApprox) && !opponentPlayerEntity.moveableData.velocity.HCBCKAHGJCA(IBGCBLLKIHA.DBOMOJGKIFI)) tex = opponentCustomTexture; - if (mainBall.ballData.ballState == BallState.CANDYBALL && mainBall.GetLastPlayerHitter() == opponentPlayerEntity) tex = opponentCustomTexture; + //Searches for the intiial candySplash and sets it to custom texture + if (effects[j].effectData.graphicName == "candySplash" && effects[j].effectData.active) + { + SetCandySplashEffect(effects[j], tex); + } } } } - Renderer[] rs = v.GetComponentsInChildren(); - foreach (var r in rs) - { - r.material.mainTexture = candySplashWhite; - r.material.color = tex.GetPixel(103, 473); - v.name = "candySplashModified"; - } } } } #endregion + + Texture2D CheckPlayerOrMainBallSplashEffect(PlayerEntity playerEntity, EffectEntity effect, Texture2D characterTex) + { + if (playerEntity?.character == Character.CANDY && characterTex != null) + { + bool playerNearEffect = HHBCPNCDNDH.HPLPMEAOJPM(IBGCBLLKIHA.FCKBPDNEAOG(playerEntity.GetPosition(), effect.GetPosition()).KEMFCABCHLO, HHBCPNCDNDH.NKKIFJJEPOL(0.2m)); + bool ballNearEffect = HHBCPNCDNDH.HPLPMEAOJPM(IBGCBLLKIHA.FCKBPDNEAOG(mainBall.GetPosition(), effect.GetPosition()).KEMFCABCHLO, HHBCPNCDNDH.NKKIFJJEPOL(0.6m)); + if (playerNearEffect && !playerEntity.moveableData.velocity.HCBCKAHGJCA(IBGCBLLKIHA.DBOMOJGKIFI) && playerEntity.abilityData.abilityState.Contains("CROUCH")) + { + return characterTex; + } + else if (ballNearEffect && lastCandyBallPlayerIndex == playerEntity.playerIndex) + { + return characterTex; + } + } + return null; + } + + void SetCandySplashEffect(EffectEntity effect, Texture2D tex) + { + Renderer r = effect.GetVisual("main").mainRenderer; + r.material.mainTexture = candySplashWhite; + r.material.color = (localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT3 || localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT4) ? tex.GetPixel(130, 92) : tex.GetPixel(103, 473); + effect.effectData.graphicName = "candySplashModified"; + } + #region Grid effects public void GridIngameEffects() { @@ -1660,63 +1712,34 @@ public void AssignGridSpecialColor(PlayerEntity pe, Texture2D tex) } #endregion + #region Doombox Effects - public void AssignDoomBoxVisualizerColorIngame(PlayerEntity pe, Texture2D tex) + public void AssignVisualizer(PlayerEntity pe, Texture2D tex) { - Color c1 = tex.GetPixel(493, 510); - Color c2 = tex.GetPixel(508, 510); - FNDGCLEDHAD visualizer = pe.GetVisual("main").mainRenderer.gameObject.GetComponent(); - Material vismat = visualizer.FHAMOPAJHNJ; - vismat.SetColor("_AmpColor0", c1); - vismat.SetColor("_AmpColor1", c2); + AssignVisualizer(pe.character, pe.GetVisual("main").mainRenderer, tex); } - public void AssignDoomBoxVisualizerColorToRenderer(Renderer r, Texture2D tex) + void AssignVisualizer(Character character, Renderer r, Texture2D tex) { - if (r.gameObject.GetComponent() != null) + FNDGCLEDHAD visualizer = r.gameObject.GetComponentInParent(); + if (visualizer != null) { - Color c1 = tex.GetPixel(493, 510); - Color c2 = tex.GetPixel(508, 510); - FNDGCLEDHAD visualizer = r.gameObject.GetComponent(); + Color c1 = character == Character.BOSS ? tex.GetPixel(493, 510) : tex.GetPixel(82, 10); + Color c2 = character == Character.BOSS ? tex.GetPixel(508, 510) : tex.GetPixel(96, 10); + Material vismat = visualizer.FHAMOPAJHNJ; + vismat.mainTexture = tex; vismat.SetColor("_AmpColor0", c1); vismat.SetColor("_AmpColor1", c2); } } - public void AssignOmegaDoomboxSmearsAndArmsIngame(PlayerEntity pe, Texture2D tex) + public void AssignOmegaDoomboxSmearsAndArms(PlayerEntity pe, Texture2D tex) { - - Color arm1 = tex.GetPixel(28, 336); - Color arm2 = tex.GetPixel(28, 325); - - Color bright1 = tex.GetPixel(113, 336); - Color bright2 = tex.GetPixel(113, 325); - - Color alpha = tex.GetPixel(178, 332); - - VisualEntity ve = pe.gameObject.GetComponent(); - if (ve != null) - { - if (ve.skinRenderers.Count > 0) - { - foreach (Renderer r in ve.skinRenderers) - { - foreach (Material m in r.materials) - { - if (m.name.Contains("bossOmegaGlassMat") || m.name.Contains("bossOmegaEffectMat")) - { - m.SetColor("_LitColor", new Color(arm1.r, arm1.g, arm1.b, bright1.r)); - m.SetColor("_ShadowColor", new Color(arm2.r, arm2.g, arm2.b, bright2.r)); - m.SetFloat("_Transparency", alpha.r); - } - } - } - } - } + AssignOmegaDoomboxSmearsAndArms(pe.GetVisual("main").mainRenderer, tex); } - public void AssignOmegaDoomboxSmearsAndArmsToRenderer(Renderer r, Texture2D tex) + public void AssignOmegaDoomboxSmearsAndArms(Renderer r, Texture2D tex) { Color arm1 = tex.GetPixel(28, 336); Color arm2 = tex.GetPixel(28, 325); @@ -1730,6 +1753,7 @@ public void AssignOmegaDoomboxSmearsAndArmsToRenderer(Renderer r, Texture2D tex) { if (m.name.Contains("bossOmegaGlassMat") || m.name.Contains("bossOmegaEffectMat")) { + m.SetTexture("_MainTex", tex); m.SetColor("_LitColor", new Color(arm1.r, arm1.g, arm1.b, bright1.r)); m.SetColor("_ShadowColor", new Color(arm2.r, arm2.g, arm2.b, bright2.r)); m.SetFloat("_Transparency", alpha.r); @@ -1737,58 +1761,28 @@ public void AssignOmegaDoomboxSmearsAndArmsToRenderer(Renderer r, Texture2D tex) } } #endregion + #region Toxic Effects public void ToxicIngameEffects() { if (localGamePlayerEntity != null && localTex != null) { - if (localGamePlayerEntity.character == Character.GRAF && localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT3 || localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT4) AssignNurseToxicCanistersIngame(localGamePlayerEntity, localTex); + if (localGamePlayerEntity.character == Character.GRAF && localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT3 || localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT4) AssignNurseToxicCanisters(localGamePlayerEntity, localTex); } if (opponentPlayerEntity != null && opponentCustomTexture != null) { - if (opponentPlayerEntity.character == Character.GRAF && opponentPlayerEntity.variant == CharacterVariant.MODEL_ALT3 || opponentPlayerEntity.variant == CharacterVariant.MODEL_ALT4) AssignNurseToxicCanistersIngame(opponentPlayerEntity, opponentCustomTexture); + if (opponentPlayerEntity.character == Character.GRAF && opponentPlayerEntity.variant == CharacterVariant.MODEL_ALT3 || opponentPlayerEntity.variant == CharacterVariant.MODEL_ALT4) AssignNurseToxicCanisters(opponentPlayerEntity, opponentCustomTexture); } } - public void AssignNurseToxicCanistersIngame(PlayerEntity pe, Texture2D tex) + public void AssignNurseToxicCanisters(PlayerEntity pe, Texture2D tex) { - - Color light = tex.GetPixel(158, 414); - Color shad = tex.GetPixel(158, 406); - - Color bright1 = tex.GetPixel(158, 397); - Color bright2 = tex.GetPixel(158, 389); - - Color alpha = tex.GetPixel(158, 380); - - VisualEntity ve = pe.gameObject.GetComponent(); - if (ve != null) - { - if (ve.skinRenderers.Count > 0) - { - foreach (Renderer r in ve.skinRenderers) - { - if (r.name == "meshNurse_MainRenderer") - { - foreach (Material m in r.materials) - { - if (m.name.Contains("grafNurseGlass")) - { - m.SetColor("_LitColor", new Color(light.r, light.g, light.b, bright1.r)); - m.SetColor("_ShadowColor", new Color(shad.r, shad.g, shad.b, bright2.r)); - m.SetFloat("_Transparency", alpha.r); - } - } - } - } - } - } + AssignNurseToxicCanisters(pe.GetVisual("main").mainRenderer, tex); } - public void AssignNurseToxicCanistersToRenderer(Renderer r, Texture2D tex) + public void AssignNurseToxicCanisters(Renderer r, Texture2D tex) { - Color light = tex.GetPixel(158, 414); Color shad = tex.GetPixel(158, 406); @@ -1801,12 +1795,12 @@ public void AssignNurseToxicCanistersToRenderer(Renderer r, Texture2D tex) { if (m.name.Contains("grafNurseGlass")) { + m.SetTexture("_MainTex", tex); m.SetColor("_LitColor", new Color(light.r, light.g, light.b, bright1.r)); m.SetColor("_ShadowColor", new Color(shad.r, shad.g, shad.b, bright2.r)); m.SetFloat("_Transparency", alpha.r); } } - } public void AssignToxicEffectColors(int playerId, Texture2D tex, CharacterVariant cv) @@ -1826,11 +1820,45 @@ public void AssignToxicEffectColors(int playerId, Texture2D tex, CharacterVarian #endregion + #region Jet Effects public void JetIngameEffects() { if (mainBall.GetLastPlayerHitter() == localGamePlayerEntity && localTex != null) AssignBubbleVisual(localGamePlayerEntity.variant, localTex); if (mainBall.GetLastPlayerHitter() == opponentPlayerEntity && opponentCustomTexture != null) AssignBubbleVisual(opponentPlayerEntity.variant, opponentCustomTexture); + + if (localGamePlayerEntity != null && localTex != null) + { + if (localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT || localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT2) AssignJetScubaVisor(localGamePlayerEntity, localTex); + } + + if (opponentPlayerEntity != null && opponentCustomTexture != null) + { + if (opponentPlayerEntity.variant == CharacterVariant.MODEL_ALT || opponentPlayerEntity.variant == CharacterVariant.MODEL_ALT2) AssignJetScubaVisor(opponentPlayerEntity, opponentCustomTexture); + } + } + public void AssignJetScubaVisor(PlayerEntity pe, Texture2D tex) + { + AssignJetScubaVisor(pe.GetVisual("main").mainRenderer, tex); + } + + public void AssignJetScubaVisor(Renderer r, Texture2D tex) + { + Color light = tex.GetPixel(60, 328); + Color shad = tex.GetPixel(60, 325); + + Color transparency = tex.GetPixel(60, 322); + + foreach (Material m in r.materials) + { + if (m.name.Contains("skateScubaGlass")) + { + m.SetTexture("_MainTex", tex); + m.SetColor("_LitColor", new Color(light.r, light.g, light.b, transparency.g)); + m.SetColor("_ShadowColor", new Color(shad.r, shad.g, shad.b, transparency.b)); + m.SetFloat("_Transparency", transparency.r); + } + } } public void AssignBubbleVisual(CharacterVariant variant, Texture2D tex) diff --git a/TextureMod/TextureHelper.cs b/TextureMod/TextureHelper.cs index 3f5eb08..0bdf339 100644 --- a/TextureMod/TextureHelper.cs +++ b/TextureMod/TextureHelper.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; -using System.IO; namespace TextureMod { @@ -42,12 +42,17 @@ class TextureHelper } } - tex = new Texture2D(512, 512, TextureFormat.RGBA32, true, false); + string texName = Path.GetFileNameWithoutExtension(fullPath); + + tex = new Texture2D(512, 512, TextureFormat.RGBA32, true, false) + { + name = texName, + filterMode = FilterMode.Trilinear, + anisoLevel = 9, + mipMapBias = -0.5f, + }; tex.LoadImage(spriteBytes); //This resizes the texture width and height - tex.filterMode = FilterMode.Trilinear; - tex.anisoLevel = 9; - tex.mipMapBias = -0.5f; - + return tex; } @@ -60,10 +65,23 @@ public static Texture2D ReloadSkin(Character _character, Texture2D _texture) string characterDirectory = ""; string skinName = ""; - foreach (string path in TL.chars) if (TL.StringToChar(Path.GetFileName(path)) == _character) characterDirectory = path; + foreach (string path in TL.chars) + { + if (TL.StringToChar(Path.GetFileName(path)) == _character) + { + characterDirectory = path; + } + } + Debug.Log("characterDirectory:" + characterDirectory); - foreach (var skin in TL.characterTextures[_character]) if (skin.Value == _texture) skinName = skin.Key; + foreach (var skin in TL.characterTextures[_character]) + { + if (skin.Value == _texture) + { + skinName = skin.Key; + } + } string oldSkinName = skinName; @@ -77,7 +95,9 @@ public static Texture2D ReloadSkin(Character _character, Texture2D _texture) { foreach (string file in Directory.GetFiles(dir)) { - if (Path.GetFileName(file) == skinName) + + Debug.Log($"File: {file} : {skinName}"); + if (Path.GetFileNameWithoutExtension(file) == skinName) { newTex = LoadPNG(file); TL.characterTextures[_character][oldSkinName] = newTex; @@ -87,7 +107,8 @@ public static Texture2D ReloadSkin(Character _character, Texture2D _texture) foreach (string file in Directory.GetFiles(characterDirectory)) { - if (Path.GetFileName(file) == skinName) + Debug.Log($"File: {file} : {skinName}"); + if (Path.GetFileNameWithoutExtension(file) == skinName) { newTex = LoadPNG(file); TL.characterTextures[_character][skinName] = newTex; diff --git a/TextureMod/TextureLoader.cs b/TextureMod/TextureLoader.cs index f77dccc..a35c43f 100644 --- a/TextureMod/TextureLoader.cs +++ b/TextureMod/TextureLoader.cs @@ -1,7 +1,9 @@ -using LLScreen; +using LLHandlers; +using LLScreen; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text.RegularExpressions; using UnityEngine; @@ -12,6 +14,7 @@ public class TextureLoader : MonoBehaviour private static string resourceFolder = Application.dataPath.Replace("/", @"\") + @"\Managed\TextureModResources\Images\Characters\"; public List chars = new List(); public Dictionary> characterTextures = new Dictionary>(); + const string regexFilter = @"^\d+#"; public bool loadingExternalFiles = true; public bool hasCactuar = false; @@ -32,73 +35,89 @@ public void LoadLibrary() chars.Add(path); } - foreach (string character in chars) + foreach (string characterFolder in chars) { + Dictionary skins = new Dictionary(); - foreach (string dir in Directory.GetDirectories(character)) + Character character = StringToChar(Path.GetFileName(characterFolder)); + bool hasDLC = CheckHasDLCForCharacter(character); + + foreach (string file in Directory.GetFiles(characterFolder, "*.png", SearchOption.TopDirectoryOnly)) { - foreach (string file in Directory.GetFiles(dir)) + ModelVariant modelVariant = ModelVariantFromFile(file); + if (modelVariant == ModelVariant.DLC && hasDLC == false) { - string cleanfile = Path.GetFileName(file); - if (cleanfile.Contains("#")) - { - List charsFile = cleanfile.ToCharArray().ToList(); - for (var i = 0; i < charsFile.Count; i++) - { - if (charsFile[0] != '#') charsFile.RemoveAt(0); - else - { - charsFile.RemoveAt(0); - break; - } - } - cleanfile = new string(charsFile.ToArray()); - } - - string cleanDir = Path.GetFileName(dir); - if (cleanDir.Contains("#")) - { - List charsDir = cleanDir.ToCharArray().ToList(); - for (var i = 0; i < charsDir.Count; i++) - { - if (charsDir[0] != '#') charsDir.RemoveAt(0); - else - { - charsDir.RemoveAt(0); - break; - } - } - cleanDir = new string(charsDir.ToArray()); - } - - skins.Add(cleanfile + " by " + cleanDir, TextureHelper.LoadPNG(file)); + continue; } + + string cleanName = Path.GetFileNameWithoutExtension(file); + cleanName = Regex.Replace(cleanName, regexFilter, ""); + skins.Add(cleanName, TextureHelper.LoadPNG(file)); } - foreach (string file in Directory.GetFiles(character)) + + + foreach (string dir in Directory.GetDirectories(characterFolder)) { - string cleanfile = Path.GetFileName(file); - if (cleanfile.Contains("#")) + string authorName = Path.GetFileName(dir); + authorName = Regex.Replace(authorName, regexFilter, ""); + + foreach (string file in Directory.GetFiles(dir, "*.png", SearchOption.TopDirectoryOnly)) { - List charsFile = cleanfile.ToCharArray().ToList(); - for (var i = 0; i < charsFile.Count; i++) + ModelVariant modelVariant = ModelVariantFromFile(file); + if (modelVariant == ModelVariant.DLC && hasDLC == false) { - if (charsFile[0] != '#') charsFile.RemoveAt(0); - else - { - charsFile.RemoveAt(0); - break; - } + continue; } - cleanfile = new string(charsFile.ToArray()); + + string cleanName = Path.GetFileNameWithoutExtension(file); + cleanName = Regex.Replace(cleanName, regexFilter, ""); + + skins.Add(cleanName + " by " + authorName, TextureHelper.LoadPNG(file)); } - skins.Add(cleanfile, TextureHelper.LoadPNG(file)); } - characterTextures.Add(StringToChar(Path.GetFileName(character)), skins); + + characterTextures.Add(character, skins); } + UIScreen.SetLoadingScreen(false); loadingExternalFiles = false; } + bool CheckHasDLCForCharacter(Character character) + { + foreach (Character DLC in TextureMod.ownedDLCs) + { + if (DLC == character) + { + return true; + } + } + return false; + } + + public enum ModelVariant + { + None, + Default, + Alternative, + DLC, + } + + ModelVariant ModelVariantFromFile(string path) + { + string fileName = Path.GetFileNameWithoutExtension(path); + + if (fileName.Contains("_ALT2")) + { + return ModelVariant.DLC; + } + else if (fileName.Contains("_ALT")) + { + return ModelVariant.Alternative; + } + else return ModelVariant.Default; + } + public Character StringToChar(string charString) { Character ret = Character.NONE; diff --git a/TextureMod/TextureMod.cs b/TextureMod/TextureMod.cs index 8d69bf6..8b901b6 100644 --- a/TextureMod/TextureMod.cs +++ b/TextureMod/TextureMod.cs @@ -1,20 +1,25 @@ -using System; -using UnityEngine; -using LLScreen; -using LLHandlers; +using LLHandlers; using LLModMenu; +using LLScreen; using Multiplayer; -using System.Collections.Generic; using Steamworks; +using System; +using System.Collections.Generic; +using UnityEngine; namespace TextureMod { public class TextureMod : MonoBehaviour { - private static TextureMod instance = null; - public static TextureMod Instance { get { return instance; } } - public static void Initialize() { GameObject gameObject = new GameObject("TextureMod"); TextureMod modscript = gameObject.AddComponent(); DontDestroyOnLoad(gameObject); instance = modscript; } - private const string modVersion = "1.4.6"; + public static TextureMod Instance { get; private set; } + public static void Initialize() + { + GameObject gameObject = new GameObject("TextureMod", typeof(TextureMod)); + Instance = gameObject.GetComponent(); + DontDestroyOnLoad(gameObject); + } + + private const string modVersion = "1.4.7"; private const string repositoryOwner = "Daioutzu"; private const string repositoryName = "LLBMM-TextureMod"; @@ -29,7 +34,7 @@ public class TextureMod : MonoBehaviour public EffectChanger effectChanger = null; public ShowcaseStudio showcaseStudio = null; - public static List ownedDLCs = new List(); + public static List ownedDLCs = new List(); public static bool hasDLC = false; private void Start() @@ -46,7 +51,7 @@ private void Update() if (tc == null) { tc = gameObject.AddComponent(); } if (ec == null) { ec = gameObject.AddComponent(); } if (md == null) { md = gameObject.AddComponent(); } - if (effectChanger == null) {effectChanger = gameObject.AddComponent(); } + if (effectChanger == null) { effectChanger = gameObject.AddComponent(); } if (showcaseStudio == null) showcaseStudio = gameObject.AddComponent(); } @@ -61,10 +66,11 @@ private void OnGUI() GUI.skin.label.fontSize = 50; if ((tl == null) || UIScreen.loadingScreenActive && tl.loadingExternalFiles == true) { + GUIStyle label = new GUIStyle(GUI.skin.label); var sX = Screen.width / 2; var sY = UIScreen.GetResolutionFromConfig().height / 3; GUI.skin.label.alignment = TextAnchor.MiddleCenter; - GUI.Label(new Rect(0, sY+50, Screen.width, sY), "TextureMod is loading External Textures"); + GUI.Label(new Rect(0, sY + 50, Screen.width, sY), "TextureMod is loading External Textures"); GUI.skin.label.alignment = TextAnchor.MiddleLeft; } GUI.contentColor = OriginalColor; @@ -76,17 +82,17 @@ private void OnGUI() private void CheckIfPLayerHasDLC() { - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1244880))) ownedDLCs.Add("Dice"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1204070))) ownedDLCs.Add("Raptor"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1174410))) ownedDLCs.Add("Dust&Ashes"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(991870)) || AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1399791))) ownedDLCs.Add("Doombox"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1269880))) ownedDLCs.Add("Toxic"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431710))) ownedDLCs.Add("Latch"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431701))) ownedDLCs.Add("Grid"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431702))) ownedDLCs.Add("Switch"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1399790))) ownedDLCs.Add("Sonata"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431711))) ownedDLCs.Add("Jet"); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431712))) ownedDLCs.Add("Candyman"); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1244880))) ownedDLCs.Add(Character.PONG); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1204070))) ownedDLCs.Add(Character.KID); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1174410))) ownedDLCs.Add(Character.BAG); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(991870)) || AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1399791))) ownedDLCs.Add(Character.BOSS); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1269880))) ownedDLCs.Add(Character.GRAF); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431710))) ownedDLCs.Add(Character.CROC); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431701))) ownedDLCs.Add(Character.ELECTRO); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431702))) ownedDLCs.Add(Character.ROBOT); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1399790))) ownedDLCs.Add(Character.BOOM); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431711))) ownedDLCs.Add(Character.PONG); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431712))) ownedDLCs.Add(Character.CANDY); } } } diff --git a/TextureMod/TextureMod.csproj b/TextureMod/TextureMod.csproj index 1b1f446..ffa374c 100644 --- a/TextureMod/TextureMod.csproj +++ b/TextureMod/TextureMod.csproj @@ -304,6 +304,7 @@ + @@ -322,6 +323,7 @@ - Xcopy $(TargetPath) "C:\Users\Dazer\Desktop\LLBMM 1.3.1\mods\$(ProjectName)" /y + Xcopy $(TargetPath) "C:\Users\Dazer\Desktop\LLBMM 1.3.1\mods\$(ProjectName)" /y +Xcopy $(TargetPath) "C:\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed" /y \ No newline at end of file From 476bb1df297c40382ee56bc4c2069ee4de455311 Mon Sep 17 00:00:00 2001 From: Daioutzu <54756730+Daioutzu@users.noreply.github.com> Date: Fri, 26 Mar 2021 21:35:27 +0000 Subject: [PATCH 10/11] I've sort of lost track of what I've done --- TextureMod/CustomSkin.cs | 56 +- TextureMod/CustomStyle.cs | 3 +- TextureMod/ModDebugging.cs | 1 - TextureMod/TextureChanger.cs | 1013 +++++++++++++++++++++------------- TextureMod/TextureHelper.cs | 39 +- TextureMod/TextureLoader.cs | 100 ++-- TextureMod/TextureMod.cs | 9 +- TextureMod/TextureMod.csproj | 120 +++- TextureMod/app.config | 8 +- 9 files changed, 852 insertions(+), 497 deletions(-) diff --git a/TextureMod/CustomSkin.cs b/TextureMod/CustomSkin.cs index a1142ef..446ea86 100644 --- a/TextureMod/CustomSkin.cs +++ b/TextureMod/CustomSkin.cs @@ -1,60 +1,74 @@ -using System; +#define CustomSkin +using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace TextureMod { -#if DEBUG +#if CustomSkin public class CustomSkin { - public CustomSkin() { } - public CustomSkin(ModelVariant _variant, string _name, string _author, string _filePath) + public CustomSkin(int _index,Character _character, VariantType _variant, string _name, string _author, string _filePath) { - SkinTexture = TextureHelper.LoadPNG(_filePath); + index = _index; + FileLocation = _filePath; + SkinTexture = TextureHelper.LoadPNG(FileLocation); Name = SkinTexture.name = _name; + Character = _character; Variant = _variant; Author = _author; } - public void Reset() - { - SkinTexture = null; - Variant = ModelVariant.None; - Author = ""; - Name = ""; - } - + public int index { get; private set; } + public Character Character { get; private set; } + public VariantType Variant { get; private set; } public Texture2D SkinTexture { get; private set; } - public ModelVariant Variant { get; private set; } + public List SkinColors { get; private set; } public string Author { get; private set; } public string Name { get; private set; } + private string FileLocation; + + public Texture2D ReloadSkin() + { + Debug.Log($"Loading Texture at...\n {FileLocation}"); + return SkinTexture = TextureHelper.LoadPNG(FileLocation); + } + public bool VariantMatch(CharacterVariant characterVariant) { switch (Variant) { - case ModelVariant.Default: + case VariantType.Default: return characterVariant < CharacterVariant.STATIC_ALT; - case ModelVariant.Alternative: + case VariantType.Alternative: return characterVariant == CharacterVariant.MODEL_ALT || characterVariant == CharacterVariant.MODEL_ALT2; - case ModelVariant.DLC: + case VariantType.DLC: return characterVariant == CharacterVariant.MODEL_ALT3 || characterVariant == CharacterVariant.MODEL_ALT4; default: return false; } } - public enum ModelVariant + public string GetSkinLabel() + { + StringBuilder sBuilder = new StringBuilder(Name); + if (Author != "") + { + sBuilder.Append($" by {Author}"); + } + return sBuilder.ToString(); + } + + public enum VariantType { None, Default, Alternative, DLC, } - } + } #endif } diff --git a/TextureMod/CustomStyle.cs b/TextureMod/CustomStyle.cs index fdc9986..59633d2 100644 --- a/TextureMod/CustomStyle.cs +++ b/TextureMod/CustomStyle.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using LLScreen; +using System.Collections.Generic; using UnityEngine; namespace TextureMod diff --git a/TextureMod/ModDebugging.cs b/TextureMod/ModDebugging.cs index 8517ad0..d765afb 100644 --- a/TextureMod/ModDebugging.cs +++ b/TextureMod/ModDebugging.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace TextureMod diff --git a/TextureMod/TextureChanger.cs b/TextureMod/TextureChanger.cs index 990e72f..f05b700 100644 --- a/TextureMod/TextureChanger.cs +++ b/TextureMod/TextureChanger.cs @@ -2,6 +2,7 @@ using LLGUI; using LLHandlers; using LLScreen; +using Multiplayer; using System; using System.Collections.Generic; using System.Linq; @@ -16,6 +17,8 @@ public class TextureChanger : MonoBehaviour public static string resourceFolder = Application.dataPath.Replace("/", @"\") + @"\Managed\TextureModResources\Images\"; private JOFJHDJHJGI gameState => DNPFJHMAIBP.HHMOGKIMBNM(); private GameMode currentGameMode => JOMBNFKIHIC.GIGAKBJGFDI.PNJOKAICMNN; + private bool IsOnline => JOMBNFKIHIC.GDNFJCCCKDM; + public static bool InMatch => World.instance != null && (DNPFJHMAIBP.HHMOGKIMBNM() == JOFJHDJHJGI.CDOFDJMLGLO || DNPFJHMAIBP.HHMOGKIMBNM() == JOFJHDJHJGI.LGILIJKMKOD) && !LLScreen.UIScreen.loadingScreenActive; public string[] debug = new string[20]; public bool doSkinPost = false; public int postTimer = 0; @@ -55,14 +58,15 @@ public class TextureChanger : MonoBehaviour public bool assignFirstSkinOnCharacterSelection = false; #endregion #region LocalPlayer Fields - public ALDOKEMAOMB localLobbyPlayer = null; + public ALDOKEMAOMB localLobbyPlayer => ALDOKEMAOMB.BJDPHEHJJJK(P2P.localPeer?.playerNr ?? 0); + private PlayerEntity localGamePlayerEntity => ALDOKEMAOMB.BJDPHEHJJJK(P2P.localPeer?.playerNr ?? 0)?.JCCIAMJEODH; + private CharacterModel localLobbyPlayerModel = null; - private PlayerEntity localGamePlayerEntity = null; public int localPlayerNr = -1; + public int localSkinIndex = -1; public Character localPlayerChar = Character.NONE; public CharacterVariant localPlayerCharVar = CharacterVariant.CORPSE; - public Texture2D localTex = null; - public string localTexName = ""; + public CustomSkin localCustomSkin; private bool initLocalPlayer = false; #endregion #region LocalPlayer ingame Model Fiels @@ -120,12 +124,13 @@ private void Start() private void OnGUI() { - if (localTex != null) //Show skin nametags + if (localCustomSkin != null) //Show skin nametags { + string labelTxt = localCustomSkin.GetSkinLabel(); GUI.skin.box.wordWrap = false; GUIContent content; - if (!intervalMode) content = new GUIContent(localTexName); - else content = new GUIContent(localTexName + " (Refresh " + "[" + reloadCustomSkinTimer + "]" + ")"); + if (!intervalMode) content = new GUIContent(labelTxt); + else content = new GUIContent(labelTxt + " (Refresh " + "[" + reloadCustomSkinTimer + "]" + ")"); GUI.skin.box.alignment = TextAnchor.MiddleCenter; GUI.skin.box.fontSize = 22; if (InLobby(GameType.Any)) @@ -136,16 +141,16 @@ private void OnGUI() { case GameMode.TUTORIAL: case GameMode.TRAINING: - GUI.Box(new Rect((Screen.width / 8), (Screen.height / 12.5f), GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); + GUI.Box(new Rect((Screen.width / 8), (Screen.height / 12.5f), GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), labelTxt); break; case GameMode._1v1: - if (localLobbyPlayer == ALDOKEMAOMB.BJDPHEHJJJK(0)) GUI.Box(new Rect(Screen.width / 10, Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); //Check if local player is the player with ID 0 - else GUI.Box(new Rect((Screen.width / 20) * 12.95f, Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); + if (localLobbyPlayer == ALDOKEMAOMB.BJDPHEHJJJK(0)) GUI.Box(new Rect(Screen.width / 10, Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), labelTxt); //Check if local player is the player with ID 0 + else GUI.Box(new Rect((Screen.width / 20) * 12.95f, Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), labelTxt); break; case GameMode.FREE_FOR_ALL: case GameMode.COMPETITIVE: - if (localLobbyPlayer == ALDOKEMAOMB.BJDPHEHJJJK(0)) GUI.Box(new Rect(0 + Screen.width / 250, Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); - else GUI.Box(new Rect((Screen.width / 4) + (Screen.width / 250), Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); + if (localLobbyPlayer == ALDOKEMAOMB.BJDPHEHJJJK(0)) GUI.Box(new Rect(0 + Screen.width / 250, Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), labelTxt); + else GUI.Box(new Rect((Screen.width / 4) + (Screen.width / 250), Screen.height / 12.5f, GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), labelTxt); break; } } @@ -157,14 +162,14 @@ private void OnGUI() { if (TextureMod.Instance.showcaseStudio.showUI == false) { - TextureMod.Instance.showcaseStudio.skinName = localTexName; + TextureMod.Instance.showcaseStudio.skinName = labelTxt; TextureMod.Instance.showcaseStudio.refreshTimer = reloadCustomSkinTimer; TextureMod.Instance.showcaseStudio.refreshMode = intervalMode; } else { - if (intervalMode) GUI.Box(new Rect((Screen.width - (Screen.width / 3.55f)) - (GUI.skin.box.CalcSize(content).x / 2), Screen.height - (Screen.height / 23), GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName + " (Refresh " + "[" + reloadCustomSkinTimer + "]" + ")"); - else GUI.Box(new Rect((Screen.width - (Screen.width / 3.55f)) - (GUI.skin.box.CalcSize(content).x / 2), Screen.height - (Screen.height / 23), GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), localTexName); + if (intervalMode) GUI.Box(new Rect((Screen.width - (Screen.width / 3.55f)) - (GUI.skin.box.CalcSize(content).x / 2), Screen.height - (Screen.height / 23), GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), labelTxt + " (Refresh " + "[" + reloadCustomSkinTimer + "]" + ")"); + else GUI.Box(new Rect((Screen.width - (Screen.width / 3.55f)) - (GUI.skin.box.CalcSize(content).x / 2), Screen.height - (Screen.height / 23), GUI.skin.box.CalcSize(content).x, GUI.skin.box.CalcSize(content).y), labelTxt); } } } @@ -176,7 +181,7 @@ private void FixedUpdate() if (!neverApplyOpponentsSkin) { if (doSkinPost) { postTimer++; } - if (localLobbyPlayer != null && localTex != null) + if (localLobbyPlayer != null && localCustomSkin != null) { if (postTimer >= postTimerLimit) { @@ -184,7 +189,7 @@ private void FixedUpdate() postTimer = 0; try { - StartCoroutine(TextureMod.Instance.ec.PostSkin(localLobbyPlayer.KLEEADMGHNE.peerId, localPlayerChar, localPlayerCharVar, localTex)); + StartCoroutine(TextureMod.Instance.ec.PostSkin(localLobbyPlayer.KLEEADMGHNE.peerId, localPlayerChar, localPlayerCharVar, localCustomSkin.SkinTexture)); } catch (Exception ex) { @@ -202,7 +207,10 @@ private void FixedUpdate() getTimer = 0; try { - StartCoroutine(TextureMod.Instance.ec.GetSkin(opponentPlayer.KLEEADMGHNE.peerId)); + if (opponentPlayer.KLEEADMGHNE?.peerId != null) + { + StartCoroutine(TextureMod.Instance.ec.GetSkin(opponentPlayer.KLEEADMGHNE.peerId)); + } } catch (Exception ex) { @@ -216,6 +224,23 @@ private void FixedUpdate() if (reloadCustomSkinTimer > 0) reloadCustomSkinTimer--; } //POST and GET requests + + bool OnSkinChangeButtonDown() + { + if (Input.GetKeyDown(nextSkin) || Controller.all.GetButtonDown(InputAction.EXPRESS_RIGHT)) + { + localSkinIndex++; + return true; + } + else if (Input.GetKeyDown(previousSkin) || Controller.all.GetButtonDown(InputAction.EXPRESS_LEFT)) + { + localSkinIndex--; + return true; + } + else return false; + } + + void ModMenuInit() { if (TextureMod.Instance.MMI != null) @@ -237,17 +262,8 @@ void ModMenuInit() } } - private void Update() + void DebugOptions() { -#if DEBUG - if (Input.GetKeyDown(KeyCode.PageDown)) - { - InitLocalPlayer(); - InitOpponentPlayer(); - } -#endif - - ModMenuInit(); #region Set Debug Vars if (showDebugInfo) { @@ -258,9 +274,9 @@ private void Update() try { md.AddToWindow("General", "In Lobby", InLobby(GameType.Any).ToString()); } catch { } try { md.AddToWindow("General", "In Game", InGame(GameType.Any).ToString()); } catch { } try { md.AddToWindow("General", "In Post Game", InPostGame().ToString()); } catch { } - try { md.AddToWindow("General", "CurrentScreen[0]", UIScreen.currentScreens[0].screenType.ToString()); } catch { } - try { md.AddToWindow("General", "CurrentScreen[1]", UIScreen.currentScreens[1].screenType.ToString()); } catch { } - try { md.AddToWindow("General", "CurrentScreen[2]", UIScreen.currentScreens[2].screenType.ToString()); } catch { } + try { md.AddToWindow("General", "CurrentScreen[0]", UIScreen.currentScreens[0]?.screenType.ToString()); } catch { } + try { md.AddToWindow("General", "CurrentScreen[1]", UIScreen.currentScreens[1]?.screenType.ToString()); } catch { } + try { md.AddToWindow("General", "CurrentScreen[2]", UIScreen.currentScreens[2]?.screenType.ToString()); } catch { } try { md.AddToWindow("Skin Exchange", "Do Skin Post", doSkinPost.ToString()); } catch { } try { md.AddToWindow("Skin Exchange", "Post Timer", postTimer.ToString()); } catch { } @@ -270,12 +286,13 @@ private void Update() try { md.AddToWindow("Skin Exchange", "Set Anti Mirror", setAntiMirrior.ToString()); } catch { } try { md.AddToWindow("Local Player", "Lobby Player", localLobbyPlayer.ToString()); } catch { md.AddToWindow("Local Player", "Lobby Player", "null"); } + try { md.AddToWindow("Local Player", "Lobby Skin Index", localSkinIndex.ToString()); } catch { md.AddToWindow("Local Player", "Lobby Skin Index", "null"); } try { md.AddToWindow("Local Player", "Lobby Player Model", localLobbyPlayerModel.ToString()); } catch { md.AddToWindow("Local Player", "Lobby Player Model", "null"); } try { md.AddToWindow("Local Player", "Game PlayerEntity", localGamePlayerEntity.ToString()); } catch { md.AddToWindow("Local Player", "Game PlayerEntity", "null"); } try { md.AddToWindow("Local Player", "Name", localPlayerNr.ToString()); } catch { } try { md.AddToWindow("Local Player", "Character", localPlayerChar.ToString()); } catch { } try { md.AddToWindow("Local Player", "Variant", localPlayerCharVar.ToString()); } catch { } - try { md.AddToWindow("Local Player", "Custom Texture", localTex.ToString()); } catch { md.AddToWindow("Local Player", "Custom Texture", "null"); } + try { md.AddToWindow("Local Player", "Custom Texture", localCustomSkin.ToString()); } catch { md.AddToWindow("Local Player", "Custom Texture", "null"); } try { md.AddToWindow("Local Player", "Initiate Player", initLocalPlayer.ToString()); } catch { } try { md.AddToWindow("Local Player", "Randomized Character", randomizedChar.ToString()); } catch { } try @@ -367,8 +384,10 @@ private void Update() #endregion + } - + void OpponetCustomCharacter() + { if (opponentPlayer != null && opponentLobbyCharacterModel != null) { if ((opponentLobbyCharacterModel.character != opponentCustomSkinCharacter || opponentLobbyCharacterModel.characterVariant != opponentCustomSkinCharacterVariant) && (opponentPlayer.DOFCCEDJODB != Character.NONE || opponentPlayer.AIINAIDBHJI != CharacterVariant.CORPSE)) @@ -418,114 +437,46 @@ private void Update() else opponentLobbyCharacterModel.SetCharacterLobby(opponentPlayer.CJFLMDNNMIE, opponentPlayer.DOFCCEDJODB, opponentPlayer.AIINAIDBHJI, false); } } + } - - if (localLobbyPlayer != null && randomizedChar == false) // Determine and assign skin to local player + private void Update() + { +#if DEBUG + if (Input.GetKeyDown(KeyCode.PageDown)) { - //Player.Selected - Has the Player selected their character yet. - if (localLobbyPlayer.CHNGAKOIJFE) - { - var setNextSkin = false; - var setPreviousSkin = false; - - if ((localPlayerChar != localLobbyPlayer.DOFCCEDJODB || localPlayerCharVar != localLobbyPlayer.AIINAIDBHJI)) - { - localTex = null; - if (assignFirstSkinOnCharacterSelection && localPlayerChar != localLobbyPlayer.DOFCCEDJODB && localLobbyPlayer.DOFCCEDJODB != Character.RANDOM) setNextSkin = true; - else initLocalPlayer = true; - localPlayerChar = localLobbyPlayer.DOFCCEDJODB; - localPlayerCharVar = localLobbyPlayer.AIINAIDBHJI; - } - - LLButton[] buttons = FindObjectsOfType(); - HDLIJDBFGKN gameStatesOnlineLobby = FindObjectOfType(); - - - - if (useOnlySetKey == false) - { - if (UIScreen.currentScreens[0]?.screenType == ScreenType.PLAYERS) - { - ScreenPlayers screenPlayers = UIScreen.currentScreens[0] as ScreenPlayers; - if (localLobbyPlayer.GDEMBCKIDMA.GetButtonDown(InputAction.EXPRESS_RIGHT)) - { - setNextSkin = true; - } - else if (localLobbyPlayer.GDEMBCKIDMA.GetButtonDown(InputAction.EXPRESS_LEFT)) - { - setPreviousSkin = true; - } - } + InitLocalPlayer(); + InitOpponentPlayer(); + } +#endif + ModMenuInit(); - if (Input.GetKey(holdKey1) && buttons.Length > 0) - { - foreach (LLButton b in buttons) b.SetActive(false); //Deactivate buttons - if (Input.GetKeyDown(nextSkin)) setNextSkin = true; - else if (Input.GetKeyDown(previousSkin)) setPreviousSkin = true; + DebugOptions(); - } - else if (Input.GetKeyUp(holdKey1) && buttons.Length > 0) - { - foreach (LLButton b in buttons) b.SetActive(true); //Reactivate buttons - } - } - else if (Input.GetKeyDown(nextSkin)) setNextSkin = true; - else if (Input.GetKeyDown(previousSkin)) setPreviousSkin = true; + OpponetCustomCharacter(); - if ((setNextSkin || setPreviousSkin) && InLobby(GameType.Any)) // Assign skin to local player - { - if (setAntiMirrior) - { - opponentCustomTexture = TextureHelper.LoadPNG(Application.dataPath.Replace("/", @"\") + @"\Managed\TextureModResources\Images\opponent.png"); - setAntiMirrior = false; - } - if (InLobby(GameType.Online)) - { - gameStatesOnlineLobby.JPNNBHNHHJC(); - gameStatesOnlineLobby.EMFKKOJEIPN(localLobbyPlayer.CJFLMDNNMIE, false); //Set Ready - gameStatesOnlineLobby.BFIGLDLHKPO(); - gameStatesOnlineLobby.OFGNNIBJOLH(localLobbyPlayer); - } + AssignSkinToLocalPlayer(); - if (localLobbyPlayer.DOFCCEDJODB == Character.RANDOM) // Randomize skin and char - { - Character randomChar = localLobbyPlayer.HGPNPNPJBMK(); - localLobbyPlayer.DOFCCEDJODB = randomChar; - localLobbyPlayer.LALEEFJMMLH = randomChar; + DisableCharacterButtons(); - localTex = GetLoadedTexture(randomChar, localTex, false, true); + CheckMirror(); - if (InLobby(GameType.Online)) - { - gameStatesOnlineLobby.EMFKKOJEIPN(localLobbyPlayer.CJFLMDNNMIE, true); //Set Ready - gameStatesOnlineLobby.OFGNNIBJOLH(localLobbyPlayer); //Send player state (Signalizes that we have changes characters and that we are ready) + InLobbyOrGameChecks(); - if (lockButtonsOnRandom) - { - foreach (LLButton b in buttons) b.SetActive(false); - randomizedChar = true; - } - } - } - else - { - if (setNextSkin) localTex = GetLoadedTexture(localLobbyPlayer.DOFCCEDJODB, localTex, false, false); - if (setPreviousSkin) localTex = GetLoadedTexture(localLobbyPlayer.DOFCCEDJODB, localTex, true, false); - } + UpdateCustomSkinsInMenu(); - localLobbyPlayerModel.PlayCamAnim(); + ApplyInGameEffects(); + } - if (InLobby(GameType.Online)) - { - doSkinPost = true; - postTimer = 0; - setAntiMirrior = false; - calculateMirror = true; - } - } - } + void LateUpdate() + { + if (Input.GetKeyDown(reloadEntireSkinLibrary)) + { + TextureMod.Instance.tl.LoadLibrary(); //Reloads the entire texture folder } + } + void DisableCharacterButtons() + { if (randomizedChar && UIScreen.currentScreens[1] != null) // If you have randomized your character, activate buttons again { if (UIScreen.currentScreens[1].screenType == ScreenType.PLAYERS_STAGE || UIScreen.currentScreens[1].screenType == ScreenType.PLAYERS_STAGE_RANKED) @@ -534,8 +485,11 @@ private void Update() foreach (LLButton b in buttons) b.SetActive(true); } } + } - if (opponentPlayer != null && opponentCustomTexture != null && localTex != null && InLobby(GameType.Any) && calculateMirror) + void CheckMirror() + { + if (opponentPlayer != null && opponentCustomTexture != null && localCustomSkin?.SkinTexture != null && InLobby(GameType.Any) && calculateMirror) { if (localPlayerChar == opponentCustomSkinCharacter) { @@ -546,7 +500,7 @@ private void Update() if (col.r > 0.5f && col.g > 0.5f && col.b > 0.5f && col.a > 0.5f) { if (col.r != 1f && col.g != 1f && col.b != 1f) { otCount++; } } else if (col.r < 0.5f && col.g < 0.5f && col.b < 0.5f) { if (col.r == 0f && col.g == 0f && col.b == 0f) { otCount++; } } } - Color[] pt = localTex.GetPixels(); + Color[] pt = localCustomSkin.SkinTexture.GetPixels(); var ptCount = 0; foreach (Color col in pt) { @@ -564,80 +518,114 @@ private void Update() } } //Check if your skin matches your opponents, and if it does set theirs to grayscale - if (localTex == null || opponentCustomTexture == null) { setAntiMirrior = false; } - + if (localCustomSkin?.SkinTexture == null || opponentCustomTexture == null) + { + setAntiMirrior = false; + } + } - switch (currentGameMode) + void ApplyInGameEffects() + { + if (InGame(GameType.Any)) { - case GameMode.TRAINING: - case GameMode.TUTORIAL: - #region In training and tutorial - if (initLocalPlayer) { InitLocalPlayer(); } - if (InLobby(GameType.Offline)) + mainBall = mainBall ?? BallHandler.instance.GetBall(0); + //Player.AllInMatch + ALDOKEMAOMB.ICOCPAFKCCE((ALDOKEMAOMB player) => + { + if (localGamePlayerEntity?.character == player.DOFCCEDJODB || opponentPlayerEntity?.character == player.DOFCCEDJODB) { - if (localLobbyPlayer == null) { localLobbyPlayer = GetLocalPlayerInLobby(GameType.Offline); } - else + switch (player.DOFCCEDJODB) { - if (localLobbyPlayerModel == null) { localLobbyPlayerModel = GetLobbyCharacterModel(localLobbyPlayer.CJFLMDNNMIE); } - else + case Character.CANDY: CandymanIngameEffects(); break; + case Character.BAG: AshesIngameEffects(); break; + case Character.GRAF: ToxicIngameEffects(); break; + case Character.ELECTRO: GridIngameEffects(); break; + case Character.SKATE: JetIngameEffects(localCustomSkin?.SkinTexture); break; + } + } + }); + } + else + { + mainBall = null; + } + } + + void InLobbyOrGameChecks() + { + if (InLobby(GameType.Any) || InGame(GameType.Any) || InPostGame()) + { + switch (currentGameMode) + { + case GameMode.TRAINING: + case GameMode.TUTORIAL: + #region In training and tutorial + + if (initLocalPlayer) + { + InitLocalPlayer(); + } + + if (InLobby(GameType.Offline)) + { + if (localLobbyPlayerModel == null) { - localLobbyPlayerModel.SetSilhouette(false); - if (localTex != null) - { - AssignTextureToCharacterModelRenderers(localLobbyPlayerModel, localTex); - } + localLobbyPlayerModel = GetCurrentCharacterModel(localLobbyPlayer.CJFLMDNNMIE); + } + + localLobbyPlayerModel?.SetSilhouette(false); + if (localCustomSkin != null) + { + AssignTextureToCharacterModelRenderers(localLobbyPlayerModel, localCustomSkin.SkinTexture); } } - } - if (InGame(GameType.Offline)) - { - if (localGamePlayerEntity == null) { localGamePlayerEntity = GetLocalPlayerInGame(); } - else + else if (InGame(GameType.Offline)) { - if (localTex != null) + if (localCustomSkin != null) { if (Input.GetKeyDown(reloadCustomSkin)) { - try { localTex = TextureHelper.ReloadSkin(localPlayerChar, localTex); } - catch { LLHandlers.AudioHandler.PlaySfx(LLHandlers.Sfx.MENU_BACK); } + try { localCustomSkin.ReloadSkin(); } + catch { AudioHandler.PlaySfx(Sfx.MENU_BACK); } } - AssignTextureToIngameCharacter(localGamePlayerEntity, localTex); - localPlayerNr = AssignTextureToHud(localGamePlayerEntity, localTex); + AssignTextureToIngameCharacter(localGamePlayerEntity, localCustomSkin.SkinTexture); + localPlayerNr = AssignTextureToHud(localGamePlayerEntity, localCustomSkin.SkinTexture); } } - } - break; - #endregion - case GameMode._1v1: - case GameMode.FREE_FOR_ALL: - case GameMode.COMPETITIVE: - #region In ranked and online lobby - if (Input.GetKeyDown(cancelKey)) - { - cancelOpponentSkin = !cancelOpponentSkin; - if (opponentLobbyCharacterModel != null) - { - opponentCustomTexture = null; - opponentCustomSkinCharacter = opponentPlayer.DOFCCEDJODB; - opponentCustomSkinCharacterVariant = opponentPlayer.AIINAIDBHJI; - if (currentGameMode == GameMode._1v1 && opponentPlayer.CJFLMDNNMIE == 1) opponentLobbyCharacterModel.SetCharacterLobby(opponentPlayer.CJFLMDNNMIE, opponentCustomSkinCharacter, CharacterVariant.CORPSE, true); - else opponentLobbyCharacterModel.SetCharacterLobby(opponentPlayer.CJFLMDNNMIE, opponentCustomSkinCharacter, CharacterVariant.CORPSE, false); - initOpponentPlayer = true; - } - } - if (InLobby(GameType.Any)) - { - if (initLocalPlayer) { InitLocalPlayer(); } - if (initOpponentPlayer) { InitOpponentPlayer(); } + break; + #endregion + case GameMode._1v1: + case GameMode.FREE_FOR_ALL: + case GameMode.COMPETITIVE: + #region In ranked and online lobby - if (localLobbyPlayer == null) + if (Input.GetKeyDown(cancelKey)) { - if (InLobby(GameType.Online)) localLobbyPlayer = GetLocalPlayerInLobby(GameType.Online); - else localLobbyPlayer = GetLocalPlayerInLobby(GameType.Offline); + cancelOpponentSkin = !cancelOpponentSkin; + if (opponentLobbyCharacterModel != null) + { + opponentCustomTexture = null; + opponentCustomSkinCharacter = opponentPlayer.DOFCCEDJODB; + opponentCustomSkinCharacterVariant = opponentPlayer.AIINAIDBHJI; + if (currentGameMode == GameMode._1v1 && opponentPlayer.CJFLMDNNMIE == 1) opponentLobbyCharacterModel.SetCharacterLobby(opponentPlayer.CJFLMDNNMIE, opponentCustomSkinCharacter, CharacterVariant.CORPSE, true); + else opponentLobbyCharacterModel.SetCharacterLobby(opponentPlayer.CJFLMDNNMIE, opponentCustomSkinCharacter, CharacterVariant.CORPSE, false); + initOpponentPlayer = true; + } } - else + + if (InLobby(GameType.Any)) { + if (initLocalPlayer) + { + InitLocalPlayer(); + } + + if (initOpponentPlayer) + { + InitOpponentPlayer(); + } + try { if (sendCancelRequestToServer == true) @@ -650,22 +638,32 @@ private void Update() //if (localLobbyPlayer.CJFLMDNNMIE == 3) initLocalPlayer = true; - if (localLobbyPlayerModel == null) { localLobbyPlayerModel = GetLobbyCharacterModel(localLobbyPlayer.CJFLMDNNMIE); } + if (localLobbyPlayerModel == null) + { + localLobbyPlayerModel = GetCurrentCharacterModel(localLobbyPlayer.CJFLMDNNMIE); + } else { localLobbyPlayerModel.SetSilhouette(false); - if (localTex != null) + if (localCustomSkin != null) { - AssignTextureToCharacterModelRenderers(localLobbyPlayerModel, localTex); + AssignTextureToCharacterModelRenderers(localLobbyPlayerModel, localCustomSkin.SkinTexture); } } - if (InLobby(GameType.Online)) + + if (InLobby(GameType.Online) && localLobbyPlayer?.PNHOIDECPJE != null) { - if (opponentPlayer == null) { opponentPlayer = GetOpponentPlayerInLobby(); } + if (opponentPlayer == null) + { + opponentPlayer = GetOpponentPlayerInLobby(); + } else { doSkinGet = true; - if (opponentLobbyCharacterModel == null) { opponentLobbyCharacterModel = GetLobbyCharacterModel(opponentPlayer.CJFLMDNNMIE); } + if (opponentLobbyCharacterModel == null) + { + opponentLobbyCharacterModel = GetCurrentCharacterModel(opponentPlayer.CJFLMDNNMIE); + } else { opponentLobbyCharacterModel.SetSilhouette(false); @@ -676,13 +674,11 @@ private void Update() } } } + } - } - else if (InGame(GameType.Any)) - { - if (localGamePlayerEntity == null) { localGamePlayerEntity = GetLocalPlayerInGame(); } - else + else if (InGame(GameType.Any)) { + try { if (sendCancelRequestToServer == true) @@ -692,42 +688,174 @@ private void Update() } } catch { } - if (localTex != null) + + if (localCustomSkin != null) { - AssignTextureToIngameCharacter(localGamePlayerEntity, localTex); - localPlayerNr = AssignTextureToHud(localGamePlayerEntity, localTex); + AssignTextureToIngameCharacter(localGamePlayerEntity, localCustomSkin.SkinTexture); + localPlayerNr = AssignTextureToHud(localGamePlayerEntity, localCustomSkin.SkinTexture); + } + + if (InGame(GameType.Online)) + { + if (opponentCustomTexture != null) + { + if (opponentPlayerEntity == null) { opponentPlayerEntity = GetOpponentPlayerInGame(); } + else + { + AssignTextureToIngameCharacter(opponentPlayerEntity, opponentCustomTexture); + opponentPlayerNr = AssignTextureToHud(opponentPlayerEntity, opponentCustomTexture); + } + } } } - if (InGame(GameType.Online)) + else if (InPostGame()) { + AssignSkinToWinnerModel(); + + if (localCustomSkin != null) + { + AssignTextureToPostGameHud(localPlayerNr, localCustomSkin.SkinTexture); + } + if (opponentCustomTexture != null) { - if (opponentPlayerEntity == null) { opponentPlayerEntity = GetOpponentPlayerInGame(); } - else - { - AssignTextureToIngameCharacter(opponentPlayerEntity, opponentCustomTexture); - opponentPlayerNr = AssignTextureToHud(opponentPlayerEntity, opponentCustomTexture); - } + AssignTextureToPostGameHud(opponentPlayerNr, opponentCustomTexture); + } + } + else + { + if (localLobbyPlayer?.NGLDMOLLPLK == false) + { + initLocalPlayer = true; } + + initOpponentPlayer = true; } + break; + } + #endregion + } + } + + void AssignSkinToLocalPlayer() + { + if (localLobbyPlayer != null && randomizedChar == false) // Determine and assign skin to local player + { + //Player.Selected - Has the Player selected their character yet. + if (localLobbyPlayer.CHNGAKOIJFE) + { + var changeSkin = false; + + if (localPlayerChar != localLobbyPlayer.DOFCCEDJODB || localPlayerCharVar != localLobbyPlayer.AIINAIDBHJI) + { + localCustomSkin = null; + if (assignFirstSkinOnCharacterSelection && localPlayerChar != localLobbyPlayer.DOFCCEDJODB && localLobbyPlayer.DOFCCEDJODB != Character.RANDOM) + { + localSkinIndex = 0; + changeSkin = true; + } + else + { + initLocalPlayer = true; + } + localPlayerChar = localLobbyPlayer.DOFCCEDJODB; + localPlayerCharVar = localLobbyPlayer.AIINAIDBHJI; } - else if (InPostGame()) + + LLButton[] buttons = FindObjectsOfType(); + HDLIJDBFGKN gameStatesOnlineLobby = FindObjectOfType(); + + if (useOnlySetKey == false) { - AssignSkinToWinnerModel(); + if (Input.GetKey(holdKey1) && buttons.Length > 0) + { + if (OnSkinChangeButtonDown()) + { + changeSkin = true; + } - if (localTex != null) { AssignTextureToPostGameHud(localPlayerNr, localTex); } - if (opponentCustomTexture != null) AssignTextureToPostGameHud(opponentPlayerNr, opponentCustomTexture); + foreach (LLButton b in buttons) + { + b.SetActive(false); //Deactivate buttons + } + } + else if (Input.GetKeyUp(holdKey1) && buttons.Length > 0) + { + foreach (LLButton b in buttons) b.SetActive(true); //Reactivate buttons + } } - else + else if (OnSkinChangeButtonDown()) { - initLocalPlayer = true; - initOpponentPlayer = true; + changeSkin = true; } - break; - #endregion - } + if (changeSkin && InLobby(GameType.Any)) // Assign skin to local player + { + if (setAntiMirrior) + { + opponentCustomTexture = TextureHelper.LoadPNG(Application.dataPath.Replace("/", @"\") + @"\Managed\TextureModResources\Images\opponent.png"); + setAntiMirrior = false; + } + + if (InLobby(GameType.Online)) + { + gameStatesOnlineLobby.JPNNBHNHHJC(); // gameStatesOnlineLobby.AutoReadyReset + gameStatesOnlineLobby.EMFKKOJEIPN(localLobbyPlayer.CJFLMDNNMIE, false); //Set Ready + gameStatesOnlineLobby.BFIGLDLHKPO(); // gameStatesOnlineLobby.UpdateReadyButton + gameStatesOnlineLobby.OFGNNIBJOLH(localLobbyPlayer); // gameStatesOnlineLobby.SendPlayerState + } + + bool isRandom = false; + if (localLobbyPlayer.DOFCCEDJODB == Character.RANDOM) // Randomize skin and char + { + //Creats a list of characters that have no skins and should be excluded from the character randomizer + List characters = new List(); + foreach (var character in TextureMod.Instance.tl.newCharacterTextures) + { + if (character.Value.Count == 0) + { + characters.Add(character.Key); + } + } + + Character randomChar = localLobbyPlayer.HGPNPNPJBMK(characters.ToArray()); + localLobbyPlayer.DOFCCEDJODB = randomChar; + + if (InLobby(GameType.Online)) + { + gameStatesOnlineLobby.EMFKKOJEIPN(localLobbyPlayer.CJFLMDNNMIE, true); // SetReady + gameStatesOnlineLobby.OFGNNIBJOLH(localLobbyPlayer); //Send player state (Signalizes that we have changes characters and that we are ready) + + if (lockButtonsOnRandom) + { + foreach (LLButton b in buttons) b.SetActive(false); + randomizedChar = true; + } + } + + isRandom = true; + } + + SetLocalCustomSkin(localLobbyPlayer.DOFCCEDJODB, isRandom); + + if (InLobby(GameType.Online)) + { + doSkinPost = true; + postTimer = 0; + setAntiMirrior = false; + calculateMirror = true; + } + } + } + else + { + InitLocalPlayer(); + } + } + } + void UpdateCustomSkinsInMenu() + { if (InMenu()) { sendCancelRequestToServer = true; @@ -735,46 +863,38 @@ private void Update() { InitLocalPlayer(); } - InitOpponentPlayer(); + + if (initOpponentPlayer == true) + { + InitOpponentPlayer(); + } } if (UIScreen.currentScreens[1] != null) { if (UIScreen.currentScreens[1]?.screenType == ScreenType.UNLOCKS_SKINS) { + var screenUnlocksSkins = UIScreen.currentScreens[1] as ScreenUnlocksSkins; + + CharacterModel characterModel = screenUnlocksSkins.previewModel; if (siluetteTimer > 0) { - CharacterModel characterModel = (UIScreen.currentScreens[1] as ScreenUnlocksSkins).previewModel; - if (localTex != null) + if (localCustomSkin != null) { characterModel.SetSilhouette(false); - AssignTextureToCharacterModelRenderers(characterModel, localTex); + AssignTextureToCharacterModelRenderers(characterModel, localCustomSkin.SkinTexture); } } if (Input.GetKey(holdKey1)) { - if (Input.GetKeyDown(nextSkin)) + if (OnSkinChangeButtonDown()) { - try - { - localTex = GetLoadedTextureForUnlocksModel(localTex, false); - SetUnlocksCharacterModel(localTex); - } - catch { } - } - else if (Input.GetKeyDown(previousSkin)) - { - try - { - localTex = GetLoadedTextureForUnlocksModel(localTex, true); - SetUnlocksCharacterModel(localTex); - } - catch { } + SetSkinForUnlocksModel(screenUnlocksSkins); } } - if (localTex != null) // Reload a skin from its file + if (localCustomSkin != null) // Reload a skin from its file { if (Input.GetKeyDown(reloadCustomSkin)) { @@ -790,9 +910,9 @@ private void Update() try { - ScreenUnlocksSkins sus = FindObjectOfType(); - localTex = TextureHelper.ReloadSkin(sus.character, localTex); - SetUnlocksCharacterModel(localTex); + localCustomSkin.ReloadSkin(); + //localTex = TextureHelper.ReloadSkin(screenUnlocksSkins.character, localTex); + SetUnlocksCharacterModel(localCustomSkin.SkinTexture); LLHandlers.AudioHandler.PlaySfx(LLHandlers.Sfx.MENU_CONFIRM); } catch { LLHandlers.AudioHandler.PlaySfx(LLHandlers.Sfx.MENU_BACK); } @@ -804,9 +924,9 @@ private void Update() { try { - ScreenUnlocksSkins sus = FindObjectOfType(); - localTex = TextureHelper.ReloadSkin(sus.character, localTex); - SetUnlocksCharacterModel(localTex); + localCustomSkin.ReloadSkin(); + //localTex = TextureHelper.ReloadSkin(screenUnlocksSkins.character, localTex); + SetUnlocksCharacterModel(localCustomSkin.SkinTexture); } catch { LLHandlers.AudioHandler.PlaySfx(LLHandlers.Sfx.MENU_BACK); } reloadCustomSkinTimer = skinReloadIntervalInFrames; @@ -816,39 +936,14 @@ private void Update() } else if (UIScreen.currentScreens[1]?.screenType == ScreenType.UNLOCKS_CHARACTERS) { - localTex = null; + localCustomSkin = null; intervalMode = false; reloadCustomSkinTimer = skinReloadIntervalInFrames; } } - if (Input.GetKeyDown(reloadEntireSkinLibrary)) TextureMod.Instance.tl.LoadLibrary(); //Reloads the entire texture folder - - if (InGame(GameType.Any)) - { - mainBall = mainBall ?? BallHandler.instance.GetBall(0); - //Player.AllInMatch - ALDOKEMAOMB.ICOCPAFKCCE((ALDOKEMAOMB player) => - { - switch (player.DOFCCEDJODB) - { - case Character.CANDY: CandymanIngameEffects(); break; - case Character.BAG: AshesIngameEffects(); break; - case Character.GRAF: ToxicIngameEffects(); break; - case Character.ELECTRO: GridIngameEffects(); break; - case Character.SKATE: JetIngameEffects(); break; - } - }); - } - else - { - mainBall = null; - } } - /// End of Update() - /// End of Update() - /// End of Update() /// End of Update() public List GetCharactersInGame() @@ -870,49 +965,67 @@ public bool InMenu() } else return false; } + public bool InLobby(GameType gt) { switch (gt) { case GameType.Online: - if (gameState == (JOFJHDJHJGI)5) - { return true; } - break; + return gameState == (JOFJHDJHJGI)GameState.LOBBY_ONLINE && UIScreen.loadingScreenActive == false; case GameType.Offline: - if (gameState == (JOFJHDJHJGI)11 || gameState == (JOFJHDJHJGI)12 || gameState == (JOFJHDJHJGI)4 || gameState == (JOFJHDJHJGI)6 || gameState == (JOFJHDJHJGI)23) - { return true; } - break; + return (gameState == (JOFJHDJHJGI)GameState.LOBBY_TRAINING || gameState == (JOFJHDJHJGI)GameState.LOBBY_TUTORIAL || gameState == (JOFJHDJHJGI)GameState.LOBBY_LOCAL || gameState == (JOFJHDJHJGI)GameState.LOBBY_CHALLENGE || gameState == (JOFJHDJHJGI)GameState.LOBBY_STORY) && UIScreen.loadingScreenActive == false; case GameType.Any: - if (gameState == (JOFJHDJHJGI)11 || gameState == (JOFJHDJHJGI)12 || gameState == (JOFJHDJHJGI)5 || gameState == (JOFJHDJHJGI)6 || gameState == (JOFJHDJHJGI)4 || gameState == (JOFJHDJHJGI)23) - { return true; } - break; + return (gameState == (JOFJHDJHJGI)GameState.LOBBY_ONLINE || gameState == (JOFJHDJHJGI)GameState.LOBBY_TRAINING || gameState == (JOFJHDJHJGI)GameState.LOBBY_TUTORIAL || gameState == (JOFJHDJHJGI)GameState.LOBBY_LOCAL || gameState == (JOFJHDJHJGI)GameState.LOBBY_CHALLENGE || gameState == (JOFJHDJHJGI)GameState.LOBBY_STORY) && UIScreen.loadingScreenActive == false; } return false; } + + public enum GameState + { + NONE, + INTRO, + MENU, + QUIT, + LOBBY_LOCAL, + LOBBY_ONLINE, + LOBBY_CHALLENGE, + CHALLENGE_LADDER, + CHALLENGE_LOST, + STORY_GRID, + STORY_COMIC, + LOBBY_TRAINING, + LOBBY_TUTORIAL, + CREDITS, + OPTIONS_GAME, + OPTIONS_INPUT, + OPTIONS_AUDIO, + OPTIONS_VIDEO, + GAME_INTRO, + GAME, + GAME_PAUSE, + GAME_RESULT, + UNLOCKS, + LOBBY_STORY + } + public bool InGame(GameType gt) { switch (gt) { case GameType.Online: - if (JOMBNFKIHIC.GDNFJCCCKDM && gameState == (JOFJHDJHJGI)19 && UIScreen.loadingScreenActive == false) - { return true; } - break; + return InMatch && IsOnline == true; case GameType.Offline: - if ((!JOMBNFKIHIC.GDNFJCCCKDM) && gameState == (JOFJHDJHJGI)19 && UIScreen.loadingScreenActive == false) - { return true; } - break; + return InMatch && IsOnline == false; case GameType.Any: - if ((!JOMBNFKIHIC.GDNFJCCCKDM || JOMBNFKIHIC.GDNFJCCCKDM) && gameState == (JOFJHDJHJGI)19 && UIScreen.loadingScreenActive == false) - { return true; } - break; + return InMatch; + default: + return false; } - return false; } + public bool InPostGame() { - if ((currentGameMode == GameMode._1v1 || currentGameMode == GameMode.FREE_FOR_ALL) && gameState == (JOFJHDJHJGI)21) - { return true; } - else { return false; } + return (currentGameMode == GameMode._1v1 || currentGameMode == GameMode.FREE_FOR_ALL || currentGameMode == GameMode.COMPETITIVE) && gameState == (JOFJHDJHJGI)GameState.GAME_RESULT; } private ALDOKEMAOMB GetLocalPlayerInLobby(GameType gt) @@ -921,23 +1034,11 @@ private ALDOKEMAOMB GetLocalPlayerInLobby(GameType gt) switch (gt) { case GameType.Online: - ScreenPlayers sp = FindObjectOfType(); - if (sp.isActive) + if (P2P.localPeer != null) { - bool inLobby = false; - foreach (PlayersSelection ps in sp.playerSelections) - { - if (ps.btPlayerName.isActiveAndEnabled) inLobby = true; - } - if (inLobby) - { - HDLIJDBFGKN gameStatesOnlineLobby = FindObjectOfType(); - if (gameStatesOnlineLobby != null) - { - Debug.Log("Assigned player nr [" + gameStatesOnlineLobby.HCCGAFLIABM.ToString() + "] as the local player"); - return ALDOKEMAOMB.BJDPHEHJJJK(gameStatesOnlineLobby.HCCGAFLIABM); - } - } + int nr = P2P.localPeer.playerNr; + Debug.Log($"Assigned player nr [{nr}] as the local player"); + return ALDOKEMAOMB.BJDPHEHJJJK(nr); } break; case GameType.Offline: @@ -945,59 +1046,45 @@ private ALDOKEMAOMB GetLocalPlayerInLobby(GameType gt) } return player; } + private ALDOKEMAOMB GetOpponentPlayerInLobby() { ALDOKEMAOMB player = null; if (localLobbyPlayer != null) { - if (localLobbyPlayer.CJFLMDNNMIE == 0) player = ALDOKEMAOMB.BJDPHEHJJJK(1); - else if (localLobbyPlayer.CJFLMDNNMIE == 1) player = ALDOKEMAOMB.BJDPHEHJJJK(0); + if (localLobbyPlayer.CJFLMDNNMIE == 0) + { + player = ALDOKEMAOMB.BJDPHEHJJJK(1); + } + else if (localLobbyPlayer.CJFLMDNNMIE == 1) + { + player = ALDOKEMAOMB.BJDPHEHJJJK(0); + } } if (player.DOFCCEDJODB != Character.NONE && player.DOFCCEDJODB != Character.RANDOM) return player; else return null; } - public CharacterModel GetLobbyCharacterModel(int playerNr) - { - CharacterModel retmodel = null; - ScreenPlayers screenPlayers = FindObjectOfType(); - foreach (PlayersSelection playersSelection in screenPlayers.playerSelections) - { - if (playersSelection.playerNr == playerNr) - { - retmodel = playersSelection.characterModel; - } - } - return retmodel; - } - public void AssignTextureToCharacterModelRenderers(CharacterModel model, Texture2D tex) { - try + Renderer[] rs = model.curModel?.transform.GetComponentsInChildren() ?? new Renderer[0]; + for (int i = 0; i < rs.Length; i++) { - Renderer[] rs = model.curModel.transform.GetComponentsInChildren(); - if (rs.Length > 0) - { - foreach (Renderer r in rs) - { - AssignTextureToRenderer(r, tex); - } - } + AssignTextureToRenderer(rs[i], tex); } - catch { } } private PlayerEntity GetLocalPlayerInGame() { return localLobbyPlayer.JCCIAMJEODH; } + private PlayerEntity GetOpponentPlayerInGame() { return opponentPlayer.JCCIAMJEODH; } - private void AssignTextureToIngameCharacter(PlayerEntity playerEntity, Texture2D tex) { VisualEntity ve = playerEntity.gameObject.GetComponent(); @@ -1045,18 +1132,14 @@ private int AssignTextureToHud(PlayerEntity playerEntity, Texture tex) private void AssignTextureToPostGameHud(int playerNr, Texture tex) { - PostScreen ps = FindObjectOfType(); - PostSceenPlayerBar[] pspbs = ps.playerBarsByPlayer; - - if (pspbs.Length > 0) + if (UIScreen.currentScreens[0]?.screenType == ScreenType.GAME_RESULTS) { - Renderer[] rs = pspbs[playerNr].gameObject.transform.GetComponentsInChildren(); - if (rs.Length > 0) + PostScreen postScreen = UIScreen.currentScreens[0] as PostScreen; + Renderer[] rs = postScreen.playerBarsByPlayer[playerNr].gameObject.transform.GetComponentsInChildren(); + + for (int i = 0; i < rs.Length; i++) { - foreach (Renderer r in rs) - { - AssignTextureToRenderer(r, tex, playerNr); - } + AssignTextureToRenderer(rs[i], tex, playerNr); } } } @@ -1092,7 +1175,7 @@ void AssignTextureToRenderer(Renderer r, Texture tex, int playerIndex = -1, Play { if (playerIndex > -1) { - ALDOKEMAOMB player = ALDOKEMAOMB.MNOLFHGAIMC(playerIndex); + ALDOKEMAOMB player = ALDOKEMAOMB.BJDPHEHJJJK(playerIndex); character = player.DOFCCEDJODB; characterVariant = player.AIINAIDBHJI; } @@ -1111,6 +1194,7 @@ void AssignTextureToRenderer(Renderer r, Texture tex, int playerIndex = -1, Play if (!materialTexName.Contains("Silhouett") && materialTexName != "") { + //r.material.shader = Shader.Find("LethalLeague/GameplayOpaque"); r.material.SetTexture("_MainTex", tex); } } @@ -1155,14 +1239,13 @@ void AssignTextureToRenderer(Renderer r, Texture tex, int playerIndex = -1, Play private void AssignSkinToWinnerModel() { - if (UIScreen.currentScreens[0]?.screenType == ScreenType.GAME_RESULTS) { PostScreen ps = UIScreen.currentScreens[0] as PostScreen; - if (localTex != null) + if (localCustomSkin != null) { - if (ps.winnerCharacter == localPlayerChar && ps.winnerCharacterVariant == localPlayerCharVar) AssignTextureToCharacterModelRenderers(ps.winnerModel, localTex); + if (ps.winnerCharacter == localPlayerChar && ps.winnerCharacterVariant == localPlayerCharVar) AssignTextureToCharacterModelRenderers(ps.winnerModel, localCustomSkin.SkinTexture); } if (opponentCustomTexture != null) @@ -1172,6 +1255,12 @@ private void AssignSkinToWinnerModel() } } + private void SetCharacterModelTex(CharacterModel characterModel, Texture2D tex) + { + characterModel.SetSilhouette(false); + AssignTextureToCharacterModelRenderers(characterModel, tex); + } + private void SetUnlocksCharacterModel(Texture2D tex) { CharacterModel[] cms = FindObjectsOfType(); @@ -1187,11 +1276,12 @@ private void SetUnlocksCharacterModel(Texture2D tex) private void InitLocalPlayer() { - localLobbyPlayer = null; + //localLobbyPlayer = null; localLobbyPlayerModel = null; - localGamePlayerEntity = null; + //localGamePlayerEntity = null; localPlayerNr = -1; - localTex = null; + localSkinIndex = -1; + localCustomSkin = null; doSkinPost = false; postTimer = 0; randomizedChar = false; @@ -1209,7 +1299,120 @@ private void InitOpponentPlayer() initOpponentPlayer = false; } + CustomSkin GetCustomSkin(Character character, bool isRandom = false) + { + List customSkins = TextureMod.Instance.tl.newCharacterTextures[character]; + if (customSkins.Count == 0) + { + Debug.Log($"[LLBMM] TextureMod: No skins for {character}"); + return null; + } + int skinIndex = localSkinIndex; + + if (skinIndex > customSkins.Count - 1) + { + skinIndex = 0; + } + else if (skinIndex < 0) + { + skinIndex = customSkins.Count - 1; + } + + localSkinIndex = skinIndex; + return customSkins[localSkinIndex]; + } + + private void SetLocalCustomSkin(Character character, bool isRandom = false) + { + localCustomSkin = GetCustomSkin(character, isRandom); + if (localCustomSkin == null) { return; } + + bool flipped = currentGameMode == GameMode._1v1 && localLobbyPlayer.CJFLMDNNMIE == 1 ? true : false; + + localPlayerCharVar = GetCustomSkinVariant(localCustomSkin.Variant, localLobbyPlayer.AIINAIDBHJI); + localPlayerChar = character; + localLobbyPlayer.AIINAIDBHJI = localPlayerCharVar; + localLobbyPlayerModel = GetCurrentCharacterModel(P2P.localPeer?.playerNr ?? 0); + localLobbyPlayerModel.SetCharacterLobby(localLobbyPlayer.CJFLMDNNMIE, localPlayerChar, localPlayerCharVar, flipped); + localLobbyPlayerModel.PlayCamAnim(); + } + private CharacterModel GetCurrentCharacterModel(int playerNr = 0) + { + if (UIScreen.currentScreens[0]?.screenType == ScreenType.PLAYERS) + { + var screenPlayers = UIScreen.currentScreens[0] as ScreenPlayers; + return screenPlayers.playerSelections[playerNr].characterModel; + } + else if (UIScreen.currentScreens[1]?.screenType == ScreenType.UNLOCKS_SKINS) + { + var screenUnlocksSkins = UIScreen.currentScreens[1] as ScreenUnlocksSkins; + return screenUnlocksSkins.previewModel; + } + else if (UIScreen.currentScreens[1]?.screenType == ScreenType.UNLOCKS_CHARACTERS) + { + var screenUnlocksCharacters = UIScreen.currentScreens[1] as ScreenUnlocksCharacters; + return screenUnlocksCharacters.previewModel; + } + return null; + } + + + CharacterVariant GetCustomSkinVariantShowcase(CustomSkin.VariantType variantType) + { + switch (variantType) + { + case CustomSkin.VariantType.Alternative: + return CharacterVariant.MODEL_ALT; + case CustomSkin.VariantType.DLC: + return CharacterVariant.MODEL_ALT3; + case CustomSkin.VariantType.Default: + return CharacterVariant.DEFAULT; + default: + return CharacterVariant.DEFAULT; + } + } + + CharacterVariant GetCustomSkinVariant(CustomSkin.VariantType variantType, CharacterVariant characterVariant) + { + switch (variantType) + { + case CustomSkin.VariantType.Alternative: + if (characterVariant == CharacterVariant.MODEL_ALT || characterVariant == CharacterVariant.MODEL_ALT2) + { + return characterVariant; + } + else if (opponentPlayer?.DOFCCEDJODB == localLobbyPlayer.DOFCCEDJODB) + { + return opponentPlayer.AIINAIDBHJI == CharacterVariant.MODEL_ALT ? CharacterVariant.MODEL_ALT2 : CharacterVariant.MODEL_ALT; + } + else return CharacterVariant.MODEL_ALT; + case CustomSkin.VariantType.DLC: + if (characterVariant == CharacterVariant.MODEL_ALT3 || characterVariant == CharacterVariant.MODEL_ALT4) + { + return characterVariant; + } + else if (opponentPlayer?.DOFCCEDJODB == localLobbyPlayer.DOFCCEDJODB) + { + return opponentPlayer.AIINAIDBHJI == CharacterVariant.MODEL_ALT3 ? CharacterVariant.MODEL_ALT4 : CharacterVariant.MODEL_ALT3; + } + else return CharacterVariant.MODEL_ALT3; + default: + if (characterVariant < CharacterVariant.STATIC_ALT) + { + return characterVariant; + } + else if (opponentPlayer?.DOFCCEDJODB == localLobbyPlayer.DOFCCEDJODB) + { + return opponentPlayer.AIINAIDBHJI == CharacterVariant.DEFAULT ? CharacterVariant.ALT0 : CharacterVariant.DEFAULT; + } + else return CharacterVariant.DEFAULT; + } + } + +#if showOLD + + [Obsolete("Method1 is deprecated, please use Method2 instead.", true)] private Texture2D GetLoadedTexture(Character c, Texture2D currentTexture, bool previous, bool random) { Texture2D ret = null; @@ -1317,10 +1520,44 @@ private Texture2D GetLoadedTexture(Character c, Texture2D currentTexture, bool p } localPlayerChar = c; texname = CleanTextureName(texname); - localTexName = texname; + localSkinNameLabel = texname; return ret; } +#endif + + private void GetSkinForUnlocksModel(ScreenUnlocksCharacters screen, sbyte next = 0) + { + Character character = screen.previewModel.character; + List customSkins = TextureMod.Instance.tl.newCharacterTextures[character]; + if (customSkins.Count == 0) + { + Debug.Log($"[LLBMM] TextureMod: No skins for {character}"); + return; + } + + localCustomSkin = GetCustomSkin(character); + screen.previewModel.SetCharacterResultScreen(0, character, GetCustomSkinVariant(localCustomSkin.Variant, screen.previewModel.characterVariant)); + siluetteTimer = 5; + } + + private void SetSkinForUnlocksModel(ScreenUnlocksSkins screenUnlocksSkins, sbyte next = 0) + { + List customSkins = TextureMod.Instance.tl.newCharacterTextures[screenUnlocksSkins.character]; + if (customSkins.Count == 0) + { + Debug.Log($"[LLBMM] TextureMod: No skins for {screenUnlocksSkins.character}"); + return; + } + + localCustomSkin = GetCustomSkin(screenUnlocksSkins.character); + screenUnlocksSkins.ShowCharacter(screenUnlocksSkins.character, GetCustomSkinVariantShowcase(localCustomSkin.Variant), true); + siluetteTimer = 5; + SetCharacterModelTex(screenUnlocksSkins.previewModel, localCustomSkin?.SkinTexture); + } + +#if showOLD + [Obsolete("Method1 is deprecated, please use Method2 instead.", true)] private Texture2D GetLoadedTextureForUnlocksModel(Texture2D currentTexture, bool previous) { Texture2D texture = null; @@ -1403,20 +1640,11 @@ private Texture2D GetLoadedTextureForUnlocksModel(Texture2D currentTexture, bool siluetteTimer = 5; - localTexName = texname; + localSkinNameLabel = texname; return texture; } - private string CleanTextureName(string texname) - { - string ret = texname; - if (ret.Contains(".png")) ret = ret.Replace(".png", ""); - if (ret.Contains(".PNG")) ret = ret.Replace(".PNG", ""); - if (ret.Contains("_ALT2")) ret = ret.Replace("_ALT2", ""); - else if (ret.Contains("_ALT")) ret = ret.Replace("_ALT", ""); - - return ret; - } +#endif private CharacterVariant GetVariantFromFileName(Character localPlayerC, string name) { @@ -1531,7 +1759,7 @@ private void SetBallColors() #region Dust&Ashes Effects public void AshesIngameEffects() { - if (localGamePlayerEntity != null && localTex != null) if (localGamePlayerEntity.character == Character.BAG) AssignAshesOutlineColor(localGamePlayerEntity, localTex); + if (localGamePlayerEntity != null && localCustomSkin?.SkinTexture != null) if (localGamePlayerEntity.character == Character.BAG) AssignAshesOutlineColor(localGamePlayerEntity, localCustomSkin.SkinTexture); else if (opponentPlayerEntity != null && opponentCustomTexture != null) if (opponentPlayerEntity.character == Character.BAG) AssignAshesOutlineColor(opponentPlayerEntity, opponentCustomTexture); } @@ -1569,7 +1797,7 @@ public void CandymanIngameEffects() { if (mainBall.GetLastPlayerHitter().character == Character.CANDY) { - if (mainBall.GetLastPlayerHitter() == localGamePlayerEntity && localTex != null) AssignSkinToCandyball(mainBall, mainBall.GetLastPlayerHitter(), localTex); + if (mainBall.GetLastPlayerHitter() == localGamePlayerEntity && localCustomSkin != null) AssignSkinToCandyball(mainBall, mainBall.GetLastPlayerHitter(), localCustomSkin.SkinTexture); else if (mainBall.GetLastPlayerHitter() == opponentPlayerEntity && opponentCustomTexture != null) AssignSkinToCandyball(mainBall, mainBall.GetLastPlayerHitter(), opponentCustomTexture); else AssignSkinToCandyball(mainBall, mainBall.GetLastPlayerHitter(), null); } @@ -1603,9 +1831,9 @@ public void AssignSkinColorToCandySplash() { EffectEntity effect = effects[i]; - if (effect.effectData.graphicName == "candySplash") + if (effect.name == "candySplash") { - Texture2D tex = CheckPlayerOrMainBallSplashEffect(localGamePlayerEntity, effect, localTex) ?? CheckPlayerOrMainBallSplashEffect(opponentPlayerEntity, effect, localTex) ?? null; + Texture2D tex = CheckPlayerOrMainBallSplashEffect(localGamePlayerEntity, effect, localCustomSkin.SkinTexture) ?? CheckPlayerOrMainBallSplashEffect(opponentPlayerEntity, effect, opponentCustomTexture) ?? null; if (tex != null) { @@ -1648,21 +1876,35 @@ void SetCandySplashEffect(EffectEntity effect, Texture2D tex) Renderer r = effect.GetVisual("main").mainRenderer; r.material.mainTexture = candySplashWhite; r.material.color = (localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT3 || localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT4) ? tex.GetPixel(130, 92) : tex.GetPixel(103, 473); - effect.effectData.graphicName = "candySplashModified"; + effect.name = "candySplashModified"; } #region Grid effects public void GridIngameEffects() { - if (mainBall.ballData.hitstunState == HitstunState.TELEPORT_STUN || mainBall.ballData.hitstunState == HitstunState.BUNT_STUN) + if (mainBall?.ballData.hitstunState == HitstunState.TELEPORT_STUN || mainBall?.ballData.hitstunState == HitstunState.BUNT_STUN) { - if (mainBall.GetLastPlayerHitter() == localGamePlayerEntity && localTex != null) AssignGridSpecialColor(localGamePlayerEntity, localTex); - if (mainBall.GetLastPlayerHitter() == opponentPlayerEntity && opponentCustomTexture != null) AssignGridSpecialColor(opponentPlayerEntity, opponentCustomTexture); + if (localGamePlayerEntity != null) + { + if (mainBall.GetLastPlayerHitter() == localGamePlayerEntity && localCustomSkin != null) AssignGridSpecialColor(localGamePlayerEntity, localCustomSkin.SkinTexture); + } + + if (opponentPlayerEntity != null) + { + if (mainBall.GetLastPlayerHitter() == opponentPlayerEntity && opponentCustomTexture != null) { AssignGridSpecialColor(opponentPlayerEntity, opponentCustomTexture); } + } } else { - if (localGamePlayerEntity.GetCurrentAbilityState().name.Contains("ELECTROCHARGE") && localTex != null) AssignGridSpecialColor(localGamePlayerEntity, localTex); - if (opponentPlayerEntity.GetCurrentAbilityState().name.Contains("ELECTROCHARGE") && opponentCustomTexture != null) AssignGridSpecialColor(opponentPlayerEntity, opponentCustomTexture); + if (localGamePlayerEntity != null) + { + if (localGamePlayerEntity.GetCurrentAbility()?.name.Contains("ELECTROCHARGE") != null && localCustomSkin != null) AssignGridSpecialColor(localGamePlayerEntity, localCustomSkin.SkinTexture); + } + + if (opponentPlayerEntity != null) + { + if (opponentPlayerEntity.GetCurrentAbility()?.name.Contains("ELECTROCHARGE") != null && opponentCustomTexture != null) AssignGridSpecialColor(opponentPlayerEntity, opponentCustomTexture); + } } } @@ -1722,15 +1964,18 @@ public void AssignVisualizer(PlayerEntity pe, Texture2D tex) void AssignVisualizer(Character character, Renderer r, Texture2D tex) { FNDGCLEDHAD visualizer = r.gameObject.GetComponentInParent(); - if (visualizer != null) + if (visualizer != null && tex != null) { Color c1 = character == Character.BOSS ? tex.GetPixel(493, 510) : tex.GetPixel(82, 10); Color c2 = character == Character.BOSS ? tex.GetPixel(508, 510) : tex.GetPixel(96, 10); - Material vismat = visualizer.FHAMOPAJHNJ; - vismat.mainTexture = tex; - vismat.SetColor("_AmpColor0", c1); - vismat.SetColor("_AmpColor1", c2); + try + { + vismat.mainTexture = tex; + vismat.SetColor("_AmpColor0", c1); + vismat.SetColor("_AmpColor1", c2); + } + catch { Debug.Log($"Visulizer Broke for a moment and I don't know why ``\\_(-.-)_/``"); } } } @@ -1766,9 +2011,9 @@ public void AssignOmegaDoomboxSmearsAndArms(Renderer r, Texture2D tex) public void ToxicIngameEffects() { - if (localGamePlayerEntity != null && localTex != null) + if (localGamePlayerEntity != null && localCustomSkin != null) { - if (localGamePlayerEntity.character == Character.GRAF && localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT3 || localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT4) AssignNurseToxicCanisters(localGamePlayerEntity, localTex); + if (localGamePlayerEntity.character == Character.GRAF && localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT3 || localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT4) AssignNurseToxicCanisters(localGamePlayerEntity, localCustomSkin.SkinTexture); } if (opponentPlayerEntity != null && opponentCustomTexture != null) { @@ -1822,14 +2067,14 @@ public void AssignToxicEffectColors(int playerId, Texture2D tex, CharacterVarian #endregion #region Jet Effects - public void JetIngameEffects() + public void JetIngameEffects(Texture2D skinTexture) { - if (mainBall.GetLastPlayerHitter() == localGamePlayerEntity && localTex != null) AssignBubbleVisual(localGamePlayerEntity.variant, localTex); + if (mainBall.GetLastPlayerHitter() == localGamePlayerEntity && skinTexture != null) AssignBubbleVisual(localGamePlayerEntity.variant, skinTexture); if (mainBall.GetLastPlayerHitter() == opponentPlayerEntity && opponentCustomTexture != null) AssignBubbleVisual(opponentPlayerEntity.variant, opponentCustomTexture); - if (localGamePlayerEntity != null && localTex != null) + if (localGamePlayerEntity != null && skinTexture != null) { - if (localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT || localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT2) AssignJetScubaVisor(localGamePlayerEntity, localTex); + if (localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT || localGamePlayerEntity.variant == CharacterVariant.MODEL_ALT2) AssignJetScubaVisor(localGamePlayerEntity, skinTexture); } if (opponentPlayerEntity != null && opponentCustomTexture != null) diff --git a/TextureMod/TextureHelper.cs b/TextureMod/TextureHelper.cs index 0bdf339..5be11d2 100644 --- a/TextureMod/TextureHelper.cs +++ b/TextureMod/TextureHelper.cs @@ -1,9 +1,7 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace TextureMod @@ -18,7 +16,6 @@ class TextureHelper Debug.Log("Could not find " + fullPath); return null; } - Texture2D tex = null; byte[] spriteBytes; using (var fileStream = File.OpenRead(fullPath)) @@ -44,6 +41,7 @@ class TextureHelper string texName = Path.GetFileNameWithoutExtension(fullPath); + Texture2D tex; tex = new Texture2D(512, 512, TextureFormat.RGBA32, true, false) { name = texName, @@ -56,6 +54,7 @@ class TextureHelper return tex; } +#if oldCode public static Texture2D ReloadSkin(Character _character, Texture2D _texture) { @@ -118,6 +117,7 @@ public static Texture2D ReloadSkin(Character _character, Texture2D _texture) Resources.UnloadUnusedAssets(); return newTex; } +#endif } public enum EChunkType : uint @@ -214,13 +214,13 @@ public static List ReadChunks(BinaryReader aReader) while (aReader.BaseStream.Position < aReader.BaseStream.Length - 4) { var chunk = new PNGChunk(); - chunk.length = aReader.ReadUInt32BE(); + chunk.length = BinaryReaderWriterExt.ReadUInt32BE(aReader); if (aReader.BaseStream.Position >= aReader.BaseStream.Length - 4 - chunk.length) break; res.Add(chunk); - chunk.type = (EChunkType)aReader.ReadUInt32BE(); + chunk.type = (EChunkType)BinaryReaderWriterExt.ReadUInt32BE(aReader); chunk.data = aReader.ReadBytes((int)chunk.length); - chunk.crc = aReader.ReadUInt32BE(); + chunk.crc = BinaryReaderWriterExt.ReadUInt32BE(aReader); uint crc = chunk.CalcCRC(); @@ -237,19 +237,19 @@ public static PNGFile ReadPNGFile(BinaryReader aReader) if (aReader == null || aReader.BaseStream.Position >= aReader.BaseStream.Length - 8) return null; var file = new PNGFile(); - file.Signature = aReader.ReadUInt64BE(); + file.Signature = BinaryReaderWriterExt.ReadUInt64BE(aReader); file.chunks = ReadChunks(aReader); return file; } public static void WritePNGFile(PNGFile aFile, BinaryWriter aWriter) { - aWriter.WriteUInt64BE(PNGFile.m_Signature); + BinaryReaderWriterExt.WriteUInt64BE(aWriter,PNGFile.m_Signature); foreach (var chunk in aFile.chunks) { - aWriter.WriteUInt32BE((uint)chunk.data.Length); - aWriter.WriteUInt32BE((uint)chunk.type); + BinaryReaderWriterExt.WriteUInt32BE(aWriter,(uint)chunk.data.Length); + BinaryReaderWriterExt.WriteUInt32BE(aWriter,(uint)chunk.type); aWriter.Write(chunk.data); - aWriter.WriteUInt32BE(chunk.crc); + BinaryReaderWriterExt.WriteUInt32BE(aWriter,chunk.crc); } } @@ -310,26 +310,29 @@ public static byte[] ChangePPI(byte[] aPNGData, float aXPPI, float aYPPI) public static class BinaryReaderWriterExt { - public static uint ReadUInt32BE(this BinaryReader aReader) + public static uint ReadUInt32BE(BinaryReader aReader) { return ((uint)aReader.ReadByte() << 24) | ((uint)aReader.ReadByte() << 16) | ((uint)aReader.ReadByte() << 8) | ((uint)aReader.ReadByte()); } - public static ulong ReadUInt64BE(this BinaryReader aReader) + + public static ulong ReadUInt64BE(BinaryReader aReader) { - return (ulong)aReader.ReadUInt32BE() << 32 | aReader.ReadUInt32BE(); + return (ulong)ReadUInt32BE(aReader) << 32 | ReadUInt32BE(aReader); } - public static void WriteUInt32BE(this BinaryWriter aWriter, uint aValue) + + public static void WriteUInt32BE(BinaryWriter aWriter, uint aValue) { aWriter.Write((byte)((aValue >> 24) & 0xFF)); aWriter.Write((byte)((aValue >> 16) & 0xFF)); aWriter.Write((byte)((aValue >> 8) & 0xFF)); aWriter.Write((byte)((aValue) & 0xFF)); } - public static void WriteUInt64BE(this BinaryWriter aWriter, ulong aValue) + + public static void WriteUInt64BE(BinaryWriter aWriter, ulong aValue) { - aWriter.WriteUInt32BE((uint)(aValue >> 32)); - aWriter.WriteUInt32BE((uint)(aValue)); + WriteUInt32BE(aWriter,(uint)(aValue >> 32)); + WriteUInt32BE(aWriter, (uint)(aValue)); } } } \ No newline at end of file diff --git a/TextureMod/TextureLoader.cs b/TextureMod/TextureLoader.cs index a35c43f..5f4f35f 100644 --- a/TextureMod/TextureLoader.cs +++ b/TextureMod/TextureLoader.cs @@ -1,8 +1,8 @@ using LLHandlers; using LLScreen; +using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text.RegularExpressions; using UnityEngine; @@ -11,10 +11,11 @@ namespace TextureMod { public class TextureLoader : MonoBehaviour { - private static string resourceFolder = Application.dataPath.Replace("/", @"\") + @"\Managed\TextureModResources\Images\Characters\"; - public List chars = new List(); - public Dictionary> characterTextures = new Dictionary>(); - const string regexFilter = @"^\d+#"; + private readonly string resourceFolder = Application.dataPath.Replace("/", @"\") + @"\Managed\TextureModResources\Images\Characters\"; + public List chars; + //public Dictionary> characterTextures = new Dictionary>(); + public Dictionary> newCharacterTextures = new Dictionary>(); + Regex regex = new Regex(@"((_ALT\d?$)|(^\d+#))"); public bool loadingExternalFiles = true; public bool hasCactuar = false; @@ -24,63 +25,82 @@ private void Start() LoadLibrary(); } - public void LoadLibrary() + private List GetCharacterFolders() { - chars.Clear(); - Resources.UnloadUnusedAssets(); - characterTextures.Clear(); + return new List(Directory.GetDirectories(resourceFolder.Replace("/", @"\"))); + } - foreach (string path in Directory.GetDirectories(resourceFolder.Replace("/", @"\"))) + public void ReloadChacterSpecificSkins(Character character) + { + List characterSkins = newCharacterTextures[character]; + for (int i = 0; i < characterSkins.Count - 1; i++) { - chars.Add(path); + characterSkins[i].ReloadSkin(); } + } - foreach (string characterFolder in chars) + public void LoadLibrary() + { + try { + chars?.Clear(); + Resources.UnloadUnusedAssets(); + newCharacterTextures.Clear(); - Dictionary skins = new Dictionary(); - Character character = StringToChar(Path.GetFileName(characterFolder)); - bool hasDLC = CheckHasDLCForCharacter(character); + chars = GetCharacterFolders(); - foreach (string file in Directory.GetFiles(characterFolder, "*.png", SearchOption.TopDirectoryOnly)) + foreach (string characterFolder in chars) { - ModelVariant modelVariant = ModelVariantFromFile(file); - if (modelVariant == ModelVariant.DLC && hasDLC == false) - { - continue; - } - - string cleanName = Path.GetFileNameWithoutExtension(file); - cleanName = Regex.Replace(cleanName, regexFilter, ""); - skins.Add(cleanName, TextureHelper.LoadPNG(file)); - } - + int indexer = 0; + List customSkins = new List(); + Character character = StringToChar(Path.GetFileName(characterFolder)); + bool hasDLC = CheckHasDLCForCharacter(character); - foreach (string dir in Directory.GetDirectories(characterFolder)) - { - string authorName = Path.GetFileName(dir); - authorName = Regex.Replace(authorName, regexFilter, ""); - - foreach (string file in Directory.GetFiles(dir, "*.png", SearchOption.TopDirectoryOnly)) + foreach (string file in Directory.GetFiles(characterFolder, "*.png", SearchOption.TopDirectoryOnly)) { ModelVariant modelVariant = ModelVariantFromFile(file); if (modelVariant == ModelVariant.DLC && hasDLC == false) { continue; } - string cleanName = Path.GetFileNameWithoutExtension(file); - cleanName = Regex.Replace(cleanName, regexFilter, ""); + cleanName = regex.Replace(cleanName, m => { return ""; }); + customSkins.Add(new CustomSkin(indexer, character, (CustomSkin.VariantType)modelVariant, cleanName, "", file)); + indexer++; + } - skins.Add(cleanName + " by " + authorName, TextureHelper.LoadPNG(file)); + foreach (string dir in Directory.GetDirectories(characterFolder)) + { + string authorName = Path.GetFileName(dir); + authorName = regex.Replace(authorName, m => { return ""; }); + + foreach (string file in Directory.GetFiles(dir, "*.png", SearchOption.TopDirectoryOnly)) + { + ModelVariant modelVariant = ModelVariantFromFile(file); + if (modelVariant == ModelVariant.DLC && hasDLC == false) + { + continue; + } + + string cleanName = Path.GetFileNameWithoutExtension(file); + cleanName = regex.Replace(cleanName, m => { return ""; }); + customSkins.Add(new CustomSkin(indexer, character, (CustomSkin.VariantType)modelVariant, cleanName, authorName, file)); + indexer++; + } } + + newCharacterTextures.Add(character, customSkins); } - characterTextures.Add(character, skins); + UIScreen.SetLoadingScreen(false); + loadingExternalFiles = false; + } + catch (Exception e) + { + TextureMod.loadingText = $"TextureMod failed to load textures"; + Debug.Log($"{e}"); + throw; } - - UIScreen.SetLoadingScreen(false); - loadingExternalFiles = false; } bool CheckHasDLCForCharacter(Character character) diff --git a/TextureMod/TextureMod.cs b/TextureMod/TextureMod.cs index 8b901b6..b02d2b0 100644 --- a/TextureMod/TextureMod.cs +++ b/TextureMod/TextureMod.cs @@ -19,7 +19,7 @@ public static void Initialize() DontDestroyOnLoad(gameObject); } - private const string modVersion = "1.4.7"; + private const string modVersion = "1.4.9"; private const string repositoryOwner = "Daioutzu"; private const string repositoryName = "LLBMM-TextureMod"; @@ -36,6 +36,7 @@ public static void Initialize() public static List ownedDLCs = new List(); public static bool hasDLC = false; + public static string loadingText = $"TextureMod is loading External Textures..."; private void Start() { @@ -55,7 +56,6 @@ private void Update() if (showcaseStudio == null) showcaseStudio = gameObject.AddComponent(); } - private void OnGUI() { var OriginalColor = GUI.contentColor; @@ -70,7 +70,7 @@ private void OnGUI() var sX = Screen.width / 2; var sY = UIScreen.GetResolutionFromConfig().height / 3; GUI.skin.label.alignment = TextAnchor.MiddleCenter; - GUI.Label(new Rect(0, sY + 50, Screen.width, sY), "TextureMod is loading External Textures"); + GUI.Label(new Rect(0, sY + 50, Screen.width, sY), loadingText); GUI.skin.label.alignment = TextAnchor.MiddleLeft; } GUI.contentColor = OriginalColor; @@ -91,8 +91,9 @@ private void CheckIfPLayerHasDLC() if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431701))) ownedDLCs.Add(Character.ELECTRO); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431702))) ownedDLCs.Add(Character.ROBOT); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1399790))) ownedDLCs.Add(Character.BOOM); - if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431711))) ownedDLCs.Add(Character.PONG); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431711))) ownedDLCs.Add(Character.SKATE); if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431712))) ownedDLCs.Add(Character.CANDY); + if (AALLGKBNLBO.OEBMADMCBAE(new AppId_t(1431700))) ownedDLCs.Add(Character.COP); } } } diff --git a/TextureMod/TextureMod.csproj b/TextureMod/TextureMod.csproj index ffa374c..c3fa46e 100644 --- a/TextureMod/TextureMod.csproj +++ b/TextureMod/TextureMod.csproj @@ -12,6 +12,7 @@ v4.5 512 true + true @@ -21,6 +22,7 @@ DEBUG;TRACE prompt 4 + false pdbonly @@ -29,6 +31,7 @@ TRACE prompt 4 + false @@ -50,257 +53,326 @@ ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\Rewired_Windows.dll - - - - - False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\TextMeshPro.dll - - False - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.dll - False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AccessibilityModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AIModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AnimationModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ARModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AssetBundleModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.AudioModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.BaselibModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ClothModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ClusterInputModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ClusterRendererModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.CoreModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.CrashReportingModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.DirectorModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.FileSystemHttpModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.GameCenterModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.GridModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.HotReloadModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ImageConversionModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.IMGUIModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.InputModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.JSONSerializeModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.LocalizationModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.Networking.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ParticleSystemModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.PerformanceReportingModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.Physics2DModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.PhysicsModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ProfilerModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.ScreenCaptureModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SharedInternalsModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SpatialTracking.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SpriteMaskModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SpriteShapeModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.StreamingModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.StyleSheetsModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.SubstanceModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TerrainModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TextCoreModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TextRenderingModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TilemapModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.Timeline.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TimelineModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.TLSModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UI.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UIElementsModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UIModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UmbraModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UNETModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityConnectModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VehiclesModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VFXModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VideoModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.VRModule.dll + False False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.WindModule.dll + False - + + False ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\LLBlaze\LLBlaze_Data\Managed\UnityEngine.XRModule.dll + False diff --git a/TextureMod/app.config b/TextureMod/app.config index 8460dd4..3b1525e 100644 --- a/TextureMod/app.config +++ b/TextureMod/app.config @@ -1,11 +1,11 @@ - + - - + + - \ No newline at end of file + From 9f3c7bf1b5c204d8e88ce8e329a89a4bfc88a81b Mon Sep 17 00:00:00 2001 From: Daioutzu <54756730+Daioutzu@users.noreply.github.com> Date: Sat, 27 Mar 2021 13:47:25 +0000 Subject: [PATCH 11/11] Fixed player initialization breaking Showcase skin select --- TextureMod/TextureChanger.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TextureMod/TextureChanger.cs b/TextureMod/TextureChanger.cs index f05b700..021287c 100644 --- a/TextureMod/TextureChanger.cs +++ b/TextureMod/TextureChanger.cs @@ -846,8 +846,8 @@ void AssignSkinToLocalPlayer() calculateMirror = true; } } - } - else + } + else if (initLocalPlayer) { InitLocalPlayer(); }