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));
@ -432,25 +432,28 @@ public class GameManagerRound3 : GameManagerBase
private void UpdateInterface()
{
HostCardCaptureCarmenInterface CaptureCarmenInterface =
(HostCardCaptureCarmenInterface)GetHostCardInterface(RoundSegmentType.CaptureCarmen);
CaptureCarmenInterface.HeaderUI.text = RoundSegmentTypeToString(RoundSegmentType.CaptureCarmen);
string City = GetCurrentCity();
string Region = GetCurrentRegion();
string Country = GetCurrentCountry();
if (Region == "" || Region.Contains(City) || Region == Country)
if (_GameStatus == GameStatus.Begin)
{
Region = "";
}
else
{
Region += ", ";
}
HostCardCaptureCarmenInterface CaptureCarmenInterface =
(HostCardCaptureCarmenInterface)GetHostCardInterface(RoundSegmentType.CaptureCarmen);
CaptureCarmenInterface.CommentUI.text = City + ", " + Region + Country;
CaptureCarmenInterface.HeaderUI.text = RoundSegmentTypeToString(RoundSegmentType.CaptureCarmen);
string City = GetCurrentCity();
string Region = GetCurrentRegion();
string Country = GetCurrentCountry();
if (Region == "" || Region.Contains(City) || Region == Country)
{
Region = "";
}
else
{
Region += ", ";
}
CaptureCarmenInterface.CommentUI.text = City + ", " + Region + Country;
}
}
private string GetRound3PlayerName()
@ -458,7 +461,7 @@ public class GameManagerRound3 : GameManagerBase
string[] CurrentWinner = _CaseManager.GetCurrentWinningPlayers();
if (CurrentWinner == null || CurrentWinner.Length != 1)
{
return "The player";
return Networking.GetOwner(GetCurrentMarker().gameObject).displayName;
}
return CurrentWinner[0];
}