From a8072cfa679c47b98ef9590a0a28098e116339af Mon Sep 17 00:00:00 2001 From: AnloGames <7383an@gmail.com> Date: Tue, 20 Aug 2024 01:02:26 +0300 Subject: [PATCH] FixPathCommit --- ZoFo/GameCore/GameManagers/MapManager/MapManager.cs | 2 +- .../GameManagers/NetworkManager/ClientNetworkManager.cs | 2 +- .../GameObjects/Entities/Interactables/Collectables/Ammo.cs | 2 +- ZoFo/GameCore/Graphics/StaticGraphicsComponent.cs | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs b/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs index 72dcdea..99b5820 100644 --- a/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs +++ b/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs @@ -75,7 +75,7 @@ namespace ZoFo.GameCore.GameManagers.MapManager (i / chunk.Height) * tileMap.TileHeight + chunk.Y * tileMap.TileHeight); Tile tile = tileSet.Tiles[number]; // По факту может быть StopObjectom, но на уровне Tiled это все в первую очередь Tile - string textureName = Path.Combine(AppContext.BaseDirectory, "Content", "Textures", "TileSetImages", + string textureName = Path.Combine("Content", "Textures", "TileSetImages", Path.GetFileName(tileSet.Image).Replace(".png", "")); switch (tile.Type) { diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs index 473abe8..078e231 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs @@ -190,7 +190,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager public void JoinRoom(string ip, int port) // multyplayer { sendingEP = new IPEndPoint(IPAddress.Parse(ip), port); - + AppManager.Instance.ChangeState(GameState.ClientPlaying); SendData(); Thread listen = new Thread(StartListening); listen.IsBackground = true; diff --git a/ZoFo/GameCore/GameObjects/Entities/Interactables/Collectables/Ammo.cs b/ZoFo/GameCore/GameObjects/Entities/Interactables/Collectables/Ammo.cs index ba4f1bc..232b77b 100644 --- a/ZoFo/GameCore/GameObjects/Entities/Interactables/Collectables/Ammo.cs +++ b/ZoFo/GameCore/GameObjects/Entities/Interactables/Collectables/Ammo.cs @@ -13,7 +13,7 @@ namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables { class Ammo:Collectable { - public override StaticGraphicsComponent graphicsComponent { get; } = new("Textures/icons/8"); + public override StaticGraphicsComponent graphicsComponent { get; } = new("Content/Textures/icons/8"); public Ammo(Vector2 position) : base(position) { graphicsComponent.ObjectDrawRectangle.Width = 20; diff --git a/ZoFo/GameCore/Graphics/StaticGraphicsComponent.cs b/ZoFo/GameCore/Graphics/StaticGraphicsComponent.cs index a631c5d..0523e93 100644 --- a/ZoFo/GameCore/Graphics/StaticGraphicsComponent.cs +++ b/ZoFo/GameCore/Graphics/StaticGraphicsComponent.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -37,7 +38,7 @@ namespace ZoFo.GameCore.Graphics return; } - texture = AppManager.Instance.Content.Load(_textureName); + texture = AppManager.Instance.Content.Load(Path.Combine(AppContext.BaseDirectory, _textureName)); } public override void Update()