Merge branch 'DevelopmentX' into MapDevelopment

This commit is contained in:
polten0 2024-08-18 15:47:54 +03:00 committed by GitHub
commit 1dd6ad7794
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 6 deletions

View file

@ -109,7 +109,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
} }
} }
return IPAddress.Loopback; return IPAddress.Loopback;
} }
//поток 2 //поток 2

View file

@ -8,8 +8,9 @@ using Microsoft.Xna.Framework.Content;
using System.Linq; using System.Linq;
using Newtonsoft.Json; using Newtonsoft.Json;
using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Media;
using ZoFo.GameCore.GUI; using System.Runtime.InteropServices;
using ZoFo.GameCore.GUI;
namespace ZoFo.GameCore.GameManagers namespace ZoFo.GameCore.GameManagers
{ {
@ -21,9 +22,18 @@ namespace ZoFo.GameCore.GameManagers
public void LoadSounds() // метод для загрузки звуков из папки public void LoadSounds() // метод для загрузки звуков из папки
{ {
//List<string> sounds = AppManager.Instance.Content.Load<List<string>>("sounds/"); //List<string> sounds = AppManager.Instance.Content.Load<List<string>>("sounds/");
var k = Directory.GetFiles(Path.Combine(AppContext.BaseDirectory, "Content", "sounds")).Where(x => x.EndsWith("xnb"));
if (k.Count() > 0) string a = Path.Combine("Content", "sounds");
string[] k;
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
k = Directory.GetFiles(Path.Combine("bin", "Debug", "net8.0", "Content", "sounds")).Where(x => x.EndsWith("xnb")).ToArray();
}
else{
k = Directory.GetFiles(Path.Combine(Directory.GetCurrentDirectory(), "Content", "sounds")).Where(x => x.EndsWith("xnb")).ToArray();
}
if (k.Length > 0)
{ {
string[] soundFiles = k.Select(x => x.Split("\\").Last().Split("/").Last().Replace(".xnb", "")).ToArray();// папка со звуками там где exe string[] soundFiles = k.Select(x => x.Split("\\").Last().Split("/").Last().Replace(".xnb", "")).ToArray();// папка со звуками там где exe