diff --git a/OpenRA.Mods.Common/Lint/CheckActorReferences.cs b/OpenRA.Mods.Common/Lint/CheckActorReferences.cs index 30d7bc1712..453c4d5298 100644 --- a/OpenRA.Mods.Common/Lint/CheckActorReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckActorReferences.cs @@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Lint void CheckActorReference(Action emitError, ActorInfo actorInfo, TraitInfo traitInfo, FieldInfo fieldInfo, IReadOnlyDictionary dict, ActorReferenceAttribute attribute) { - var values = LintExts.GetFieldValues(traitInfo, fieldInfo, emitError, attribute.DictionaryReference); + var values = LintExts.GetFieldValues(traitInfo, fieldInfo, attribute.DictionaryReference); foreach (var value in values) { if (value == null) @@ -82,7 +82,7 @@ namespace OpenRA.Mods.Common.Lint void CheckWeaponReference(Action emitError, ActorInfo actorInfo, TraitInfo traitInfo, FieldInfo fieldInfo, IReadOnlyDictionary dict) { - var values = LintExts.GetFieldValues(traitInfo, fieldInfo, emitError); + var values = LintExts.GetFieldValues(traitInfo, fieldInfo); foreach (var value in values) { if (value == null) @@ -96,7 +96,7 @@ namespace OpenRA.Mods.Common.Lint void CheckVoiceReference(Action emitError, ActorInfo actorInfo, TraitInfo traitInfo, FieldInfo fieldInfo, IReadOnlyDictionary dict) { - var values = LintExts.GetFieldValues(traitInfo, fieldInfo, emitError); + var values = LintExts.GetFieldValues(traitInfo, fieldInfo); foreach (var value in values) { if (value == null) diff --git a/OpenRA.Mods.Common/Lint/CheckConditions.cs b/OpenRA.Mods.Common/Lint/CheckConditions.cs index 85c14b6b3c..fc185ec968 100644 --- a/OpenRA.Mods.Common/Lint/CheckConditions.cs +++ b/OpenRA.Mods.Common/Lint/CheckConditions.cs @@ -40,19 +40,19 @@ namespace OpenRA.Mods.Common.Lint { var fieldConsumed = trait.GetType().GetFields() .Where(x => x.HasAttribute()) - .SelectMany(f => LintExts.GetFieldValues(trait, f, emitError)); + .SelectMany(f => LintExts.GetFieldValues(trait, f)); var propertyConsumed = trait.GetType().GetProperties() .Where(x => x.HasAttribute()) - .SelectMany(p => LintExts.GetPropertyValues(trait, p, emitError)); + .SelectMany(p => LintExts.GetPropertyValues(trait, p)); var fieldGranted = trait.GetType().GetFields() .Where(x => x.HasAttribute()) - .SelectMany(f => LintExts.GetFieldValues(trait, f, emitError)); + .SelectMany(f => LintExts.GetFieldValues(trait, f)); var propertyGranted = trait.GetType().GetProperties() .Where(x => x.HasAttribute()) - .SelectMany(f => LintExts.GetPropertyValues(trait, f, emitError)); + .SelectMany(f => LintExts.GetPropertyValues(trait, f)); foreach (var c in fieldConsumed.Concat(propertyConsumed)) if (!string.IsNullOrEmpty(c)) diff --git a/OpenRA.Mods.Common/Lint/CheckCursors.cs b/OpenRA.Mods.Common/Lint/CheckCursors.cs index 85929a2ee2..7c2924e119 100644 --- a/OpenRA.Mods.Common/Lint/CheckCursors.cs +++ b/OpenRA.Mods.Common/Lint/CheckCursors.cs @@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Lint if (cursorReference == null) continue; - var cursor = LintExts.GetFieldValues(traitInfo, field, emitError, cursorReference.DictionaryReference).FirstOrDefault(); + var cursor = LintExts.GetFieldValues(traitInfo, field, cursorReference.DictionaryReference).FirstOrDefault(); if (string.IsNullOrEmpty(cursor)) continue; diff --git a/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs b/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs index 5e12e9d5d0..290d8611a3 100644 --- a/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs @@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Lint var fields = traitInfo.GetType().GetFields().Where(f => f.HasAttribute()); foreach (var field in fields) { - var locomotors = LintExts.GetFieldValues(traitInfo, field, emitError); + var locomotors = LintExts.GetFieldValues(traitInfo, field); foreach (var locomotor in locomotors) { if (string.IsNullOrEmpty(locomotor)) diff --git a/OpenRA.Mods.Common/Lint/CheckNotifications.cs b/OpenRA.Mods.Common/Lint/CheckNotifications.cs index d7ee9c0176..3993bffe31 100644 --- a/OpenRA.Mods.Common/Lint/CheckNotifications.cs +++ b/OpenRA.Mods.Common/Lint/CheckNotifications.cs @@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Lint else type = notificationReference.NotificationType; - var notifications = LintExts.GetFieldValues(traitInfo, field, emitError); + var notifications = LintExts.GetFieldValues(traitInfo, field); foreach (var notification in notifications) { if (string.IsNullOrEmpty(notification)) diff --git a/OpenRA.Mods.Common/Lint/CheckPalettes.cs b/OpenRA.Mods.Common/Lint/CheckPalettes.cs index c6d8382a9e..ac838d896d 100644 --- a/OpenRA.Mods.Common/Lint/CheckPalettes.cs +++ b/OpenRA.Mods.Common/Lint/CheckPalettes.cs @@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Lint isPlayerPalette = paletteReference.IsPlayerPalette; } - var references = LintExts.GetFieldValues(traitInfo, field, emitError); + var references = LintExts.GetFieldValues(traitInfo, field); foreach (var reference in references) { if (string.IsNullOrEmpty(reference)) @@ -100,7 +100,7 @@ namespace OpenRA.Mods.Common.Lint isPlayerPalette = paletteReference.IsPlayerPalette; } - var references = LintExts.GetFieldValues(projectileInfo, field, emitError); + var references = LintExts.GetFieldValues(projectileInfo, field); foreach (var reference in references) { if (string.IsNullOrEmpty(reference)) @@ -131,7 +131,7 @@ namespace OpenRA.Mods.Common.Lint foreach (var field in fields.Where(x => x.HasAttribute())) { var paletteDefinition = field.GetCustomAttributes(true).First(); - var values = LintExts.GetFieldValues(traitInfo, field, emitError); + var values = LintExts.GetFieldValues(traitInfo, field); foreach (var value in values) { if (paletteDefinition.IsPlayerPalette) diff --git a/OpenRA.Mods.Common/Lint/CheckSequences.cs b/OpenRA.Mods.Common/Lint/CheckSequences.cs index 1d157168f3..dac722c95f 100644 --- a/OpenRA.Mods.Common/Lint/CheckSequences.cs +++ b/OpenRA.Mods.Common/Lint/CheckSequences.cs @@ -83,7 +83,7 @@ namespace OpenRA.Mods.Common.Lint sequenceImages = new[] { imageOverride.ToLowerInvariant() }; } - foreach (var sequence in LintExts.GetFieldValues(traitInfo, field, emitError, sequenceReference.DictionaryReference)) + foreach (var sequence in LintExts.GetFieldValues(traitInfo, field, sequenceReference.DictionaryReference)) { if (string.IsNullOrEmpty(sequence)) continue; @@ -128,7 +128,7 @@ namespace OpenRA.Mods.Common.Lint } image = image.ToLowerInvariant(); - foreach (var sequence in LintExts.GetFieldValues(projectileInfo, field, emitError, sequenceReference.DictionaryReference)) + foreach (var sequence in LintExts.GetFieldValues(projectileInfo, field, sequenceReference.DictionaryReference)) { if (string.IsNullOrEmpty(sequence)) continue; diff --git a/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs b/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs index 7abb8e7c94..430de250e1 100644 --- a/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Lint var fields = traitInfo.GetType().GetFields().Where(f => f.HasAttribute()); foreach (var field in fields) { - var voiceSets = LintExts.GetFieldValues(traitInfo, field, emitError); + var voiceSets = LintExts.GetFieldValues(traitInfo, field); foreach (var voiceSet in voiceSets) { if (string.IsNullOrEmpty(voiceSet)) @@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Lint var fields = traitInfo.GetType().GetFields().Where(f => f.HasAttribute()); foreach (var field in fields) { - var voices = LintExts.GetFieldValues(traitInfo, field, emitError); + var voices = LintExts.GetFieldValues(traitInfo, field); foreach (var voice in voices) { if (string.IsNullOrEmpty(voice)) diff --git a/OpenRA.Mods.Common/Lint/LintExts.cs b/OpenRA.Mods.Common/Lint/LintExts.cs index 46647712b4..1f853afafa 100644 --- a/OpenRA.Mods.Common/Lint/LintExts.cs +++ b/OpenRA.Mods.Common/Lint/LintExts.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Lint { public class LintExts { - public static IEnumerable GetFieldValues(object ruleInfo, FieldInfo fieldInfo, Action emitError, + public static IEnumerable GetFieldValues(object ruleInfo, FieldInfo fieldInfo, LintDictionaryReference dictionaryReference = LintDictionaryReference.None) { var type = fieldInfo.FieldType; @@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Lint throw new InvalidOperationException($"Bad type for reference on {ruleInfo.GetType().Name}.{fieldInfo.Name}. Supported types: {supportedTypes.JoinWith(", ")}"); } - public static IEnumerable GetPropertyValues(object ruleInfo, PropertyInfo propertyInfo, Action emitError, + public static IEnumerable GetPropertyValues(object ruleInfo, PropertyInfo propertyInfo, LintDictionaryReference dictionaryReference = LintDictionaryReference.None) { var type = propertyInfo.PropertyType; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/MenuButtonsChromeLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/MenuButtonsChromeLogic.cs index 3cbd63a878..b860d12b9e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/MenuButtonsChromeLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/MenuButtonsChromeLogic.cs @@ -10,7 +10,6 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; using OpenRA.Mods.Common.Traits; using OpenRA.Widgets; @@ -22,13 +21,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly World world; readonly Widget worldRoot; readonly Widget menuRoot; - readonly string clickSound = ChromeMetrics.Get("ClickSound"); bool disableSystemButtons; Widget currentWidget; [ObjectCreator.UseCtor] - public MenuButtonsChromeLogic(Widget widget, ModData modData, World world, Dictionary logicArgs) + public MenuButtonsChromeLogic(Widget widget, World world) { this.world = world; @@ -82,9 +80,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic { "initialPanel", IngameInfoPanel.Debug } }); } - - if (logicArgs.TryGetValue("ClickSound", out var yaml)) - clickSound = yaml.Value; } void OpenMenuPanel(MenuButtonWidget button, WidgetArgs widgetArgs = null)