Skip to content

Commit

Permalink
Compatibility for Rail Route update 10
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfCYBER committed Feb 18, 2023
1 parent 123b4c0 commit f51eb21
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Heatmap/Heatmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public override CachedLocalizedString Description
private GameObject _timerObject;
private int _timerIteration = 0; // tracks how often the timer has elapsed

private InputAction _actionToggleHeatmap
private readonly InputAction _actionToggleHeatmap
= new InputAction("Toggle Heatmap", type: InputActionType.Button, binding: "<Keyboard>/h");

/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions Heatmap/UI/SettingsPanel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Game;
using Game.Context;
using Heatmap.IO;
using Heatmap.Unity;
using UnityEngine;
Expand Down Expand Up @@ -83,7 +84,7 @@ private void InitializeValues()
public static void Show()
{
Log("Opening settings panel", LogLevel.Info);
Instance = new SettingsPanel(GameController.Current.UiCanvas.gameObject);
Instance = new SettingsPanel(Ctx.Deps.GameButtons.GetComponentInParent<Canvas>().gameObject);
}

public static void Destroy()
Expand Down
2 changes: 1 addition & 1 deletion Heatmap/UI/ToolbarButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ToolbarButton
public ToolbarButton()
{
// Find the button that will be copied, and the layoutgroup it is in
GameButton sourceButton = Ctx.Deps.GameButtons.ContractsButtonHolder;
GameButton sourceButton = Ctx.Deps.GameButtons.ContractsButton.GetComponentInParent<GameButton>();
VerticalLayoutGroup buttonGroup = sourceButton.GetComponentInParent<VerticalLayoutGroup>();

// Copy the button and add it to the layoutgroup
Expand Down
3 changes: 2 additions & 1 deletion Heatmap/UI/Tooltip.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using Game;
using Game.Context;
using Heatmap.Unity;
using TMPro;
using UnityEngine;
Expand Down Expand Up @@ -37,7 +38,7 @@ public static void Show()
// Create a tooltip if it does not exist
if (_tooltipInstance == null)
{
Canvas uiCanvas = GameController.Current.UiCanvas;
Canvas uiCanvas = Ctx.Deps.GameButtons.GetComponentInParent<Canvas>();
_tooltipInstance = UnityEngine.Object.Instantiate(_prefab,
uiCanvas.transform, worldPositionStays: false);
_tooltipInstance.GetComponent<TooltipManager>().CanvasRect =
Expand Down

0 comments on commit f51eb21

Please sign in to comment.