Exemplo n.º 1
0
    /// <summary>
    /// Sets the current CCState and renders all displayed menus for this state
    /// </summary>
    void SetCCState(CCState newState, bool updateMenus)
    {
        //Begin state enable stuff

        //Begin state disable stuff
        if (newState != CCState.Selecting)
        {
            CC_Selectable.CancelSelect();
        }

        CC_Menu CreationMenu = GetMenuByName("CreationMenu");

        if (CreationMenu != null)
        {
            CreationMenu.SetEnabled(false);
        }

        CC_Menu windowManagerMenu = GetMenuByName("WindowManagerMenu");

        if (windowManagerMenu != null)
        {
            windowManagerMenu.SetEnabled(false);
        }

        CC_UISelectionManager._instance.ChangeCCState(newState);

        backgroundHandler.Disable();

        //Menu rendering
        if (updateMenus)
        {
            UpdateMenus(newState);
        }
        currState = newState;
    }
Exemplo n.º 2
0
    /// <summary>
    /// Creates the CC default menu
    /// </summary>
    void CreateCCMenu()
    {
        CCState[] renderStates = { CCState.Default, CCState.Selecting };
        CC_Menu   menu         = CreateNewCC_Menu(menuPanelPrefab, renderStates, "CCMenu");

        menu.AddButton(menuButtonPrefab, () => StopEditMode(), "Stop Editting");
        menu.AddButton(menuButtonPrefab, () => OpenUIElementCreationMenu(), "Creation Menu");
        menu.AddButton(menuButtonPrefab, () => CallBackground(), "Background Color Menu");
        menu.AddButton(menuButtonPrefab, () => ToggleWindowManager(), "Save/Load");
        menu.SetEnabled(true);
    }