Browse Source

Added more fields to ActivityMessageEvents

jamesperet 2 years ago
parent
commit
90835da246
3 changed files with 20 additions and 6 deletions
  1. 1 1
      Readme.md
  2. 18 4
      Runtime/EventManager/ActivityMessageEvents.cs
  3. 1 1
      package.json

+ 1 - 1
Readme.md

@@ -1,4 +1,4 @@
-# 📦 KairoEngine.Core v0.1.8
+# 📦 KairoEngine.Core v0.1.9
 
 This contains the base code that other packages will use. It includes code for the module system, event system and common interfaces.
 

+ 18 - 4
Runtime/EventManager/ActivityMessageEvents.cs

@@ -1,4 +1,5 @@
-using System.Collections;
+using System;
+using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
@@ -39,13 +40,26 @@ namespace KairoEngine.Core
         }
         #endregion
 
+        #region FullMessage
+        public static event System.Action<string, string, string, string, Sprite, float, bool, bool, Action, string, string, string> OnFullMessage;
+        public static void Send(string text, string id, string group, string prefab, Sprite icon, float time, bool sticky, bool hideOnClick, 
+            Action action, string tooltipHeader = "", string tooltipBody = "", string tooltipType = "")
+        {
+            if(OnFullMessage != null)
+            {
+                OnFullMessage(text, id, group, prefab, icon, time, sticky, hideOnClick, action, tooltipHeader, tooltipBody, tooltipType);
+            }
+        }
+        #endregion
+
         #region UpdateMessage
-        public static event System.Action<string, string, float, bool> OnUpdateActivityMessage;
-        public static void Update(string oldText, string newText, float time, bool sticky)
+        public static event System.Action<string, string, Sprite, float, bool, bool, Action, string, string, string> OnUpdateActivityMessage;
+        public static void Update(string id, string newText, Sprite newIcon, float newTime, bool sticky, bool hideOnClick, 
+            Action newAction, string tooltipHeader = "", string tooltipBody = "", string tooltipType = "")
         {
             if(OnUpdateActivityMessage != null)
             {
-                OnUpdateActivityMessage(oldText, newText, time, sticky);
+                OnUpdateActivityMessage(id, newText, newIcon, newTime, sticky, hideOnClick, newAction, tooltipHeader, tooltipBody, tooltipType);
             }
         }
         #endregion

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "at.kairoscope.kairoengine.core",
   "displayName" : "KairoEngine Core",
-  "version": "0.1.8",
+  "version": "0.1.9",
   "unity": "2020.3",
   "description": "Base package for the KairoEngine library by Kairoscope",
   "repository": {