Compare commits
5 Commits
draft_text
...
ee4e489219
| Author | SHA1 | Date | |
|---|---|---|---|
| ee4e489219 | |||
| d720b03480 | |||
| 2c32af6b42 | |||
| b21023ba24 | |||
| 2d0b25f65c |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -3,3 +3,9 @@ obj/
|
|||||||
/packages/
|
/packages/
|
||||||
riderModule.iml
|
riderModule.iml
|
||||||
/_ReSharper.Caches/
|
/_ReSharper.Caches/
|
||||||
|
Package/embedded/polonium_templates/
|
||||||
|
Package/embedded/Patches/RegistryPassThrough.p.cs
|
||||||
|
VersionInfo.props
|
||||||
|
Polonium.sln.DotSettings.user
|
||||||
|
.godot
|
||||||
|
.idea
|
||||||
13
.idea/.idea.Polonium/.idea/.gitignore
generated
vendored
13
.idea/.idea.Polonium/.idea/.gitignore
generated
vendored
@@ -1,13 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Rider ignored files
|
|
||||||
/.idea.Hangman.SDK.iml
|
|
||||||
/modules.xml
|
|
||||||
/projectSettingsUpdater.xml
|
|
||||||
/contentModel.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
4
.idea/.idea.Polonium/.idea/encodings.xml
generated
4
.idea/.idea.Polonium/.idea/encodings.xml
generated
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
|
||||||
</project>
|
|
||||||
8
.idea/.idea.Polonium/.idea/indexLayout.xml
generated
8
.idea/.idea.Polonium/.idea/indexLayout.xml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="UserContentModel">
|
|
||||||
<attachedFolders />
|
|
||||||
<explicitIncludes />
|
|
||||||
<explicitExcludes />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
7
.idea/.idea.Polonium/.idea/vcs.xml
generated
7
.idea/.idea.Polonium/.idea/vcs.xml
generated
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
<mapping directory="$PROJECT_DIR$/../Polonium.Generators" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -41,8 +41,16 @@
|
|||||||
<EmbeddedFiles Include="$(MSBuildThisFileDirectory)embedded/**/*.*"/>
|
<EmbeddedFiles Include="$(MSBuildThisFileDirectory)embedded/**/*.*"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Copy
|
<Copy
|
||||||
SourceFiles="@(EmbeddedFiles)"
|
SourceFiles="@(EmbeddedFiles)"
|
||||||
DestinationFolder="$(ProjectDir)embedded/%(RecursiveDir)"
|
DestinationFolder="$(ProjectDir)embedded/%(RecursiveDir)"
|
||||||
|
/>
|
||||||
|
<Copy
|
||||||
|
SourceFiles="$(MSBuildThisFileDirectory)editorconfig"
|
||||||
|
DestinationFiles="$(ProjectDir).editorconfig"
|
||||||
|
/>
|
||||||
|
<Copy
|
||||||
|
SourceFiles="$(MSBuildThisFileDirectory)gitignore"
|
||||||
|
DestinationFiles="$(ProjectDir)embedded/.gitignore"
|
||||||
/>
|
/>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PoloniumTemplateFiles Include="$(MSBuildThisFileDirectory)embedded/polonium_templates/**/*.*" />
|
<PoloniumTemplateFiles Include="$(MSBuildThisFileDirectory)embedded/polonium_templates/**/*.*" />
|
||||||
|
|||||||
2
Package/build/editorconfig
Normal file
2
Package/build/editorconfig
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[embedded/*]
|
||||||
|
generated_code = true
|
||||||
1
Package/build/gitignore
Normal file
1
Package/build/gitignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*
|
||||||
@@ -24,7 +24,7 @@ public partial class PoloniumTextureButton : TextureButton
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
PrivateTextureSetName = value;
|
PrivateTextureSetName = value;
|
||||||
t = GlobalRegistry.TextureSetMap.GetValueOrDefault(value, null);
|
TextureSet t = GlobalRegistry.TextureSetMap.GetValueOrDefault(value, null);
|
||||||
if (t is not null)
|
if (t is not null)
|
||||||
{
|
{
|
||||||
TextureNormal = t.Normal;
|
TextureNormal = t.Normal;
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ public static partial class GlobalRegistry
|
|||||||
}
|
}
|
||||||
public static PoloniumRegistry PoloniumRegistry => PoloniumRegistry.Instance;
|
public static PoloniumRegistry PoloniumRegistry => PoloniumRegistry.Instance;
|
||||||
public static bool Paused { get; set; }
|
public static bool Paused { get; set; }
|
||||||
public static HashSet<ITimeConsumer> TimeConsumers { get; } = [];
|
|
||||||
public static void Prepare() => PoloniumRegistry.Prepare();
|
public static void Prepare() => PoloniumRegistry.Prepare();
|
||||||
|
|
||||||
// ReSharper disable once PartialTypeWithSinglePart
|
// ReSharper disable once PartialTypeWithSinglePart
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<Project Sdk="Godot.NET.Sdk/4.4.0-beta.3">
|
<Project Sdk="Godot.NET.Sdk/4.4.0-beta.3">
|
||||||
|
<Import Project="VersionInfo.props" Condition="Exists('VersionInfo.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
@@ -8,12 +8,13 @@
|
|||||||
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
||||||
<PackageId>Polonium</PackageId>
|
<PackageId>Polonium</PackageId>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<Version>0.1.1-x</Version>
|
<Version>$(PoloniumVersion)</Version>
|
||||||
<Authors>Hangman</Authors>
|
<Authors>Hangman</Authors>
|
||||||
<DisableImplicitRestore>true</DisableImplicitRestore>
|
<DisableImplicitRestore>true</DisableImplicitRestore>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Polonium.Tasks" Version="0.1.1-x" />
|
<PackageReference Include="Polonium.Tasks" Version="$(PoloniumTasksVersion)" />
|
||||||
|
<None Include="VersionInfo.props" Pack="true" PackagePath="build" Condition="Exists('VersionInfo.props')" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Target Name="Prepare" BeforeTargets="BeforeBuild">
|
<Target Name="Prepare" BeforeTargets="BeforeBuild">
|
||||||
<RemoveDir Directories="$(ProjectDir)Package/embedded/polonium_templates" Condition="Exists('$(ProjectDir)Package/polonium_templates')"/>
|
<RemoveDir Directories="$(ProjectDir)Package/embedded/polonium_templates" Condition="Exists('$(ProjectDir)Package/polonium_templates')"/>
|
||||||
@@ -23,16 +24,23 @@
|
|||||||
TemplateDirectory="$(ProjectDir)Package/embedded/polonium_templates"
|
TemplateDirectory="$(ProjectDir)Package/embedded/polonium_templates"
|
||||||
AttributeName="ProxyNode"
|
AttributeName="ProxyNode"
|
||||||
/>
|
/>
|
||||||
|
<Delete
|
||||||
|
Files="$(ProjectDir)Package/embedded/RegistryPassThrough.p.cs"
|
||||||
|
Condition="Exists('$(ProjectDir)Package/embedded/RegistryPassThrough.p.cs')"
|
||||||
|
/>
|
||||||
|
<GenerateRegistryPassThrough ProjectDir="$(ProjectDir)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="NuGet.config" />
|
<None Include="NuGet.config" />
|
||||||
<None Include="Package/build/$(AssemblyName).targets" Pack="true" PackagePath="build" />
|
<None Include="Package/build/**/*" Pack="true" PackagePath="build" />
|
||||||
<None Include="Package/build/$(AssemblyName).props" Pack="true" PackagePath="build" />
|
|
||||||
<None Include="Package/embedded/**/*.*" Pack="true" PackagePath="build/embedded" />
|
<None Include="Package/embedded/**/*.*" Pack="true" PackagePath="build/embedded" />
|
||||||
<None Include="publish" />
|
<None Include="publish" />
|
||||||
<None Include="build" />
|
<Compile Remove="Package/**/*.*" />
|
||||||
<Compile Remove="Package/**/*.*"/>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Package\build\editorconfig" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="CleanPreviousPackages" BeforeTargets="Build">
|
<Target Name="CleanPreviousPackages" BeforeTargets="Build">
|
||||||
@@ -57,6 +65,7 @@
|
|||||||
<Target Name="RestoreNoCache" BeforeTargets="Build">
|
<Target Name="RestoreNoCache" BeforeTargets="Build">
|
||||||
<Message Text="Restoring packages with no chache" Importance="high" />
|
<Message Text="Restoring packages with no chache" Importance="high" />
|
||||||
<Exec Command="dotnet restore --no-cache" />
|
<Exec Command="dotnet restore --no-cache" />
|
||||||
|
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
17
build
17
build
@@ -1,17 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
rm -rf ~/.nuget/packages/polonium*
|
|
||||||
cd ../Polonium.Tasks
|
|
||||||
dotnet clean Polonium.Tasks.csproj
|
|
||||||
dotnet restore Polonium.Tasks.csproj
|
|
||||||
dotnet build Polonium.Tasks.csproj
|
|
||||||
|
|
||||||
cd ../Polonium.Generators
|
|
||||||
dotnet clean Polonium.Generators.csproj
|
|
||||||
dotnet restore Polonium.Generators.csproj
|
|
||||||
dotnet build Polonium.Generators.csproj
|
|
||||||
|
|
||||||
cd ../Polonium
|
|
||||||
rm -rf ~/.nuget/packages/polonium*
|
|
||||||
dotnet clean Polonium.csproj
|
|
||||||
dotnet restore Polonium.csproj
|
|
||||||
dotnet build Polonium.csproj
|
|
||||||
12
publish
Normal file → Executable file
12
publish
Normal file → Executable file
@@ -1,2 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
dotnet nuget push "$(ls -t ./.godot/mono/temp/bin/Debug/Polonium.*.nupkg | head -n 1)" --source hangman-lab
|
|
||||||
|
SCRIPT_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")")/
|
||||||
|
LATEST_PACKAGE=$(ls -t "${SCRIPT_DIR}".godot/mono/temp/bin/Debug/Polonium.*.nupkg 2>/dev/null | head -n 1)
|
||||||
|
|
||||||
|
if [[ -z "$LATEST_PACKAGE" ]]; then
|
||||||
|
echo "❌ Error: No .nupkg file found in ${SCRIPT_DIR}/bin/Debug/"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "🚀 Pushing NuGet package: $LATEST_PACKAGE"
|
||||||
|
dotnet nuget push "$LATEST_PACKAGE" --source hangman-lab
|
||||||
|
|
||||||
|
|||||||
6
src/Attributes/RegistryPassThrough.cs
Normal file
6
src/Attributes/RegistryPassThrough.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Polonium.Attributes;
|
||||||
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
|
public class RegistryPassThrough(bool getterOnly = false) : Attribute
|
||||||
|
{
|
||||||
|
public bool GetterOnly { get; set; } = getterOnly;
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using Godot;
|
using Godot;
|
||||||
using Polonium.Agents;
|
using Polonium.Agents;
|
||||||
|
using Polonium.Attributes;
|
||||||
using Polonium.Interfaces;
|
using Polonium.Interfaces;
|
||||||
using Polonium.Resources;
|
using Polonium.Resources;
|
||||||
|
|
||||||
@@ -7,19 +8,24 @@ namespace Polonium;
|
|||||||
|
|
||||||
public class PoloniumRegistry
|
public class PoloniumRegistry
|
||||||
{
|
{
|
||||||
public static IGlobalRegistry GlobalRegistry { get; set; }
|
|
||||||
private static PoloniumRegistry InternalInstance { get; set; }
|
private static PoloniumRegistry InternalInstance { get; set; }
|
||||||
public static PoloniumRegistry Instance => InternalInstance ??= new PoloniumRegistry();
|
public static PoloniumRegistry Instance => InternalInstance ??= new PoloniumRegistry();
|
||||||
|
[RegistryPassThrough]
|
||||||
public Config Config { get; set; }
|
public Config Config { get; set; }
|
||||||
|
[RegistryPassThrough]
|
||||||
public Save Save { get; set; }
|
public Save Save { get; set; }
|
||||||
|
|
||||||
public static void Prepare()
|
public static void Prepare()
|
||||||
{
|
{
|
||||||
DirAccess.MakeDirAbsolute("user://saves");
|
DirAccess.MakeDirAbsolute("user://saves");
|
||||||
}
|
}
|
||||||
public Dictionary<string, Agent> Agents { get; set; } = new();
|
// ReSharper disable once CollectionNeverQueried.Global
|
||||||
|
[RegistryPassThrough(true)]
|
||||||
|
public Dictionary<string, Agent> Agents { get; } = new();
|
||||||
|
|
||||||
public HashSet<ITimeConsumer> TimeConsumers { get; set; } = new();
|
// ReSharper disable once CollectionNeverQueried.Global
|
||||||
|
[RegistryPassThrough(true)]
|
||||||
|
public HashSet<ITimeConsumer> TimeConsumers { get; } = new();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user