Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions BetterStats/BetterStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,29 +274,29 @@ private static EnhancedUIProductEntryElements EnhanceUIProductEntry(UIProductEnt
__instance.consumeUnitLabel.GetComponent<RectTransform>().anchoredPosition = new Vector2(initialXOffset + valuesWidth + 4, -4);

var maxProductionLabel = CopyText(__instance.productLabel, new Vector2(maxOffset, 0));
maxProductionLabel.text = "Theoretical max";
maxProductionLabel.text = "Theoretical Max".Translate();
var maxProductionValue = CopyText(__instance.productText, new Vector2(maxOffset, 0));
maxProductionValue.text = "0";
var maxProductionUnit = CopyText(__instance.productUnitLabel, new Vector2(maxOffset, 0));
maxProductionUnit.text = "/min";

var maxConsumptionLabel = CopyText(__instance.consumeLabel, new Vector2(maxOffset, 0));
maxConsumptionLabel.text = "Theoretical max";
maxConsumptionLabel.text = "Theoretical Max".Translate();
var maxConsumptionValue = CopyText(__instance.consumeText, new Vector2(maxOffset, 0));
maxConsumptionValue.text = "0";
var maxConsumptionUnit = CopyText(__instance.consumeUnitLabel, new Vector2(maxOffset, 0));
maxConsumptionUnit.text = "/min";

var counterProductionLabel = CopyText(__instance.productLabel, new Vector2(-initialXOffset, 0));
counterProductionLabel.GetComponent<RectTransform>().sizeDelta = new Vector2(60, 40);
counterProductionLabel.text = "Producers";
counterProductionLabel.text = "Producers".Translate();
var counterProductionValue = CopyText(__instance.productText, new Vector2(-initialXOffset, 0));
counterProductionValue.GetComponent<RectTransform>().sizeDelta = new Vector2(60, 40);
counterProductionValue.text = "0";

var counterConsumptionLabel = CopyText(__instance.consumeLabel, new Vector2(-initialXOffset, 0));
counterConsumptionLabel.GetComponent<RectTransform>().sizeDelta = new Vector2(60, 40);
counterConsumptionLabel.text = "Consumers";
counterConsumptionLabel.text = "Consumers".Translate();
var counterConsumptionValue = CopyText(__instance.consumeText, new Vector2(-initialXOffset, 0));
counterConsumptionValue.GetComponent<RectTransform>().sizeDelta = new Vector2(60, 40);
counterConsumptionValue.text = "0";
Expand Down Expand Up @@ -337,8 +337,12 @@ public static void UIStatisticsWindow__OnOpen_Postfix(UIStatisticsWindow __insta
if (favoritesLabel != null)
{
favoritesLabel.SetActive(false);
Console.WriteLine($"favorites label set inactive");
}
else
{
Console.WriteLine($"favorites label not found");
}

sprOn = Sprite.Create(texOn, new Rect(0, 0, texOn.width, texOn.height), new Vector2(0.5f, 0.5f));
sprOff = Sprite.Create(texOff, new Rect(0, 0, texOff.width, texOff.height), new Vector2(0.5f, 0.5f));

Expand Down Expand Up @@ -378,7 +382,7 @@ public static void UIStatisticsWindow__OnOpen_Postfix(UIStatisticsWindow __insta
rectTxt.anchoredPosition = new Vector2(20, 0);

Text text = rectTxt.gameObject.AddComponent<Text>();
text.text = "Display /sec";
text.text = "Display /sec".Translate();
text.fontStyle = FontStyle.Normal;
text.fontSize = 14;
text.verticalOverflow = VerticalWrapMode.Overflow;
Expand Down Expand Up @@ -427,7 +431,7 @@ public static void UIStatisticsWindow__OnOpen_Postfix(UIStatisticsWindow __insta
_placeholder.alignment = TextAnchor.MiddleLeft;
_placeholder.supportRichText = false;
_placeholder.horizontalOverflow = HorizontalWrapMode.Overflow;
_placeholder.text = "Filter";
_placeholder.text = "Filter".Translate();
(_placeholder.transform as RectTransform).sizeDelta = new Vector2(90, 30);
(_placeholder.transform as RectTransform).anchoredPosition = new Vector2(5, 0);

Expand Down
2 changes: 1 addition & 1 deletion BetterStats/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

Expand Down