mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 18:47:55 +08:00
feat: event/pool display follows current time
This commit is contained in:
@@ -2575,10 +2575,23 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
if (File.Exists(jsonPath))
|
||||
{
|
||||
JObject versionJson = (JObject)JsonConvert.DeserializeObject(File.ReadAllText(jsonPath));
|
||||
var currentTime = (ulong)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
var poolTime = (ulong)versionJson?["gacha"]["time"];
|
||||
var activityTime = (ulong)versionJson?["activity"]["time"];
|
||||
|
||||
if (poolTime > activityTime)
|
||||
if ((currentTime < poolTime) && (currentTime < activityTime))
|
||||
{
|
||||
versionName = string.Empty;
|
||||
}
|
||||
else if ((currentTime >= poolTime) && (currentTime < activityTime))
|
||||
{
|
||||
versionName = versionJson?["gacha"]?["pool"]?.ToString() ?? string.Empty;
|
||||
}
|
||||
else if ((currentTime < poolTime) && (currentTime >= activityTime))
|
||||
{
|
||||
versionName = versionJson?["activity"]?["name"]?.ToString() ?? string.Empty;
|
||||
}
|
||||
else if (poolTime > activityTime)
|
||||
{
|
||||
versionName = versionJson?["gacha"]?["pool"]?.ToString() ?? string.Empty;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user