Skip to content

Commit 8d12692

Browse files
committed
Supress CS8974 for game projects & minor UI fixes to remove errors in 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
1 parent 279f8e0 commit 8d12692

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

engine/Sandbox.Compiling/CompilerConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public Configuration()
2424

2525
[Title( "Symbols" ), Description( "A list of pre-processor symbols to define when compiling, separated with semi-colons." )]
2626
public string DefineConstants { get; set; } = "SANDBOX";
27-
public string NoWarn { get; set; } = "1701;1702;1591;";
27+
public string NoWarn { get; set; } = "1701;1702;1591;8974;";
2828
public string WarningsAsErrors { get; set; } = "";
2929
public bool TreatWarningsAsErrors { get; set; }
3030
public bool Nullables { get; set; }

engine/Sandbox.SolutionGenerator/Templates/Project.Vars.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal partial class Project
3030
public string RootNamespace;
3131
public string Nullable = "disable";
3232
public string DefineConstants = "SANDBOX;DEBUG;TRACE";
33-
public string NoWarn = "1701;1702;1591";
33+
public string NoWarn = "1701;1702;1591;8974";
3434
public string WarningsAsErrors = "";
3535
public bool TreatWarningsAsErrors = false;
3636
public bool IsEditorProject = false;

game/addons/base/.sbproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"Compiler": {
1919
"RootNamespace": "Sandbox",
2020
"DefineConstants": "SANDBOX;ADDON;DEBUG",
21-
"NoWarn": "1701;1702;1591;",
2221
"TreatWarningsAsErrors": true
2322
}
2423
}

game/addons/base/code/UI/Components/NavigationHost.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public Panel Navigate( string url, bool redirectToDefault = true )
113113
//
114114
// Make url absolute by adding it to parent url
115115
//
116-
if ( url?.StartsWith( "~/" ) ?? false && parent.IsValid() )
116+
if ( (url?.StartsWith( "~/" ) ?? false) && parent.IsValid() )
117117
{
118118
url = $"{parent.CurrentUrl}/{url[2..]}";
119119
}

game/addons/base/code/UI/Controls/SliderControl.razor

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,22 @@
2121
</div>
2222
}
2323

24-
<div @ref="TrackPanel" class="track">
25-
<div class="track-active" style="width: @(SliderPosition)%;"></div>
26-
<div @ref="ThumbPanel" style="left: @(SliderPosition)%;" class="thumb">
27-
28-
@if (this.HasActive)
29-
{
30-
<div class="value-tooltip">
31-
<label>@Value.ToString( NumberFormat )</label>
32-
<div class="tail"></div>
33-
</div>
34-
}
35-
36-
</div>
37-
</div>
24+
<Panel @ref="TrackPanel" class="track">
25+
<ChildContent>
26+
<div class="track-active" style="width: @(SliderPosition)%;"></div>
27+
<Panel @ref="ThumbPanel" style="left: @(SliderPosition)%;" class="thumb">
28+
<ChildContent>
29+
@if (this.HasActive)
30+
{
31+
<div class="value-tooltip">
32+
<label>@Value.ToString( NumberFormat )</label>
33+
<div class="tail"></div>
34+
</div>
35+
}
36+
</ChildContent>
37+
</Panel>
38+
</ChildContent>
39+
</Panel>
3840

3941
</div>
4042
</root>

0 commit comments

Comments
 (0)