diff options
-rw-r--r-- | AnodyneArchipelago/ArchipelagoTreasure.cs | 2 | ||||
-rw-r--r-- | AnodyneArchipelago/Patches/StatePatches.cs | 29 | ||||
-rw-r--r-- | AnodyneArchipelago/Plugin.cs | 2 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | Resources/LICENSE.archipelago-asset-pack.txt | 1 | ||||
-rw-r--r-- | Resources/archipelago.png | bin | 0 -> 710 bytes |
6 files changed, 34 insertions, 1 deletions
diff --git a/AnodyneArchipelago/ArchipelagoTreasure.cs b/AnodyneArchipelago/ArchipelagoTreasure.cs index 90f979c..9074108 100644 --- a/AnodyneArchipelago/ArchipelagoTreasure.cs +++ b/AnodyneArchipelago/ArchipelagoTreasure.cs | |||
@@ -9,7 +9,7 @@ namespace AnodyneArchipelago | |||
9 | { | 9 | { |
10 | private string _location; | 10 | private string _location; |
11 | 11 | ||
12 | public ArchipelagoTreasure(string location, Vector2 pos) : base("item_jump_shoes", pos, 0, -1) | 12 | public ArchipelagoTreasure(string location, Vector2 pos) : base("archipelago", pos, 0, -1) |
13 | { | 13 | { |
14 | _location = location; | 14 | _location = location; |
15 | } | 15 | } |
diff --git a/AnodyneArchipelago/Patches/StatePatches.cs b/AnodyneArchipelago/Patches/StatePatches.cs index c1e03fe..6da5eb5 100644 --- a/AnodyneArchipelago/Patches/StatePatches.cs +++ b/AnodyneArchipelago/Patches/StatePatches.cs | |||
@@ -10,9 +10,24 @@ using static AnodyneSharp.AnodyneGame; | |||
10 | using AnodyneSharp.Drawing; | 10 | using AnodyneSharp.Drawing; |
11 | using System.IO; | 11 | using System.IO; |
12 | using System; | 12 | using System; |
13 | using AnodyneSharp.Resources; | ||
14 | using BepInEx; | ||
15 | using Microsoft.Xna.Framework.Graphics; | ||
16 | using Microsoft.Xna.Framework; | ||
17 | using System.Collections.Generic; | ||
13 | 18 | ||
14 | namespace AnodyneArchipelago.Patches | 19 | namespace AnodyneArchipelago.Patches |
15 | { | 20 | { |
21 | [HarmonyPatch(typeof(AnodyneGame), "LoadContent")] | ||
22 | class AnodyneLoadContentPatch | ||
23 | { | ||
24 | static void Prefix(AnodyneGame __instance) | ||
25 | { | ||
26 | FieldInfo gdmField = typeof(AnodyneGame).GetField("graphics", BindingFlags.NonPublic | BindingFlags.Instance); | ||
27 | Plugin.GraphicsDevice = ((GraphicsDeviceManager)gdmField.GetValue(__instance)).GraphicsDevice; | ||
28 | } | ||
29 | } | ||
30 | |||
16 | [HarmonyPatch(typeof(AnodyneGame), "Update")] | 31 | [HarmonyPatch(typeof(AnodyneGame), "Update")] |
17 | class GameUpdatePatch | 32 | class GameUpdatePatch |
18 | { | 33 | { |
@@ -127,4 +142,18 @@ namespace AnodyneArchipelago.Patches | |||
127 | Plugin.ArchipelagoManager.ActivateGoal(); | 142 | Plugin.ArchipelagoManager.ActivateGoal(); |
128 | } | 143 | } |
129 | } | 144 | } |
145 | |||
146 | [HarmonyPatch(typeof(ResourceManager), nameof(ResourceManager.LoadResources))] | ||
147 | static class LoadResourcesPatch | ||
148 | { | ||
149 | static void Postfix() | ||
150 | { | ||
151 | FileStream filestream = File.OpenRead($"{Paths.GameRootPath}\\Resources\\archipelago.png"); | ||
152 | Texture2D apSprite = Texture2D.FromStream(Plugin.GraphicsDevice, filestream); | ||
153 | |||
154 | FieldInfo texturesField = typeof(ResourceManager).GetField("_textures", BindingFlags.NonPublic | BindingFlags.Static); | ||
155 | Dictionary<string, Texture2D> textures = (Dictionary<string, Texture2D>)texturesField.GetValue(null); | ||
156 | textures["archipelago"] = apSprite; | ||
157 | } | ||
158 | } | ||
130 | } | 159 | } |
diff --git a/AnodyneArchipelago/Plugin.cs b/AnodyneArchipelago/Plugin.cs index 18f0d36..6c1333d 100644 --- a/AnodyneArchipelago/Plugin.cs +++ b/AnodyneArchipelago/Plugin.cs | |||
@@ -3,6 +3,7 @@ using BepInEx; | |||
3 | using BepInEx.NET.Common; | 3 | using BepInEx.NET.Common; |
4 | using HarmonyLib; | 4 | using HarmonyLib; |
5 | using HarmonyLib.Tools; | 5 | using HarmonyLib.Tools; |
6 | using Microsoft.Xna.Framework.Graphics; | ||
6 | using System; | 7 | using System; |
7 | using System.Reflection; | 8 | using System.Reflection; |
8 | 9 | ||
@@ -13,6 +14,7 @@ namespace AnodyneArchipelago | |||
13 | { | 14 | { |
14 | public static Plugin Instance = null; | 15 | public static Plugin Instance = null; |
15 | 16 | ||
17 | public static GraphicsDevice GraphicsDevice = null; | ||
16 | public static Player Player = null; | 18 | public static Player Player = null; |
17 | public static ArchipelagoManager ArchipelagoManager = null; | 19 | public static ArchipelagoManager ArchipelagoManager = null; |
18 | public static bool IsGamePaused = false; | 20 | public static bool IsGamePaused = false; |
diff --git a/README.md b/README.md index c087917..6484058 100644 --- a/README.md +++ b/README.md | |||
@@ -51,6 +51,7 @@ The layout of the `AnodyneArchipelago` release is as follows: | |||
51 | `MonoMod.RuntimeDetour.dll`, `MonoMod.Utils.dll`, `SemanticVersioning.dll`. | 51 | `MonoMod.RuntimeDetour.dll`, `MonoMod.Utils.dll`, `SemanticVersioning.dll`. |
52 | - The `AnodyneArchipelago` dependencies: `Archipelago.MultiClient.Net.dll`, | 52 | - The `AnodyneArchipelago` dependencies: `Archipelago.MultiClient.Net.dll`, |
53 | `Newtonsoft.Json.dll`. | 53 | `Newtonsoft.Json.dll`. |
54 | - The `Resources` folder from the repository root. | ||
54 | - A folder called `BepInEx`, containing two subfolders: `config`, which contains | 55 | - A folder called `BepInEx`, containing two subfolders: `config`, which contains |
55 | `BepInEx.cfg` from the repository root, and `plugins`, which contains | 56 | `BepInEx.cfg` from the repository root, and `plugins`, which contains |
56 | `AnodyneArchipelago.dll` itself. | 57 | `AnodyneArchipelago.dll` itself. |
diff --git a/Resources/LICENSE.archipelago-asset-pack.txt b/Resources/LICENSE.archipelago-asset-pack.txt new file mode 100644 index 0000000..24bc1fb --- /dev/null +++ b/Resources/LICENSE.archipelago-asset-pack.txt | |||
@@ -0,0 +1 @@ | |||
This work © 2022 by Krista Corkos and Christopher Wilson is licensed under Attribution-NonCommercial 4.0 International. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ \ No newline at end of file | |||
diff --git a/Resources/archipelago.png b/Resources/archipelago.png new file mode 100644 index 0000000..3ce37df --- /dev/null +++ b/Resources/archipelago.png | |||
Binary files differ | |||