public override void Load() { if (!Main.dedServ) { InfoUI = new GameInfo(); InfoUI.Activate(); ButtonUI = new ButtonUI(); ButtonUI.Activate(); ConfirmPanelUI = new Confirm_Panel(); ConfirmPanelUI.Activate(); /////////////////////////////////////////////////// UserInterface = new UserInterface(); UserInterface.SetState(null); InfoUserInterface = new UserInterface(); InfoUserInterface.SetState(InfoUI); ButtonUserInterface = new UserInterface(); ButtonUserInterface.SetState(ButtonUI); ConfirmPanelUserInterface = new UserInterface(); ConfirmPanelUserInterface.SetState(ConfirmPanelUI); ////////////////////////////////////////////////// } }
public override void Load() { Instance = this; Logger.InfoFormat($"{0} Extra Explosives logger", Name); //UI stuff ExtraExplosivesUserInterface = new UserInterface(); ExtraExplosivesReforgeBombInterface = new UserInterface(); CEBossInterface = new UserInterface(); CEBossInterfaceNonOwner = new UserInterface(); //Hotkey stuff TriggerExplosion = RegisterHotKey("Explode", "Mouse2"); TriggerUIReforge = RegisterHotKey("Open Reforge Bomb UI", "P"); ToggleCookbookUI = RegisterHotKey("UIToggle", "\\"); TriggerBoost = RegisterHotKey("TriggerBoost", "S"); if (!Main.dedServ) { cookbookInterface = new UserInterface(); buttonInterface = new UserInterface(); ButtonUI = new ButtonUI(); ButtonUI.Activate(); CookbookUI = new CookbookUI(); CookbookUI.Deactivate(); cookbookInterface.SetState(CookbookUI); buttonInterface.SetState(ButtonUI); } //shaders if (Main.netMode != NetmodeID.Server) { //load in the shaders Ref <Effect> screenRef = new Ref <Effect>(GetEffect("Effects/Shader")); // The path to the compiled shader file. Filters.Scene["Bang"] = new Filter(new ScreenShaderData(screenRef, "Bang"), EffectPriority.VeryHigh); //float4 name Filters.Scene["Bang"].Load(); Ref <Effect> screenRef2 = new Ref <Effect>(GetEffect("Effects/NukeShader")); // The path to the compiled shader file. Filters.Scene["BigBang"] = new Filter(new ScreenShaderData(screenRef2, "BigBang"), EffectPriority.VeryHigh); //float4 name Filters.Scene["BigBang"].Load(); // Shader stuff sent in this pull cuz i didnt want to delete it, ignore for now Ref <Effect> burningScreenFilter = new Ref <Effect>(GetEffect("Effects/HPScreenFilter")); Filters.Scene["BurningScreen"] = new Filter(new ScreenShaderData(burningScreenFilter, "BurningScreen"), EffectPriority.Medium); // Shouldnt override more important shaders Filters.Scene["BurningScreen"].Load(); //Bomb shader Ref <Effect> bombShader = new Ref <Effect>(GetEffect("Effects/bombshader")); GameShaders.Misc["bombshader"] = new MiscShaderData(bombShader, "BombShader"); } ModVersion = "v" + Version.ToString().Trim(); //Goes out and grabs the version that the mod browser has using (WebClient client = new WebClient()) { if (CheckForInternetConnection()) { //Parsing the data we need from the api var json = client.DownloadString("https://raw.githubusercontent.com/VolcanicMG/ExtraExplosives/master/Version.TXT"); json.ToString().Trim(); CurrentVersion = json; client.Dispose(); } } Mod yabhb = ModLoader.GetMod("FKBossHealthBar"); if (yabhb != null) { yabhb.Call("hbStart"); yabhb.Call("hbSetTexture", GetTexture("NPCs/CaptainExplosiveBoss/healtbar_left"), GetTexture("NPCs/CaptainExplosiveBoss/healtbar_frame"), GetTexture("NPCs/CaptainExplosiveBoss/healtbar_right"), GetTexture("NPCs/CaptainExplosiveBoss/healtbar_fill")); //yabhb.Call("hbSetMidBarOffset", 20, 12); //yabhb.Call("hbSetBossHeadCentre", 22, 34); yabhb.Call("hbFinishSingle", ModContent.NPCType <CaptainExplosiveBoss>()); } }