예제 #1
0
    public void SetPanelActive(ClientFrontend.MenuShowing menuShowing)
    {
        var active = menuShowing != ClientFrontend.MenuShowing.None;

        gameObject.SetActive(active);
        if (active)
        {
            foreach (var a in GetComponentsInChildren <MenuButton>(true))
            {
                var enabled = (a.ingameOption && menuShowing == ClientFrontend.MenuShowing.Ingame) || (a.mainmenuOption && menuShowing == ClientFrontend.MenuShowing.Main);
                a.gameObject.SetActive(enabled);
            }
            // Close any open menu
            ShowSubMenu(null);
        }
    }
예제 #2
0
    private void CmdMenu(string[] args)
    {
        float fadeTime = 0.0f;

        ClientFrontend.MenuShowing show = ClientFrontend.MenuShowing.Main;
        if (args.Length > 0)
        {
            if (args[0] == "0")
            {
                show = ClientFrontend.MenuShowing.None;
            }
            else if (args[0] == "2")
            {
                show = ClientFrontend.MenuShowing.Ingame;
            }
        }
        if (args.Length > 1)
        {
            float.TryParse(args[1], NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out fadeTime);
        }
        clientFrontend.ShowMenu(show, fadeTime);
        Console.SetOpen(false);
    }