Updated notifier system

This commit is contained in:
SamSWAT 2022-01-06 22:35:28 +03:00
parent 888cd5871d
commit 2a98eceb43
2 changed files with 6 additions and 4 deletions

1
.gitignore vendored
View File

@ -478,3 +478,4 @@ dkms.conf
/project/SamSWAT.TimeWeatherChanger/Key.snk
/project/Shared/Keys
/project/SamSWAT.TimeWeatherChanger/SamSWAT.TimeWeatherChanger.sln

View File

@ -2,12 +2,12 @@
using UnityEngine;
using EFT;
using EFT.UI;
using EFT.Communications;
using EFT.Weather;
using Comfort.Common;
using RegexCMD = GClass2296;
using GameDateTime = GClass1258;
using Notifier = GClass1691;
using NotifierParams = GClass1690;
using CursorSettings = GClass2299;
using Random = UnityEngine.Random;
@ -51,7 +51,7 @@ namespace SamSWAT.TimeWeatherChanger
if (gameWorld == null)
{
string log = "In order to change the weather, you have to go in a raid first.";
Notifier.DisplayNotification(new NotifierParams(log));
Notifier.DisplayWarningNotification(log, ENotificationDurationType.Long);
PreloaderUI.Instance.Console.AddLog(" " + log, "[TWChanger]:");
}
else
@ -59,7 +59,7 @@ namespace SamSWAT.TimeWeatherChanger
if (GameObject.Find("Weather") == null)
{
string log = "An error occurred when executing command, seems like you are either in the hideout or factory.";
Notifier.DisplayNotification(new NotifierParams(log));
Notifier.DisplayWarningNotification(log, ENotificationDurationType.Default);
PreloaderUI.Instance.Console.AddLog(" " + log, "[TWChanger]:");
}
else
@ -108,7 +108,7 @@ namespace SamSWAT.TimeWeatherChanger
if (GameObject.Find("Weather") == null)
{
//Notify player with bottom-right error popup
Notifier.DisplayNotification(new NotifierParams("An error occurred when opening weather panel, seems like you are either in the hideout or factory."));
Notifier.DisplayWarningNotification("An error occurred when opening weather panel, seems like you are either in the hideout or factory.");
}
else
{
@ -185,6 +185,7 @@ namespace SamSWAT.TimeWeatherChanger
modifiedDateTime = currentDateTime.AddHours((double)targetTimeHours - currentDateTime.Hour);
modifiedDateTime = modifiedDateTime.AddMinutes((double)targetTimeMinutes - currentDateTime.Minute);
gameDateTime.Reset(modifiedDateTime);
Notifier.DisplayMessageNotification("Time was set to: " + modifiedDateTime.ToString("HH:mm"));
Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.MenuInspectorWindowClose);
}