public override void Load() { instance = this; Actions = new Dictionary <string, ActionItem>() { { "Chat", new ChatAction() }, { "GetCaster", new GetCasterOperation() }, { "Num", new NumberLiteral() }, { "Bool", new BooleanLiteral() }, { "String", new StringLiteral() }, { "Vec2", new Vec2Literal() }, //{ "Vec3", new Vec3Literal() }, { "Set", new SetParameterOperation() }, { "Get", new GetParameterOperation() }, { "Add", new AddOperation() }, { "Sub", new SubtractOperation() }, { "Mul", new MultiplyOperation() }, { "Div", new DivideOperation() }, { "Pow", new PowerOperation() }, { "GetProjectile", new GetProjectileOperation() }, { "GetPosition", new GetPositionOperation() }, { "GetMotion", new GetMotionOperation() }, { "AddMotion", new AddMotionAction() }, { "Push", new PushParameterOperation() }, { "Pop", new PopParameterOperation() }, { "Sleep", new SleepControl() }, { "Jump", new JumpIfControl() }, { "Goto", new GotoControl() }, { "NearbyNPCs", new GetNearbyEnemiesOperation() } }; actions = new List <ActionItem>() { }; foreach (KeyValuePair <string, ActionItem> act in Actions) { AddItem(act.Value.GetType().Name, act.Value); actions.Add(act.Value); } ActionContext.Default = new ActionContext(); if (!Main.dedServ) { UI = new UserInterface(); modularUI = new UserInterface(); Textures.LoadAll(); } Sets.Item.casing = new bool[0]; Sets.Item.drive = new bool[0]; Sets.Item.lens = ItemID.Sets.Factory.CreateBoolSet(ItemID.Lens, ItemID.Sapphire, ItemID.Ruby, ItemID.MechanicalLens, ItemID.EyeoftheGolem); Sets.Item.battery = ItemID.Sets.Factory.CreateBoolSet(ItemID.StarinaBottle, ItemID.ShadowOrb, ItemID.CrimsonHeart, ItemID.LihzahrdPowerCell, ItemID.MechanicalBatteryPiece); NonFishItem.ResizeArrays += () => { Array.Resize(ref Sets.Item.casing, Item.staff.Length); Array.Resize(ref Sets.Item.drive, Item.staff.Length); Array.Resize(ref Sets.Item.lens, Item.staff.Length); Array.Resize(ref Sets.Item.battery, Item.staff.Length); }; }
public override void Unload() { actions = null; Actions = null; UI = null; modularUI = null; glyphItemUI = null; modularUIState = null; ActionContext.Default = null; Sets.Item.casing = null; Sets.Item.drive = null; Sets.Item.lens = null; Sets.Item.battery = null; Textures.UnloadAll(); instance = null; }