public OverlayRenderer(PathOfExile poe, RenderingContext rc) { this.poe = poe; poe.Area.OnAreaChange += area => modelUpdatePeriod = 6; this.MinimapRenderer = new MinimapRenderer(); this.XphRenderer = new XPHRenderer(); this.PreloadAlert = new PreloadAlert(); this.hudRenderers = new List<HUDPlugin>{ new HealthBarRenderer(), new ItemAlerter(), this.MinimapRenderer, new ItemLevelRenderer(), new ItemRollsRenderer(), new DangerAlert(), this.XphRenderer, new ClientHacks(), this.PreloadAlert }; if (Settings.GetBool("Window.ShowIngameMenu")) { #if !DEBUG this.hudRenderers.Add(new Menu.Menu()); #endif } rc.OnRender += this.rc_OnRender; this.hudRenderers.ForEach(x => x.Init(poe, this)); }
public override void DrawAt(RenderingContext rc, Vec2 point, Rect rect) { float xD = ((float)(SpriteSize.X)) / SpriteSize.X; float yD = ((float)(SpriteSize.Y)) / SpriteSize.Y; RectUV uvRect = new RectUV(xD * ChosenImage.X, yD * ChosenImage.Y, xD * (ChosenImage.X + 1), yD * (ChosenImage.Y + 1)); rc.AddSprite(this.TextureFile, rect, uvRect, TintColor); }
public override void Render(RenderingContext rc) { if (!Settings.GetBool("Tooltip") || !Settings.GetBool("Tooltip.ShowItemLevel")) { return; } Element uIHover = this.poe.Internal.IngameState.UIHover; Entity item = uIHover.AsObject<InventoryItemIcon>().Item; if (item.address != 0 && item.IsValid) { Tooltip tooltip = uIHover.AsObject<InventoryItemIcon>().Tooltip; if (tooltip == null) { return; } Element childAtIndex = tooltip.GetChildAtIndex(0); if (childAtIndex == null) { return; } Element childAtIndex2 = childAtIndex.GetChildAtIndex(1); if (childAtIndex2 == null) { return; } Rect clientRect = childAtIndex2.GetClientRect(); rc.AddTextWithHeight(new Vec2(clientRect.X + 2, clientRect.Y + 2), item.GetComponent<Mods>().ItemLevel.ToString(), Color.White, 16, DrawTextFormat.Left); } }
public override void Render(RenderingContext rc) { bool flag = Settings.GetBool("ClientHacks") && Settings.GetBool("ClientHacks.Maphack"); if (flag != this.maphackEnabled) { this.maphackEnabled = !this.maphackEnabled; if (this.maphackEnabled) { this.EnableMaphack(); } else { this.DisableMaphack(); } } if (this.zoomhackEnabled && this.poe.InGame) { float zFar = this.poe.Internal.IngameState.Camera.ZFar; if (zFar != 10000f) { this.poe.Internal.IngameState.Camera.ZFar = 10000f; } } bool flag2 = Settings.GetBool("ClientHacks") && Settings.GetBool("ClientHacks.Zoomhack"); if (flag2 != this.zoomhackEnabled) { this.zoomhackEnabled = !this.zoomhackEnabled; if (this.zoomhackEnabled) { this.EnableZoomhack(); } else { this.DisableZoomhack(); } } bool flag3 = Settings.GetBool("ClientHacks") && Settings.GetBool("ClientHacks.Fullbright"); if (flag3 != this.fullbrightEnabled) { this.fullbrightEnabled = !this.fullbrightEnabled; if (this.fullbrightEnabled) { this.EnableFullbright(); return; } this.DisableFullbright(); } }
public OverlayRenderer(GameController gameController, SettingsRoot settings, RenderingContext rc) { this.Settings = settings; this.gameController = gameController; this.plugins = new List<HUDPlugin>{ new HealthBarRenderer(), new ItemAlerter(), new MapIconsRenderer(gatherMapIcons), new AdvTooltopRenderer(), new MonsterTracker(), new PoiTracker(), new XPHRenderer(), new ClientHacks(), #if DEBUG //new ShowUiHierarchy(), //new MainAddresses(), #endif new PreloadAlert(), new DpsMeter(), // new FpsMeter(), }; gameController.Area.OnAreaChange += (area) => { _modelUpdatePeriod = 6; foreach (var hudPlugin in plugins) hudPlugin.OnAreaChange(area); }; foreach (var plugin in plugins) { if( null != plugin.SettingsNode ) Settings.AddModule(plugin.SettingsNode); } if (Settings.Global.ShowIngameMenu) { #if !DEBUG this.plugins.Add(new Menu.Menu(settings)); #endif } UpdateObserverLists(); rc.RenderModules = this.rc_OnRender; this.plugins.ForEach(x => x.Init(gameController)); }
public override void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints) { if ((Settings.Maphack) != this.maphackEnabled) { this.maphackEnabled = !this.maphackEnabled; if (this.maphackEnabled) this.EnableMaphack(); else this.DisableMaphack(); } if (this.zoomhackEnabled && this.model.InGame) { float zFar = this.model.Internal.IngameState.Camera.ZFar; if (zFar != 10000f) { this.model.Internal.IngameState.Camera.ZFar = 10000f; } } if ((Settings.Zoomhack) != this.zoomhackEnabled) { this.zoomhackEnabled = !this.zoomhackEnabled; if (this.zoomhackEnabled) this.EnableZoomhack(); else this.DisableZoomhack(); } if (Settings.Fullbright != this.fullbrightEnabled) { this.fullbrightEnabled = !this.fullbrightEnabled; if (this.fullbrightEnabled) this.EnableFullbright(); else this.DisableFullbright(); } if (Settings.SuspendParticles != this.particlesEnabled) { this.particlesEnabled = !this.particlesEnabled; if (this.particlesEnabled) this.EnableParticles(); else this.DisableParticles(); } }
private void rc_OnRender(RenderingContext rc) { if (!Settings.GetBool("Window.RequireForeground") || this.poe.Window.IsForeground()) { this.modelUpdatePeriod++; if (this.modelUpdatePeriod > 6) { this.poe.Update(); this.modelUpdatePeriod = 0; } if (!this.poe.InGame || this.poe.Player == null) { return; } foreach (HUDPlugin current in this.hudRenderers) { current.Render(rc); } } }
public abstract void Render(RenderingContext rc);
private void rc_OnRender(RenderingContext rc) { if (Settings.Global.RequireForeground && !this.gameController.Window.IsForeground()) return; this._modelUpdatePeriod++; if (this._modelUpdatePeriod > 6) { this.gameController.RefreshState(); this._modelUpdatePeriod = 0; } bool ingame = this.gameController.InGame; if ( !ingame || this.gameController.Player == null) { return; } Dictionary<UiMountPoint, Vec2> mountPoints = new Dictionary<UiMountPoint, Vec2>(); mountPoints[UiMountPoint.UnderMinimap] = gameController.Internal.IngameState.IngameUi.GetRightTopUnderMinimap(); mountPoints[UiMountPoint.LeftOfMinimap] = gameController.Internal.IngameState.IngameUi.GetRightTopLeftOfMinimap(); foreach (HUDPlugin current in this.plugins) { if (current.SettingsNode == null || current.SettingsNode.Enabled) current.Render(rc, mountPoints); } }
public void InitD3D() { Rect rect = window.ClientRect(); presentParameters.BackBufferWidth = rect.W; presentParameters.BackBufferHeight = rect.H; dx = new Device(d3d = new Direct3D(), 0, DeviceType.Hardware, base.Handle, CreateFlags.Multithreaded | CreateFlags.HardwareVertexProcessing, new[] { presentParameters }); RC = new RenderingContext(dx, window); Configuration.AddResultWatch(ResultCode.DeviceLost, ResultWatchFlags.AlwaysIgnore); }
public void InitD3D() { Rect rect = this.window.ClientRect(); PresentParameters presentParameters = new PresentParameters(); presentParameters.Windowed = true; presentParameters.SwapEffect = SwapEffect.Discard; presentParameters.BackBufferFormat = Format.A8R8G8B8; presentParameters.BackBufferWidth = rect.W; presentParameters.BackBufferHeight = rect.H; presentParameters.PresentationInterval = PresentInterval.One; this.dx = new Device(new Direct3D(), 0, DeviceType.Hardware, base.Handle, CreateFlags.Multithreaded | CreateFlags.HardwareVertexProcessing, new PresentParameters[] { presentParameters }); this.RC = new RenderingContext(this.dx, this.window); Configuration.AddResultWatch(ResultCode.DeviceLost, ResultWatchFlags.AlwaysIgnore); }
public virtual void DrawAt(RenderingContext rc, Vec2 point, Rect rect) { rc.AddTexture(this.TextureFile, rect, TintColor); }
public abstract void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints);