Skip to content

Commit b099a93

Browse files
1.8.0
1 parent 9958d37 commit b099a93

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.8.0] - 2024-04-12
9+
10+
### Changed
11+
12+
- Fixed health & days left HUD to actually reflect the correct value (in real time)
13+
814
## [1.7.1] - 2024-04-12
915

1016
### Changed

ConfigurableWarning.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>netstandard2.1</TargetFramework>
55
<AssemblyName>ConfigurableWarning</AssemblyName>
66
<Description>Makes the game configurable!</Description>
7-
<Version>1.7.1</Version>
7+
<Version>1.8.0</Version>
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
99
<LangVersion>latest</LangVersion>
1010
<NoWarn>$(NoWarn);CS0436</NoWarn>

Source/Patches/UIPatches.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using HarmonyLib;
2+
3+
namespace ConfigurableWarning.Patches {
4+
[HarmonyPatch]
5+
internal class UIPatches {
6+
[HarmonyPostfix]
7+
[HarmonyPatch(typeof(UI_Health), nameof(UI_Health.Update))]
8+
internal static void UpdateHealth(UI_Health __instance) {
9+
__instance.fill.fillAmount = Player.localPlayer.data.health / Plugin.Instance.PluginConfig.maxHealth.Value;
10+
}
11+
12+
[HarmonyPostfix]
13+
[HarmonyPatch(typeof(UI_DaysLeft), nameof(UI_DaysLeft.Update))]
14+
internal static void UpdateDaysLeft(UI_DaysLeft __instance) {
15+
int num = Plugin.Instance.PluginConfig.daysPerQuota.Value - SurfaceNetworkHandler.RoomStats.CurrentQuotaDay + 1;
16+
17+
__instance.text.text = (num == 1) ? __instance.m_LastDayText : __instance.m_DaysLeftText.Replace("{0}", num.ToString());
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)