Пример #1
0
        //!
        //! Sets up all buttons for the main menu.
        //!
        private void setupMainMenu()
        {
            // views
            IMenuButton buttonPers = Elements.MenuButtonToggle();

            buttonPers.AddAction(GeneralMenu_Perspective_sel, GeneralMenu_Perspective_nrm, () => togglePerspectives());
            UI.OnUIChanged.AddListener(() => { buttonPers.Toggled = (secondaryMenu.currentLayout == layouts.PERSPECTIVES); });  // register for ui changes
            mainMenu.addButton(buttonPers);
            // info button
            //
            // modes
            IMenuButton buttonModes = Elements.MenuButtonList();

            buttonModes.AddAction(ModeMenu_EditMode_sel, ModeMenu_EditMode_nrm, () => changeMode(layouts.EDIT));
            buttonModes.AddAction(ModeMenu_AnimationMode_sel, ModeMenu_AnimationMode_nrm, () => changeMode(layouts.ANIMATION)); // anim
            buttonModes.AddAction(ModeMenu_ScoutMode_sel, ModeMenu_ScoutMode_nrm, () => changeMode(layouts.SCOUT));             //scout
            mainMenu.addButton(buttonModes);

            // gyro toggle
            IMenuButton buttonGyro = Elements.MenuButtonToggle();

            buttonGyro.AddAction(GeneralMenu_Gyro_sel, GeneralMenu_Gyro_nrm, () => mainController.toggleCameraRotation()); // for toggle
            buttonGyro.AddHoldAction(() => mainController.resetCameraOffset());
            mainMenu.addButton(buttonGyro);

            // config
            IMenuButton buttonConfig = Elements.MenuButtonToggle();

            buttonConfig.AddAction(GeneralMenu_Settings_sel, GeneralMenu_Settings_nrm, () => drawConfigWidget());
            buttonConfig.AddAction(GeneralMenu_Settings_sel, GeneralMenu_Settings_nrm, () => hideConfigWidget());       // untoggle action
            UI.OnUIChanged.AddListener(() => { buttonConfig.Toggled = (configWidget.gameObject.activeSelf == true); }); // register for ui changes
            mainMenu.addButton(buttonConfig);
            mainMenu.addButtonToLayout(buttonConfig, layouts.SPLASH);

            //help
            IMenuButton buttonHelp = Elements.MenuButton();

            buttonHelp.AddAction(GeneralMenu_Help_sel, GeneralMenu_Help_nrm, call: () => openHelp()); // switch off
            mainMenu.addButton(buttonHelp);
            mainMenu.addButtonToLayout(buttonHelp, layouts.SPLASH);
            // quit
            IMenuButton buttonQuit = Elements.MenuButton();

            buttonQuit.AddAction(GeneralMenu_OnOff_sel, GeneralMenu_OnOff_nrm, call: () => quitApplication());              // switch off
            mainMenu.addButton(buttonQuit);
            mainMenu.addButtonToLayout(buttonQuit, layouts.SPLASH);

            // set splash layout
            mainMenu.switchLayout(layouts.SPLASH);
        }
Пример #2
0
        //!
        //! Sets up all buttons for the main menu.
        //!
        private void setupMainMenu()
        {
            // views
            IMenuButton buttonPers = Elements.MenuButtonToggle();

            buttonPers.AddAction(GeneralMenu_Perspective_sel, GeneralMenu_Perspective_nrm, () => secondaryMenuSwitchLayout(layouts.PERSPECTIVES));
            OnSecondaryMenuVisibility.AddListener(((MenuButtonToggle)buttonPers).setToggleState);               // register changes
            mainMenu.addButton(buttonPers);
            // info button
            //
            // modes
            IMenuButton buttonModes = Elements.MenuButtonList();

            buttonModes.AddAction(ModeMenu_EditMode_sel, ModeMenu_EditMode_nrm, () => changeMode(layouts.EDIT));
            buttonModes.AddAction(ModeMenu_AnimationMode_sel, ModeMenu_AnimationMode_nrm, () => changeMode(layouts.ANIMATION)); // anim
            buttonModes.AddAction(ModeMenu_ScoutMode_sel, ModeMenu_ScoutMode_nrm, () => changeMode(layouts.SCOUT));             //scout
            mainMenu.addButton(buttonModes);
            // gyro toggle
            IMenuButton buttonGyro = Elements.MenuButtonToggle();

            buttonGyro.AddAction(GeneralMenu_Gyro_sel, GeneralMenu_Gyro_nrm, () => mainController.toggleCameraRotation());              // for toggle
            buttonGyro.AddAction(GeneralMenu_Gyro_sel, GeneralMenu_Gyro_nrm, () => mainController.toggleCameraRotation());              // for untogle
            buttonGyro.AddHoldAction(() => mainController.resetCameraOffset());
            mainMenu.addButton(buttonGyro);
            // config
            IMenuButton buttonConfig = Elements.MenuButtonToggle();

            buttonConfig.AddAction(GeneralMenu_Settings_sel, GeneralMenu_Settings_nrm, () => drawConfigWidget());
            buttonConfig.AddAction(GeneralMenu_Settings_sel, GeneralMenu_Settings_nrm, () => hideConfigWidget());        // untoggle action
            configWidget.OnVisibilityChanged.AddListener(((MenuButtonToggle)buttonConfig).setToggleState);               // register changes (connect to config widget visibility)
            mainMenu.addButton(buttonConfig);
            mainMenu.addButtonToLayout(buttonConfig, layouts.SPLASH);
            // quit
            IMenuButton buttonQuit = Elements.MenuButton();

            buttonQuit.AddAction(GeneralMenu_OnOff_sel, GeneralMenu_OnOff_nrm, call: () => quitApplication());              // switch off
            mainMenu.addButton(buttonQuit);
            mainMenu.addButtonToLayout(buttonQuit, layouts.SPLASH);

            // set splash layout
            mainMenu.switchLayout(layouts.SPLASH);
        }
Пример #3
0
        private void setupCenterMenu()
        {
            // translate
            IMenuButton buttonTrans = Elements.MenuButtonToggle();

            buttonTrans.AddAction(EditMode_Translate_sel, EditMode_Translate_nrm, () => editTranslation(buttonTrans));
            centerMenu.addButton(buttonTrans, layouts.OBJECT);
            centerMenu.addButtonToLayout(buttonTrans, layouts.LIGHT);
            centerMenu.addButtonToLayout(buttonTrans, layouts.MOCAP);
            // rotate
            IMenuButton buttonRot = Elements.MenuButtonToggle();

            buttonRot.AddAction(EditMode_Rotate_sel, EditMode_Rotate_nrm, () => editRotation(buttonRot));
            UI.OnUIChanged.AddListener(() => { buttonRot.Toggled = mainController.ActiveMode == MainController.Mode.rotationMode; });
            centerMenu.addButton(buttonRot, layouts.OBJECT);
            centerMenu.addButtonToLayout(buttonRot, layouts.MOCAP);
            centerMenu.addButtonToLayout(buttonRot, layouts.LIGHT);
            // scale
            IMenuButton buttonScl = Elements.MenuButtonToggle();

            buttonScl.AddAction(EditMode_Scale_sel, EditMode_Scale_nrm, () => editScale(buttonScl));
            centerMenu.addButton(buttonScl, layouts.OBJECT);
            centerMenu.addButton(buttonScl, layouts.MOCAP);
            // reset
            IMenuButton buttonReset = Elements.MenuButton();

            buttonReset.AddAction(EditMode_Reset_sel, EditMode_Reset_nrm, call: () => objectReset());
            centerMenu.addButton(buttonReset, layouts.OBJECT);
            centerMenu.addButton(buttonReset, layouts.MOCAP);
            centerMenu.addButtonToLayout(buttonReset, layouts.LIGHT);
            // graviy/kinematic on off
            IMenuButton buttonKin = Elements.MenuButtonToggle();

            buttonKin.AddAction(EditMode_GravityOn_sel, EditMode_GravityOn_nrm, () => mainController.toggleLockSelectionKinematic());
            UI.OnUIChanged.AddListener(() => { buttonKin.Toggled = mainController.HasGravityOn(); });        // register for ui changes
            centerMenu.OnMenuOpen.AddListener(() => { buttonKin.Toggled = mainController.HasGravityOn(); }); // register for ui changes
            centerMenu.addButton(buttonKin, layouts.OBJECT);
            centerMenu.addButton(buttonKin, layouts.MOCAP);
            // Mocap trigger
            IMenuButton buttonMocap = Elements.MenuButtonToggle();

            buttonMocap.AddAction(AnimationMode_Pause_sel, AnimationMode_Play_nrm, call: () => triggerMocap(buttonMocap));
            buttonMocap.AddHoldAction(() => mainController.buttonAnimatorCmdClicked(0)); // reset/re-trigger mocap animation
            centerMenu.addButton(buttonMocap, layouts.MOCAP);
            // light color
            IMenuButton buttonLightCol = Elements.MenuButtonToggle();

            buttonLightCol.AddAction(EditMode_LightColour_sel, EditMode_LightColour_nrm, () => editLightColor(buttonLightCol)); //
            centerMenu.addButton(buttonLightCol, layouts.LIGHT);
            // light settings
            IMenuButton buttonLightSet = Elements.MenuButtonToggle();

            buttonLightSet.AddAction(EditMode_LightSettings_sel, EditMode_LightSettings_nrm, () => editLightSettings(buttonLightSet));
            centerMenu.addButton(buttonLightSet, layouts.LIGHT);

            /*
             * // angle
             * IMenuButton buttonLightAng = Elements.MenuButtonToggle();
             *          buttonLightAng.AddAction(EditMode_LightConeAngle_sel, EditMode_LightConeAngle_nrm, () => editLightAngle(buttonLightAng));
             *          centerMenu.addButton( buttonLightAng, layouts.LIGHTSPOT );
             *          // intensity
             *          IMenuButton buttonLightInt = Elements.MenuButtonToggle();
             *          buttonLightInt.AddAction(EditMode_LightIntensity_sel, EditMode_LightIntensity_nrm, () => editLightIntensity(buttonLightInt));
             *          centerMenu.addButton( buttonLightInt, layouts.LIGHTDIR );
             *          centerMenu.addButtonToLayout( buttonLightInt, layouts.LIGHTSPOT );
             *          centerMenu.addButtonToLayout( buttonLightInt, layouts.LIGHTPOINT );
             */
            // cue add
            IMenuButton buttonAniCueAdd = Elements.MenuButton();

            ((Button)buttonAniCueAdd).name = "AddCueMenu";
            buttonAniCueAdd.AddAction(AnimationMode_CueAdd_sel, AnimationMode_CueAdd_nrm, () => animationAddCueMenu(buttonAniCueAdd));
            centerMenu.addButton(buttonAniCueAdd, layouts.ANIMATION);
            // cue remove
            //IMenuButton buttonAniCueRem = Elements.MenuButton();
            //buttonAniCueRem.AddAction(AnimationMode_CueDelete_sel, AnimationMode_CueDelete_nrm); // 10
            //centerMenu.addButton( buttonAniCueRem, layouts.ANIMATION );
            // translate
            buttonTrans.AddAction(EditMode_Translate_sel, EditMode_Translate_nrm, () => editTranslation(buttonTrans));
            centerMenu.addButtonToLayout(buttonTrans, layouts.ANIMATION);
            // rotate
            buttonRot.AddAction(EditMode_Rotate_sel, EditMode_Rotate_nrm, () => editRotation(buttonRot));
            centerMenu.addButtonToLayout(buttonRot, layouts.ANIMATION);
            // scale
            centerMenu.addButtonToLayout(buttonScl, layouts.ANIMATION);
            // edit animation
            //IMenuButton buttonAniEdi = Elements.MenuButtonToggle();
            //buttonAniEdi.AddAction(AnimationMode_KeyframeTranslate_sel, AnimationMode_KeyframeTranslate_nrm, () => editAnimation(buttonAniEdi));
            //centerMenu.addButton(buttonAniEdi, layouts.ANIMATION);
            // delete animation
            IMenuButton buttonAniRem = Elements.MenuButton();

            buttonAniRem.AddAction(AnimationMode_DeleteKeyframe_sel, AnimationMode_DeleteKeyframe_nrm, call: () => animationDelete());
            centerMenu.addButton(buttonAniRem, layouts.ANIMATION);
        }