-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
240 additions
and
74 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Fika.Core/Coop/Patches/HideoutPlayerOwner_SetPointOfView_Patch.cs
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,24 @@ | ||
using EFT; | ||
using Fika.Core.UI.Custom; | ||
using SPT.Reflection.Patching; | ||
using System.Reflection; | ||
|
||
namespace Fika.Core.Coop.Patches | ||
{ | ||
public class HideoutPlayerOwner_SetPointOfView_Patch : ModulePatch | ||
{ | ||
protected override MethodBase GetTargetMethod() | ||
{ | ||
return typeof(HideoutPlayerOwner).GetMethod(nameof(HideoutPlayerOwner.SetPointOfView)); | ||
} | ||
|
||
[PatchPostfix] | ||
public static void Postfix(HideoutPlayerOwner __instance) | ||
{ | ||
if (__instance.FirstPersonMode && MainMenuUIScript.Instance != null) | ||
{ | ||
MainMenuUIScript.Instance.UpdatePresence(UI.FikaUIGlobals.EFikaPlayerPresence.IN_HIDEOUT); | ||
} | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
Fika.Core/Networking/Models/Presence/FikaPlayerPresenceResponse.cs
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,55 @@ | ||
using EFT; | ||
using JsonType; | ||
using System.Runtime.Serialization; | ||
using static Fika.Core.UI.FikaUIGlobals; | ||
|
||
namespace Fika.Core.Networking.Models.Presence | ||
{ | ||
[DataContract] | ||
public struct FikaPlayerPresence | ||
{ | ||
[DataMember(Name = "nickname")] | ||
public string Nickname; | ||
|
||
[DataMember(Name = "level")] | ||
public int Level; | ||
|
||
[DataMember(Name = "activity")] | ||
public EFikaPlayerPresence Activity; | ||
|
||
[DataMember(Name = "activityStartedTimestamp")] | ||
public long ActivityStartedTimestamp; | ||
|
||
[DataMember(Name = "raidInformation")] | ||
public RaidInformation? RaidInformation; | ||
|
||
public FikaPlayerPresence(string nickname, int level, EFikaPlayerPresence activity, long activityStartedTimestamp, RaidInformation? raidInformation) | ||
{ | ||
Nickname = nickname; | ||
Level = level; | ||
Activity = activity; | ||
ActivityStartedTimestamp = activityStartedTimestamp; | ||
RaidInformation = raidInformation; | ||
} | ||
} | ||
|
||
[DataContract] | ||
public struct RaidInformation | ||
{ | ||
[DataMember(Name = "location")] | ||
public string Location; | ||
|
||
[DataMember(Name = "side")] | ||
public ESideType Side; | ||
|
||
[DataMember(Name = "time")] | ||
public EDateTime Time; | ||
|
||
public RaidInformation(string location, ESideType side, EDateTime time) | ||
{ | ||
Location = location; | ||
Side = side; | ||
Time = time; | ||
} | ||
} | ||
} |
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,26 @@ | ||
using System.Runtime.Serialization; | ||
using static Fika.Core.UI.FikaUIGlobals; | ||
|
||
namespace Fika.Core.Networking.Models.Presence | ||
{ | ||
[DataContract] | ||
public struct FikaSetPresence | ||
{ | ||
[DataMember(Name = "activity")] | ||
public EFikaPlayerPresence Presence; | ||
|
||
[DataMember(Name = "raidInformation")] | ||
public RaidInformation? RaidInformation; | ||
|
||
public FikaSetPresence(EFikaPlayerPresence presence) | ||
{ | ||
Presence = presence; | ||
} | ||
|
||
public FikaSetPresence(EFikaPlayerPresence presence, RaidInformation? raidInformation) | ||
{ | ||
Presence = presence; | ||
RaidInformation = raidInformation; | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -680,7 +680,7 @@ private void RefreshUI() | |
break; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public IEnumerator ServerQuery() | ||
{ | ||
|
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,25 @@ | ||
using Fika.Core.UI.Custom; | ||
using SPT.Reflection.Patching; | ||
using System.Reflection; | ||
using static EFT.UI.InventoryScreen; | ||
using static Fika.Core.UI.FikaUIGlobals; | ||
|
||
namespace Fika.Core.UI.Patches | ||
{ | ||
public class GClass3421_ShowAction_Patch : ModulePatch | ||
{ | ||
protected override MethodBase GetTargetMethod() | ||
{ | ||
return typeof(GClass3421).GetMethod(nameof(GClass3421.ShowAction)); | ||
} | ||
|
||
[PatchPostfix] | ||
public static void Postfix(GClass3421 __instance) | ||
{ | ||
if (!__instance.InRaid) | ||
{ | ||
MainMenuUIScript.Instance.UpdatePresence(EFikaPlayerPresence.IN_STASH); | ||
} | ||
} | ||
} | ||
} |
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,21 @@ | ||
using EFT.UI; | ||
using Fika.Core.UI.Custom; | ||
using SPT.Reflection.Patching; | ||
using System.Reflection; | ||
|
||
namespace Fika.Core.UI.Patches | ||
{ | ||
public class MenuScreen_Awake_Patch : ModulePatch | ||
{ | ||
protected override MethodBase GetTargetMethod() | ||
{ | ||
return typeof(MenuScreen).GetMethod(nameof(MenuScreen.Awake)); | ||
} | ||
|
||
[PatchPostfix] | ||
public static void Postfix(MenuScreen __instance) | ||
{ | ||
__instance.gameObject.AddComponent<MainMenuUIScript>(); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
Fika.Core/UI/Patches/MenuScreen/MenuScreen_method_8_Patch.cs
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,24 @@ | ||
using EFT.UI; | ||
using Fika.Core.UI.Custom; | ||
using SPT.Reflection.Patching; | ||
using System.Reflection; | ||
|
||
namespace Fika.Core.UI.Patches | ||
{ | ||
public class MenuScreen_method_8_Patch : ModulePatch | ||
{ | ||
protected override MethodBase GetTargetMethod() | ||
{ | ||
return typeof(MenuScreen).GetMethod(nameof(MenuScreen.method_8)); | ||
} | ||
|
||
[PatchPostfix] | ||
public static void Postfix(bool minimized) | ||
{ | ||
if (!minimized && MainMenuUIScript.Instance != null) | ||
{ | ||
MainMenuUIScript.Instance.UpdatePresence(FikaUIGlobals.EFikaPlayerPresence.IN_MENU); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.