about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2020-02-10 01:20:22 +0100
committeraszlig <aszlig@nix.build>2020-02-10 06:18:15 +0100
commit4eb43849cff17c1da74a82b719ef0b9bc43f2808 (patch)
tree1bbf33242279f3dc91f925524da05b9e43462706 /pkgs/games
parentb1fb7970491a67cb41803c34563973bcd4129294 (diff)
invisigun-heroes: Update to version 1.7.16
Lots of changes have been introduced in version 1.7.6, so here is a
small summary:

  * New "The Hero's Journey" mode, which allows to discover the
    abilities of each hero along with challenges and puzzles.
  * Three new heroes: Djaan-Khe, Zephyr, Violet
  * Challenge mode has been removed (replaced by "The Hero's Journey").
  * Guest Edition has been removed.

The full changelog can be found here:

http://www.sombr.com/pub/SIG/changelog/

While Invisigun Heroes in general went pretty smooth when it comes to
packaging on our side, this time unfortunately we needed to patch
something.

There is now a new "config.json", which is written inside the game's
data directory. Of course, since the data directory resides in the Nix
store, I've relocated the file to be written into the the config
directory ($XDG_CONFIG_HOME/unity3d/Sombr Studio/Invisigun Reloaded) of
the game.

Note that the config directory has also changed from "Invisigun Heroes"
to "Invisigun Reloaded", so if you don't want to play the old version,
you can delete the "Invisigun Heroes" directory.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/itch/invisigun-heroes.nix35
1 files changed, 30 insertions, 5 deletions
diff --git a/pkgs/games/itch/invisigun-heroes.nix b/pkgs/games/itch/invisigun-heroes.nix
index f584db5e..15aba338 100644
--- a/pkgs/games/itch/invisigun-heroes.nix
+++ b/pkgs/games/itch/invisigun-heroes.nix
@@ -1,18 +1,43 @@
-{ buildUnity, fetchItch }:
+{ buildUnity, fetchItch, mono, monogamePatcher, strace }:
 
 buildUnity rec {
   name = "invisigun-heroes";
-  fullName = "Invisigun Heroes";
-  saveDir = "Sombr Studio/Invisigun Heroes";
-  version = "1.6.101";
+  fullName = "Invisigun";
+  saveDir = "Sombr Studio/Invisigun Reloaded";
+  version = "1.7.16";
 
   src = fetchItch {
     name = "${name}-${version}.zip";
     gameId = 25561;
     uploadId = 208583;
     version = "v${version}";
-    sha256 = "0l3dqkda9xxvlx5jbb5s3gp8yblzvp2k2wjsg8h9xx860c5nj3cy";
+    sha256 = "1flwc5wvw84s53my8v8n402iz6izjs4d4ppffajdv9cg1vs3nbpl";
   };
 
+  nativeBuildInputs = [ mono monogamePatcher ];
+
+  buildPhase = ''
+    cat > nix-support.cs <<EOF
+    using UnityEngine;
+
+    public class NixSupport {
+      public static string GetFullPathStub(string _ignore) {
+        return Application.persistentDataPath;
+      }
+    }
+    EOF
+
+    mcs nix-support.cs -target:library \
+      -r:Invisigun_Data/Managed/UnityEngine.CoreModule \
+      -out:Invisigun_Data/Managed/NixSupport.dll
+
+    monogame-patcher replace-call \
+      -i Invisigun_Data/Managed/Assembly-CSharp.dll \
+      -a Invisigun_Data/Managed/NixSupport.dll \
+      'System.String System.IO.Path::GetFullPath(System.String)' \
+      'System.String NixSupport::GetFullPathStub(System.String)' \
+      FileManagerAdapter_Desktop::ApplicationPath
+  '';
+
   sandbox.paths.required = [ "$HOME/Invisigun Heroes" ];
 }