Skip to content

Commit

Permalink
compat mode disables clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed May 27, 2024
1 parent 1754c10 commit f5d9a26
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions OpenDreamClient/Input/MouseInputSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.UserInterface;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.Input;
using Robust.Shared.Input.Binding;
using Robust.Shared.Map;
Expand All @@ -22,6 +24,7 @@ internal sealed class MouseInputSystem : SharedMouseInputSystem {
[Dependency] private readonly EntityLookupSystem _lookupSystem = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly MapSystem _mapSystem = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!;

private DreamViewOverlay? _dreamViewOverlay;
private ContextMenuPopup _contextMenu = default!;
Expand Down Expand Up @@ -84,6 +87,9 @@ public void HandleStatClick(string atomRef, bool isMiddle) {

var mapCoords = viewport.ScreenToMap(args.PointerLocation.Position);
var mousePos = (args.RelativePixelPosition - viewportBox.TopLeft) / viewportBox.Size * viewport.ViewportSize;

if(_configurationManager.GetCVar(CVars.DisplayCompat))
return null; //Compat mode causes crashes with RT's GetPixel because OpenGL ES doesn't support GetTexImage()
var lookupColor = _dreamViewOverlay.MouseMap.GetPixel((int)mousePos.X, (int)mousePos.Y);
var underMouse = _dreamViewOverlay.MouseMapLookup.GetValueOrDefault(lookupColor);
if (underMouse == null)
Expand Down

0 comments on commit f5d9a26

Please sign in to comment.