diff --git a/DunGenPlus/DunGenPlus.sln b/DunGenPlus/DunGenPlus.sln index 725ac19..d831d28 100644 --- a/DunGenPlus/DunGenPlus.sln +++ b/DunGenPlus/DunGenPlus.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 17.10.35013.160 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DunGenPlus", "DunGenPlus\DunGenPlus.csproj", "{13CDE60E-1975-463B-9DA1-CCB3F3EBABD8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DunGenPlusEditor", "DunGenPlusEditor\DunGenPlusEditor.csproj", "{D3F32D4B-49DA-46D2-A408-000D4B2513EC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {13CDE60E-1975-463B-9DA1-CCB3F3EBABD8}.Debug|Any CPU.Build.0 = Debug|Any CPU {13CDE60E-1975-463B-9DA1-CCB3F3EBABD8}.Release|Any CPU.ActiveCfg = Release|Any CPU {13CDE60E-1975-463B-9DA1-CCB3F3EBABD8}.Release|Any CPU.Build.0 = Release|Any CPU + {D3F32D4B-49DA-46D2-A408-000D4B2513EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3F32D4B-49DA-46D2-A408-000D4B2513EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3F32D4B-49DA-46D2-A408-000D4B2513EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3F32D4B-49DA-46D2-A408-000D4B2513EC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DunGenPlus/DunGenPlus/DunGenPlus.csproj b/DunGenPlus/DunGenPlus/DunGenPlus.csproj index 97c7fdb..71e7fed 100644 --- a/DunGenPlus/DunGenPlus/DunGenPlus.csproj +++ b/DunGenPlus/DunGenPlus/DunGenPlus.csproj @@ -201,7 +201,9 @@ - copy "$(TargetPath)" "C:\Users\Jose Garcia\AppData\Roaming\r2modmanPlus-local\LethalCompany\profiles\SDM Debug\BepInEx\plugins\Alice-DungeonGenerationPlus\$(TargetName).dll" + copy "$(TargetPath)" "C:\Users\Jose Garcia\AppData\Roaming\r2modmanPlus-local\LethalCompany\profiles\SDM Debug\BepInEx\plugins\Alice-DungeonGenerationPlus\$(TargetName).dll" +copy "$(TargetPath)" "D:\Previous Computer\Desktop\LethalCompany Modding\Libraries\$(TargetName).dll" +copy "$(TargetPath)" "D:\Previous Computer\Desktop\LethalCompany Modding\DunGenPlus\DunGenPlus\DunGenPlus\DunGenPlus\$(TargetName).dll" copy "D:\Previous Computer\Desktop\LethalCompany Modding\Unity Template\Assets\AssetBundles\dungen" "$(ProjectDir)\dungen" diff --git a/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll b/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll index 41dafe6..e4dae0a 100644 Binary files a/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll and b/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll differ diff --git a/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlusEditor.dll b/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlusEditor.dll new file mode 100644 index 0000000..f56643c Binary files /dev/null and b/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlusEditor.dll differ diff --git a/DunGenPlus/DunGenPlusEditor/DunGenPlusEditor.csproj b/DunGenPlus/DunGenPlusEditor/DunGenPlusEditor.csproj new file mode 100644 index 0000000..6c2a145 --- /dev/null +++ b/DunGenPlus/DunGenPlusEditor/DunGenPlusEditor.csproj @@ -0,0 +1,82 @@ + + + + + Debug + AnyCPU + {D3F32D4B-49DA-46D2-A408-000D4B2513EC} + Library + Properties + DunGenPlusEditor + DunGenPlusEditor + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\Libraries\Assembly-CSharp-firstpass.dll + + + ..\..\..\Libraries\Assembly-CSharp-publicized.dll + + + ..\..\..\Libraries\DunGenPlus.dll + + + + + + + + + + + ..\..\..\Libraries\UnityEditor.dll + + + ..\..\..\Libraries\UnityEditor.UIBuilderModule.dll + + + ..\..\..\Libraries\UnityEditor.UIElementsModule.dll + + + ..\..\..\Libraries\UnityEngine.dll + + + ..\..\..\Libraries\UnityEngine.CoreModule.dll + + + False + ..\..\..\Libraries\UnityEngine.TextRenderingModule.dll + + + ..\..\..\Libraries\UnityEngine.UIElementsModule.dll + + + + + + + + + copy "$(TargetPath)" "D:\Previous Computer\Desktop\LethalCompany Modding\DunGenPlus\DunGenPlus\DunGenPlus\DunGenPlus\$(TargetName).dll" + + \ No newline at end of file diff --git a/DunGenPlus/DunGenPlusEditor/Properties/AssemblyInfo.cs b/DunGenPlus/DunGenPlusEditor/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..33893eb --- /dev/null +++ b/DunGenPlus/DunGenPlusEditor/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下を通して制御されます +// 制御されます。アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("DunGenPlusEditor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DunGenPlusEditor")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから +// 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります +[assembly: Guid("d3f32d4b-49da-46d2-a408-000d4b2513ec")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// メジャー バージョン +// マイナー バージョン +// ビルド番号 +// リビジョン +// +// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DunGenPlus/DunGenPlusEditor/PropertyOverridePropertyDrawer.cs b/DunGenPlus/DunGenPlusEditor/PropertyOverridePropertyDrawer.cs new file mode 100644 index 0000000..82560cb --- /dev/null +++ b/DunGenPlus/DunGenPlusEditor/PropertyOverridePropertyDrawer.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEditor; +using UnityEditor.UIElements; +using UnityEngine.UIElements; +using DunGenPlus; + +namespace DunGenPlusEditor { + [CustomPropertyDrawer(typeof(PropertyOverride<>), true)] + public class PropertyOverridePropertyDrawer : PropertyDrawer { + + public override VisualElement CreatePropertyGUI(SerializedProperty property) { + + var container = new VisualElement(); + + var box = new Box(); + box.style.paddingBottom = 4f; + box.style.paddingLeft = 4f; + box.style.paddingRight = 4f; + box.style.paddingTop = 4f; + box.style.marginBottom = 8f; + + var label = new Label(property.displayName); + var weight = label.style.unityFontStyleAndWeight; + weight.value = UnityEngine.FontStyle.Bold; + label.style.unityFontStyleAndWeight = weight; + box.Add(label); + + var overrideProperty = property.FindPropertyRelative("Override"); + var valueProperty = property.FindPropertyRelative("Value"); + + var overrideItem = new PropertyField(overrideProperty); + overrideItem.style.marginLeft = 8f; + var valueItem = new PropertyField(valueProperty); + valueItem.style.marginLeft = 8f; + var valueDefaultItem = new Label("Using DungeonFlow's corresponding values"); + valueDefaultItem.style.marginLeft = 11f; + + void SetDisplayState(bool state){ + valueItem.style.display = state ? DisplayStyle.Flex : DisplayStyle.None; + valueDefaultItem.style.display = !state ? DisplayStyle.Flex : DisplayStyle.None; + } + SetDisplayState(overrideProperty.boolValue); + overrideItem.RegisterValueChangeCallback(evt => SetDisplayState(evt.changedProperty.boolValue)); + + box.Add(overrideItem); + box.Add(valueItem); + box.Add(valueDefaultItem); + + container.Add(box); + + return container; + } + + } +}