-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ClonkAndre/dev
Move dev into main
- Loading branch information
Showing
26 changed files
with
3,434 additions
and
32 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System; | ||
|
||
using DiscordRPC.Logging; | ||
|
||
namespace IVPresence.Classes | ||
{ | ||
internal class DiscordLogger : ILogger | ||
{ | ||
|
||
#region Properties | ||
/// <summary> | ||
/// The level of logging to apply to this logger. | ||
/// </summary> | ||
public LogLevel Level { get; set; } | ||
#endregion | ||
|
||
#region Constructor | ||
public DiscordLogger(LogLevel logLevel) | ||
{ | ||
Level = logLevel; | ||
} | ||
public DiscordLogger() | ||
{ | ||
Level = LogLevel.Info; | ||
} | ||
#endregion | ||
|
||
public void Trace(string message, params object[] args) | ||
{ | ||
if (Level <= LogLevel.Trace) | ||
{ | ||
string text = "TRACE: " + message; | ||
Logging.LogDebug(text, args); | ||
} | ||
} | ||
public void Info(string message, params object[] args) | ||
{ | ||
if (Level <= LogLevel.Info) | ||
{ | ||
string text = "INFO: " + message; | ||
Logging.Log(text, args); | ||
} | ||
} | ||
public void Warning(string message, params object[] args) | ||
{ | ||
if (Level <= LogLevel.Warning) | ||
{ | ||
string text = "WARN: " + message; | ||
Logging.LogWarning(text, args); | ||
} | ||
} | ||
public void Error(string message, params object[] args) | ||
{ | ||
if (Level <= LogLevel.Error) | ||
{ | ||
string text = "ERR : " + message; | ||
Logging.LogError(text, args); | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace IVPresence.Classes.Json | ||
{ | ||
internal class CustomInterior | ||
{ | ||
|
||
#region Variables | ||
public int ModelIndex; | ||
public string LargeImageKey; | ||
public string DisplayName; | ||
public string CustomDetailPresence; | ||
#endregion | ||
|
||
#region Constructor | ||
public CustomInterior() | ||
{ | ||
|
||
} | ||
#endregion | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace IVPresence.Classes.Json | ||
{ | ||
internal class CustomRichPresence | ||
{ | ||
|
||
#region Variables | ||
public string LargeImageKey; | ||
public string LargeImageText; | ||
#endregion | ||
|
||
#region Constructor | ||
public CustomRichPresence() | ||
{ | ||
|
||
} | ||
#endregion | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace IVPresence.Classes.Json | ||
{ | ||
internal class EpisodeInfo | ||
{ | ||
|
||
#region Variables | ||
public int ID; | ||
public bool IsBaseEpisode; | ||
public string ProtagonistName; | ||
public string ProtagonistImageKey; | ||
#endregion | ||
|
||
#region Constructor | ||
public EpisodeInfo() | ||
{ | ||
|
||
} | ||
#endregion | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Numerics; | ||
|
||
namespace IVPresence.Classes.Json | ||
{ | ||
internal class PredefinedLocations | ||
{ | ||
|
||
#region Variables | ||
public string ID; | ||
public TriggerRange RangeTrigger; | ||
//public TriggerBox BoxTrigger; | ||
public CustomRichPresence CustomRichPresence; | ||
#endregion | ||
|
||
#region Constructor | ||
/// <summary> | ||
/// A constructor which sets up this <see cref="PredefinedLocations"/> for a <see cref="TriggerRange"/>. | ||
/// </summary> | ||
/// <param name="id">Just an indentifier for this location so its easier to debug.</param> | ||
/// <param name="pos">The target position.</param> | ||
/// <param name="triggerRange">The target range around the given position.</param> | ||
public PredefinedLocations(string id, Vector3 pos, float triggerRange) | ||
{ | ||
ID = id; | ||
RangeTrigger = new TriggerRange(pos, triggerRange); | ||
} | ||
///// <summary> | ||
///// A constructor which sets up this <see cref="PredefinedLocations"/> for a <see cref="TriggerBox"/>. | ||
///// </summary> | ||
///// <param name="id">Just an indentifier for this location so its easier to debug.</param> | ||
///// <param name="pos1">The upper-left position for a 3D box.</param> | ||
///// <param name="pos2">The lower-right position for a 3D box.</param> | ||
//public PredefinedLocations(string id, Vector3 pos1, Vector3 pos2) | ||
//{ | ||
// ID = id; | ||
// BoxTrigger = new TriggerBox(pos1, pos2); | ||
//} | ||
/// <summary> | ||
/// Default constructor. | ||
/// </summary> | ||
public PredefinedLocations() | ||
{ | ||
|
||
} | ||
#endregion | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace IVPresence.Classes.Json | ||
{ | ||
internal class RadioInfo | ||
{ | ||
|
||
#region Variables | ||
public string RawName; | ||
public string DisplayName; | ||
#endregion | ||
|
||
#region Constructor | ||
public RadioInfo() | ||
{ | ||
|
||
} | ||
#endregion | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Numerics; | ||
|
||
namespace IVPresence.Classes.Json | ||
{ | ||
internal class TriggerBox | ||
{ | ||
|
||
#region Variables | ||
public Vector3 Pos1; | ||
public Vector3 Pos2; | ||
#endregion | ||
|
||
#region Constructor | ||
public TriggerBox(Vector3 pos1, Vector3 pos2) | ||
{ | ||
Pos1 = pos1; | ||
Pos2 = pos2; | ||
} | ||
public TriggerBox() | ||
{ | ||
|
||
} | ||
#endregion | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Numerics; | ||
|
||
namespace IVPresence.Classes.Json | ||
{ | ||
internal class TriggerRange | ||
{ | ||
|
||
#region Variables | ||
public Vector3 Position; | ||
public float Range; | ||
#endregion | ||
|
||
#region Constructor | ||
public TriggerRange(Vector3 pos, float range) | ||
{ | ||
Position = pos; | ||
Range = range; | ||
} | ||
public TriggerRange() | ||
{ | ||
|
||
} | ||
#endregion | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using IVSDKDotNet; | ||
|
||
namespace IVPresence.Classes | ||
{ | ||
internal class Logging | ||
{ | ||
|
||
public static void Log(string str, params object[] args) | ||
{ | ||
IVGame.Console.Print(string.Format("[IVPresence] {0}", string.Format(str, args))); | ||
} | ||
public static void LogWarning(string str, params object[] args) | ||
{ | ||
IVGame.Console.PrintWarning(string.Format("[IVPresence] {0}", string.Format(str, args))); | ||
} | ||
public static void LogError(string str, params object[] args) | ||
{ | ||
IVGame.Console.PrintError(string.Format("[IVPresence] {0}", string.Format(str, args))); | ||
} | ||
|
||
public static void LogDebug(string str, params object[] args) | ||
{ | ||
#if DEBUG | ||
IVGame.Console.Print(string.Format("[IVPresence] [DEBUG] {0}", string.Format(str, args))); | ||
#endif | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using IVSDKDotNet; | ||
|
||
namespace IVPresence.Classes | ||
{ | ||
internal class ModSettings | ||
{ | ||
|
||
#region Variables | ||
// General | ||
public static bool LogErrorsToConsole; | ||
public static bool AllowOtherModsToSetPresence; | ||
public static bool ShowPresenceOfOtherMods; | ||
|
||
// Credits | ||
public static bool ShowStatistics; | ||
|
||
// Network | ||
public static bool ShowNetworkKillerName; | ||
#endregion | ||
|
||
public static void Load(SettingsFile settingsFile) | ||
{ | ||
// General | ||
LogErrorsToConsole = settingsFile.GetBoolean("General", "LogErrorsToConsole", true); | ||
AllowOtherModsToSetPresence = settingsFile.GetBoolean("General", "AllowOtherModsToSetPresence", true); | ||
ShowPresenceOfOtherMods = settingsFile.GetBoolean("General", "ShowPresenceOfOtherMods", true); | ||
|
||
// Credits | ||
ShowStatistics = settingsFile.GetBoolean("Credits", "ShowStatistics", true); | ||
|
||
// Network | ||
ShowNetworkKillerName = settingsFile.GetBoolean("Network", "ShowNetworkKillerName", true); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
namespace IVPresence | ||
{ | ||
|
||
internal enum TextState | ||
{ | ||
Default = 0, | ||
State1 = 1, | ||
State2 = 2, | ||
State3 = 3, | ||
State4 = 4, | ||
State5 = 5, | ||
State6 = 6, | ||
State7 = 7, | ||
State8 = 8, | ||
State9 = 9, | ||
State10 = 10, | ||
MAX | ||
} | ||
|
||
internal enum CauseOfDeath | ||
{ | ||
Unknown, | ||
FallingDamage, | ||
FleeingFromCops, | ||
FightingCops, | ||
Headshot, | ||
Fire, | ||
Explosion, | ||
ExplosionNoobtubed, | ||
ExplodingCar, | ||
ExplodingBike, | ||
ExplodingTruck, | ||
ExplodingPetrolPump, | ||
} | ||
|
||
internal enum GasStation | ||
{ | ||
None, | ||
Ron, | ||
GlobeOil, | ||
Terroil | ||
} | ||
|
||
} |
Oops, something went wrong.