private void Awake() { Global = GameObject.Find("GlobalInformation").GetComponent <GlobalInformation>(); plantBag = GameObject.Find("PlantBag").GetComponent <PlantBag>(); }
public override void Action(CommandCaller caller, string input, string[] args) { if (args.Length != 1) { BagsOfHoldingMod.sendChat("Use with \"reloadOrder\" with a held bag to reload its order, \"reloadOmnibag\" to reload omnibag's content list and \"remakeBags\" to remake all bag orders into the configs."); return; } if ((args[0].Equals("reloadOrder") || args[0].Equals("\"reloadOrder\"")) && caller.Player.HeldItem.modItem != null && caller.Player.HeldItem.modItem is GenericHoldingBag) { GenericHoldingBag bag = caller.Player.HeldItem.modItem as GenericHoldingBag; bag.setupItemList(); BagsOfHoldingMod.sendChat("Reloaded bag order"); return; } if (args[0].Equals("reloadOmnibag") || args[0].Equals("\"reloadOmnibag\"")) { TrueOmniBag.contents2 = null; BagPlayer.reloadOmnibag(); BagsOfHoldingMod.sendChat("Recreated Omnibag order."); return; } if (args[0].Equals("remakeBags") || args[0].Equals("\"remakeBags\"")) { GenericHoldingBag bg = new BaitBag(); resetBagConfig(bg); bg.remakeFromConfig(); bg = new ChunkBag(); resetBagConfig(bg); bg.remakeFromConfig(); bg = new CoinBag(); resetBagConfig(bg); bg.remakeFromConfig(); bg = new CrateBag(); resetBagConfig(bg); bg.remakeFromConfig(); bg = new DirtBag(); resetBagConfig(bg); bg.remakeFromConfig(); bg = new DyeMaterialBag(); resetBagConfig(bg); bg.remakeFromConfig(); bg = new FishBag(); resetBagConfig(bg); bg.remakeFromConfig(); bg = new GemBag(); resetBagConfig(bg); bg.remakeFromConfig(); bg = new MushroomBag(); resetBagConfig(bg); bg.remakeFromConfig(); bg = new OreBag(); resetBagConfig(bg); bg.remakeFromConfig(); bg = new PlantBag(); resetBagConfig(bg); bg.remakeFromConfig(); bg = new WoodBag(); resetBagConfig(bg); bg.remakeFromConfig(); FishingBag.resetContents(); NatureBag.resetContents(); OmniBag.resetContents(); BagsOfHoldingMod.sendChat("Reset all bag orders to the original order list."); } }