Skip to content

Commit

Permalink
*fix for unlimited resized logos
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphyum committed Jul 14, 2018
1 parent b726abe commit b123028
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions InnerSphereMap/InnerSphereMap/HolderClasses.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using BattleTech;
using BattleTech.Framework;
using System.Collections.Generic;
using UnityEngine;

namespace InnerSphereMap {
public class Settings {
Expand Down Expand Up @@ -35,6 +36,7 @@ public class Settings {

public class Fields {
public static float cbill = 0;
public static Transform originalTransform = null;
}

public struct PotentialContract {
Expand Down
7 changes: 6 additions & 1 deletion InnerSphereMap/InnerSphereMap/Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ static void Postfix(StarmapRenderer __instance) {
restorationLogo?.SetActive(false);

GameObject go;
if(Fields.originalTransform == null) {
Fields.originalTransform = UnityEngine.Object.Instantiate(__instance.restorationLogo).transform;
}
Texture2D texture2D2;
byte[] data;
if (GameObject.Find("davionLogoMap") == null) {
Expand Down Expand Up @@ -513,7 +516,9 @@ public static class StarmapRenderer_PlaceLogo_Patch {

static void Postfix(StarmapRenderer __instance, Faction faction, GameObject logo) {
try{
logo.transform.localScale += new Vector3(10f, 10f, 10f);
if(logo.transform.localScale == Fields.originalTransform.localScale) {
logo.transform.localScale += new Vector3(10f, 10f, 10f);
}
}
catch (Exception e) {
Logger.LogError(e);
Expand Down

0 comments on commit b123028

Please sign in to comment.