This is a menu plugin. Here is a portion of the simplified code for easy reading. I want to dsiplay "ShowUI" and "Sub1" at the same time (Sub1 means the first subdirectory which is default display). But I don't know how deal with "args" so that I can not call "ShowUI"... Not sure whether I made it clear. Thanks for anyhelp.
using System;
using System.Collections.Generic;
using Oxide.Core;
using Newtonsoft.Json;
using UnityEngine;
using Oxide.Game.Rust.Cui;
namespace Oxide.Plugins
{
[Info("MCmenu2", "d", "0.0.1")]
[Description("MCmenu2")]
internal class MCmenu2 : RustPlugin
{
public List<BasePlayer> MenuOpenedPlayers = new List<BasePlayer>();
[ChatCommand("mc2")]
void ShowUI(BasePlayer player)
{
var elements = new CuiElementContainer();
var HUD0 = elements.Add(new CuiPanel
{
Image = { Color = "0 0 0 0.9"},
RectTransform = { AnchorMin = "0.01 0.9", AnchorMax = "0.99 0.99" },
CursorEnabled = true,
FadeOut = 0f
}, "Overlay", "HUD0");
elements.Add(new CuiLabel
{
Text = { Color = "1 0.65 0 1", Text = "title", FontSize = 30, Align = TextAnchor.MiddleLeft },
RectTransform = { AnchorMin = "0.01 0.01", AnchorMax = "1 0.99" },
}, "HUD0");
Sub1(args);
CuiHelper.AddUi(player, elements);
}
[ConsoleCommand("Sub1")]
void Sub1(ConsoleSystem.Arg args)
{
var player = args.Connection.player as BasePlayer;
if (player == null)
return;
var ElementsSub1 = new CuiElementContainer();
var HUDSub1 = ElementsSub1.Add(new CuiPanel
{
Image = { Color = "0 0 0 0.9"},
RectTransform = { AnchorMin = "0.01 0.01", AnchorMax = "0.33 0.89" },
}, "Overlay", "HUDSub1");
}
}