-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e77874c
commit 628361e
Showing
9 changed files
with
88 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
namespace hats.Commands | ||
{ | ||
using System; | ||
using System.Linq; | ||
using CommandSystem; | ||
using Exiled.API.Features; | ||
using UnityEngine; | ||
|
||
public class HatDebug : ICommand | ||
{ | ||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response) | ||
{ | ||
var ply = Player.Get(sender); | ||
if (ply is null || ply.IsHost) | ||
{ | ||
response = "Is host."; | ||
return false; | ||
} | ||
|
||
if (!Plugin.Singleton.hats.ContainsKey(ply.UserId)) | ||
{ | ||
response = "Player isnt wearing a hat!"; | ||
return false; | ||
} | ||
|
||
var schem = Plugin.Singleton.hats[ply.UserId]; | ||
if(schem.gameObject.IsHat(out var hat)) | ||
{ | ||
var gameObject = hat.gameObject; | ||
Transform parent; | ||
response = $"Name: {hat.hat.Name}" + | ||
$"Enabled: {hat.schem.enabled}" + | ||
$"Config rotation offset: {hat.hat.Rotation}" + | ||
$"Config position offset: {hat.hat.Offset}" + | ||
$"Actual local rotation: {gameObject.transform.localRotation}" + | ||
$"Actual local position: {gameObject.transform.localPosition}" + | ||
$"Parent GO (is player): {(parent = gameObject.transform.parent).gameObject.name} ({ply.GameObject == parent.gameObject})" + | ||
$"Hat global position: {gameObject.transform.position}"; | ||
return true; | ||
} | ||
|
||
response = "Something went wrong"; | ||
return false; | ||
} | ||
|
||
public string Command { get; } = "Debug"; | ||
public string[] Aliases { get; } = { }; | ||
public string Description { get; } = "Print hat debug information"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace hats.Commands | ||
{ | ||
using System; | ||
using CommandSystem; | ||
using Exiled.API.Features; | ||
using Exiled.Permissions.Extensions; | ||
|
||
public class ReloadHats : ICommand | ||
{ | ||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response) | ||
{ | ||
if(!sender.CheckPermission("hats.reload")) | ||
{ | ||
response = "Missing permission: hats.reload."; | ||
return false; | ||
} | ||
|
||
API.LoadHats(); | ||
response = "reloaded hats!"; | ||
return true; | ||
} | ||
|
||
public string Command { get; } = "reload"; | ||
public string[] Aliases { get; } = { }; | ||
public string Description { get; } = "Reloads all hats (WILL REMOVE ALL CURRENT HATS!)"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters