Skip to content

Commit

Permalink
5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nebby1999 committed Sep 7, 2024
1 parent 36e089f commit c909d42
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 13 deletions.
1 change: 0 additions & 1 deletion Assets/VisualElements/R2EKSettings.uxml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<RoR2.Editor.EqualLabelWidthContainer class="r2ek-elide-label" style="flex-grow: 1; flex-direction: column; -unity-text-align: upper-left; white-space: normal;">
<ui:TextField picking-mode="Ignore" label="Language Token Prefix" binding-path="_tokenPrefix" tooltip="A token prefix your your language tokens, this should not have white spaces, underscores or dashes." style="width: auto;" />
<ui:Toggle label="Enable RiskOfThunder Naming Conventions" name="EnableNamingConventions" binding-path="_enableNamingConventions" tooltip="Wether the official naming conventions for objects are enabled, this is yet to be inplemented" style="display: flex; visibility: visible;" />
<ui:Toggle label="Enable Thunderkit Integration" name="EnableThunderkitIntegration" binding-path="_enableThunderkitIntegration" tooltip="Wether the ThunderKit integration is enabled, which enables certain extra features. Suffice to say, it requires thunderkit." />
<ui:Toggle label="Purge Project Settings" name="PurgeProjectSettings" binding-path="_purgeProjectSettings" tooltip="Wether R2EK Purges the ProjectSettings file of orphaned settings" />
</RoR2.Editor.EqualLabelWidthContainer>
<ui:VisualElement>
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### '5.1.0'

* General Changes:
* Non Core Assemblies (RoR2.Editor.Scripts, RoR2.Editor.R2API, RoR2.Editor.Thunderkit) will only load when the required packages are installed utilizing the Version Defines system of AssemblyDefinitions.

* Core Changes:
* Removed logs from ``AssetDatabase.LoadAssetFromGUID`` to avoid generating multiple logs when being called by IMGUI related methods.
* Removed "Enable ThunderKit Integration" option from the main settings, as the ThunderKit integration now becomes enabled and disabled automatically depending on the AssemblyDef's Version Defines.

### '5.0.4'

* Core Changes:
Expand Down
2 changes: 0 additions & 2 deletions Editor/Core/AssetDatabaseUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@ public static T LoadAssetFromGUID<T>(GUID guid, Func<T> defaultInitializer = nul
var path = AssetDatabase.GUIDToAssetPath(guid);
if (string.IsNullOrEmpty(path))
{
Debug.LogWarning($"Cannot load asset with guid {guid} as the AssetDatabase doesnt contain said guid.");
return defaultInitializer?.Invoke() ?? default(T);
}

T obj = AssetDatabase.LoadAssetAtPath<T>(path);
if (!obj)
{
Debug.LogWarning($"Cannot load asset with guid {guid} using type {typeof(T).Name}.");
return defaultInitializer?.Invoke() ?? default(T);
}
return obj;
Expand Down
2 changes: 1 addition & 1 deletion Editor/Core/Data/EditorSettingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private static EditorSettingCollection GetEditorSetting(Type editorType, IEditor

return editorSetting;
}
throw new NullReferenceException($"Setting for editor type {editorType} within {provider.providerName} does not exist.");
return null;
}

private static EditorSettingCollection CreateSettingsFor(Type editorType, SettingType settingType, IEditorSettingProvider provider)
Expand Down
2 changes: 1 addition & 1 deletion Editor/R2APISupport/AddressReferencedAssetDrawer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if RISKOFRAIN2 && RISKOFTHUNDER_R2API_ADDRESSABLES
#if R2EK_R2API_ADDRESSABLES
using R2API.AddressReferencedAssets;
using System;
using System.Collections.Generic;
Expand Down
22 changes: 19 additions & 3 deletions Editor/R2APISupport/RoR2.Editor.R2API.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,25 @@
],
"autoReferenced": true,
"defineConstraints": [
"RISKOFTHUNDER_R2API_ADDRESSABLES",
"RISKOFRAIN2"
"R2EK_R2API_ENABLE",
"R2EK_ROR2_IMPORTED"
],
"versionDefines": [
{
"name": "riskofrain2",
"expression": "[1.3.1]",
"define": "R2EK_ROR2_IMPORTED"
},
{
"name" : "riskofthunder-r2api_addressables",
"expression" : "1.0.3",
"define": "R2EK_R2API_ADDRESSABLES"
},
{
"name" : "riskofthunder-r2api_core",
"expression" : "5.1.1",
"define": "R2EK_R2API_ENABLE"
}
],
"versionDefines": [],
"noEngineReferences": false
}
10 changes: 8 additions & 2 deletions Editor/RoR2/RoR2.Editor.Scripts.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@
],
"autoReferenced": true,
"defineConstraints": [
"RISKOFRAIN2"
"R2EK_ROR2_IMPORTED"
],
"versionDefines": [
{
"name": "riskofrain2",
"expression": "[1.3.1]",
"define": "R2EK_ROR2_IMPORTED"
}
],
"versionDefines": [],
"noEngineReferences": false
}
16 changes: 14 additions & 2 deletions Editor/ThunderkitSupport/RoR2.Editor.ThunderKit.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,20 @@
],
"autoReferenced": true,
"defineConstraints": [
"R2EK_THUNDERKIT"
"R2EK_THUNDERKIT",
"R2EK_ROR2_IMPORTED"
],
"versionDefines": [
{
"name": "com.passivepicasso.thunderkit",
"expression": "9.0.0",
"define": "R2EK_THUNDERKIT"
},
{
"name": "riskofrain2",
"expression": "[1.3.1]",
"define": "R2EK_ROR2_IMPORTED"
}
],
"versionDefines": [],
"noEngineReferences": false
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"url": ""
},
"displayName": "RoR2EditorKit",
"version": "5.0.2",
"version": "5.1.0",
"unity": "2021.3",
"description": "The Risk of Rain 2 Editor Kit (Abreviated as ROR2EK) is a Thunderkit Extension designed specifically for helping mod creators create content for Risk of Rain 2.",
"dependencies": {
Expand Down

0 comments on commit c909d42

Please sign in to comment.