Skip to content

Commit 88de8da

Browse files
authored
v 1.1.1
1 parent 96199ad commit 88de8da

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

MenuManagerApi/IMenuApi.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,17 @@ namespace MenuManager
1111
public interface IMenuApi
1212
{
1313
public IMenu NewMenu(string title, Action<CCSPlayerController> back_action = null, Action<CCSPlayerController> reset_action = null);
14+
15+
// Deprecated, only for backward compatibility
16+
public IMenu NewMenu(string title, Action<CCSPlayerController> back_action = null);
17+
//
18+
1419
public IMenu NewMenuForcetype(string title, MenuType type, Action<CCSPlayerController> back_action = null, Action<CCSPlayerController> reset_action = null);
20+
21+
// Deprecated, only for backward compatibility
22+
public IMenu NewMenuForcetype(string title, MenuType type, Action<CCSPlayerController> back_action = null);
23+
//
24+
1525
public void CloseMenu(CCSPlayerController player);
1626
public MenuType GetMenuType(CCSPlayerController player);
1727
}

MenuManagerCore/CMenuApi.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,21 @@ public IMenu NewMenu(string title, Action<CCSPlayerController> back_action = nul
2323
return new MenuInstance(title, back_action, reset_action);
2424
}
2525

26+
public IMenu NewMenu(string title, Action<CCSPlayerController> back_action = null)
27+
{
28+
return new MenuInstance(title, back_action, null);
29+
}
30+
2631
public IMenu NewMenuForcetype(string title, MenuType type, Action<CCSPlayerController> back_action = null, Action<CCSPlayerController> reset_action = null)
2732
{
2833
return new MenuInstance(title, back_action, reset_action, type);
2934
}
3035

36+
public IMenu NewMenuForcetype(string title, MenuType type, Action<CCSPlayerController> back_action = null)
37+
{
38+
return new MenuInstance(title, back_action, null, type);
39+
}
40+
3141
public void CloseMenu(CCSPlayerController player)
3242
{
3343
Control.CloseMenu(player);

MenuManagerCore/Main.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class PluginConfig : BasePluginConfig
2727
public class MenuManagerCore : BasePlugin, IPluginConfig<PluginConfig>
2828
{
2929
public override string ModuleName => "MenuManager [Core]";
30-
public override string ModuleVersion => "1.1";
30+
public override string ModuleVersion => "1.1.1";
3131
public override string ModuleAuthor => "Nick Fox";
3232
public override string ModuleDescription => "All menus interacts in one core";
3333

@@ -69,7 +69,7 @@ public void OnCommand(CCSPlayerController? player, CommandInfo command)
6969
{
7070
if (player != null)
7171
{
72-
var menu = _api.NewMenu(Misc.ColorText(Localizer["menumanager.select_type"]));
72+
var menu = _api.NewMenu(Misc.ColorText(Localizer["menumanager.select_type"]), null);
7373
menu.PostSelectAction = PostSelectAction.Close;
7474
menu.AddMenuOption(Misc.ColorText(Localizer["menumanager.console"]), (player, option) => { Misc.SelectPlayerMenu(player, MenuType.ConsoleMenu); });
7575
menu.AddMenuOption(Misc.ColorText(Localizer["menumanager.chat"]), (player, option) => { Misc.SelectPlayerMenu(player, MenuType.ChatMenu); });

MenuManagerTest/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void OnCommand(CCSPlayerController? player, CommandInfo command)
2727
{
2828
if (player != null)
2929
{
30-
var menu = _api.NewMenu("Ticklingig");
30+
var menu = _api.NewMenu("Ticklingig", null);
3131
for (int i = 0; i < 10; i++)
3232
menu.AddMenuOption($"itemline{i}", (player, option) => { player.PrintToChat($"Selected: {option.Text}"); });
3333
menu.Open(player);

0 commit comments

Comments
 (0)