From ba246dd63800f8e45f7c78fed0eabecbf9db31c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sat, 2 Mar 2024 14:19:02 +0100 Subject: [PATCH] ScriptCore: Fixed some nullable warnings --- ScriptCore/Editor/EntityEditor.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ScriptCore/Editor/EntityEditor.cs b/ScriptCore/Editor/EntityEditor.cs index 75e73d8..eaa98bf 100644 --- a/ScriptCore/Editor/EntityEditor.cs +++ b/ScriptCore/Editor/EntityEditor.cs @@ -76,7 +76,7 @@ internal class EntityEditor /// The list of attributes of the field. If it contains a , this will be used as the tooltip. /// If null or the attribute isn't in the list, will be used as tooltip. /// A string containing the propertyName as ImGui id - private static string StartNewProperty(string propertyName, IEnumerable attributes) + private static string StartNewProperty(string propertyName, IEnumerable? attributes) { TooltipAttribute? tooltip = GetAttribute(attributes); @@ -251,7 +251,7 @@ internal class EntityEditor } } - var value = (T)reference; + var value = (T)reference!; if (range?.Slider == true) { @@ -271,7 +271,7 @@ internal class EntityEditor if (fieldType == typeof(bool)) { - bool value = (bool)reference; + bool value = (bool)reference!; if (ImGui.Checkbox(fieldId, ref value)) newValue = value; } @@ -283,7 +283,7 @@ internal class EntityEditor // TODO: Add text input validation, so that it isn't possible to type invalid chars char* value = stackalloc char[4]; - switch((char)reference) + switch((char)reference!) { case '\a': value[0] = '\\'; @@ -759,7 +759,7 @@ internal class EntityEditor return newValue; } - private static object? ShowEntityDropTarget(string fieldName, Type fieldType, object? currentValue, IEnumerable attributes) + private static object? ShowEntityDropTarget(string fieldName, Type fieldType, object? currentValue, IEnumerable? attributes) { object? newValue = DidNotChange;