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
// its not a nuget package yet and it doesnt have a repo so im just putting it into a gist for now | |
/* | |
MIT License | |
Copyright (c) 2023 ConfiG | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
Add-Type -Assembly System.IO.Compression.FileSystem | |
# Install BepInEx | |
$ArchivePath = "./BepInEx-temp.zip" | |
$LatestRelease = Invoke-RestMethod -Uri https://api.github.com/repos/BepInEx/BepInEx/releases/latest -Method Get | |
foreach($asset in $LatestRelease.assets) { | |
if(!$asset.name.StartsWith("BepInEx_x64_")) { | |
continue | |
} | |
Invoke-WebRequest -uri $asset.browser_download_url -OutFile $ArchivePath |
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
public static List<LevelSpeed> SortSpeedsModified(List<LevelSpeed> list) { | |
List<LevelSpeed> unsorted = new List<LevelSpeed>(list); | |
List<LevelSpeed> sorted = new List<LevelSpeed>(); | |
unsorted.Sort((speed1, speed2) => speed1.offset.CompareTo(speed2.offset)); | |
int direction = 0; | |
for(int i = 0; i < unsorted.Count; i++) { | |
if(unsorted[i].offset == 0) { | |
direction = Math.Sign(unsorted[i].speed); | |
sorted.Add(unsorted[i]); |