Merge branch 'DevelopmentY' of github.com:progtime-net/ZoFo into DevelopmentY
This commit is contained in:
commit
6d47993988
4 changed files with 21 additions and 4 deletions
|
@ -250,7 +250,7 @@ namespace ZoFo.GameCore
|
|||
}
|
||||
else if (update is UpdateGameEnded)
|
||||
{
|
||||
GameEnd();
|
||||
EndGame();
|
||||
}
|
||||
else if (update is UpdatePlayerParametrs && myPlayer !=null && update.IdEntity == myPlayer.Id) //aaa
|
||||
{
|
||||
|
@ -336,12 +336,16 @@ namespace ZoFo.GameCore
|
|||
(ent as Player).rad = (update as UpdatePlayerParametrs).radiatoin;
|
||||
}
|
||||
}
|
||||
public void GameEnd()
|
||||
public void EndGame()
|
||||
{
|
||||
networkManager.CloseConnection();
|
||||
CloseConnection();
|
||||
AppManager.Instance.ChangeState(GameState.NotPlaying);
|
||||
AppManager.Instance.SetGUI(new FinishingGUI());
|
||||
}
|
||||
public void CloseConnection()
|
||||
{
|
||||
networkManager.CloseConnection();
|
||||
}
|
||||
|
||||
public Entity FindEntityById(int id)
|
||||
{
|
||||
|
|
|
@ -68,6 +68,7 @@ public class FinishingGUI : AbstractGUI
|
|||
Elements.Add(ExitButton);
|
||||
|
||||
//player itams
|
||||
if (AppManager.Instance.client.myPlayer is null) return;
|
||||
foreach (var item in AppManager.Instance.client.myPlayer.lootData.loots)
|
||||
{
|
||||
if (item.Value > 0)
|
||||
|
|
|
@ -48,6 +48,14 @@ public class PauseGUI : AbstractGUI
|
|||
};
|
||||
exitButton.LeftButtonPressed += () =>
|
||||
{
|
||||
if (AppManager.Instance.gamestate == GameState.HostPlaying)
|
||||
{
|
||||
AppManager.Instance.server.EndGame();
|
||||
}
|
||||
else
|
||||
{
|
||||
AppManager.Instance.client.CloseConnection();
|
||||
}
|
||||
AppManager.Instance.SoundManager.StopAllSounds();
|
||||
AppManager.Instance.SoundManager.StartAmbientSound("Button click");
|
||||
AppManager.Instance.SoundManager.StartAmbientSound("Background menu music");
|
||||
|
|
|
@ -159,7 +159,11 @@ namespace ZoFo.GameCore
|
|||
UpdateGameEnded gameEnded = new UpdateGameEnded();
|
||||
networkManager.AddData(gameEnded);
|
||||
networkManager.SendData();
|
||||
networkManager.CloseConnection();
|
||||
CloseConnection();
|
||||
}
|
||||
public void CloseConnection()
|
||||
{
|
||||
networkManager.CloseConnection();
|
||||
}
|
||||
|
||||
public List<GameObject> gameObjects = new List<GameObject>();
|
||||
|
|
Loading…
Add table
Reference in a new issue