void ToggleWindows(AdminChatWindow window) { adminPlayerChat.gameObject.SetActive(false); adminToAdminChat.gameObject.SetActive(false); playerPrayerWindow.gameObject.SetActive(false); switch (window) { case AdminChatWindow.AdminPlayerChat: adminPlayerChat.gameObject.SetActive(true); SelectedWindow = AdminChatWindow.AdminPlayerChat; break; case AdminChatWindow.AdminToAdminChat: adminToAdminChat.gameObject.SetActive(true); SelectedWindow = AdminChatWindow.AdminToAdminChat; break; case AdminChatWindow.PrayerWindow: playerPrayerWindow.gameObject.SetActive(true); SelectedWindow = AdminChatWindow.PrayerWindow; break; default: SelectedWindow = AdminChatWindow.None; break; } if (WindowChangeEvent != null) { WindowChangeEvent.Invoke(SelectedWindow); } }
public void ClientUpdateNotifications(string notificationKey, AdminChatWindow targetWindow, int amt, bool clearAll) { switch (targetWindow) { case AdminChatWindow.AdminPlayerChat: if (clearAll) { playerNotification.RemoveNotification(notificationKey); if (amt == 0) { return; } } //No need to update notification if the player is already selected in admin chat if (adminChatWindows.SelectedWindow == AdminChatWindow.AdminPlayerChat) { if (adminChatWindows.adminPlayerChat.SelectedPlayer != null && adminChatWindows.adminPlayerChat.SelectedPlayer.uid == notificationKey) { break; } } playerNotification.AddNotification(notificationKey, amt); break; case AdminChatWindow.AdminToAdminChat: if (clearAll) { adminNotification.RemoveNotification(notificationKey); if (amt == 0) { return; } } if (adminChatWindows.adminToAdminChat.gameObject.activeInHierarchy) { return; } adminNotification.AddNotification(notificationKey, amt); break; case AdminChatWindow.PrayerWindow: if (clearAll) { prayerNotification.AddNotification(notificationKey, amt); } prayerNotification.AddNotification(notificationKey, amt); break; } }
void ToggleButtons(AdminChatWindow selectedWindow) { if (adminChatButton != null) { adminChatButton.image.color = unSelectedColor; } if (mentorChatButton != null) { mentorChatButton.image.color = unSelectedColor; } if (playerChatButton != null) { playerChatButton.image.color = unSelectedColor; } if (prayerWindowButton != null) { prayerWindowButton.image.color = unSelectedColor; } switch (selectedWindow) { case AdminChatWindow.AdminPlayerChat: if (playerChatButton != null) { playerChatButton.image.color = selectedColor; } break; case AdminChatWindow.MentorPlayerChat: if (mentorChatButton != null) { mentorChatButton.image.color = selectedColor; } break; case AdminChatWindow.AdminToAdminChat: if (adminChatButton != null) { adminChatButton.image.color = selectedColor; } break; case AdminChatWindow.PrayerWindow: if (prayerWindowButton != null) { prayerWindowButton.image.color = selectedColor; } break; } }
/// <summary> /// Send notification updates to all admins /// </summary> public static NetMessage SendToAll(string notificationKey, AdminChatWindow targetWindow, int amt, bool clearAll = false) { NetMessage msg = new NetMessage { NotificationKey = notificationKey, TargetWindow = targetWindow, Amount = amt, ClearAll = clearAll, IsFullUpdate = false, FullUpdateJson = "" }; SendToAll(msg); return(msg); }
/// <summary> /// Send notification updates to all admins /// </summary> public static AdminChatNotifications SendToAll(string notificationKey, AdminChatWindow targetWindow, int amt, bool clearAll = false) { AdminChatNotifications msg = new AdminChatNotifications { NotificationKey = notificationKey, TargetWindow = targetWindow, Amount = amt, ClearAll = clearAll, IsFullUpdate = false, FullUpdateJson = "" }; msg.SendToAll(); return(msg); }
void ToggleButtons(AdminChatWindow selectedWindow) { adminChatButton.image.color = unSelectedColor; playerChatButton.image.color = unSelectedColor; prayerWindowButton.image.color = unSelectedColor; switch (selectedWindow) { case AdminChatWindow.AdminPlayerChat: playerChatButton.image.color = selectedColor; break; case AdminChatWindow.AdminToAdminChat: adminChatButton.image.color = selectedColor; break; case AdminChatWindow.PrayerWindow: prayerWindowButton.image.color = selectedColor; break; } }
void OnAdminChatWindowChange(AdminChatWindow selectedWindow) { ToggleButtons(selectedWindow); }