-
Notifications
You must be signed in to change notification settings - Fork 2
/
ModSettings.cs
56 lines (44 loc) · 1.67 KB
/
ModSettings.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
// ReSharper disable CollectionNeverUpdated.Global
// ReSharper disable FieldCanBeMadeReadOnly.Global
namespace ISM3025
{
internal class ModSettings
{
// TODO: add feature to not resize in campaign
public float MapWidth = 200f;
public float MapHeight = 200f;
public float MapMargin = 50f;
public float MapBottomMargin = 100f;
public float MinFov = 20f;
public float MaxFov = 125f;
public bool UseSmoothZoom = true;
public float SmoothZoomTime = 0.15f;
public float StarHitboxSize = 2f;
public float BorderMargin = 5f;
public float LogoScalar = 0.75f;
public float LogoMaxSize = 50f;
public string NavRoomScreenTexturePath = "";
public Dictionary<string, float[]> FactionColors = new Dictionary<string, float[]>();
public Dictionary<string, string> FactionLogoPaths = new Dictionary<string, string>();
public string GenerateShopsTag = "mod_generate_shops";
public List<string> GenerateShopsIgnoreTags = new List<string>();
public Dictionary<string, string> TagToShopItemCollection = new Dictionary<string, string>();
public static ModSettings Parse(string json)
{
ModSettings settings;
try
{
settings = JsonConvert.DeserializeObject<ModSettings>(json);
}
catch (Exception e)
{
Main.HBSLog.Log($"Reading settings failed: {e.Message}");
settings = new ModSettings();
}
return settings;
}
}
}