public override void PostSetupContent() { Mod bossChecklist = ModLoader.GetMod("BossChecklist"); if (bossChecklist != null) { bossChecklist.Call("AddBossWithInfo", "Ultra Eye of Cthulhu", 16.0f, (Func <bool>)(() => TUAWorld.EoCDeathCount >= 1), "Use a [i:" + ItemID.SuspiciousLookingEye + "] at night after Moon lord has been defeated"); bossChecklist.Call("AddBossWithInfo", "Eye of EoADowned - God of Destruction", 16.1f, (Func <bool>)(() => ModContent.GetInstance <TUAWorld>().UltraMode), "Use a [i:" + ItemType("Spawner") + "] after --1sing Ay. 0F C1^lh> in ^1tra and murder it, if you can..."); } Mod achievementLibs = ModLoader.GetMod("AchievementLibs"); if (achievementLibs != null) { Func <bool> c = () => TUAWorld.EoADowned; achievementLibs.Call("AddAchievementWithoutReward", this, "Once there was an eye that was a god...", "Kill the Eye of Apocalypse - God of Destruction!", "Achievement/EoAKill", c); achievementLibs.Call("AddAchievementWithoutReward", this, "The terrible moon tried to kill us", "Use [i:" + ModContent.ItemType <EyeOfPerception>() + "] and succesfully survive all 8 wave of the Apocalypse Moon", "Achievement/EoAKill", (Func <bool>)(() => TUAWorld.ApoMoonDowned)); achievementLibs.Call("AddAchievementWithoutAction", this, "Once there was the Eye of Cthulhu... the ultra one", "Kill the Ultra EoC succesfully.", "Achievement/UltraEoC", new int[] { ModContent.ItemType <EyeOfPerception>() }, new int[] { 1 }, (Func <bool>)(() => TUAWorld.EoCDeathCount >= 1)); } RecipeUtils.SetAllFurnaceRecipeSystem(); ReflManager <Type> .RemoveItem("TMain"); ReflManager <Type> .AddItem("TMain", typeof(Main)); }
static TUA() { version = "0.1 dev";; tModLoaderVersion2 = ""; SAVE_PATH = Main.SavePath; raidsUI = new RaidsUI(); #if DEBUG devMode = true; #else devMode = false; #endif quote = new List <string>(); animate = GetAnimatedTitle(); gameTime = new GameTime(); ReflManager <Type> .AddItem("TMain", typeof(Main)); RaidsManager.Fill(); }
public override void OnInitialize() { xButtonTexture = TUA.instance.GetTexture("Texture/X_ui"); xButton = new UIElement(); xButton.Width.Set(20f, 0f); xButton.Height.Set(22f, 0f); xButton.Left.Set(Main.screenWidth / 2f + 300f, 0f); xButton.Top.Set(Main.screenHeight / 2f - 125f, 0f); xButton.OnClick += (evt, listElem) => UIManager.CloseRaidsUI(); selectTextPanel = new UITextPanel <TranslationWrapper> (LocalizationManager.instance.GetRawTranslation("TUA.UI.Select"), 0.5f, true) { DrawPanel = true, TextScale = 0.5f }; selectTextPanel.Width.Set(100f, 0f); selectTextPanel.Left.Set(Main.screenWidth / 2f - selectTextPanel.Width.Pixels / 2, 0f); selectTextPanel.Top.Set(Main.screenHeight / 2f + 260f, 0f); selectTextPanel.OnClick += SetCurrentRaids; mainPanel = new CustomizableUIPanel(TUA.instance.GetTexture("Texture/UI/panel")); mainPanel.Width.Set(300f, 0); mainPanel.Height.Set(350f, 0); mainPanel.Left.Set(Main.screenWidth / 2f - 305f, 0f); mainPanel.Top.Set(Main.screenHeight / 2f - 100f, 0f); descriptionPanel = new CustomizableUIPanel(TUA.instance.GetTexture("Texture/UI/panel")); descriptionPanel.Width.Set(300f, 0); descriptionPanel.Height.Set(350f, 0); descriptionPanel.Left.Set(Main.screenWidth / 2f + 5f, 0f); descriptionPanel.Top.Set(Main.screenHeight / 2f - 100f, 0f); raidsDescription = new UIScrollingText(); raidsDescription.Top.Set(2f, 0f); raidsDescription.Left.Set(5, 0f); raidsDescription.Height.Set(330f, 0f); raidsDescription.Width.Set(250f, 0f); raidsDescription.SetText("No raids are currently selected"); descriptionPanel.Append(raidsDescription); scrollbar = new UIScrollbar(); scrollbar.Height.Set(-5f, 1f); scrollbar.Top.Set(5, 0); scrollbar.SetView(100f, 100f); scrollbar.HAlign = 1f; raidsList = new UIList(); raidsList.Top.Set(10f, 0f); raidsList.Left.Set(-5f, 0f); raidsList.Height.Set(300f, 0); raidsList.Width.Set(250f, 0f); raidsList.SetScrollbar(scrollbar); mainPanel.Append(raidsList); mainPanel.Append(scrollbar); Append(mainPanel); Append(descriptionPanel); Append(selectTextPanel); Append(xButton); #region Get Description In Shitcode Way StringBuilder builder = new StringBuilder(); switch (currentlySelectedRaids.RaidsType) { case RaidsID.TheGreatHellRide: builder.AppendLine("The Great Hell Ride"); builder.AppendLine("Have you heard the legend of the great hell ride?"); builder.AppendLine("From what I've heard, it's a lot of fun and at the end you have to fight a giant wall!"); builder.AppendLine("Sadly, I've not ever seen the infamous wall and I'll probably never get to, but you can do something about that."); builder.AppendLine("- The Guide"); break; case RaidsID.TheWrathOfTheWasteland: builder.AppendLine("The Wrath of the Wasteland"); builder.AppendLine("An earthquale just came from the core of the Wasteland, the heart might be angry again."); builder.AppendLine("Your goal is calm down the Heart of the Wasteland and make sure it doesn't wake up again."); builder.AppendLine("But first, you'll need to run some errands as you need specific stuff to calm it down"); builder.AppendLine("- The Guide and the Infinity Traveler"); break; case RaidsID.TheEyeOfDestruction: builder.AppendLine("The Hunt Beyond the Void"); builder.AppendLine("A long time ago, I fought this god. He was one of the most powerful one I ever fought mainly because it could control the element of the void."); builder.AppendLine("This eye, also known as the eye of apocalypse, got out of his sleep after you killed the Ultra eye of Cthulhu."); builder.AppendLine("If he does what he did 1000 years ago, the world might be destroyed... Check the moon, because that's your biggest concern for now"); builder.AppendLine("- The Infinity Traveler"); break; case RaidsID.None: builder.AppendLine("There are no active raids currently!"); break; } raidsDescription.SetText(builder.ToString()); #endregion // Type no longer matters, the order of which panels are added here does ReflManager <RaidsPanel> .AddItem(PTI("None"), new RaidsPanel(RaidsID.None, () => RaidsWorld.currentRaid == RaidsID.None)); ReflManager <RaidsPanel> .AddItem(PTI("WoF"), new RaidsPanel(RaidsID.TheGreatHellRide, () => !Main.hardMode && TUAWorld.Wasteland)); ReflManager <RaidsPanel> .AddItem(PTI("HotW"), // since ^^ will be checked first, there is no need to check !TUAWorld.Wasteland new RaidsPanel(RaidsID.TheWrathOfTheWasteland, () => !Main.hardMode)); ReflManager <RaidsPanel> .AddItem(PTI("EoA"), new RaidsPanel(RaidsID.TheEyeOfDestruction, () => TUAWorld.ApoMoonDowned && !TUAWorld.EoADowned)); string PTI(string name) => "RaidsPanel_" + name; }