Na začátku hry se mapa na serveru synchronizuje s mapou u clienta. Rozšířen spritesheet monitoru o remote dveře. Přidána GlobalClassLib pro kód sdílený mezi clientem a serverem. Základ pro implementaci ovládání remote dveří.
This commit is contained in:
parent
8801a7c919
commit
7e6b3d724b
25 changed files with 374 additions and 67 deletions
|
|
@ -1,6 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FNAF_Clone.GUI;
|
||||
using FNAF_Clone.Map;
|
||||
using GlobalClassLib;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using MonoGameLibrary.Input;
|
||||
using PacketLib;
|
||||
|
|
@ -9,11 +12,11 @@ namespace FNAF_Clone;
|
|||
|
||||
public class CommandManager {
|
||||
private static (string label, Keys key, Action action)[] keybinds = [
|
||||
("Toggle Camera", Keys.Space, SendToggleCamera),
|
||||
("Toggle camera", Keys.Space, SendToggleCamera),
|
||||
("Toggle left door", Keys.A, ToggleDoorLeft),
|
||||
("Toggle centre door", Keys.W, ToggleDoorCentre),
|
||||
("Toggle right door", Keys.D, ToggleDoorRight)
|
||||
|
||||
("Toggle right door", Keys.D, ToggleDoorRight),
|
||||
("Toggle back door", Keys.S, ToggleDoorBack)
|
||||
];
|
||||
|
||||
private static InputListenerHook toggleCamHook = new(true);
|
||||
|
|
@ -26,16 +29,25 @@ public class CommandManager {
|
|||
Client.SendCommands([PlayerCommand.TOGGLE_MONITOR()]);
|
||||
}
|
||||
|
||||
private static void ToggleDoorLeft() => SendToggleDoor(0);
|
||||
private static void ToggleDoorCentre() => SendToggleDoor(1);
|
||||
private static void ToggleDoorRight() => SendToggleDoor(2);
|
||||
private static void ToggleDoorLeft() => SendToggleDoor(Direction.EAST);
|
||||
private static void ToggleDoorCentre() => SendToggleDoor(Direction.NORTH);
|
||||
private static void ToggleDoorRight() => SendToggleDoor(Direction.WEST);
|
||||
private static void ToggleDoorBack() => SendToggleDoor(Direction.SOUTH);
|
||||
|
||||
|
||||
private static void SendToggleDoor(int id) {
|
||||
private static void SendToggleDoor(Direction direction) {
|
||||
if (Screen.CurrentScreen.Label == UIManager.ScreenTypes.CAMERAS){
|
||||
//TODO: camera doors
|
||||
SendToggleRemoteDoor(direction);
|
||||
return;
|
||||
}
|
||||
Client.SendCommands([PlayerCommand.TOGGLE_DOOR_OFFICE(id)]);
|
||||
Client.SendCommands([PlayerCommand.TOGGLE_DOOR_OFFICE(direction)]);
|
||||
}
|
||||
|
||||
private static void SendToggleRemoteDoor(Direction direction) { // WIP
|
||||
TileConnectorProjection[] connectors = ClientMapManager.GetConnectors(Client.Player.state.camera).Where(c => c.Type == ConnectorType.DOOR_REMOTE).ToArray();
|
||||
|
||||
|
||||
// Client.SendCommands([PlayerCommand.TOGGLE_DOOR_REMOTE()]);
|
||||
}
|
||||
|
||||
public static void SendChangeCamera(int idx, int idy) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue