-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from jonathan-robertson/a21
Support A21
- Loading branch information
Showing
16 changed files
with
79 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
<xml> | ||
<ModInfo> | ||
<Name value="Days Remaining" /> | ||
<Description value="Update trader restock date and vending expiration date to show days until vs date of." /> | ||
<Author value="Jonathan Robertson (Kanaverum)" /> | ||
<Version value="0.1.0" /> | ||
<Website value="https://github.com/jonathan-robertson/days-remaining" /> | ||
</ModInfo> | ||
<Name value="kanaverum-days-remaining" /> | ||
<DisplayName value="Days Remaining" /> | ||
<Version value="1.0.0" /> | ||
<Description value="Update trader restock date and vending expiration date to show days until vs date of." /> | ||
<Author value="Jonathan Robertson (Kanaverum)" /> | ||
<Website value="https://github.com/jonathan-robertson/days-remaining" /> | ||
</xml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using HarmonyLib; | ||
using System; | ||
|
||
namespace DaysRemaining.Patches | ||
{ | ||
[HarmonyPatch(typeof(GameManager), "SetWorldTime")] | ||
internal class GameManager_SetWorldTime_Patches | ||
{ | ||
private static readonly ModLog<GameManager_SetWorldTime_Patches> _log = new ModLog<GameManager_SetWorldTime_Patches>(); | ||
|
||
public static void Postfix() | ||
{ | ||
try | ||
{ | ||
var players = GameManager.Instance.World.Players.list; | ||
for (var i = 0; i < players.Count; i++) | ||
{ | ||
if (Helpers.TryGetClientInfo(players[i].entityId, out var clientInfo)) | ||
{ | ||
Helpers.SetExpirationDaysRemaining(clientInfo, players[i]); | ||
} | ||
} | ||
} | ||
catch (Exception e) | ||
{ | ||
_log.Error("Postfix", e); | ||
} | ||
} | ||
} | ||
|
||
[HarmonyPatch(typeof(GameManager), "updateTimeOfDay")] | ||
internal class GameManager_updateTimeOfDay_Patches | ||
{ | ||
private static readonly ModLog<GameManager_updateTimeOfDay_Patches> _log = new ModLog<GameManager_updateTimeOfDay_Patches>(); | ||
|
||
public static void Postfix() | ||
{ | ||
try | ||
{ | ||
var players = GameManager.Instance.World.Players.list; | ||
for (var i = 0; i < players.Count; i++) | ||
{ | ||
if (Helpers.TryGetClientInfo(players[i].entityId, out var clientInfo)) | ||
{ | ||
Helpers.SetExpirationDaysRemaining(clientInfo, players[i]); | ||
} | ||
} | ||
} | ||
catch (Exception e) | ||
{ | ||
_log.Error("Postfix", e); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters