Ownership changes now apply to the filing cabinet and its note dispensers.

This commit is contained in:
Jamie Greunbaum 2025-12-07 00:39:10 -05:00
parent 92bb182d27
commit bc56353e25
2 changed files with 33 additions and 21 deletions

View File

@ -59,6 +59,15 @@ public class FilingCabinet : UdonSharpBehaviour
base.OnDeserialization(Result);
}
public override void OnOwnershipTransferred(VRCPlayerApi Player)
{
foreach (FilingCabinetNoteDispenser NoteDispenser in _NoteDispensers)
{
Networking.SetOwner(Player, NoteDispenser.gameObject);
}
base.OnOwnershipTransferred(Player);
}
public void OpenDrawer1()
{

View File

@ -165,10 +165,11 @@ public class GameManagerRound3 : GameManagerBase
public void BeginRound()
{
GetCurrentMarker().SendCustomNetworkEvent(NetworkEventTarget.Owner, "Activated", true);
_GameStatus = GameStatus.Begin;
UpdateInterface();
GetCurrentMarker().SendCustomNetworkEvent(NetworkEventTarget.Owner, "Activated", true);
_EndingPlayer.LoadRandomVideo();
StartTimer();
@ -179,7 +180,6 @@ public class GameManagerRound3 : GameManagerBase
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
"PlayMusicLoop", MusicEventType.CarmenChaseMusic);
_GameStatus = GameStatus.Begin;
_Timer = TIMER_LENGTH;
SendCustomNetworkEvent(NetworkEventTarget.Owner, nameof(BeginTimerTick));
@ -431,6 +431,8 @@ public class GameManagerRound3 : GameManagerBase
private void UpdateInterface()
{
if (_GameStatus == GameStatus.Begin)
{
HostCardCaptureCarmenInterface CaptureCarmenInterface =
(HostCardCaptureCarmenInterface)GetHostCardInterface(RoundSegmentType.CaptureCarmen);
@ -452,13 +454,14 @@ public class GameManagerRound3 : GameManagerBase
CaptureCarmenInterface.CommentUI.text = City + ", " + Region + Country;
}
}
private string GetRound3PlayerName()
{
string[] CurrentWinner = _CaseManager.GetCurrentWinningPlayers();
if (CurrentWinner == null || CurrentWinner.Length != 1)
{
return "The player";
return Networking.GetOwner(GetCurrentMarker().gameObject).displayName;
}
return CurrentWinner[0];
}