added a way for lua to override people's jobs

This commit is contained in:
Evil Factory
2021-11-30 11:36:00 -03:00
parent 1972772fb3
commit 7c8536127c
3 changed files with 59 additions and 42 deletions
@@ -45,6 +45,12 @@ namespace Barotrauma
return (GUITextBox.OnEnterHandler)((GUITextBox a, string b) => new LuaResult(LuaSetup.luaSetup.CallFunction(function, a, b)).Bool());
});
#endif
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Table, typeof(Pair<JobPrefab, int>), v =>
{
return new Pair<JobPrefab, int>((JobPrefab)v.Table.Get(1).ToObject(), (int)v.Table.Get(2).CastToNumber());
});
}
public static void RegisterAction<T>()