Add config for employee per perk
This commit is contained in:
@@ -15,9 +15,11 @@ namespace CykaMod {
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<int> playersAdded;
|
||||
public static ConfigEntry<int> employeePerPerk;
|
||||
|
||||
public void Awake() {
|
||||
playersAdded = Config.Bind("General", "PlayersAdded", 0);
|
||||
employeePerPerk = Config.Bind("General", "EmployeePerPerk", 1);
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
@@ -46,7 +48,12 @@ namespace CykaMod {
|
||||
for (int i = 0; i < codes.Count; i++) {
|
||||
if (codes[i].opcode == OpCodes.Ldc_I4_1) {
|
||||
Console.WriteLine("Found Ldc_I4_1");
|
||||
codes[i].opcode = OpCodes.Ldc_I4_2;
|
||||
codes[i].opcode = OpCodes.Nop;
|
||||
codes.Insert(i + 1,
|
||||
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(Main), "employeePerPerk")));
|
||||
codes.Insert(i + 2,
|
||||
new CodeInstruction(OpCodes.Call,
|
||||
AccessTools.PropertyGetter(typeof(Main).GetField("employeePerPerk").FieldType, "Value")));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user