-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMod.cs
41 lines (35 loc) · 1.24 KB
/
Mod.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Mod.cs
// Copyright Karel Kroeze, 2017-2017
using RimWorld;
using RimWorld.Planet;
using UnityEngine;
using Verse;
using Verse.Sound;
namespace FollowMe {
public class Mod: Verse.Mod {
public static Settings Settings { get; private set; }
public Mod(ModContentPack content) : base(content) {
Settings = GetSettings<Settings>();
}
public override string SettingsCategory() {
return "Fluffy.FollowMe".Translate();
}
public override void DoSettingsWindowContents(Rect inRect) {
Settings.DoWindowContents(inRect);
}
public static void DoMessage(string message, MessageTypeDef type) {
DoMessage(message, type, TargetInfo.Invalid);
}
public static void DoMessage(string message, MessageTypeDef type, GlobalTargetInfo target) {
if (Settings.showNotifications) {
if (Settings.playSounds) {
Messages.Message(message, target, type);
} else {
Messages.Message(message, target, MessageTypeDefOf.SilentInput);
}
} else if (Settings.playSounds) {
type.sound.PlayOneShotOnCamera();
}
}
}
}