Skip to content
Open
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
10 changes: 9 additions & 1 deletion Source/CombatExtended/Harmony/Harmony_GlobalControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ namespace CombatExtended.HarmonyCE;
internal static class Harmony_GlobalControls
{
private const float magicExtraOffset = 8f;
private static WeatherTracker weatherTracker;
private static Map cachedMap;

private static void Postfix(ref float curBaseY)
{
float offsetXFromOriginalMethod = UI.screenWidth - 200f;
Find.CurrentMap?.GetComponent<WeatherTracker>().DoWindGUI(offsetXFromOriginalMethod + magicExtraOffset, ref curBaseY);
if (cachedMap != Find.CurrentMap)
{
cachedMap = Find.CurrentMap;
weatherTracker = cachedMap.GetComponent<WeatherTracker>();
}

weatherTracker?.DoWindGUI(offsetXFromOriginalMethod + magicExtraOffset, ref curBaseY);
}
}
Loading