Skip to content

Commit

Permalink
Merge pull request #2 from techno-dwarf-works/feature/refactoring
Browse files Browse the repository at this point in the history
Version 0.0.3
  • Loading branch information
uurha committed Oct 7, 2024
1 parent 8d5574f commit 5834709
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 39 deletions.
19 changes: 0 additions & 19 deletions Editor/EditorAddons/Settings/SelectElementBehaviour.cs

This file was deleted.

3 changes: 0 additions & 3 deletions Editor/EditorAddons/Settings/SelectElementBehaviour.cs.meta

This file was deleted.

4 changes: 3 additions & 1 deletion Editor/EditorAddons/Settings/ValidationSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@

namespace Better.Validation.EditorAddons.Settings
{
[ScriptableCreate(PrefixConstants.BetterPrefix + "/" + nameof(Editor) + "/" + nameof(Validation))]
[ScriptableCreate(SettingsPath)]
public class ValidationSettings : ScriptableSettings<ValidationSettings>
{
public const string SettingsPath = PrefixConstants.BetterPrefix + "/" + nameof(Editor) + "/" + nameof(Validation);

[SerializeField] private bool _disableBuildValidation;
[SerializeField] private ValidationType _buildLoggingLevel = ValidationType.Warning;

Expand Down
13 changes: 1 addition & 12 deletions Editor/EditorAddons/Settings/ValidationSettingsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,22 @@
using Better.Internal.Core.Runtime;
using Better.ProjectSettings.EditorAddons;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.UIElements;

namespace Better.Validation.EditorAddons.Settings
{
internal class ValidationSettingsProvider : ProjectSettingsProvider<ValidationSettings>
internal class ValidationSettingsProvider : DefaultProjectSettingsProvider<ValidationSettings>
{
private readonly Editor _editor;
public const string Path = PrefixConstants.BetterPrefix + "/" + nameof(Validation);

public ValidationSettingsProvider() : base(Path)
{
keywords = new HashSet<string>(new[] { "Better", "Validation", "Warnings", "Ignore" });
_editor = Editor.CreateEditor(_settings);
}

[MenuItem(Path + "/" + PrefixConstants.HighlightPrefix, false, 999)]
private static void Highlight()
{
SettingsService.OpenProjectSettings(ProjectPath + Path);
}

//TODO: maybe change to new InspectorElement(_editor); for DefaultProjectSettingsProvider<T>
protected override void CreateVisualElements(VisualElement rootElement)
{
var inspectorElement = new InspectorElement(_editor);
rootElement.Add(inspectorElement);
}
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "com.tdw.better.validation",
"displayName": "Better Validation",
"version": "0.0.2",
"version": "0.0.3",
"unity": "2021.3",
"description": " ",
"dependencies": {
"com.tdw.better.internal.core": "0.0.2",
"com.tdw.better.commons" : "0.0.44",
"com.tdw.better.attributes" : "0.0.1",
"com.tdw.better.projectsettings": "0.1.3"
"com.tdw.better.commons" : "0.0.57",
"com.tdw.better.attributes" : "0.0.2",
"com.tdw.better.projectsettings": "0.1.4"
},
"author": {
"name": "Better Plugins",
Expand Down

0 comments on commit 5834709

Please sign in to comment.