From 481813b5f168e7ef6c06f2c95e568e2f8d4072fb Mon Sep 17 00:00:00 2001 From: GlowPuff Date: Mon, 28 Jun 2021 07:45:26 -0400 Subject: [PATCH] fixed Custom Group in any Mission Preset causing the app to hang --- .../Cards/Enemies/Other/{M1000.png => M070.png} | Bin .../Enemies/Other/{M1000.png.meta => M070.png.meta} | 4 ++-- .../Assets/Resources/Languages/De/instructions.json | 2 +- .../Languages/En/DeploymentGroups/enemies.json | 2 +- .../Assets/Resources/Languages/En/instructions.json | 2 +- .../Assets/Resources/Languages/Es/instructions.json | 2 +- .../Assets/Resources/Languages/Fr/instructions.json | 2 +- LORAI/Assets/Scripts/Common/DGPrefab.cs | 6 +++--- LORAI/Assets/Scripts/Common/DataStore.cs | 2 +- .../Assets/Scripts/MainGame/EnemyActivationPopup.cs | 8 ++++---- LORAI/Assets/Scripts/MainGame/GenericChooser.cs | 12 ++++++------ LORAI/Assets/Scripts/Title/GroupToggleContainer.cs | 11 +++++++++-- LORAI/Assets/Scripts/Title/NewGameScreen.cs | 5 ++++- 13 files changed, 34 insertions(+), 24 deletions(-) rename LORAI/Assets/Resources/Cards/Enemies/Other/{M1000.png => M070.png} (100%) rename LORAI/Assets/Resources/Cards/Enemies/Other/{M1000.png.meta => M070.png.meta} (98%) diff --git a/LORAI/Assets/Resources/Cards/Enemies/Other/M1000.png b/LORAI/Assets/Resources/Cards/Enemies/Other/M070.png similarity index 100% rename from LORAI/Assets/Resources/Cards/Enemies/Other/M1000.png rename to LORAI/Assets/Resources/Cards/Enemies/Other/M070.png diff --git a/LORAI/Assets/Resources/Cards/Enemies/Other/M1000.png.meta b/LORAI/Assets/Resources/Cards/Enemies/Other/M070.png.meta similarity index 98% rename from LORAI/Assets/Resources/Cards/Enemies/Other/M1000.png.meta rename to LORAI/Assets/Resources/Cards/Enemies/Other/M070.png.meta index 81e06ec..ce974dc 100644 --- a/LORAI/Assets/Resources/Cards/Enemies/Other/M1000.png.meta +++ b/LORAI/Assets/Resources/Cards/Enemies/Other/M070.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c1cceabbef1b6b04e98d06485da02f9a +guid: 6ad879e727ddda6418efaee2f3fcbb4a TextureImporter: internalIDToNameTable: [] externalObjects: {} @@ -61,7 +61,7 @@ TextureImporter: compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 - applyGammaDecoding: 1 + applyGammaDecoding: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform diff --git a/LORAI/Assets/Resources/Languages/De/instructions.json b/LORAI/Assets/Resources/Languages/De/instructions.json index 866a5ee..95eb1a8 100644 --- a/LORAI/Assets/Resources/Languages/De/instructions.json +++ b/LORAI/Assets/Resources/Languages/De/instructions.json @@ -2,7 +2,7 @@ [ { "instName": "Manuelle Aufstellung", - "instID": "DG1000", + "instID": "DG070", "content": [ { "instruction": [ diff --git a/LORAI/Assets/Resources/Languages/En/DeploymentGroups/enemies.json b/LORAI/Assets/Resources/Languages/En/DeploymentGroups/enemies.json index 141754c..ffa177b 100644 --- a/LORAI/Assets/Resources/Languages/En/DeploymentGroups/enemies.json +++ b/LORAI/Assets/Resources/Languages/En/DeploymentGroups/enemies.json @@ -993,6 +993,6 @@ "expansion": "Other", "ignored": "Coordinated Raid", "isElite": true - } + } ] } \ No newline at end of file diff --git a/LORAI/Assets/Resources/Languages/En/instructions.json b/LORAI/Assets/Resources/Languages/En/instructions.json index dbe5425..05ee39c 100644 --- a/LORAI/Assets/Resources/Languages/En/instructions.json +++ b/LORAI/Assets/Resources/Languages/En/instructions.json @@ -2,7 +2,7 @@ [ { "instName": "Manual Deployment", - "instID": "DG1000", + "instID": "DG070", "content": [ { "instruction": [ diff --git a/LORAI/Assets/Resources/Languages/Es/instructions.json b/LORAI/Assets/Resources/Languages/Es/instructions.json index 25d85b3..ca232f3 100644 --- a/LORAI/Assets/Resources/Languages/Es/instructions.json +++ b/LORAI/Assets/Resources/Languages/Es/instructions.json @@ -2,7 +2,7 @@ [ { "instName": "Despliegue manual", - "instID": "DG1000", + "instID": "DG070", "content": [ { "instruction": [ diff --git a/LORAI/Assets/Resources/Languages/Fr/instructions.json b/LORAI/Assets/Resources/Languages/Fr/instructions.json index bcc849d..a9b1288 100644 --- a/LORAI/Assets/Resources/Languages/Fr/instructions.json +++ b/LORAI/Assets/Resources/Languages/Fr/instructions.json @@ -2,7 +2,7 @@ [ { "instName": "Déploiement Manuel", - "instID": "DG1000", + "instID": "DG070", "content": [ { "instruction": [ diff --git a/LORAI/Assets/Scripts/Common/DGPrefab.cs b/LORAI/Assets/Scripts/Common/DGPrefab.cs index 621eddb..f98ecd6 100644 --- a/LORAI/Assets/Scripts/Common/DGPrefab.cs +++ b/LORAI/Assets/Scripts/Common/DGPrefab.cs @@ -47,9 +47,9 @@ public void Init( CardDescriptor cd ) iconImage.sprite = Resources.Load( $"Cards/Villains/{cd.id.Replace( "DG", "M" )}" ); outline.effectColor = eliteColor; } - else if ( cd.id == "DG1000" )//handle custom group + else if ( cd.id == "DG070" )//handle custom group { - iconImage.sprite = Resources.Load( "Cards/Enemies/Other/M1000" ); + iconImage.sprite = Resources.Load( "Cards/Enemies/Other/M070" ); } else//otherwise it's an ally { @@ -151,7 +151,7 @@ public void RemoveSelf() { //add card back to dep hand ONLY IF IT'S NOT THE CUSTOM GROUP //AND if it's NOT a villain - if ( cardDescriptor.id != "DG1000" && !DataStore.villainCards.cards.Contains( cardDescriptor ) ) + if ( cardDescriptor.id != "DG070" && !DataStore.villainCards.cards.Contains( cardDescriptor ) ) DataStore.deploymentHand.Add( cardDescriptor ); //remove it from deployed list DataStore.deployedEnemies.Remove( cardDescriptor ); diff --git a/LORAI/Assets/Scripts/Common/DataStore.cs b/LORAI/Assets/Scripts/Common/DataStore.cs index b940fe2..339bc0b 100644 --- a/LORAI/Assets/Scripts/Common/DataStore.cs +++ b/LORAI/Assets/Scripts/Common/DataStore.cs @@ -7,7 +7,7 @@ public static class DataStore { - public static readonly string appVersion = "v.1.0.14"; + public static readonly string appVersion = "v.1.0.15"; public static readonly string[] languageCodeList = { "En", "De", "Es", "Fr" }; public static Dictionary> missionCards; diff --git a/LORAI/Assets/Scripts/MainGame/EnemyActivationPopup.cs b/LORAI/Assets/Scripts/MainGame/EnemyActivationPopup.cs index 31c0f25..98b875f 100644 --- a/LORAI/Assets/Scripts/MainGame/EnemyActivationPopup.cs +++ b/LORAI/Assets/Scripts/MainGame/EnemyActivationPopup.cs @@ -1,9 +1,9 @@ -using UnityEngine; -using UnityEngine.UI; -using DG.Tweening; -using TMPro; +using DG.Tweening; using System.Linq; +using TMPro; +using UnityEngine; using UnityEngine.EventSystems; +using UnityEngine.UI; public class EnemyActivationPopup : MonoBehaviour { diff --git a/LORAI/Assets/Scripts/MainGame/GenericChooser.cs b/LORAI/Assets/Scripts/MainGame/GenericChooser.cs index 8d1c81a..429e057 100644 --- a/LORAI/Assets/Scripts/MainGame/GenericChooser.cs +++ b/LORAI/Assets/Scripts/MainGame/GenericChooser.cs @@ -1,11 +1,11 @@ -using UnityEngine; -using UnityEngine.UI; -using DG.Tweening; +using DG.Tweening; using System; -using System.Linq; using System.Collections.Generic; +using System.Linq; using TMPro; +using UnityEngine; using UnityEngine.EventSystems; +using UnityEngine.UI; public class GenericChooser : MonoBehaviour { @@ -47,10 +47,10 @@ public void Show( ChooserMode mode, List cards, Action( cards ); - if ( mode == ChooserMode.DeploymentGroups ) + if ( mode == ChooserMode.DeploymentGroups && !cardDescriptors.Any( x => x.id == "DG070" ) ) cardDescriptors.Add( custom ); OnChangeExpansion( "Core" ); diff --git a/LORAI/Assets/Scripts/Title/GroupToggleContainer.cs b/LORAI/Assets/Scripts/Title/GroupToggleContainer.cs index f07118c..f953b0c 100644 --- a/LORAI/Assets/Scripts/Title/GroupToggleContainer.cs +++ b/LORAI/Assets/Scripts/Title/GroupToggleContainer.cs @@ -48,6 +48,9 @@ public void OnToggle( Toggle toggle ) else previewImage.sprite = Resources.Load( $"Cards/Enemies/{selectedExpansion}/{enemyCards[index].id}" ); + if ( enemyCards[index].id == "DG070" ) + previewImage.gameObject.SetActive( false ); + previewNameText.text = enemyCards[index].name; if ( buttonToggles[index].isOn ) @@ -87,7 +90,11 @@ public void OnChangeExpansion( string expansion ) else if ( groupIndex == 3 ) deploymentCards = DataStore.deploymentCards; + CardDescriptor custom = new CardDescriptor() { cost = 0, expansion = "Other", name = "Custom Group", faction = "None", id = "DG070", ignored = "", priority = 2, rcost = 0, size = 1, tier = 1 }; + enemyCards = deploymentCards.cards.Where( x => x.expansion == expansion ).ToList(); + if ( expansion == "Other" ) + enemyCards.Add( custom ); DeploymentCards prevSelected = DataStore.sessionData.selectedDeploymentCards[groupIndex]; Sprite thumbNail = null; @@ -102,7 +109,7 @@ public void OnChangeExpansion( string expansion ) child.gameObject.SetActive( true );//re-enable the Toggle var id = int.Parse( enemyCards[i].id.Substring( 2 ).TrimStart( '0' ) ); - if ( id <= 69 )//groupIndex != 2 )//if NOT villains + if ( id <= 70 )//groupIndex != 2 )//if NOT villains thumbNail = Resources.Load( $"Cards/Enemies/{selectedExpansion}/{enemyCards[i].id.Replace( "DG", "M" )}" ); else//villain thumb directory thumbNail = Resources.Load( $"Cards/Villains/{enemyCards[i].id.Replace( "DG", "M" )}" ); @@ -110,7 +117,7 @@ public void OnChangeExpansion( string expansion ) //set the thumbnail texture var thumb = child.Find( "Image" ); thumb.GetComponent().sprite = thumbNail; - if ( enemyCards[i].isElite || id > 69 ) + if ( enemyCards[i].isElite || id > 70 ) thumb.GetComponent().color = new Color( 1, .5f, .5f, 1 ); else thumb.GetComponent().color = new Color( 1, 1, 1, 1 ); diff --git a/LORAI/Assets/Scripts/Title/NewGameScreen.cs b/LORAI/Assets/Scripts/Title/NewGameScreen.cs index 476dcf6..2126894 100644 --- a/LORAI/Assets/Scripts/Title/NewGameScreen.cs +++ b/LORAI/Assets/Scripts/Title/NewGameScreen.cs @@ -222,7 +222,10 @@ public void LoadMissionPreset() mercenaryToggle.isOn = DataStore.sessionData.includeMercs; imperialToggle.isOn = DataStore.sessionData.includeImperials; - var allCards = DataStore.deploymentCards.cards.Concat( DataStore.villainCards.cards ); + CardDescriptor custom = new CardDescriptor() { cost = 0, expansion = "Other", name = "Custom Group", faction = "None", id = "DG070", ignored = "", priority = 2, rcost = 0, size = 1, tier = 1 }; + + var allCards = DataStore.deploymentCards.cards.Concat( DataStore.villainCards.cards ).ToList(); + allCards.Add( custom ); DataStore.sessionData.MissionStarting.Clear(); foreach ( var card in mp.initialGroups )