Skip to content

Supress CS8974 for game projects & minor UI fixes to remove errors in…#10484

Closed
FylmTM wants to merge 951 commits intoFacepunch:masterfrom
FylmTM:razor-fixes-for-rider-rebased
Closed

Supress CS8974 for game projects & minor UI fixes to remove errors in…#10484
FylmTM wants to merge 951 commits intoFacepunch:masterfrom
FylmTM:razor-fixes-for-rider-rebased

Conversation

@FylmTM
Copy link
Copy Markdown

@FylmTM FylmTM commented Apr 15, 2026

Pull Request

Thanks for contributing to s&box ❤️
Please fill out the sections below to help us review your change efficiently.


Summary

  • Add CS8974 to list of supressed warnings (false-negative for Razor integration in Rider)
  • Minor bugfix for unreacheable path validation in NavigationHost
  • Use Panel instead of div when @ref is required in Base Library

Motivation & Context

When opening game project in Rider it would complain about several Razor files in Base Library, marking the whole tree as having errors:
image

Specifically these 2 errors:

  • Converting method group 'OnClick' to non-delegate type 'object'. Did you intend to invoke the method?
  • Cannot convert source type 'ElementReference' to target type 'Sandbox.UI.Panel'

After these fixes they are gone:
image

Implementation Details

I have chosen to add CS8974 to the list of supressed warnings for all generated projects, making a decision that this warning is not common/popular enough, while having great dev experience is more important.

Also I have opened issue for Rider directly, hopefully someday they will introduce proper support for specifying different base class for common elements.

I have also thought about adding shims for most common html element to shadow built-in html elements, like so:

namespace Sandbox.UI;
class partial div : Panel;
// and so on

It works, but decided to just fix couple places in base library that were still using @ref on div.
Each user then can decide to create such shim in their own projects if needed.

Checklist

  • Code follows existing style and conventions
  • No unnecessary formatting or unrelated changes
  • Public APIs are documented (if applicable)
  • Unit tests added where applicable and all passing
  • I’m okay with this PR being rejected or requested to change 🙂

lolleko and others added 30 commits March 9, 2026 09:35
…4200)

CollisionEventSystem is quite alloc heavy especially the action wiring causes 10+ heap allocations per collider.
Collect pending acks in List rather than spamming async tasks.
Process List in Tick.
So we don't allocate when a GameObejct doesn't have any tags
Fast & alloc free pass for GameTags.SetFrom
* Remove unnecessary static singletons in MainMenu code

* Empty SceneWorld delete queues during shutdown

* Dresser cancel async load operation on destroy

* Use reflection to null references to static native resources on shutdown

This way we don't  have to remember doing this manually.

* Fix SoundOcclusionSystem using static lists to reference resources

* Sound System: Use weak references to refer to scenes

* Cleanup static logging listeners that kept strong refs to panels

* UISystem Cleanup, make sure all panel/stylesheet refs are released

* RenderTarget and RenderAttributes shutdown cleanup

* Rework AvatarLoader, ThumbLoader & HTTPImageLoader Cache

First try to go through ResourceLibrary.WeakIndex which might already hold the texture.

If there is no hit, go through a second cache that caches HTTP & Steam API response bytes instead of textures.
We want to cache the response bytes rather than the actual Texture, so stuff cached sits in RAM not VRAM.
Before avatars and thumbs would reside in VRAM.

* Fix rendertarget leak in CommandList.Attr.SetValue

GetDepthTarget() / GetColorTarget() return a new strong handle (ref count +1).
We need to DestroyStrongHandle()  that ref. So handles don't leak.

* Call EngineLoop.DrainFrameEndDisposables before shutdown

* NativeResourceCache now report leaks on shutdown

* Override Resource.Destroy for native resources, kill stronghandles

* Deregister SceneWorld from SceneWorld.All during destruction

* Ensure async texture loading cancels on shutdown

* SkinnedModelRender bonemergetarget deregister from target OnDisabled

* Clear shaderMaterials cache during shutdown

* Refactor Shutdown code

Mostly renaming methods from Clear() -> Shutdown()
Adding separate GlobalContext.Shutdown function (more aggressive than GlobalContext.Reset).
Clear some static input state.

* Deregister surfaces from Surface.All in OnDestroy

* RunAllStaticConstructors when loading a mount

* Advanced managed resource leak tracker enabled via `resource_leak_tracking 1`

Works by never pruning the WeakTable in NativeResourceCache.
So we can check for all resources if they are still being held on to and log a callstack.
* Support types like Curve, Gradient, ParticleGradient in movies
* Fix TransformOperation.OnReduce: old implementation was nonsense, could stack overflow
* Add optional filePath parameter to GenerateScreenshotFilename
* Force movie project to save even if we don't think it's changed
* ITemporaryEffect.IsActive pseudo-property for movie recordings
* Add ITrack.GetPathString() extension
* Safety when trying to compress a sample block
* Skip updating playback rate on renderers with a bone merge target
* Move PropertySignal<T>.FromSamples to PropertySignal
* Fix view not always updating when zooming
* Enabled tracks defaults to false when applying
* Movie export: manually call Scene.EditorTick, pause updates elsewhere (fixes Facepunch#10137)
* CanMakeTrackFromProperties: default to only allowing user types
Introduced in Facepunch/sbox#4242 , which added some additional panel cleanup
Ignore static members when serializing or cloning components, makes no sense and breaks cloning with Expression Trees (that was introduced in Facepunch/sbox#4202)

Fixes Facepunch#10161
Synthesizer never disposed its SpeechSynthesizer, causing background VoiceSynthesis threads to accumulate indefinitely (30+ seen in crash dumps).
This may have caused crashes in TTS heavy games like DXRP.

In addition we now properly terminate the SoundStream so SoundHandle.IsPlaying will become false after the stream has been played.

See: Facepunch#4184
Needs to be rethought, it gets in the way often -- keeping view handle though
* Sync localisation files to clients thru network files
* Changing lang triggers Panel.LanguageChanged again, so we can rebuild panels, labels, etc.
* Init ActiveFriends as Enumerable.Empty

* Snip IconPanel logging its url
…punch#4283)

Benchmark runner loads scenes in succession.
If a previous scene already generated a navmesh, on the load of another scene the navmesh bounds would not update, because the bounds where already set by the previous scene.
Fixed by always updating the bounds if CustomBounds is not set.
* Kill CrashReporter before unloading steam DLL

* Properly shutdown SteamAPI on SourceEngine exit

* Smaller minidumps for retail builds

We can use a minimal minidump and still extract managed stack traces
lolleko and others added 28 commits April 9, 2026 15:15
Add `DeferGeneration` property to skip navmesh generation during scene load, allowing tiles to be generated and unloaded on demand at runtime.

New public API:
- `NavMesh.DeferGeneration` - skip tile generation on load
- `NavMesh.RequestTileGeneration`/`RequestTilesGeneration` - fire-and-forget via cache loop
- `NavMesh.UnloadTile`/`UnloadTiles` - remove tiles from the navmesh
* preload resolutions on init
Managed will queue deletion no need to check for proper destruction this early
…acepunch#4525)

* WildcardMatch use MatchesSimpleExpression instead of expensive regex

* More WildcardMatch tests
Dot-based AlmostEqual returned false for zero quaternions (default==default would be false), breaking the transform guard that catches uninitialized transforms.
* Don't UpdatePrefabInstances if the edited PrefabScene is the only one open in editor

* Avoid some allocations when processing prefab guid mappings

* Json Diff use 64bit hash isntead of paths for presence tracking, which avoids a ton of string allocations

* Less LINQ in prefab GUID tracking code
* Add Texture Pool section to shadow debug

https://files.facepunch.com/lolleko/2026/April/13_16-21-UsedRook.png

Shows of orphaned textures (in flight stat keeps growing.

* Return shadow map to pool when light is destroyed

https://files.facepunch.com/lolleko/2026/April/13_16-24-ClutteredCooter.png

* Use Queue instead of Stack for shadow texture pool eviction

We want FIFO semantics instead of LIFO.
Stack (LIFO) buried old textures under newer ones, potentially preventing disposal

* Remove unused OnLightRemoved callback
* Reduce allocation pressure in shadow mapper hot path.

Gets rid of a Bunch of array, IEnumerable and LINQ allocations.
It's only tiny bit more verbose

* Avoid string allocation every frame

* FindOrCreateProjectedCubeShadowMap: avoid allocations & frustum/matrix math

* AddShadowView: avoid CFmtStr in hot path
- Fix hotloading breaking ScenePanels
- `ScenePanel.Scene` setter now handles cleanup and will make sure re-assigning the same scene instance doessn't break anything
- Add tests
- `movie` command records light components
- Only include shadow properties if shadows are enabled
- Record DirectionalLight.SkyColor so things like day/night cycles are included in recordings properly

https://files.facepunch.com/CarsonKompon/2026/April/13_11-16-RoastedRook.mp4
* Hotspot tweaks

-Use Active Material
-Allow Mirror Horizontal/ Vertical
-Button for apply per face.

https://files.facepunch.com/louie/1b1411b1/sbox-dev_M3ykoez2o2.png
* Make Editable Mesh inside undo scope

* Copilot suggestion

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Stupid robot just getcomponent

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
New UI rendering that groups multiple panels to be grouped into a single draw call when possible.

New custom rendering API for custom panels using `Panel.Draw.XX` to emit drawing commands.
* Remove duplicated linux libraries and renamed them correctly, managed native libraries should have no versioning, libswscale was still being symlinked

* Fix case sensitiveness on these, causes Code folder to be doubled and make case insensitive vfs confused, no idea how this even happened

* Fix case sensitivity in asset paths to ensure sanity
… Rider

- `CS8974` warnings is false-positive for Razor integration in Rider
- Minor bugfix for unreacheable path validation in NavigationHost
- Use `Panel` instead of `div` when `@ref` is required
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.