Skip to content

Commit

Permalink
Update BabbleExpressions.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
dfgHiatus authored Apr 24, 2024
1 parent 3a138fd commit a6150b6
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions BabbleExpressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@
namespace VRCFaceTracking.Babble;
public static class BabbleExpressions
{
private const string BabbleExpressionsPath = "BabbleExpressions.json";
// private const string BabbleExpressionsPath = "BabbleExpressions.json";

public static readonly TwoKeyDictionary<UnifiedExpressions, string, float> BabbleExpressionMap;
static BabbleExpressions()
{
var expressions = Path.Combine(
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!,
BabbleExpressionsPath);
var converter = new TwoKeyDictionaryConverter<UnifiedExpressions, string, float>();
if (!File.Exists(expressions))
{
string json = JsonConvert.SerializeObject(
DefaultBabbleExpressionMap, converter);
File.WriteAllText(expressions, json);
}
// public static readonly TwoKeyDictionary<UnifiedExpressions, string, float> BabbleExpressionMap;
// static BabbleExpressions()
// {
// var expressions = Path.Combine(
// Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!,
// BabbleExpressionsPath);
// var converter = new TwoKeyDictionaryConverter<UnifiedExpressions, string, float>();
// if (!File.Exists(expressions))
// {
// string json = JsonConvert.SerializeObject(
// DefaultBabbleExpressionMap, converter);
// File.WriteAllText(expressions, json);
// }

BabbleExpressionMap = JsonConvert.DeserializeObject
<TwoKeyDictionary<UnifiedExpressions, string, float>>
(File.ReadAllText(expressions), converter)!;
}
// BabbleExpressionMap = JsonConvert.DeserializeObject
// <TwoKeyDictionary<UnifiedExpressions, string, float>>
// (File.ReadAllText(expressions), converter)!;
// }

private static readonly TwoKeyDictionary<UnifiedExpressions, string, float> DefaultBabbleExpressionMap = new()
private static readonly TwoKeyDictionary<UnifiedExpressions, string, float> BabbleExpressionMap = new()
{
{ UnifiedExpressions.CheekPuffLeft, "/cheekPuffLeft", 0f },
{ UnifiedExpressions.CheekPuffRight, "/cheekPuffRight", 0f },
Expand Down

0 comments on commit a6150b6

Please sign in to comment.