forked from katycat5e/DVPassengerJobs
/
PJModSettings.cs
42 lines (36 loc) · 1.09 KB
/
PJModSettings.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityModManagerNet;
namespace PassengerJobsMod
{
public class PJModSettings : UnityModManager.ModSettings, IDrawable
{
[Draw("Use custom wage scaling for (new) passenger haul jobs")]
public bool UseCustomWages = true;
[Draw("Generate passenger trains with uniform car type")]
public bool UniformConsists = true;
[Draw("Perform data purge for uninstall (see log for results)")]
public bool DoPurge = false;
public override void Save( UnityModManager.ModEntry modEntry )
{
Save(this, modEntry);
}
public void OnChange()
{
if( DoPurge )
{
DoPurge = false;
PurgeData();
}
}
public void PurgeData()
{
PassengerLicenseUtil.RefundLicenses();
PassengerLicenseUtil.DestroySpawnedLicenses();
PassengerJobGenerator.PurgePassengerJobChains();
}
}
}