-
Notifications
You must be signed in to change notification settings - Fork 86
add changes to make compilable for hk 1.5.12620 #164
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
Open
SFGrenade
wants to merge
40
commits into
hk-modding:master
Choose a base branch
from
SFGrenade:hk-beta-branch-unity-6-update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
a789ba4
add changes to make compilable for hk 1.5.12301
SFGrenade ad0ffab
it wasn't public, it was private
SFGrenade bad9b70
do fancy private stuff
SFGrenade dcfaa9f
language doesn't need to get patched if it doesn't exist in the first…
SFGrenade e4e10bc
use `MonoMod.MonoModLinkFrom`
SFGrenade 7a06e12
adjust patches to methods how they appear in dnspy v6.2.0
SFGrenade e0e6d67
make use of game's vanilla binaries & don't have newtonsoft and mscor…
SFGrenade e91596f
remove unused method
SFGrenade bff85a4
remove base onenter
SFGrenade 7b64c07
made loading work better
SFGrenade 9adc878
update hollowknight.version
SFGrenade 86d0b1b
full canvas, no offsets & modloader obj
SFGrenade c835383
Merge branch 'master' into hk-beta-branch-unity-6-update
SFGrenade 05b3ccf
add one backwards-compatability property
SFGrenade 207132d
who needs reflection if you have monomod fuckery
SFGrenade 9674f71
accidental double newline
SFGrenade b74e35b
make comment clear
SFGrenade 7211d50
don't relink the entirety of TCLL, just the `get(str, str)` method
SFGrenade 2252e7d
MonoModLinkFrom has only 1 arg
SFGrenade 32ab611
not just desktopplatform with `EncryptedSharedData`
SFGrenade ae7998b
make it an obsolete warning
SFGrenade fc2be8c
try to have type forwarding
SFGrenade a63c33e
add postpatcher
SFGrenade f1703aa
more methods for language
SFGrenade b08045f
move monomodrules and custom attributes into subfolder
SFGrenade a3a1b4f
add RawIlPatchAttribute & rework EnemyDeathEffects patch into IL form…
SFGrenade 5fc168c
do the first part of IL patches
SFGrenade 03b0282
have the attributes in the attributes namespaces but without attribut…
SFGrenade 1e9f8dc
use emitdelegate
SFGrenade 9e1ba41
start gamemanager il patches
SFGrenade d9f24b1
fix move after labels not working
SFGrenade b7e8ed9
have IL patches for LoadFirstScene and OnWillActivateFirstLevel
SFGrenade 104bcf7
remove attribute from name & add todo comments
SFGrenade cbe52a5
add missing enum values and some [MonoModReplace]
SFGrenade 3c25982
remove a few comments to show why the opcode fuckery happens
SFGrenade 339b01f
fix the afterlabel thing
SFGrenade 53eeaee
make HealthManager into an IL patch & add some more todo comments
SFGrenade 9bc3aec
implement more IL patches
SFGrenade 88a8c80
not everything can be an IL patch
SFGrenade 31a6bfe
update the last patches
SFGrenade File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,91 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Reflection; | ||
| using UObject = UnityEngine.Object; | ||
| using USystemLanguage = UnityEngine.SystemLanguage; | ||
|
|
||
| namespace Language; | ||
|
|
||
| [Obsolete("Use `TeamCherry.Localization.Language` instead.")] | ||
| public static class Language | ||
| { | ||
| public static void LoadLanguage() => COMPAT_LoadLanguage(); | ||
| public static void LoadAvailableLanguages() => COMPAT_LoadAvailableLanguages(); | ||
| public static string[] GetLanguages() => COMPAT_GetLanguages(); | ||
| public static bool SwitchLanguage(string langCode) => COMPAT_SwitchLanguage(langCode); | ||
| public static bool SwitchLanguage(LanguageCode code) => COMPAT_SwitchLanguage((TeamCherry.Localization.LanguageCode) code); | ||
| public static UObject GetAsset(string name) => COMPAT_GetAsset(name); | ||
| public static LanguageCode CurrentLanguage() => (LanguageCode) COMPAT_CurrentLanguage(); | ||
| public static string Get(string key) => COMPAT_Get(key); | ||
| public static IEnumerable<string> GetSheets() => COMPAT_GetSheets(); | ||
| public static IEnumerable<string> GetKeys(string sheetTitle) => COMPAT_GetKeys(sheetTitle); | ||
| public static bool Has(string key) => COMPAT_Has(key); | ||
| public static bool Has(string key, string sheet) => COMPAT_Has(key, sheet); | ||
| public static bool HasSheet(string sheet) => COMPAT_HasSheet(sheet); | ||
| public static LanguageCode LanguageNameToCode(USystemLanguage name) => (LanguageCode) COMPAT_LanguageNameToCode(name); | ||
| public static string GetInternal(string key, string sheetTitle) => COMPAT_Get(key, sheetTitle); | ||
| [MonoMod.MonoModLinkFrom("System.String TeamCherry.Localization.Language::Get(System.String,System.String)")] | ||
| public static string Get(string key, string sheetTitle) => Modding.ModHooks.LanguageGet(key, sheetTitle); | ||
|
|
||
| private static void DoSwitch(LanguageCode newLang) => COMPAT_DoSwitch((TeamCherry.Localization.LanguageCode) newLang); | ||
| private static bool HasLanguageFile(string lang, string sheetTitle) => COMPAT_HasLanguageFile(lang, sheetTitle); | ||
| private static string GetLanguageFileContents(string sheetTitle) => COMPAT_GetLanguageFileContents(sheetTitle); | ||
|
|
||
| // Keep these below the `[MonoMod.MonoModLinkFrom("TeamCherry.Localization.Language")]`, as the reverse order would cause a cyclic loop of methods calling themselves | ||
| // thanks to MonoMod resolving these links top-down | ||
| // which would make a `LinkTo(TCLL)->LinkFrom(TCLL)` into a fully recursive function ⟳ | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.Void LoadLanguage()")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static void COMPAT_LoadLanguage(); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.Void LoadAvailableLanguages()")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static void COMPAT_LoadAvailableLanguages(); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.String[] GetLanguages()")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static string[] COMPAT_GetLanguages(); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.Boolean SwitchLanguage(System.String)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static bool COMPAT_SwitchLanguage(string langCode); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.Boolean SwitchLanguage(TeamCherry.Localization.LanguageCode)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static bool COMPAT_SwitchLanguage(TeamCherry.Localization.LanguageCode code); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "UnityEngine.Object GetAsset(System.String)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static UObject COMPAT_GetAsset(string name); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "TeamCherry.Localization.LanguageCode CurrentLanguage()")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static TeamCherry.Localization.LanguageCode COMPAT_CurrentLanguage(); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.String Get(System.String)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static string COMPAT_Get(string key); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.String Get(System.String,System.String)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static string COMPAT_Get(string key, string sheetTitle); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.Collections.Generic.IEnumerable`1<System.String> GetSheets()")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static IEnumerable<string> COMPAT_GetSheets(); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.Collections.Generic.IEnumerable`1<System.String> GetKeys(System.String)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static IEnumerable<string> COMPAT_GetKeys(string sheetTitle); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.Boolean Has(System.String)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static bool COMPAT_Has(string key); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.Boolean Has(System.String,System.String)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static bool COMPAT_Has(string key, string sheet); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.Boolean HasSheet(System.String)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static bool COMPAT_HasSheet(string sheet); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "TeamCherry.Localization.LanguageCode LanguageNameToCode(UnityEngine.SystemLanguage)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static TeamCherry.Localization.LanguageCode COMPAT_LanguageNameToCode(USystemLanguage name); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.Void DoSwitch(TeamCherry.Localization.LanguageCode)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static void COMPAT_DoSwitch(TeamCherry.Localization.LanguageCode name); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.Boolean HasLanguageFile(System.String,System.String)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static bool COMPAT_HasLanguageFile(string lang, string sheetTitle); | ||
| [MonoMod.MonoModLinkTo("TeamCherry.Localization.Language", "System.String GetLanguageFileContents(System.String)")] | ||
| [MonoMod.MonoModRemove] | ||
| extern private static string COMPAT_GetLanguageFileContents(string sheetTitle); | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just realized that this will get the obsolete warning, but this is the wanted method call to use.