-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 864ac9c
Showing
27 changed files
with
1,456 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: CI | ||
|
||
on: [ "push", "pull_request" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 6.x | ||
|
||
- name: Run the Cake script | ||
uses: cake-build/cake-action@v1 | ||
with: | ||
verbosity: Diagnostic | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: Dumpostor.dll | ||
path: Dumpostor/bin/Release/net6.0/Dumpostor.dll | ||
|
||
- uses: softprops/action-gh-release@v1 | ||
if: github.ref_type == 'tag' | ||
with: | ||
draft: true | ||
files: Dumpostor/bin/Release/net6.0/Dumpostor.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
bin/ | ||
obj/ | ||
/packages/ | ||
riderModule.iml | ||
/_ReSharper.Caches/ | ||
.idea | ||
/tools | ||
.vscode | ||
*.DotSettings.user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dumpostor", "Dumpostor\Dumpostor.csproj", "{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// ReSharper disable CheckNamespace | ||
|
||
namespace System.Runtime.CompilerServices; | ||
|
||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, Inherited = false)] | ||
internal sealed class RequiredMemberAttribute : Attribute | ||
{ | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] | ||
internal sealed class CompilerFeatureRequiredAttribute : Attribute | ||
{ | ||
public CompilerFeatureRequiredAttribute(string featureName) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using HarmonyLib; | ||
using TMPro; | ||
using UnityEngine; | ||
|
||
namespace Dumpostor; | ||
|
||
[HarmonyPatch] | ||
internal sealed class DummyMapLoadHacks | ||
{ | ||
public static void Initialize() | ||
{ | ||
TranslationController.Instance.Awake(); | ||
DumpostorPlugin.EnglishLanguageUnit = new LanguageUnit(TranslationController.Instance.Languages[SupportedLangs.English]); | ||
|
||
var go = new GameObject(); | ||
var shadowQuad = go.AddComponent<MeshRenderer>(); | ||
shadowQuad.material = new Material(Shader.Find("Unlit/ShadowShader")); | ||
HudManager.Instance.ShadowQuad = shadowQuad; | ||
|
||
HudManager.Instance.Chat = go.AddComponent<ChatController>(); | ||
HudManager.Instance.GameSettings = go.AddComponent<TextMeshPro>(); | ||
|
||
Camera.main!.gameObject.AddComponent<FollowerCamera>(); | ||
|
||
go.AddComponent<NormalGameManager>(); | ||
} | ||
|
||
[HarmonyPatch(typeof(ChatController), nameof(ChatController.ForceClosed))] | ||
[HarmonyPrefix] | ||
public static bool SkipForceClosed() => false; | ||
|
||
[HarmonyPatch(typeof(ChatController), nameof(ChatController.SetVisible))] | ||
[HarmonyPrefix] | ||
public static bool SkipSetVisible() => false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text.Json; | ||
|
||
namespace Dumpostor.Dumpers; | ||
|
||
public sealed class ColorDumper : IDumper | ||
{ | ||
public string FileName => Path.Combine("enums", "ColorType.json"); | ||
|
||
public string Dump() | ||
{ | ||
var id = 0; | ||
|
||
return JsonSerializer.Serialize( | ||
Palette.ColorNames.ToDictionary(k => DumpostorPlugin.EnglishLanguageUnit.GetString(k.ToString()).ToLower().Capitalize(), _ => id++), | ||
DumpostorPlugin.JsonSerializerOptions | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Text.Json; | ||
using Il2CppSystem.IO; | ||
|
||
namespace Dumpostor.Dumpers; | ||
|
||
public sealed class EnumDumper<T> : IDumper where T : Enum | ||
{ | ||
public string FileName => Path.Combine("enums", typeof(T).Name + ".json"); | ||
|
||
public string Dump() | ||
{ | ||
return JsonSerializer.Serialize( | ||
Extensions.GetValues<T>().ToDictionary(k => Enum.GetName(typeof(T), k), v => v), | ||
new JsonSerializerOptions | ||
{ | ||
WriteIndented = true, | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Dumpostor.Dumpers; | ||
|
||
public interface IDumper | ||
{ | ||
string FileName { get; } | ||
|
||
string Dump(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Text.Json; | ||
using UnityEngine; | ||
|
||
namespace Dumpostor.Dumpers; | ||
|
||
public sealed class InfoDumper : IDumper | ||
{ | ||
public string FileName => "info.json"; | ||
|
||
public string Dump() | ||
{ | ||
return JsonSerializer.Serialize( | ||
new DumpInfo | ||
{ | ||
DumpostorVersion = DumpostorPlugin.Version, | ||
GameVersion = Application.version, | ||
PlatformType = Constants.GetPlatformType(), | ||
}, | ||
DumpostorPlugin.JsonSerializerOptions | ||
); | ||
} | ||
|
||
public sealed class DumpInfo | ||
{ | ||
public required string DumpostorVersion { get; init; } | ||
public required string GameVersion { get; init; } | ||
public required Platforms PlatformType { get; init; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text.Json; | ||
using UnityEngine; | ||
|
||
namespace Dumpostor.Dumpers.Map; | ||
|
||
public sealed class DoorsDumper : IMapDumper | ||
{ | ||
public string FileName => "doors.json"; | ||
|
||
public string Dump(ShipStatus shipStatus) | ||
{ | ||
var doors = new Dictionary<int, DoorInfo>(); | ||
|
||
var indexAsId = shipStatus.AllDoors.All(d => d.Id == 0); | ||
|
||
for (var i = 0; i < shipStatus.AllDoors.Count; i++) | ||
{ | ||
var door = shipStatus.AllDoors[i]; | ||
|
||
var id = indexAsId ? i : door.Id; | ||
doors.Add(id, new DoorInfo | ||
{ | ||
Room = door.Room, | ||
Position = door.transform.position, | ||
}); | ||
} | ||
|
||
return JsonSerializer.Serialize(doors, DumpostorPlugin.JsonSerializerOptions); | ||
} | ||
|
||
public sealed class DoorInfo | ||
{ | ||
public required SystemTypes Room { get; init; } | ||
public required Vector2 Position { get; init; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Dumpostor.Dumpers.Map; | ||
|
||
public interface IMapDumper | ||
{ | ||
string FileName { get; } | ||
|
||
string Dump(ShipStatus shipStatus); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Text.Json; | ||
using UnityEngine; | ||
|
||
namespace Dumpostor.Dumpers.Map; | ||
|
||
public sealed class SpawnDumper : IMapDumper | ||
{ | ||
public string FileName => "spawn.json"; | ||
|
||
public string Dump(ShipStatus shipStatus) | ||
{ | ||
return JsonSerializer.Serialize(SpawnInfo.From(shipStatus), DumpostorPlugin.JsonSerializerOptions); | ||
} | ||
|
||
public sealed class SpawnInfo | ||
{ | ||
public required Vector2 InitialSpawnCenter { get; init; } | ||
public required Vector2 MeetingSpawnCenter { get; init; } | ||
public required Vector2 MeetingSpawnCenter2 { get; init; } | ||
public required float SpawnRadius { get; init; } | ||
|
||
public static SpawnInfo From(ShipStatus shipStatus) | ||
{ | ||
return new SpawnInfo | ||
{ | ||
InitialSpawnCenter = shipStatus.InitialSpawnCenter, | ||
MeetingSpawnCenter = shipStatus.MeetingSpawnCenter, | ||
MeetingSpawnCenter2 = shipStatus.MeetingSpawnCenter2, | ||
SpawnRadius = shipStatus.SpawnRadius, | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
|
||
namespace Dumpostor.Dumpers.Map; | ||
|
||
public sealed class SystemsDumper : IMapDumper | ||
{ | ||
public string FileName => "systems.json"; | ||
|
||
public string Dump(ShipStatus shipStatus) | ||
{ | ||
var systems = new Dictionary<SystemTypes, string>(); | ||
|
||
foreach (var key in shipStatus.Systems.Keys) | ||
{ | ||
ISystemType value = shipStatus.Systems[key]; | ||
systems.Add(key, value.Cast<Il2CppSystem.Object>().GetIl2CppType().FullName); | ||
} | ||
|
||
return JsonSerializer.Serialize(systems, DumpostorPlugin.JsonSerializerOptions); | ||
} | ||
} |
Oops, something went wrong.