mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 18:32:45 +00:00
Merge pull request #434 from misternebula/change-gamestate-event
This commit is contained in:
commit
bce5fd395a
@ -30,7 +30,7 @@ namespace QSB.ClientServerStateSync
|
||||
|
||||
public void ChangeClientState(ClientState newState)
|
||||
{
|
||||
if (QSBPlayerManager.LocalPlayer.State == newState)
|
||||
if (PlayerTransformSync.LocalInstance == null || QSBPlayerManager.LocalPlayer.State == newState)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -87,22 +87,18 @@ namespace QSB.Menus
|
||||
}
|
||||
}
|
||||
|
||||
public void JoinGame(bool inEye, bool inSolarSystem)
|
||||
public void JoinGame(bool inEye)
|
||||
{
|
||||
if (inEye)
|
||||
{
|
||||
LoadManager.LoadSceneAsync(OWScene.EyeOfTheUniverse, true, LoadManager.FadeType.ToBlack, 1f, false);
|
||||
Locator.GetMenuInputModule().DisableInputs();
|
||||
}
|
||||
else if (inSolarSystem)
|
||||
else
|
||||
{
|
||||
LoadManager.LoadSceneAsync(OWScene.SolarSystem, true, LoadManager.FadeType.ToBlack, 1f, false);
|
||||
Locator.GetMenuInputModule().DisableInputs();
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugLog.DebugWrite("tried to join game that wasnt in solar system or eye??");
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenInfoPopup(string message, string buttonText)
|
||||
|
@ -21,8 +21,6 @@ namespace QSB.SaveSync.Events
|
||||
{
|
||||
AboutId = LocalPlayerId,
|
||||
ForId = toId,
|
||||
InSolarSystem = QSBSceneManager.CurrentScene == OWScene.SolarSystem,
|
||||
InEye = QSBSceneManager.CurrentScene == OWScene.EyeOfTheUniverse,
|
||||
WarpedToTheEye = gameSave.warpedToTheEye,
|
||||
SecondsRemainingOnWarp = gameSave.secondsRemainingOnWarp,
|
||||
LaunchCodesGiven = PlayerData.KnowsLaunchCodes(),
|
||||
@ -53,11 +51,7 @@ namespace QSB.SaveSync.Events
|
||||
|
||||
PlayerData.SaveCurrentGame();
|
||||
|
||||
if (message.InEye != (QSBSceneManager.CurrentScene == OWScene.EyeOfTheUniverse)
|
||||
|| message.InSolarSystem != (QSBSceneManager.CurrentScene == OWScene.SolarSystem))
|
||||
{
|
||||
MenuManager.Instance.JoinGame(message.InEye, message.InSolarSystem);
|
||||
}
|
||||
MenuManager.Instance.JoinGame(message.WarpedToTheEye);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,8 +7,6 @@ namespace QSB.SaveSync.Events
|
||||
{
|
||||
internal class GameStateMessage : PlayerMessage
|
||||
{
|
||||
public bool InSolarSystem { get; set; }
|
||||
public bool InEye { get; set; }
|
||||
public bool WarpedToTheEye { get; set; }
|
||||
public float SecondsRemainingOnWarp { get; set; }
|
||||
public bool LaunchCodesGiven { get; set; }
|
||||
@ -19,8 +17,6 @@ namespace QSB.SaveSync.Events
|
||||
public override void Deserialize(QNetworkReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
InSolarSystem = reader.ReadBoolean();
|
||||
InEye = reader.ReadBoolean();
|
||||
WarpedToTheEye = reader.ReadBoolean();
|
||||
SecondsRemainingOnWarp = reader.ReadSingle();
|
||||
LaunchCodesGiven = reader.ReadBoolean();
|
||||
@ -48,8 +44,6 @@ namespace QSB.SaveSync.Events
|
||||
public override void Serialize(QNetworkWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(InSolarSystem);
|
||||
writer.Write(InEye);
|
||||
writer.Write(WarpedToTheEye);
|
||||
writer.Write(SecondsRemainingOnWarp);
|
||||
writer.Write(LaunchCodesGiven);
|
||||
|
Loading…
x
Reference in New Issue
Block a user