-
Notifications
You must be signed in to change notification settings - Fork 4
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
e7012d4
commit 5eec0ab
Showing
15 changed files
with
963 additions
and
651 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,127 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace HintServiceMeow.Config | ||
{ | ||
public class PlayerUIConfig | ||
{ | ||
[Description("The default time to show for each type of common hint.\r\n" + | ||
"Short means that the hint has on title but not decription\r\n")] | ||
public int ItemHintDisplayTime { get; set; } = 10; | ||
public int ShortItemHintDisplayTime { get; set; } = 5; | ||
|
||
public int MapHintDisplayTime { get; set; } = 10; | ||
public int ShortMapHintDisplayTime { get; set; } = 7; | ||
|
||
public int RoleHintDisplayTime { get; set; } = 15; | ||
public int ShortRoleHintDisplayTime { get; set; } = 5; | ||
|
||
public int OtherHintDisplayTime { get; set; } = 5; | ||
|
||
[Description("The default config to show for each type of common hint.\r\n" + | ||
"Only config for alignment, font size, hint fiel, and priority are valid.\r\n")] | ||
public List<DynamicHintConfig> ItemHints { get; set; } = new List<DynamicHintConfig>() | ||
{ | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Center, | ||
FontSize = 25, | ||
TopYCoordinate = 450, | ||
BottomYCoordinate = 750 | ||
}, | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Center, | ||
FontSize = 25, | ||
TopYCoordinate = 475, | ||
BottomYCoordinate = 775 | ||
} | ||
}; | ||
|
||
public List<DynamicHintConfig> MapHints { get; set; } = new List<DynamicHintConfig>() | ||
{ | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Right, | ||
FontSize = 25, | ||
TopYCoordinate = 0, | ||
BottomYCoordinate = 200 | ||
}, | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Right, | ||
FontSize = 25, | ||
TopYCoordinate = 25, | ||
BottomYCoordinate = 225 | ||
} | ||
}; | ||
|
||
public List<DynamicHintConfig> RoleHints { get; set; } = new List<DynamicHintConfig>() | ||
{ | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Left, | ||
FontSize = 30, | ||
TopYCoordinate = 100, | ||
BottomYCoordinate = 500 | ||
}, | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Left, | ||
FontSize = 25, | ||
TopYCoordinate = 130, | ||
BottomYCoordinate = 530 | ||
}, | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Left, | ||
FontSize = 25, | ||
TopYCoordinate = 155, | ||
BottomYCoordinate = 555 | ||
}, | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Left, | ||
FontSize = 25, | ||
TopYCoordinate = 180, | ||
BottomYCoordinate = 580 | ||
} | ||
}; | ||
|
||
public List<DynamicHintConfig> OtherHints { get; set; } = new List<DynamicHintConfig>() | ||
{ | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Center, | ||
FontSize = 20, | ||
TopYCoordinate = 520, | ||
BottomYCoordinate = 700 | ||
}, | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Center, | ||
FontSize = 20, | ||
TopYCoordinate = 540, | ||
BottomYCoordinate = 700 | ||
}, | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Center, | ||
FontSize = 20, | ||
TopYCoordinate = 560, | ||
BottomYCoordinate = 700 | ||
}, | ||
new DynamicHintPositionConfig() | ||
{ | ||
Alignment = HintAlignment.Center, | ||
FontSize = 20, | ||
TopYCoordinate = 580, | ||
BottomYCoordinate = 700 | ||
} | ||
}; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,22 +1,20 @@ | ||
using Exiled.API.Enums; | ||
using Exiled.API.Interfaces; | ||
using PlayerRoles; | ||
using Respawning; | ||
using Exiled.API.Interfaces; | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
|
||
namespace HintServiceMeow.Config | ||
{ | ||
public class PluginConfig:IConfig | ||
{ | ||
internal static PluginConfig instance; | ||
internal static PluginConfig Instance; | ||
|
||
public bool IsEnabled { get; set; } = true; | ||
public bool Debug { get; set; } = false; | ||
|
||
[Description("Configs for PlayerDisplay. Changing these configs might leads to errors")] | ||
public PlayerDisplayConfig PlayerDisplayConfig { get; set; } = new PlayerDisplayConfig(); | ||
|
||
[Description("The for PlayerUI. PlayerUI contains commonly used hints")] | ||
public PlayerUIConfig PlayerUIConfig { get; set; } = new PlayerUIConfig(); | ||
} | ||
} |
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,43 @@ | ||
using Exiled.Events.EventArgs.Player; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace HintServiceMeow | ||
{ | ||
public static class EventHandler | ||
{ | ||
public delegate void NewPlayerHandler(PlayerDisplay playerDisplay); | ||
public static event NewPlayerHandler NewPlayer; | ||
|
||
internal static void InvokeNewPlayerEvent(PlayerDisplay pd) | ||
{ | ||
NewPlayer?.Invoke(pd); | ||
} | ||
|
||
// Create PlayerDisplay and PlayerUIConfig for the new player | ||
internal static void OnVerified(VerifiedEventArgs ev) | ||
{ | ||
if (ev.Player.IsNPC) return; | ||
|
||
var pd = new PlayerDisplay(ev.Player); | ||
new PlayerUI(ev.Player); | ||
|
||
EventHandler.InvokeNewPlayerEvent(pd); | ||
} | ||
|
||
internal static void OnLeft(LeftEventArgs ev) | ||
{ | ||
PlayerUI.RemovePlayerUI(ev.Player); | ||
PlayerDisplay.RemovePlayerDisplay(ev.Player); | ||
} | ||
|
||
internal static void OnDisable() | ||
{ | ||
PlayerUI.ClearPlayerUI(); | ||
PlayerDisplay.ClearPlayerDisplay(); | ||
} | ||
} | ||
} |
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,78 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace HintServiceMeow | ||
{ | ||
[Description("Please be aware that the plugin might not be using all of the config." + | ||
"\r\nIn other words, not all of the following configs are valid")] | ||
public class DynamicHintConfig | ||
{ | ||
[Description("The ID of the hint")] | ||
public string Id { get; set; } = null; | ||
|
||
[Description("The priority of the hint. Higher priority means the hint is less likely to be covered by other hint." + | ||
"\r\nnAvailable: Highest, High, Medium, Low, Lowest")] | ||
public HintPriority Priority { get; set; } = HintPriority.Medium; | ||
|
||
public DynamicHintPositionConfig Position { get; set; } = new DynamicHintPositionConfig(); | ||
|
||
public DynamicHintContentConfig Content { get; set; } = new DynamicHintContentConfig(); | ||
|
||
public DynamicHintConfig() | ||
{ | ||
} | ||
} | ||
|
||
public class DynamicHintPositionConfig | ||
{ | ||
[Description("The alignment of the hint. " + | ||
"\r\nAvailable: Left, Right, Center ")] | ||
public HintAlignment Alignment { get; set; } = HintAlignment.Center; | ||
|
||
[Description("The size of the font, default is 20")] | ||
public int FontSize { get; set; } = 20; | ||
|
||
[Description("The Y-Coordiante of top boundary, default is 300")] | ||
public int TopYCoordinate { get; set; } = 300; | ||
|
||
[Description("The Y-Coordiante of bottom boundary, default is 700")] | ||
public int BottomYCoordinate { get; set; } = 700; | ||
|
||
public DynamicHintPositionConfig() | ||
{ | ||
} | ||
|
||
public static implicit operator DynamicHintConfig(DynamicHintPositionConfig v) | ||
{ | ||
return new DynamicHintConfig() | ||
{ | ||
Position = v, | ||
}; | ||
} | ||
} | ||
|
||
public class DynamicHintContentConfig | ||
{ | ||
[Description("The initial message displayed. The message migth be changed by the plugin")] | ||
public string Message { get; set; } = "This is a default message"; | ||
|
||
[Description("To hide the hint or not.")] | ||
public bool Hide { get; set; } = false; | ||
|
||
public DynamicHintContentConfig() | ||
{ | ||
} | ||
|
||
public static implicit operator DynamicHintConfig(DynamicHintContentConfig v) | ||
{ | ||
return new DynamicHintConfig() | ||
{ | ||
Content = v, | ||
}; | ||
} | ||
} | ||
} |
Oops, something went wrong.