Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid rendering an empty maptext #2242

Merged
merged 2 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions OpenDreamClient/Input/MouseInputSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ public void HandleAtomMouseMove(ScalingViewport viewport, Vector2 relativePos, C

var mapCoords = viewport.ScreenToMap(globalPos.Position);
var mousePos = (relativePos - viewportBox.TopLeft) / viewportBox.Size * viewport.ViewportSize;
if (mousePos.X >= _dreamViewOverlay.MouseMap.Size.X || mousePos.Y >= _dreamViewOverlay.MouseMap.Size.Y)
return null;

if(_configurationManager.GetCVar(CVars.DisplayCompat))
return null; //Compat mode causes crashes with RT's GetPixel because OpenGL ES doesn't support GetTexImage()
Expand Down
2 changes: 1 addition & 1 deletion OpenDreamClient/Rendering/ClientScreenOverlaySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace OpenDreamClient.Rendering;

internal sealed class ClientScreenOverlaySystem : SharedScreenOverlaySystem {
public HashSet<EntityUid> ScreenObjects = new();
public readonly HashSet<EntityUid> ScreenObjects = new();

[Dependency] private readonly IEntityManager _entityManager = default!;

Expand Down
2 changes: 1 addition & 1 deletion OpenDreamClient/Rendering/DreamViewOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ public void DrawIcon(DrawingHandleWorld handle, Vector2i renderTargetSize, Rende
}

//Maptext
if(iconMetaData.Maptext != null) {
if (!string.IsNullOrWhiteSpace(iconMetaData.Maptext)) {
var maptextSize = iconMetaData.MaptextSize!.Value;
if (maptextSize.X == 0)
maptextSize.X = 32;
Expand Down
12 changes: 6 additions & 6 deletions OpenDreamShared/Dream/MouseOpacity.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace OpenDreamShared.Dream {
public enum MouseOpacity {
Transparent = 0,
PixelOpaque = 1,
Opaque = 2
}
namespace OpenDreamShared.Dream;

public enum MouseOpacity {
Transparent = 0,
PixelOpaque = 1,
Opaque = 2
}
Loading