-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from yhl452493373/version-label-3.9-dev
Add Offical version option and raid code
- Loading branch information
Showing
5 changed files
with
121 additions
and
8 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
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
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
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,40 @@ | ||
using System; | ||
using System.Reflection; | ||
using EFT; | ||
using EFT.UI; | ||
using HarmonyLib; | ||
using SPT.Reflection.Patching; | ||
|
||
namespace Fika.Core.EssentialPatches | ||
{ | ||
/// <summary> | ||
/// Update version label with raid code when game started | ||
/// </summary> | ||
public class FikaVersionLabelUpdate_Patch : ModulePatch | ||
{ | ||
public static string raidCode; | ||
|
||
protected override MethodBase GetTargetMethod() | ||
{ | ||
return typeof(GameWorld).GetMethod(nameof(GameWorld.OnGameStarted), | ||
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); | ||
} | ||
|
||
[PatchPostfix] | ||
private static void Postfix(GameWorld __instance) | ||
{ | ||
if (!string.IsNullOrEmpty(raidCode)) | ||
{ | ||
Traverse preloaderUiTraverse = Traverse.Create(MonoBehaviourSingleton<PreloaderUI>.Instance); | ||
//Game version | ||
// preloaderUiTraverse.Field("string_2").SetValue($"Game version"); | ||
//Raid code | ||
preloaderUiTraverse.Field("string_3").SetValue($"{raidCode}"); | ||
//Game mode | ||
// preloaderUiTraverse.Field("string_4").SetValue("PvE"); | ||
//Update version label | ||
preloaderUiTraverse.Method("method_6").GetValue(); | ||
} | ||
} | ||
} | ||
} |
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