aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-02-25 10:07:28 -0500
committerlempamo <[email protected]>2017-02-25 10:07:28 -0500
commit046560fe991f439c8cc45e8e355bf9f801e514ac (patch)
treee8c14c7cfbc192d2e0cf60e3faef32d24b86ba0c /ShiftOS_TheReturn
parent271c973c3f1de0afd96a4ad3d0e0ed43b5e1b4f8 (diff)
parent413a7da898716d43711dcfe99791b329bb6d866b (diff)
downloadshiftos_thereturn-046560fe991f439c8cc45e8e355bf9f801e514ac.tar.gz
shiftos_thereturn-046560fe991f439c8cc45e8e355bf9f801e514ac.tar.bz2
shiftos_thereturn-046560fe991f439c8cc45e8e355bf9f801e514ac.zip
Merge remote-tracking branch 'refs/remotes/shiftos-game/master'
Diffstat (limited to 'ShiftOS_TheReturn')
-rw-r--r--ShiftOS_TheReturn/NotificationDaemon.cs19
-rw-r--r--ShiftOS_TheReturn/SaveSystem.cs5
2 files changed, 16 insertions, 8 deletions
diff --git a/ShiftOS_TheReturn/NotificationDaemon.cs b/ShiftOS_TheReturn/NotificationDaemon.cs
index 3a2e96a..3ea8a54 100644
--- a/ShiftOS_TheReturn/NotificationDaemon.cs
+++ b/ShiftOS_TheReturn/NotificationDaemon.cs
@@ -45,6 +45,15 @@ namespace ShiftOS.Engine
notes[note].Read = true;
WriteNotes(notes);
}
+
+ public static int GetUnreadCount()
+ {
+ int c = 0;
+ foreach (var note in GetAllFromFile())
+ if (note.Read == false)
+ c++; //gahh I hate that programming language.
+ return c;
+ }
}
public struct Notification
@@ -57,13 +66,13 @@ namespace ShiftOS.Engine
Timestamp = DateTime.Now;
}
- public bool Read { get; internal set; }
- public NotificationType Type { get; private set; }
- public object Data { get; private set; }
- public DateTime Timestamp { get; private set; }
+ public bool Read { get; set; }
+ public NotificationType Type { get; set; }
+ public object Data { get; set; }
+ public DateTime Timestamp { get; set; }
}
- public enum NotificationType : byte
+ public enum NotificationType
{
Generic = 0x00,
MemoReceived = 0x10,
diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs
index fb7070a..9ae18a9 100644
--- a/ShiftOS_TheReturn/SaveSystem.cs
+++ b/ShiftOS_TheReturn/SaveSystem.cs
@@ -209,8 +209,7 @@ namespace ShiftOS.Engine
public static void TransferCodepointsToVoid(int amount)
{
CurrentSave.Codepoints -= amount;
- if(!Shiftorium.Silent)
- Console.WriteLine($"{{SHIFTORIUM_TRANSFERRED_TO}}: {amount} -> sys");
+ NotificationDaemon.AddNotification(NotificationType.CodepointsSent, amount);
}
public static void Restart()
@@ -302,7 +301,7 @@ namespace ShiftOS.Engine
public static void TransferCodepointsFrom(string who, int amount)
{
- Console.WriteLine($"{{SHIFTORIUM_TRANSFERRED_FROM}}: {amount} <- {who}");
+ NotificationDaemon.AddNotification(NotificationType.CodepointsReceived, amount);
CurrentSave.Codepoints += amount;
}
}