1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:07:52 +08:00

Update code to support new inspectcode analysis rules

This commit is contained in:
Dean Herbert 2017-09-14 12:58:32 +09:00
parent 0ca60eaecc
commit b1145272d1
12 changed files with 23 additions and 12 deletions

View File

@ -1,3 +1,4 @@
# 2017-09-14
clone_depth: 1
version: '{branch}-{build}'
configuration: Debug

@ -1 +1 @@
Subproject commit b060218232fcd6f24d4922d05160616db0195bd4
Subproject commit 7347c386dcd10eb799b1ce1512536879328109f9

View File

@ -99,9 +99,12 @@ namespace osu.Game.Beatmaps
public bool TrackLoaded => track != null;
public void TransferTo(WorkingBeatmap other)
{
lock (trackLock)
{
if (track != null && BeatmapInfo.AudioEquals(other.BeatmapInfo))
other.track = track;
}
if (background != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo))
other.background = background;

View File

@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Settings.Sections.Debug
{
RelativeSizeAxes = Axes.X,
Text = "Force garbage collection",
Action = () => GC.Collect()
Action = GC.Collect
},
};
}

View File

@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
{
RelativeSizeAxes = Axes.X,
Text = "Open osu! folder",
Action = () => storage.OpenInNativeExplorer(),
Action = storage.OpenInNativeExplorer,
}
};
}

View File

@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{
RelativeSizeAxes = Axes.X,
Text = "Key Configuration",
Action = () => keyConfig.ToggleVisibility()
Action = keyConfig.ToggleVisibility
},
};
}

View File

@ -50,7 +50,7 @@ namespace osu.Game.Screens.Menu
OnEdit = delegate { Push(new Editor()); },
OnSolo = delegate { Push(consumeSongSelect()); },
OnMulti = delegate { Push(new Lobby()); },
OnExit = delegate { Exit(); },
OnExit = Exit,
}
}
},

View File

@ -1,8 +1,10 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Objects;
@ -34,10 +36,12 @@ namespace osu.Game.Screens.Play
foreach (var h in objects)
{
IHasEndTime end = h as IHasEndTime;
var endTime = Math.Max((h as IHasEndTime)?.EndTime ?? h.StartTime, h.StartTime);
Debug.Assert(endTime > h.StartTime);
int startRange = (int)((h.StartTime - firstHit) / interval);
int endRange = (int)(((end?.EndTime > 0 ? end.EndTime : h.StartTime) - firstHit) / interval);
int endRange = (int)((endTime - firstHit) / interval);
for (int i = startRange; i <= endRange; i++)
Values[i]++;
}

View File

@ -106,7 +106,7 @@ namespace osu.Game.Screens.Select
Origin = Anchor.CentreRight,
SelectionChanged = carouselSelectionChanged,
BeatmapsChanged = carouselBeatmapsLoaded,
DeleteRequested = b => promptDelete(b),
DeleteRequested = promptDelete,
RestoreRequested = s => { foreach (var b in s.Beatmaps) manager.Restore(b); },
HideDifficultyRequested = b => manager.Hide(b),
StartRequested = () => carouselRaisedStart(),

View File

@ -237,7 +237,7 @@ namespace osu.Game.Screens.Tournament
RelativeSizeAxes = Axes.X,
Text = "Reset",
Action = () => reset(false)
Action = () => reset()
}
}
}

View File

@ -26,7 +26,7 @@ namespace osu.Game.Users
private void load(TextureStore textures)
{
Texture texture = null;
if (user?.Id > 1) texture = textures.Get($@"https://a.ppy.sh/{user.Id}");
if (user != null && user.Id > 1) texture = textures.Get($@"https://a.ppy.sh/{user.Id}");
if (texture == null) texture = textures.Get(@"Online/avatar-guest");
Add(new Sprite

View File

@ -56,6 +56,8 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NestedStringInterpolation/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NotAccessedField_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterHidesMember/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterOnlyUsedForPreconditionCheck_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterOnlyUsedForPreconditionCheck_002ELocal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PossibleMultipleEnumeration/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PrivateVariableCanBeMadeReadonly/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PublicConstructorInAbstractClass/@EntryIndexedValue">WARNING</s:String>
@ -617,6 +619,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-frame
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FENUM/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FENUM_005FMEMBER/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FINTERFACE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMIXED_005FENUM/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE_005FEXPORTED/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE_005FLOCAL/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>