Skip to content

Commit

Permalink
remove debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
silentstorm committed Feb 16, 2023
1 parent 09145dd commit 7818486
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 37 deletions.
21 changes: 1 addition & 20 deletions AssetLoadingPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,12 @@ public static void Postfix(string name,ref Sprite __result){
public class AudioFactoryStart_Patch{
[HarmonyPostfix]
public static void Postfix(AudioFactory __instance){
Log("audio");
foreach(string bundlePath in Directory.GetFiles(BundleDir)){
if(bundlePath.EndsWith("clips")){
try{
Log(1);
AssetBundleCreateRequest bundleCreateReq=AssetBundle.LoadFromFileAsync(bundlePath);
Log(bundleCreateReq.isDone);
Log(2);
AssetBundle bundle=bundleCreateReq.assetBundle;
Log(bundle==null);
Log(3);
foreach(var thing in bundle.AllAssetNames()){
Log(thing);
}
Log(4);
AssetBundleRequest bundleReq=bundle.LoadAllAssetsAsync<AudioClip>();
Log(4.1f);
Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray<uObject>assets=bundleReq.allAssets;
Log(5);
foreach(uObject asset in assets){
Log(6);
foreach(uObject asset in AssetBundle.LoadFromFileAsync(bundlePath).assetBundle.LoadAllAssetsAsync<AudioClip>().allAssets){
__instance.RegisterAudioClip(asset.name,asset.Cast<AudioClip>());
Log(7);
}
Log(8);
}catch(Exception error){
Log("Failed to add audio clips from "+bundlePath);
string message=error.Message;
Expand Down
5 changes: 0 additions & 5 deletions MiscPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ public class HarmonyPatches{
public class Btd6PlayerCheckForNewParagonPipEvent_Patch{
[HarmonyPrefix]
public static bool Prefix(){
Log("pip");
return false;
}
}
[HarmonyPatch(typeof(ProfileModel),"Validate")]
public class ProfileModelValidate_Patch{
[HarmonyPostfix]
public static void Postfix(ProfileModel __instance){
Log("profile");
foreach(KeyValuePair<string,SC2Tower>sc2tower in TowerTypes){
try{
SC2Tower tower=sc2tower.Value;
Expand All @@ -36,7 +34,6 @@ public static void Postfix(ProfileModel __instance){
public class TitleScreenStart_Patch{
[HarmonyPostfix]
public static void Postfix(){
Log("title");
try{
gameModel=Game.instance.model;
LocManager=LocalizationManager.Instance;
Expand Down Expand Up @@ -85,10 +82,8 @@ public static void Postfix(){
if(tower.AddToShop){
towerSet.Add(tower.ShopDetails());
}
Log(tower.Name+" "+tower.Upgradable);
if(tower.Upgradable){
foreach(UpgradeModel upgrade in tower.UpgradeModels){
Log(upgrade.name);
upgrades.Add(upgrade);
}
}
Expand Down
2 changes: 1 addition & 1 deletion ModHelperData.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace SC2ExpansionLoader{
public static class ModHelperData{
public const string WorksOnVersion="34.3";
public const string Version="2.5.0";
public const string Version="2.5.1";
public const string Name="SC2ExpansionLoader";
public const string Description="Loader for any SC2Expansion mods, this mod adds nothing by itself. Will be automatically downloaded if required";
public const string RepoOwner = "Onixiya";
Expand Down
2 changes: 0 additions & 2 deletions TowerPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public static void Postfix(Weapon __instance){
public class SimulationRoundStart_Patch{
[HarmonyPostfix]
public static void Postfix(){
Log(1);
foreach(SC2Tower tower in TowerTypes.Values){
try{
tower.RoundStart();
Expand All @@ -40,7 +39,6 @@ public static void Postfix(){
public class SimulationRoundEnd_Patch{
[HarmonyPostfix]
public static void Postfix(){
Log(1);
foreach(SC2Tower tower in TowerTypes.Values){
try{
tower.RoundEnd();
Expand Down
9 changes: 0 additions & 9 deletions UpgradeMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,31 +137,22 @@ public void Start(){
[HideFromIl2Cpp]
public void SetRowUp(List<Button>buttons){
for(int i=0;i<CurrentTower.MaxTier;i++){
Log(i+" "+CurrentTower.Name);
Button button=buttons[i];
Log(1);
UpgradeModel upgrade=CurrentTower.UpgradeModels[i];
Log(2);
string iconAsset=upgrade.icon.guidRef.Split('[')[1];
Log(3);
iconAsset=iconAsset.Remove(iconAsset.Length-1);
Texture2D texture=LoadAsset<Texture2D>(iconAsset,CurrentTower.LoadedBundle).Cast<Texture2D>();
button.image.sprite=Sprite.Create(texture,new(0,0,texture.width,texture.height),new());
button.GetComponentInChildren<Il2CppTMPro.TextMeshProUGUI>().text=upgrade.name;
UpgradeMenuButton upgradeButton=button.gameObject.AddComponent<UpgradeMenuButton>();
upgradeButton.Cost=upgrade.cost;
upgradeButton.Description=LocManager.GetText(upgrade.name+" Description");
Log(4);
Log(CurrentTower.TowerModels[i+1].portrait.guidRef);
string thing=CurrentTower.TowerModels[i+1].portrait.guidRef;
Log(5);
string portraitAsset=thing.Split('[')[1];
Log(6);
portraitAsset=portraitAsset.Remove(portraitAsset.Length-1);
upgradeButton.PortraitAsset=portraitAsset;
upgradeButton.Menu=this;
button.gameObject.SetActive(true);
Log(7);
}
}
public static System.Collections.IEnumerator Show(UpgradeMenuCom menu){
Expand Down

0 comments on commit 7818486

Please sign in to comment.