Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev --> Main for 1.5 release #263

Merged
merged 65 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7c1aa1f
Generified configuration :3
cheese3660 Jul 19, 2023
03e06ef
Move space warp over to using generic config system
cheese3660 Jul 19, 2023
b868f9e
Update build_spacewarp.yml
Rexicon226 Jul 22, 2023
6b0e855
delete external_dlls folder
Rexicon226 Jul 22, 2023
0b84b0f
Start work on modularizing Space Warp (Note, this will not build atm)
cheese3660 Jul 22, 2023
9d0cea8
Adding more stuff to PluginRegister.cs
cheese3660 Jul 22, 2023
7e29209
Got rid of most annoying part of SpaceWarpManager, splitting it into …
cheese3660 Jul 22, 2023
eb50e00
Close to working modularized space warp
cheese3660 Jul 22, 2023
a26702e
Working modularization, causes typeload exceptions w/ old mods
cheese3660 Jul 23, 2023
ec8cc0a
Fully functional refactoring of SpaceWarp into multiple modules
cheese3660 Jul 23, 2023
3bc70af
remove dll copy from readme
Rexicon226 Jul 23, 2023
2b28a8c
Small refactoring (code style, unused imports...)
jan-bures Jul 24, 2023
3fc028d
Merge pull request #248 from SpaceWarpDev/modularization
cheese3660 Jul 24, 2023
9f497ff
Sound API made public
jan-bures Jul 24, 2023
2c358d3
Merge pull request #249 from SpaceWarpDev/sound-api
jan-bures Jul 24, 2023
7326cdd
Cleaned up project files
jan-bures Jul 24, 2023
4de2335
Added PublicAPI/UsedImplicitely attributes where appropriate, did som…
jan-bures Jul 25, 2023
63bdc7d
Loading screen stuff
cheese3660 Jul 26, 2023
7ceb4d4
Merge remote-tracking branch 'origin/dev' into dev
cheese3660 Jul 26, 2023
30be71c
Fix loading screen patching
cheese3660 Jul 26, 2023
ecbfdef
set version to 1.5.0 in dev
Rexicon226 Jul 27, 2023
403a8df
Update SpaceWarpPlugin.cs
Rexicon226 Jul 27, 2023
ff5ecaf
Merge branch 'dev' into 1.5-refactor
Rexicon226 Jul 27, 2023
b214b5c
Merge pull request #250 from SpaceWarpDev/1.5-refactor
Rexicon226 Jul 27, 2023
c8e70fe
Start messaging project
cheese3660 Aug 24, 2023
e82e4cd
Merge remote-tracking branch 'origin/dev' into dev
cheese3660 Aug 24, 2023
1604b27
Add csproj as well lol
cheese3660 Aug 24, 2023
cf7bd58
Some changes for 1.5 :3
cheese3660 Aug 24, 2023
0b661fd
Finished automatic swinfo generation
cheese3660 Aug 26, 2023
69aebac
Details!
cheese3660 Aug 27, 2023
8789ee4
Add comment on where to use it
cheese3660 Aug 27, 2023
b166193
Allow `-prerelease` in the like in semantic versions
cheese3660 Aug 27, 2023
791b78a
Treat versions appended with `-...` as before those appended without
cheese3660 Aug 27, 2023
b02fe2f
Attempt to compare prerelease versions
cheese3660 Aug 27, 2023
64c106d
Add SemanticVersion class and associated tests
jan-bures Aug 27, 2023
3b72644
Change version checking to use semantic versioning in spec 2.0.
jan-bures Aug 27, 2023
305d581
Using semver checking for dependencies now, fixed old version utility
cheese3660 Aug 27, 2023
ac4ca33
Merge pull request #254 from SpaceWarpDev/semver
cheese3660 Aug 27, 2023
dbb9707
Resolve issue #224
cheese3660 Aug 28, 2023
5247c1a
GOTs message bus handling system first edition, copypasta'd out to 16…
cheese3660 Aug 28, 2023
7c9b110
Merge pull request #255 from SpaceWarpDev/messaging
cheese3660 Aug 28, 2023
9ac7043
Add wiki link to details pane for spacewarp
cheese3660 Aug 28, 2023
395bef8
Merge remote-tracking branch 'origin/dev' into dev
cheese3660 Aug 28, 2023
0aa2033
Recursive disabling
cheese3660 Aug 30, 2023
ee5c425
Fix config stomping
cheese3660 Aug 30, 2023
a84a1b7
Convert `-` for 1.5
cheese3660 Aug 31, 2023
4148593
Possibly Reading SWInfo version to stop me from duplicating stuff?
cheese3660 Aug 31, 2023
08bf6cd
Fix problem completely about invalid ids
cheese3660 Sep 1, 2023
818dd9e
Merge branch 'hotfix-1.4.4_possibly' into dev
cheese3660 Sep 1, 2023
2085d62
Fix paths and colors
cheese3660 Sep 1, 2023
3874301
Remove failed json peek stuff
cheese3660 Sep 1, 2023
1a66353
Convert CRLF -> LF for localization files
cheese3660 Sep 1, 2023
620919e
Initial scaffolding
Falki-git Sep 5, 2023
f2f14e2
Add KSC app tray and button registration
Falki-git Sep 5, 2023
d25b194
Cleanup
Falki-git Sep 7, 2023
2504a62
Remove unused code and add comments
Falki-git Sep 7, 2023
b5c42b4
Cleanup
Falki-git Sep 7, 2023
e7f641a
Merge pull request #261 from Falki-git/KscAppTray
cheese3660 Sep 7, 2023
cc558ba
First steps for definining conflicts in the 2.0 spec
cheese3660 Sep 8, 2023
1bc95ee
Fix all known problems with settings menu
cheese3660 Sep 8, 2023
6456031
Update the bundle to have a conflict foldout
cheese3660 Sep 8, 2023
cf62901
Conflict errors now show in the mods list, update localization
cheese3660 Sep 8, 2023
f34dc8e
Fix bugs related to the nonexistence of gamedata/mods
cheese3660 Sep 8, 2023
e7b54f8
Fix a bug I noticed in the PluginRegister.cs file
cheese3660 Sep 13, 2023
1693054
Actually handle 1.2 mods correctly (eww)
cheese3660 Oct 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project>
<PropertyGroup>
<SpaceWarpVersion>1.4.3</SpaceWarpVersion>
<SpaceWarpVersion>1.5.0</SpaceWarpVersion>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>SpaceWarp</RootNamespace>
<LangVersion>11</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
Expand All @@ -28,4 +29,23 @@
System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute;
</PolySharpIncludeGeneratedTypes>
</PropertyGroup>

<!-- <ItemGroup Label="Dependencies for build targets">-->
<!-- <PackageReference Include="JsonPeek" Version="1.2.0" PrivateAssets="all"/>-->
<!-- </ItemGroup>-->

<!-- &lt;!&ndash; Define the main target &ndash;&gt;-->
<!-- <Target Label="Reading properties from swinfo.json" Name="ReadPropertiesFromJson" BeforeTargets="PreBuildEvent">-->
<!-- <JsonPeek ContentPath="$(SolutionDir)/SpaceWarpBuildTemplate/swinfo.json" Query="$">-->
<!-- <Output TaskParameter="Result" ItemName="Swinfo"/>-->
<!-- </JsonPeek>-->
<!-- <JsonPeek ContentPath="$(SolutionDir)/SpaceWarpBuildTemplate/swinfo.json" Query="$.dependencies">-->
<!-- <Output TaskParameter="Result" ItemName="Dependencies"/>-->
<!-- </JsonPeek>-->

<!-- &lt;!&ndash; Extract properties from the JSON &ndash;&gt;-->
<!-- <PropertyGroup>-->
<!-- <SpaceWarpVersion>@(Swinfo -> '%(version)')</SpaceWarpVersion>-->
<!-- </PropertyGroup>-->
<!-- </Target>-->
</Project>
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using JetBrains.Annotations;
using SpaceWarp.API.Lua;
using UnityEngine;
using Logger = BepInEx.Logging.Logger;

namespace SpaceWarp.API.Assets;

[SpaceWarpLuaAPI("Assets")]
[PublicAPI]
public static class AssetManager
{
private static readonly Dictionary<string, UnityObject> AllAssets = new();
Expand Down Expand Up @@ -135,7 +137,7 @@ public static bool TryGetAsset<T>(string path, out T asset) where T : UnityObjec

return true;
}

/// <summary>
/// Gets an asset from the specified asset path
/// </summary>
Expand Down
45 changes: 45 additions & 0 deletions SpaceWarp.Core/API/Configuration/BepInExConfigEntry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using BepInEx.Configuration;
using JetBrains.Annotations;

namespace SpaceWarp.API.Configuration;

[PublicAPI]
public class BepInExConfigEntry : IConfigEntry
{
public readonly ConfigEntryBase EntryBase;

public BepInExConfigEntry(ConfigEntryBase entryBase)
{
EntryBase = entryBase;
}

public object Value
{
get => EntryBase.BoxedValue;
set => EntryBase.BoxedValue = value;
}
public Type ValueType => EntryBase.SettingType;

public T Get<T>() where T : class
{
if (!typeof(T).IsAssignableFrom(ValueType))
{
throw new InvalidCastException($"Cannot cast {ValueType} to {typeof(T)}");
}

return Value as T;
}

public void Set<T>(T value)
{
if (!ValueType.IsAssignableFrom(typeof(T)))
{
throw new InvalidCastException($"Cannot cast {ValueType} to {typeof(T)}");
}

EntryBase.BoxedValue = Convert.ChangeType(value, ValueType);
}

public string Description => EntryBase.Description.Description;
}
34 changes: 34 additions & 0 deletions SpaceWarp.Core/API/Configuration/BepInExConfigFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System.Collections.Generic;
using BepInEx.Configuration;
using JetBrains.Annotations;

namespace SpaceWarp.API.Configuration;

[PublicAPI]
public class BepInExConfigFile : IConfigFile
{

public readonly ConfigFile AdaptedConfigFile;

public BepInExConfigFile(ConfigFile adaptedConfigFile)
{
AdaptedConfigFile = adaptedConfigFile;
}

public void Save()
{
AdaptedConfigFile.Save();
}

public IConfigEntry this[string section, string key] => new BepInExConfigEntry(AdaptedConfigFile[section, key]);

public IConfigEntry Bind<T>(string section, string key, T defaultValue = default, string description = "")
{
return new BepInExConfigEntry(AdaptedConfigFile.Bind(section, key, defaultValue, description));
}

public IReadOnlyList<string> Sections => AdaptedConfigFile.Keys.Select(x => x.Section).Distinct().ToList();

public IReadOnlyList<string> this[string section] => AdaptedConfigFile.Keys.Where(x => x.Section == section)
.Select(x => x.Key).ToList();
}
25 changes: 25 additions & 0 deletions SpaceWarp.Core/API/Configuration/ConfigValue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using JetBrains.Annotations;

namespace SpaceWarp.API.Configuration;

[PublicAPI]
public class ConfigValue<T>
{
public IConfigEntry Entry;

public ConfigValue(IConfigEntry entry)
{
Entry = entry;
if (typeof(T) != entry.ValueType)
{
throw new ArgumentException(nameof(entry));
}
}

public T Value
{
get => (T)Entry.Value;
set => Entry.Value = value;
}
}
23 changes: 23 additions & 0 deletions SpaceWarp.Core/API/Configuration/EmptyConfigFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections.Generic;
using JetBrains.Annotations;

namespace SpaceWarp.API.Configuration;

[PublicAPI]
public class EmptyConfigFile : IConfigFile
{
public void Save()
{
}

public IConfigEntry this[string section, string key] => throw new KeyNotFoundException($"{section}/{key}");

public IConfigEntry Bind<T>(string section, string key, T defaultValue = default, string description = "")
{
throw new System.NotImplementedException();
}

public IReadOnlyList<string> Sections => new List<string>();

public IReadOnlyList<string> this[string section] => throw new KeyNotFoundException($"{section}");
}
15 changes: 15 additions & 0 deletions SpaceWarp.Core/API/Configuration/IConfigEntry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using JetBrains.Annotations;

namespace SpaceWarp.API.Configuration;

[PublicAPI]
public interface IConfigEntry
{
public object Value { get; set; }
public Type ValueType { get; }
public T Get<T>() where T : class;
public void Set<T>(T value);

public string Description { get; }
}
17 changes: 17 additions & 0 deletions SpaceWarp.Core/API/Configuration/IConfigFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Collections.Generic;
using JetBrains.Annotations;

namespace SpaceWarp.API.Configuration;

[PublicAPI]
public interface IConfigFile
{
public void Save();

public IConfigEntry this[string section, string key] { get; }

public IConfigEntry Bind<T>(string section, string key, T defaultValue = default, string description = "");

public IReadOnlyList<string> Sections { get; }
public IReadOnlyList<string> this[string section] { get; }
}
53 changes: 53 additions & 0 deletions SpaceWarp.Core/API/Configuration/JsonConfigEntry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System;
using JetBrains.Annotations;

namespace SpaceWarp.API.Configuration;

[PublicAPI]
public class JsonConfigEntry : IConfigEntry
{
private readonly JsonConfigFile _configFile;
private object _value;

public JsonConfigEntry(JsonConfigFile configFile, Type type, string description, object value)
{
_configFile = configFile;
_value = value;
Description = description;
ValueType = type;
}


public object Value
{
get => _value;
set
{
_value = value;
_configFile.Save();
}
}

public Type ValueType { get; }
public T Get<T>() where T : class
{
if (!typeof(T).IsAssignableFrom(ValueType))
{
throw new InvalidCastException($"Cannot cast {ValueType} to {typeof(T)}");
}

return Value as T;
}

public void Set<T>(T value)
{
if (!ValueType.IsAssignableFrom(typeof(T)))
{
throw new InvalidCastException($"Cannot cast {ValueType} to {typeof(T)}");
}

Value = Convert.ChangeType(value, ValueType);
}

public string Description { get; }
}
Loading