public static void Init(InitParams initParams) { mod = initParams.Mod; var go = new GameObject(mod.Title); instance = go.AddComponent <BestiaryMain>(); readyToOpenUI = false; DaggerfallUnity.Instance.ItemHelper.RegisterCustomItem(BestiaryItem.templateIndex, ItemGroups.UselessItems2, typeof(BestiaryItem)); mod.SaveDataInterface = instance; mod.LoadSettingsCallback = LoadSettings; StateManager.OnStartNewGame += OnGameStarted; StartGameBehaviour.OnStartGame += OnNewGameStarted; EnemyDeath.OnEnemyDeath += EnemyDeath_OnEnemyDeath; PlayerActivate.OnLootSpawned += AddBestiary_OnLootSpawned; EnemyDeath.OnEnemyDeath += BestiaryLoot_OnEnemyDeath; mod.IsReady = true; }
public override bool UseItem(ItemCollection collection) { switch (BestiaryMain.SettingMenuUnlock) { case 0: DaggerfallUI.UIManager.PushWindow(BestiaryMain.bestiaryUIScreen); break; case 1: DaggerfallUI.UIManager.PushWindow(BestiaryMain.bestiaryUIScreen); break; case 2: if (!BestiaryMain.UnlockedBestiary) { BestiaryMain.UnlockedBestiary = true; BestiaryMain.DisplayMessage("You study the contents of the book closely. You have unlocked the Bestiary."); } DaggerfallUI.UIManager.PushWindow(BestiaryMain.bestiaryUIScreen); break; } return(true); }