/
NLObP
/
AAEmu
Обзор
Документация
Войти
/
NLObP
/
AAEmu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
AAEmu.Game/Scripts/Commands/InGameCashShop.cs
66 строк
2 KB
Roger Barreto
Collection expressions check + blank lines update (#1110)
11 дек 2024, 19:38
Не верифицирован
11 дек 2024, 19:38
0ce5643
Код
Авторство
О чём код?
using AAEmu.Game.Core.Managers; using AAEmu.Game.Models.Game; using AAEmu.Game.Models.Game.Char; using AAEmu.Game.Utils.Scripts; namespace AAEmu.Game.Scripts.Commands; public class InGameCashShop : ICommand { public string[] CommandNames { get; set; } = ["ingamecashshop", "ics"]; public void OnLoad() { CommandManager.Instance.Register(CommandNames, this); } public string GetCommandLineHelp() { return "<on||off||reload>"; } public string GetCommandHelpText() { return "Enables or disables the InGameCashShop as well as allows to reloading of the data"; } public void Execute(Character character, string[] args, IMessageOutput messageOutput) { var doCommand = "list"; if (args.Length > 0) { doCommand = args[0].ToLower(); } switch (doCommand) { case "list": CommandManager.SendNormalText(this, messageOutput, $"Currently loaded {CashShopManager.Instance.ShopItems.Count} shop items listed as {CashShopManager.Instance.MenuItems.Count} entries across all tabs in the cash shop."); break; case "on": CashShopManager.Instance.EnabledShop(); CommandManager.SendNormalText(this, messageOutput, $"Shop has been enabled"); break; case "off": CashShopManager.Instance.DisableShop(); CommandManager.SendNormalText(this, messageOutput, $"Shop has been disabled"); break; case "reload": if (CashShopManager.Instance.Enabled) { CommandManager.SendNormalText(this, messageOutput, $"First disable the shop before reloading it"); } else { CashShopManager.Instance.Load(); CommandManager.SendNormalText(this, messageOutput, $"Items reloaded"); } break; default: CommandManager.SendErrorText(this, messageOutput, $"Unknown command: {doCommand}"); break; } } }