chore: version 1.2.4.b2-panorama1, drop WASDMenuAPI project
- ModuleVersion 1.2.4.b2-panorama1; the startup version check and its download link now use git.zio.sh/cs2/jRandomSkills releases instead of upstream's GitHub - updater.json lists the release - Remove the unused WASDMenuAPI project from the solution and repo, and its README credit
This commit is contained in:
parent
793370a55f
commit
7810c6e302
18 changed files with 10 additions and 584 deletions
1
.github/en.md
vendored
1
.github/en.md
vendored
|
|
@ -411,7 +411,6 @@ This plugin uses content from the following projects:
|
||||||
- [Ray-Trace](https://github.com/FUNPLAY-pro-CS2/Ray-Trace) by [SlynxCZ](https://github.com/SlynxCZ) - New Trace Ray system
|
- [Ray-Trace](https://github.com/FUNPLAY-pro-CS2/Ray-Trace) by [SlynxCZ](https://github.com/SlynxCZ) - New Trace Ray system
|
||||||
- [CS2FlashingHtmlHudFix](https://github.com/girlglock/CS2FlashingHtmlHudFix) by [girlglock](https://github.com/girlglock) - A fix for window flickering
|
- [CS2FlashingHtmlHudFix](https://github.com/girlglock/CS2FlashingHtmlHudFix) by [girlglock](https://github.com/girlglock) - A fix for window flickering
|
||||||
- [ChaseMod](https://github.com/ipsvn/ChaseMod/blob/master/Utils/Memory/CCSMatch.cs) by [ipsvn](https://github.com/ipsvn) - Round score management
|
- [ChaseMod](https://github.com/ipsvn/ChaseMod/blob/master/Utils/Memory/CCSMatch.cs) by [ipsvn](https://github.com/ipsvn) - Round score management
|
||||||
- [WASDMenuAPI](https://github.com/Interesting-exe/WASDMenuAPI) by [Interesting-exe](https://github.com/Interesting-exe) - API to easily create WASD menus
|
|
||||||
- [GeoLocationLanguageManagerPlugin](https://github.com/aprox2/GeoLocationLanguageManagerPlugin) by [aprox2](https://github.com/aprox2) - Geolocation language manager
|
- [GeoLocationLanguageManagerPlugin](https://github.com/aprox2/GeoLocationLanguageManagerPlugin) by [aprox2](https://github.com/aprox2) - Geolocation language manager
|
||||||
- [GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data) by [MaxMind](https://www.maxmind.com/) - Geolocation data
|
- [GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data) by [MaxMind](https://www.maxmind.com/) - Geolocation data
|
||||||
- [cs2-css-flashlight](https://github.com/creazy231/cs2-css-flashlight) by [creazy231](https://github.com/creazy231) - Lighting creation system
|
- [cs2-css-flashlight](https://github.com/creazy231/cs2-css-flashlight) by [creazy231](https://github.com/creazy231) - Lighting creation system
|
||||||
|
|
|
||||||
1
.github/pl.md
vendored
1
.github/pl.md
vendored
|
|
@ -411,7 +411,6 @@ Plugin korzysta z zawartości następujących projektów:
|
||||||
- [Ray-Trace](https://github.com/FUNPLAY-pro-CS2/Ray-Trace) autorstwa [SlynxCZ](https://github.com/SlynxCZ) - Nowy system śledzenia promieni (Trace Ray)
|
- [Ray-Trace](https://github.com/FUNPLAY-pro-CS2/Ray-Trace) autorstwa [SlynxCZ](https://github.com/SlynxCZ) - Nowy system śledzenia promieni (Trace Ray)
|
||||||
- [CS2FlashingHtmlHudFix](https://github.com/girlglock/CS2FlashingHtmlHudFix) autorstwa [girlglock](https://github.com/girlglock) - Poprawka migotania okienka z supermocą
|
- [CS2FlashingHtmlHudFix](https://github.com/girlglock/CS2FlashingHtmlHudFix) autorstwa [girlglock](https://github.com/girlglock) - Poprawka migotania okienka z supermocą
|
||||||
- [ChaseMod](https://github.com/ipsvn/ChaseMod/blob/master/Utils/Memory/CCSMatch.cs) autorstwa [ipsvn](https://github.com/ipsvn) - Ustawianie wyniku rund
|
- [ChaseMod](https://github.com/ipsvn/ChaseMod/blob/master/Utils/Memory/CCSMatch.cs) autorstwa [ipsvn](https://github.com/ipsvn) - Ustawianie wyniku rund
|
||||||
- [WASDMenuAPI](https://github.com/Interesting-exe/WASDMenuAPI) autorstwa [Interesting-exe](https://github.com/Interesting-exe) - API do łatwego tworzenia menu za pomocą klawiszy WASD
|
|
||||||
- [GeoLocationLanguageManagerPlugin](https://github.com/aprox2/GeoLocationLanguageManagerPlugin) autorstwa [aprox2](https://github.com/aprox2) - Zarządzenie geolokalizacją
|
- [GeoLocationLanguageManagerPlugin](https://github.com/aprox2/GeoLocationLanguageManagerPlugin) autorstwa [aprox2](https://github.com/aprox2) - Zarządzenie geolokalizacją
|
||||||
- [GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data) autorstwa [MaxMind](https://www.maxmind.com/) - Dane geolokalizacyjne
|
- [GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data) autorstwa [MaxMind](https://www.maxmind.com/) - Dane geolokalizacyjne
|
||||||
- [cs2-css-flashlight](https://github.com/creazy231/cs2-css-flashlight) autorstwa [creazy231](https://github.com/creazy231) - System tworzenia oświetlenia
|
- [cs2-css-flashlight](https://github.com/creazy231/cs2-css-flashlight) autorstwa [creazy231](https://github.com/creazy231) - System tworzenia oświetlenia
|
||||||
|
|
|
||||||
|
|
@ -411,7 +411,6 @@ Plugin korzysta z zawartości następujących projektów:
|
||||||
- [Ray-Trace](https://github.com/FUNPLAY-pro-CS2/Ray-Trace) autorstwa [SlynxCZ](https://github.com/SlynxCZ) - Nowy system śledzenia promieni (Trace Ray)
|
- [Ray-Trace](https://github.com/FUNPLAY-pro-CS2/Ray-Trace) autorstwa [SlynxCZ](https://github.com/SlynxCZ) - Nowy system śledzenia promieni (Trace Ray)
|
||||||
- [CS2FlashingHtmlHudFix](https://github.com/girlglock/CS2FlashingHtmlHudFix) autorstwa [girlglock](https://github.com/girlglock) - Poprawka migotania okienka z supermocą
|
- [CS2FlashingHtmlHudFix](https://github.com/girlglock/CS2FlashingHtmlHudFix) autorstwa [girlglock](https://github.com/girlglock) - Poprawka migotania okienka z supermocą
|
||||||
- [ChaseMod](https://github.com/ipsvn/ChaseMod/blob/master/Utils/Memory/CCSMatch.cs) autorstwa [ipsvn](https://github.com/ipsvn) - Ustawianie wyniku rund
|
- [ChaseMod](https://github.com/ipsvn/ChaseMod/blob/master/Utils/Memory/CCSMatch.cs) autorstwa [ipsvn](https://github.com/ipsvn) - Ustawianie wyniku rund
|
||||||
- [WASDMenuAPI](https://github.com/Interesting-exe/WASDMenuAPI) autorstwa [Interesting-exe](https://github.com/Interesting-exe) - API do łatwego tworzenia menu za pomocą klawiszy WASD
|
|
||||||
- [GeoLocationLanguageManagerPlugin](https://github.com/aprox2/GeoLocationLanguageManagerPlugin) autorstwa [aprox2](https://github.com/aprox2) - Zarządzenie geolokalizacją
|
- [GeoLocationLanguageManagerPlugin](https://github.com/aprox2/GeoLocationLanguageManagerPlugin) autorstwa [aprox2](https://github.com/aprox2) - Zarządzenie geolokalizacją
|
||||||
- [GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data) autorstwa [MaxMind](https://www.maxmind.com/) - Dane geolokalizacyjne
|
- [GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data) autorstwa [MaxMind](https://www.maxmind.com/) - Dane geolokalizacyjne
|
||||||
- [cs2-css-flashlight](https://github.com/creazy231/cs2-css-flashlight) autorstwa [creazy231](https://github.com/creazy231) - System tworzenia oświetlenia
|
- [cs2-css-flashlight](https://github.com/creazy231/cs2-css-flashlight) autorstwa [creazy231](https://github.com/creazy231) - System tworzenia oświetlenia
|
||||||
|
|
|
||||||
|
|
@ -411,7 +411,6 @@ This plugin uses content from the following projects:
|
||||||
- [Ray-Trace](https://github.com/FUNPLAY-pro-CS2/Ray-Trace) by [SlynxCZ](https://github.com/SlynxCZ) - New Trace Ray system
|
- [Ray-Trace](https://github.com/FUNPLAY-pro-CS2/Ray-Trace) by [SlynxCZ](https://github.com/SlynxCZ) - New Trace Ray system
|
||||||
- [CS2FlashingHtmlHudFix](https://github.com/girlglock/CS2FlashingHtmlHudFix) by [girlglock](https://github.com/girlglock) - A fix for window flickering
|
- [CS2FlashingHtmlHudFix](https://github.com/girlglock/CS2FlashingHtmlHudFix) by [girlglock](https://github.com/girlglock) - A fix for window flickering
|
||||||
- [ChaseMod](https://github.com/ipsvn/ChaseMod/blob/master/Utils/Memory/CCSMatch.cs) by [ipsvn](https://github.com/ipsvn) - Round score management
|
- [ChaseMod](https://github.com/ipsvn/ChaseMod/blob/master/Utils/Memory/CCSMatch.cs) by [ipsvn](https://github.com/ipsvn) - Round score management
|
||||||
- [WASDMenuAPI](https://github.com/Interesting-exe/WASDMenuAPI) by [Interesting-exe](https://github.com/Interesting-exe) - API to easily create WASD menus
|
|
||||||
- [GeoLocationLanguageManagerPlugin](https://github.com/aprox2/GeoLocationLanguageManagerPlugin) by [aprox2](https://github.com/aprox2) - Geolocation language manager
|
- [GeoLocationLanguageManagerPlugin](https://github.com/aprox2/GeoLocationLanguageManagerPlugin) by [aprox2](https://github.com/aprox2) - Geolocation language manager
|
||||||
- [GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data) by [MaxMind](https://www.maxmind.com/) - Geolocation data
|
- [GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data) by [MaxMind](https://www.maxmind.com/) - Geolocation data
|
||||||
- [cs2-css-flashlight](https://github.com/creazy231/cs2-css-flashlight) by [creazy231](https://github.com/creazy231) - Lighting creation system
|
- [cs2-css-flashlight](https://github.com/creazy231/cs2-css-flashlight) by [creazy231](https://github.com/creazy231) - Lighting creation system
|
||||||
|
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
using CounterStrikeSharp.API.Core;
|
|
||||||
using WASDSharedAPI;
|
|
||||||
|
|
||||||
namespace WASDMenuAPI.Classes;
|
|
||||||
|
|
||||||
public class WasdManager : IWasdMenuManager
|
|
||||||
{
|
|
||||||
public void OpenMainMenu(CCSPlayerController? player, IWasdMenu? menu)
|
|
||||||
{
|
|
||||||
if(!TryGetPlayer(player, out var menuPlayer)) return;
|
|
||||||
menuPlayer?.OpenMainMenu((WasdMenu?)menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CloseMenu(CCSPlayerController? player)
|
|
||||||
{
|
|
||||||
if (!TryGetPlayer(player, out var menuPlayer)) return;
|
|
||||||
menuPlayer?.OpenMainMenu(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CloseSubMenu(CCSPlayerController? player)
|
|
||||||
{
|
|
||||||
if (!TryGetPlayer(player, out var menuPlayer)) return;
|
|
||||||
menuPlayer?.CloseSubMenu();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CloseAllSubMenus(CCSPlayerController? player)
|
|
||||||
{
|
|
||||||
if (!TryGetPlayer(player, out var menuPlayer)) return;
|
|
||||||
menuPlayer?.CloseAllSubMenus();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OpenSubMenu(CCSPlayerController? player, IWasdMenu? menu)
|
|
||||||
{
|
|
||||||
if (!TryGetPlayer(player, out var menuPlayer)) return;
|
|
||||||
menuPlayer?.OpenSubMenu(menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IWasdMenu CreateMenu(string title, string itemText, string itemHoverText, string controlText)
|
|
||||||
{
|
|
||||||
WasdMenu menu = new()
|
|
||||||
{
|
|
||||||
Title = title,
|
|
||||||
ItemText = itemText,
|
|
||||||
ItemHoverText = itemHoverText,
|
|
||||||
ControlText = controlText
|
|
||||||
};
|
|
||||||
return menu;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool HasMenu(CCSPlayerController? player)
|
|
||||||
{
|
|
||||||
if (TryGetPlayer(player, out var menuPlayer) && menuPlayer != null)
|
|
||||||
return menuPlayer.MainMenu != null;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdateActiveMenu(CCSPlayerController? player, Dictionary<string, Action<CCSPlayerController, IWasdMenuOption>> list)
|
|
||||||
{
|
|
||||||
if (!TryGetPlayer(player, out var menuPlayer)) return;
|
|
||||||
menuPlayer?.UpdateActiveMenu(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool SetMenuPaused(CCSPlayerController? player, bool pause)
|
|
||||||
{
|
|
||||||
if (TryGetPlayer(player, out var menuPlayer) && menuPlayer != null)
|
|
||||||
{
|
|
||||||
menuPlayer.Paused = pause;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool TryGetPlayer(CCSPlayerController? player, out WasdMenuPlayer? menuPlayer)
|
|
||||||
{
|
|
||||||
menuPlayer = null!;
|
|
||||||
if (player == null || !player.IsValid || player.IsBot || player.SteamID == 0) return false;
|
|
||||||
return WASDMenuAPI.Players.TryGetValue(player.SteamID, out menuPlayer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
using CounterStrikeSharp.API.Core;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using WASDSharedAPI;
|
|
||||||
|
|
||||||
namespace WASDMenuAPI.Classes;
|
|
||||||
|
|
||||||
public class WasdMenu : IWasdMenu
|
|
||||||
{
|
|
||||||
[AllowNull] public string Title { get; set; } = "";
|
|
||||||
[AllowNull] public string ItemText { get; set; } = "";
|
|
||||||
[AllowNull] public string ItemHoverText { get; set; } = "";
|
|
||||||
[AllowNull] public string ControlText { get; set; } = "";
|
|
||||||
public LinkedList<IWasdMenuOption>? Options { get; set; } = new();
|
|
||||||
public LinkedListNode<IWasdMenuOption>? Prev { get; set; } = null;
|
|
||||||
public LinkedListNode<IWasdMenuOption> Add(string display, Action<CCSPlayerController, IWasdMenuOption> onChoice)
|
|
||||||
{
|
|
||||||
Options ??= new();
|
|
||||||
WasdMenuOption newOption = new()
|
|
||||||
{
|
|
||||||
OptionDisplay = display,
|
|
||||||
OnChoose = onChoice,
|
|
||||||
Index = Options.Count,
|
|
||||||
Parent = this
|
|
||||||
};
|
|
||||||
return Options.AddLast(newOption);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
using CounterStrikeSharp.API.Core;
|
|
||||||
using WASDMenuAPI.Classes;
|
|
||||||
using WASDSharedAPI;
|
|
||||||
|
|
||||||
namespace WASDMenuAPI;
|
|
||||||
|
|
||||||
public class WasdMenuOption : IWasdMenuOption
|
|
||||||
{
|
|
||||||
public IWasdMenu? Parent { get; set; }
|
|
||||||
public string? OptionDisplay { get; set; }
|
|
||||||
public Action<CCSPlayerController, IWasdMenuOption>? OnChoose { get; set; }
|
|
||||||
public int Index { get; set; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,300 +0,0 @@
|
||||||
using System.Text;
|
|
||||||
using CounterStrikeSharp.API;
|
|
||||||
using CounterStrikeSharp.API.Core;
|
|
||||||
using WASDMenuAPI.Classes;
|
|
||||||
using WASDSharedAPI;
|
|
||||||
|
|
||||||
namespace WASDMenuAPI;
|
|
||||||
|
|
||||||
public class WasdMenuPlayer
|
|
||||||
{
|
|
||||||
public required CCSPlayerController Player { get; set; }
|
|
||||||
public WasdMenu? MainMenu = null;
|
|
||||||
public LinkedListNode<IWasdMenuOption>? CurrentChoice = null;
|
|
||||||
public LinkedListNode<IWasdMenuOption>? MenuStart = null;
|
|
||||||
public string CenterHtml = "";
|
|
||||||
public static int DefaultVisibleOptions = 3;
|
|
||||||
public int VisibleOptions => DefaultVisibleOptions;
|
|
||||||
public PlayerButtons Buttons { get; set; }
|
|
||||||
public bool Paused = false;
|
|
||||||
|
|
||||||
public int scrollIndex = 0;
|
|
||||||
public int maxLength = 21;
|
|
||||||
public int scrollJump = 3;
|
|
||||||
|
|
||||||
public void OpenMainMenu(WasdMenu? menu)
|
|
||||||
{
|
|
||||||
if (menu == null)
|
|
||||||
{
|
|
||||||
MainMenu = null;
|
|
||||||
CurrentChoice = null;
|
|
||||||
CenterHtml = "";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MainMenu = menu;
|
|
||||||
CurrentChoice = MainMenu.Options?.First;
|
|
||||||
MenuStart = CurrentChoice;
|
|
||||||
UpdateCenterHtml();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OpenSubMenu(IWasdMenu? menu)
|
|
||||||
{
|
|
||||||
if (menu == null)
|
|
||||||
{
|
|
||||||
CurrentChoice = MainMenu?.Options?.First;
|
|
||||||
MenuStart = CurrentChoice;
|
|
||||||
UpdateCenterHtml();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CurrentChoice = menu.Options?.First;
|
|
||||||
MenuStart = CurrentChoice;
|
|
||||||
UpdateCenterHtml();
|
|
||||||
}
|
|
||||||
public void GoBackToPrev(LinkedListNode<IWasdMenuOption>? menu)
|
|
||||||
{
|
|
||||||
if (menu == null)
|
|
||||||
{
|
|
||||||
CurrentChoice = MainMenu?.Options?.First;
|
|
||||||
MenuStart = CurrentChoice;
|
|
||||||
UpdateCenterHtml();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CurrentChoice = menu;
|
|
||||||
if (CurrentChoice.Value.Index >= 5 )
|
|
||||||
{
|
|
||||||
MenuStart = CurrentChoice;
|
|
||||||
for (int i = 0; i < VisibleOptions; i++)
|
|
||||||
{
|
|
||||||
MenuStart = MenuStart?.Previous;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
MenuStart = CurrentChoice.List?.First;
|
|
||||||
UpdateCenterHtml();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CloseSubMenu()
|
|
||||||
{
|
|
||||||
if (CurrentChoice?.Value.Parent?.Prev == null)
|
|
||||||
return;
|
|
||||||
GoBackToPrev(CurrentChoice?.Value.Parent.Prev);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CloseAllSubMenus()
|
|
||||||
{
|
|
||||||
OpenSubMenu(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Choose()
|
|
||||||
{
|
|
||||||
CurrentChoice?.Value.OnChoose?.Invoke(Player, CurrentChoice.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ScrollDown()
|
|
||||||
{
|
|
||||||
if(CurrentChoice == null || MainMenu == null)
|
|
||||||
return;
|
|
||||||
scrollIndex = 0;
|
|
||||||
CurrentChoice = CurrentChoice.Next ?? CurrentChoice.List?.First;
|
|
||||||
MenuStart = CurrentChoice!.Value.Index >= VisibleOptions ? MenuStart!.Next : CurrentChoice.List?.First;
|
|
||||||
UpdateCenterHtml();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ScrollUp()
|
|
||||||
{
|
|
||||||
if(CurrentChoice == null || MainMenu == null)
|
|
||||||
return;
|
|
||||||
scrollIndex = 0;
|
|
||||||
CurrentChoice = CurrentChoice.Previous ?? CurrentChoice.List?.Last;
|
|
||||||
if (CurrentChoice == CurrentChoice?.List?.Last && CurrentChoice?.Value.Index >= VisibleOptions)
|
|
||||||
{
|
|
||||||
MenuStart = CurrentChoice;
|
|
||||||
for (int i = 0; i < VisibleOptions - 1; i++)
|
|
||||||
MenuStart = MenuStart?.Previous;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
MenuStart = CurrentChoice!.Value.Index >= VisibleOptions ? MenuStart!.Previous : CurrentChoice.List?.First;
|
|
||||||
UpdateCenterHtml();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateCenterHtml()
|
|
||||||
{
|
|
||||||
if (CurrentChoice == null || MainMenu == null || MenuStart == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
StringBuilder builder = new();
|
|
||||||
string itemText = "";
|
|
||||||
string itemHoverText = "";
|
|
||||||
string endControl = "";
|
|
||||||
LinkedListNode<IWasdMenuOption>? option = MenuStart;
|
|
||||||
|
|
||||||
builder.AppendLine("<jRS/>");
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(option?.Value?.Parent?.Title))
|
|
||||||
builder.AppendLine(option.Value.Parent?.Title ?? "");
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(option?.Value?.Parent?.ItemText))
|
|
||||||
itemText = option?.Value?.Parent?.ItemText ?? "";
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(option?.Value?.Parent?.ItemHoverText))
|
|
||||||
itemHoverText = option?.Value?.Parent?.ItemHoverText ?? "";
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(option?.Value?.Parent?.ControlText))
|
|
||||||
endControl = option?.Value?.Parent?.ControlText ?? "";
|
|
||||||
|
|
||||||
int shown = 0;
|
|
||||||
int maxOptions = VisibleOptions;
|
|
||||||
|
|
||||||
while (shown < maxOptions && option != null && option.Value != null)
|
|
||||||
{
|
|
||||||
/* if (shown == maxOptions - 1 && option.Next != null)
|
|
||||||
{
|
|
||||||
builder.AppendLine(
|
|
||||||
$"<img src='https://raw.githubusercontent.com/oqyh/cs2-Kill-Sound-GoldKingZ/main/Resources/arrow.gif' class=''> <img src='https://raw.githubusercontent.com/oqyh/cs2-Kill-Sound-GoldKingZ/main/Resources/arrow.gif' class=''> <img src='https://raw.githubusercontent.com/oqyh/cs2-Kill-Sound-GoldKingZ/main/Resources/arrow.gif' class=''> <br>");
|
|
||||||
break;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
string input = option.Value.OptionDisplay ?? string.Empty;
|
|
||||||
string color = string.Empty;
|
|
||||||
string text = input;
|
|
||||||
|
|
||||||
if (input.Contains('|'))
|
|
||||||
{
|
|
||||||
string[] parts = input.Split("|", 2);
|
|
||||||
color = parts[0].StartsWith("#") && parts[0].Length == 7 ? parts[0] : string.Empty;
|
|
||||||
text = parts.Length > 1 ? parts[1] : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
string cleanText = text.Replace("\u200B", "")
|
|
||||||
.Replace("\u200C", "")
|
|
||||||
.Replace("\u202A", "")
|
|
||||||
.Replace("\u202C", "");
|
|
||||||
|
|
||||||
int sepIndex = cleanText.IndexOf(" : ");
|
|
||||||
string namePart = sepIndex != -1 ? cleanText.Substring(0, sepIndex) : cleanText;
|
|
||||||
string statsPart = sepIndex != -1 ? cleanText.Substring(sepIndex) : "";
|
|
||||||
|
|
||||||
int start = 0;
|
|
||||||
int length = cleanText.Length;
|
|
||||||
|
|
||||||
if (option == CurrentChoice)
|
|
||||||
{
|
|
||||||
if (cleanText.Length > maxLength)
|
|
||||||
{
|
|
||||||
int remaining = cleanText.Length - scrollIndex;
|
|
||||||
if (remaining <= maxLength)
|
|
||||||
{
|
|
||||||
start = scrollIndex;
|
|
||||||
length = remaining;
|
|
||||||
if (Server.TickCount % 32 == 0) scrollIndex = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
start = scrollIndex;
|
|
||||||
length = maxLength;
|
|
||||||
if (Server.TickCount % 32 == 0) scrollIndex += scrollJump;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
start = 0;
|
|
||||||
length = Math.Min(cleanText.Length, maxLength);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
start = 0;
|
|
||||||
length = Math.Min(cleanText.Length, maxLength);
|
|
||||||
}
|
|
||||||
|
|
||||||
int nameLength = namePart.Length;
|
|
||||||
|
|
||||||
int nameSliceStart = Math.Max(start, 0);
|
|
||||||
int nameSliceEnd = Math.Min(start + length, nameLength);
|
|
||||||
int nameSliceLength = Math.Max(0, nameSliceEnd - nameSliceStart);
|
|
||||||
string visibleName = nameSliceLength > 0 ? cleanText.Substring(nameSliceStart, nameSliceLength) : "";
|
|
||||||
|
|
||||||
int statsSliceStart = Math.Max(start, nameLength);
|
|
||||||
int statsSliceEnd = Math.Min(start + length, cleanText.Length);
|
|
||||||
int statsSliceLength = Math.Max(0, statsSliceEnd - statsSliceStart);
|
|
||||||
|
|
||||||
string visibleStats = statsSliceLength > 0 ? cleanText.Substring(statsSliceStart, statsSliceLength) : "";
|
|
||||||
string finalOptionText = (visibleName.Length > 0 ? $"\u202A{visibleName}\u202C" : "") + visibleStats;
|
|
||||||
|
|
||||||
if (option == CurrentChoice)
|
|
||||||
builder.AppendLine(string.Format(itemHoverText, finalOptionText));
|
|
||||||
else
|
|
||||||
builder.AppendLine(string.Format(itemText, string.IsNullOrEmpty(color) ? finalOptionText : $"<font color='{color}'>{finalOptionText}</font>"));
|
|
||||||
|
|
||||||
option = option.Next;
|
|
||||||
shown++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(endControl))
|
|
||||||
builder.AppendLine(endControl);
|
|
||||||
|
|
||||||
CenterHtml = builder.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdateActiveMenu(Dictionary<string, Action<CCSPlayerController, IWasdMenuOption>> list)
|
|
||||||
{
|
|
||||||
if (list.Count == 0)
|
|
||||||
{
|
|
||||||
OpenMainMenu(null);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var options = MainMenu?.Options;
|
|
||||||
if (MainMenu == null || options == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
options.Clear();
|
|
||||||
bool choiceExists = false;
|
|
||||||
|
|
||||||
foreach (var item in list)
|
|
||||||
{
|
|
||||||
WasdMenuOption newOption = new()
|
|
||||||
{
|
|
||||||
OptionDisplay = item.Key,
|
|
||||||
OnChoose = item.Value,
|
|
||||||
Index = options.Count,
|
|
||||||
Parent = MainMenu
|
|
||||||
};
|
|
||||||
options.AddLast(newOption);
|
|
||||||
|
|
||||||
if (CurrentChoice?.Value?.OptionDisplay == item.Key)
|
|
||||||
{
|
|
||||||
CurrentChoice = options.Last;
|
|
||||||
choiceExists = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!choiceExists)
|
|
||||||
CurrentChoice = options.First;
|
|
||||||
|
|
||||||
if (CurrentChoice != null)
|
|
||||||
{
|
|
||||||
if (CurrentChoice.Value.Index >= VisibleOptions)
|
|
||||||
{
|
|
||||||
MenuStart = CurrentChoice;
|
|
||||||
for (int i = 0; i < VisibleOptions - 1; i++)
|
|
||||||
MenuStart = MenuStart?.Previous;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
MenuStart = MainMenu.Options?.First;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateCenterHtml();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string SafeSubstring(string text, int start, int length)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(text)) return "";
|
|
||||||
if (start < 0) start = 0;
|
|
||||||
if (start >= text.Length) return "";
|
|
||||||
if (start + length > text.Length)
|
|
||||||
length = text.Length - start;
|
|
||||||
return text.Substring(start, length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
using CounterStrikeSharp.API.Core;
|
|
||||||
|
|
||||||
namespace WASDSharedAPI;
|
|
||||||
|
|
||||||
public interface IWasdMenu
|
|
||||||
{
|
|
||||||
public string? Title { get; set; }
|
|
||||||
public string? ItemText { get; set; }
|
|
||||||
public string? ItemHoverText { get; set; }
|
|
||||||
public string? ControlText { get; set; }
|
|
||||||
public LinkedList<IWasdMenuOption>? Options { get; set; }
|
|
||||||
// previous option node
|
|
||||||
public LinkedListNode<IWasdMenuOption>? Prev { get; set; }
|
|
||||||
public LinkedListNode<IWasdMenuOption> Add(string display, Action<CCSPlayerController, IWasdMenuOption> onChoice);
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
using CounterStrikeSharp.API.Core;
|
|
||||||
|
|
||||||
namespace WASDSharedAPI;
|
|
||||||
|
|
||||||
public interface IWasdMenuManager
|
|
||||||
{
|
|
||||||
//open the menu as main menu
|
|
||||||
public void OpenMainMenu(CCSPlayerController? player, IWasdMenu? menu);
|
|
||||||
//close all menus
|
|
||||||
public void CloseMenu(CCSPlayerController? player);
|
|
||||||
//close current submenu and go to previous menu/submenu
|
|
||||||
public void CloseSubMenu(CCSPlayerController? player);
|
|
||||||
//close all submenus and go to main menu
|
|
||||||
public void CloseAllSubMenus(CCSPlayerController? player);
|
|
||||||
//open menu as submenu
|
|
||||||
public void OpenSubMenu(CCSPlayerController? player, IWasdMenu? menu);
|
|
||||||
//create new menu object
|
|
||||||
public IWasdMenu CreateMenu(string title, string itemText, string itemHoverText, string ControlText);
|
|
||||||
public bool HasMenu(CCSPlayerController? player);
|
|
||||||
public void UpdateActiveMenu(CCSPlayerController? player, Dictionary<string, Action<CCSPlayerController, IWasdMenuOption>> list);
|
|
||||||
public bool SetMenuPaused(CCSPlayerController? player, bool pause);
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
using CounterStrikeSharp.API.Core;
|
|
||||||
|
|
||||||
namespace WASDSharedAPI;
|
|
||||||
|
|
||||||
public interface IWasdMenuOption
|
|
||||||
{
|
|
||||||
public IWasdMenu? Parent { get; set; }
|
|
||||||
public string? OptionDisplay { get; set; }
|
|
||||||
public Action<CCSPlayerController, IWasdMenuOption>? OnChoose { get; set; }
|
|
||||||
public int Index { get; set; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
||||||
using CounterStrikeSharp.API;
|
|
||||||
using CounterStrikeSharp.API.Core;
|
|
||||||
using WASDMenuAPI.Classes;
|
|
||||||
|
|
||||||
namespace WASDMenuAPI;
|
|
||||||
|
|
||||||
public class WASDMenuAPI
|
|
||||||
{
|
|
||||||
public static string ModuleName => "WASDMenuAPI";
|
|
||||||
public static string ModuleVersion => "1.0.2";
|
|
||||||
public static string ModuleAuthor => "Interesting";
|
|
||||||
|
|
||||||
public static readonly Dictionary<ulong, WasdMenuPlayer> Players = [];
|
|
||||||
|
|
||||||
public static void LoadPlugin(BasePlugin basePlugin, bool hotReload)
|
|
||||||
{
|
|
||||||
basePlugin.RegisterEventHandler<EventPlayerActivate>((@event, info) =>
|
|
||||||
{
|
|
||||||
if (@event.Userid != null)
|
|
||||||
Players[@event.Userid.SteamID] = new WasdMenuPlayer
|
|
||||||
{
|
|
||||||
Player = @event.Userid,
|
|
||||||
Buttons = 0
|
|
||||||
};
|
|
||||||
return HookResult.Continue;
|
|
||||||
});
|
|
||||||
basePlugin.RegisterEventHandler<EventPlayerDisconnect>((@event, info) =>
|
|
||||||
{
|
|
||||||
if (@event.Userid != null) Players.Remove(@event.Userid.SteamID);
|
|
||||||
return HookResult.Continue;
|
|
||||||
});
|
|
||||||
|
|
||||||
basePlugin.RegisterListener<Listeners.OnTick>(OnTick);
|
|
||||||
|
|
||||||
if(hotReload)
|
|
||||||
foreach (var pl in Utilities.GetPlayers())
|
|
||||||
{
|
|
||||||
Players[pl.SteamID] = new WasdMenuPlayer
|
|
||||||
{
|
|
||||||
Player = pl,
|
|
||||||
Buttons = pl.Buttons
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void OnTick()
|
|
||||||
{
|
|
||||||
foreach (var player in Players.Values.Where(p => p.MainMenu != null && p.Player?.IsValid == true))
|
|
||||||
{
|
|
||||||
if (player.Paused)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ((player.Buttons & PlayerButtons.Forward) == 0 && (player.Player.Buttons & PlayerButtons.Forward) != 0)
|
|
||||||
player.ScrollUp();
|
|
||||||
else if((player.Buttons & PlayerButtons.Back) == 0 && (player.Player.Buttons & PlayerButtons.Back) != 0)
|
|
||||||
player.ScrollDown();
|
|
||||||
else if((player.Buttons & PlayerButtons.Use) == 0 && (player.Player.Buttons & PlayerButtons.Use) != 0)
|
|
||||||
player.Choose();
|
|
||||||
|
|
||||||
player.Buttons = player.Player.Buttons;
|
|
||||||
if (!string.IsNullOrEmpty(player.CenterHtml))
|
|
||||||
player.Player.PrintToCenterHtml(player.CenterHtml);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.373" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 17
|
|
||||||
VisualStudioVersion = 17.9.34728.123
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WASDMenuAPI", "WASDMenuAPI.csproj", "{0119D01B-2F71-4918-B638-795C423E143F}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{0119D01B-2F71-4918-B638-795C423E143F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{0119D01B-2F71-4918-B638-795C423E143F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{0119D01B-2F71-4918-B638-795C423E143F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{0119D01B-2F71-4918-B638-795C423E143F}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {33517EB0-9056-4518-864C-37D0AFF4124B}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
|
|
@ -5,8 +5,6 @@ VisualStudioVersion = 17.9.34728.123
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "jRandomSkills", "jRandomSkills.csproj", "{1412DD25-558C-425A-A7F6-347C970136E5}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "jRandomSkills", "jRandomSkills.csproj", "{1412DD25-558C-425A-A7F6-347C970136E5}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WASDMenuAPI", "../WASDMenuAPI - SRC Files/WASDMenuAPI.csproj", "{E13A84FA-EAB5-CAC7-8143-DD55AB40EAB5}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
|
@ -17,10 +15,6 @@ Global
|
||||||
{1412DD25-558C-425A-A7F6-347C970136E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{1412DD25-558C-425A-A7F6-347C970136E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{1412DD25-558C-425A-A7F6-347C970136E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{1412DD25-558C-425A-A7F6-347C970136E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{1412DD25-558C-425A-A7F6-347C970136E5}.Release|Any CPU.Build.0 = Release|Any CPU
|
{1412DD25-558C-425A-A7F6-347C970136E5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{E13A84FA-EAB5-CAC7-8143-DD55AB40EAB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{E13A84FA-EAB5-CAC7-8143-DD55AB40EAB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{E13A84FA-EAB5-CAC7-8143-DD55AB40EAB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{E13A84FA-EAB5-CAC7-8143-DD55AB40EAB5}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ namespace src
|
||||||
public override string ModuleName => "[CS2] [ jRandomSkills ]";
|
public override string ModuleName => "[CS2] [ jRandomSkills ]";
|
||||||
public override string ModuleAuthor => "D3X (Original), Juzlus (Modifier), ByDexterTR (Contributor)";
|
public override string ModuleAuthor => "D3X (Original), Juzlus (Modifier), ByDexterTR (Contributor)";
|
||||||
public override string ModuleDescription => "Plugin adds random skills every round for CS2 by D3X. Modified by Juzlus.";
|
public override string ModuleDescription => "Plugin adds random skills every round for CS2 by D3X. Modified by Juzlus.";
|
||||||
public override string ModuleVersion => "1.2.4.b2";
|
public override string ModuleVersion => "1.2.4.b2-panorama1";
|
||||||
|
|
||||||
public override void Load(bool hotReload)
|
public override void Load(bool hotReload)
|
||||||
{
|
{
|
||||||
|
|
@ -250,7 +250,7 @@ namespace src
|
||||||
Console.ForegroundColor = (ConsoleColor)CS2ConsoleColors.Red;
|
Console.ForegroundColor = (ConsoleColor)CS2ConsoleColors.Red;
|
||||||
Console.WriteLine($"\n#########################################################");
|
Console.WriteLine($"\n#########################################################");
|
||||||
Console.WriteLine($"# Download the new version from: #");
|
Console.WriteLine($"# Download the new version from: #");
|
||||||
Console.WriteLine($"# https://github.com/Juzlus/jRandomSkills/releases #");
|
Console.WriteLine($"# https://git.zio.sh/cs2/jRandomSkills/releases #");
|
||||||
Console.WriteLine($"#########################################################");
|
Console.WriteLine($"#########################################################");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -356,7 +356,7 @@ namespace src
|
||||||
{
|
{
|
||||||
using HttpClient client = new();
|
using HttpClient client = new();
|
||||||
client.DefaultRequestHeaders.UserAgent.Add(new System.Net.Http.Headers.ProductInfoHeaderValue("jRandomSkills", "1.0"));
|
client.DefaultRequestHeaders.UserAgent.Add(new System.Net.Http.Headers.ProductInfoHeaderValue("jRandomSkills", "1.0"));
|
||||||
const string URL = "https://api.github.com/repos/Juzlus/jRandomSkills/releases/latest";
|
const string URL = "https://git.zio.sh/api/v1/repos/cs2/jRandomSkills/releases/latest";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,7 +1,13 @@
|
||||||
{
|
{
|
||||||
"name": "jRandomSkills",
|
"name": "jRandomSkills",
|
||||||
"current_version": "v1.2.3.b3",
|
"current_version": "v1.2.4.b2-panorama1",
|
||||||
"releases": [
|
"releases": [
|
||||||
|
{
|
||||||
|
"version": "v1.2.4.b2-panorama1",
|
||||||
|
"release_date": "2026-09-24",
|
||||||
|
"download": "https://git.zio.sh/cs2/jRandomSkills/releases/download/v1.2.4.b2-panorama1/jRandomSkills.v1.2.4.b2-panorama1.zip",
|
||||||
|
"output_folder": "addons/counterstrikesharp/"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "v1.2.3.b3",
|
"version": "v1.2.3.b3",
|
||||||
"release_date": "2026-08-01",
|
"release_date": "2026-08-01",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue