mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 19:39:21 +00:00
Notification mods into one
This commit is contained in:
parent
9869407802
commit
f6d3d05860
8 changed files with 247 additions and 20 deletions
46
ml_egn/Utils.cs
Normal file
46
ml_egn/Utils.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.Networking;
|
||||
using ABI_RC.Core.UI;
|
||||
using DarkRift;
|
||||
|
||||
namespace ml_egn
|
||||
{
|
||||
static class Utils
|
||||
{
|
||||
public static bool IsMenuOpened()
|
||||
{
|
||||
return ((ViewManager.Instance != null) ? ViewManager.Instance.isGameMenuOpen() : false);
|
||||
}
|
||||
|
||||
public static void ShowMenuNotification(string p_message, float p_time = 1f)
|
||||
{
|
||||
if(ViewManager.Instance != null)
|
||||
ViewManager.Instance.TriggerPushNotification(p_message, p_time);
|
||||
}
|
||||
|
||||
public static void ShowMenuAlert(string p_title, string p_message)
|
||||
{
|
||||
if(ViewManager.Instance != null)
|
||||
ViewManager.Instance.TriggerAlert(p_title, p_message, -1, true);
|
||||
}
|
||||
|
||||
public static void ShowHUDNotification(string p_title, string p_message, string p_small = "", bool p_immediate = false)
|
||||
{
|
||||
if(CohtmlHud.Instance != null)
|
||||
{
|
||||
if(p_immediate)
|
||||
CohtmlHud.Instance.ViewDropTextImmediate(p_title, p_message, p_small);
|
||||
else
|
||||
CohtmlHud.Instance.ViewDropText(p_title, p_message, p_small);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsConnected()
|
||||
{
|
||||
bool l_result = false;
|
||||
if((NetworkManager.Instance != null) && (NetworkManager.Instance.GameNetwork != null))
|
||||
l_result = (NetworkManager.Instance.GameNetwork.ConnectionState == ConnectionState.Connected);
|
||||
return l_result;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue