Пример #1
0
        bool FrameRenderingQueued(FrameEvent evt)
        {
            selectedModName = modChooserMenu.getSelectedItem();
            float carouselOffset = modChooserMenu.getSelectionIndex() - carouselPlace;

            if ((carouselOffset <= 0.001) && (carouselOffset >= -0.001))
            {
                carouselPlace = modChooserMenu.getSelectionIndex();
            }
            else
            {
                carouselPlace += carouselOffset * OpenMB.Utilities.Helper.Clamp <float>(evt.timeSinceLastFrame * 15.0f, -1.0f, 1.0f);
            }

            for (int i = 0; i < modThumbs.Count; i++)
            {
                float thumbOffset = carouselPlace - i;
                float phase       = (thumbOffset / 2.0f) - 2.8f;

                if (thumbOffset < -5 || thumbOffset > 4)    // prevent thumbnails from wrapping around in a circle
                {
                    modThumbs[i].Hide();
                    continue;
                }
                else
                {
                    modThumbs[i].Show();
                }

                float left  = Mogre.Math.Cos(phase) * 200.0f;
                float top   = Mogre.Math.Sin(phase) * 200.0f;
                float scale = 1.0f / Convert.ToSingle(System.Math.Pow((Mogre.Math.Abs(thumbOffset) + 1.0f), 0.75f));

                OverlayContainer.ChildContainerIterator xx = modThumbs[i].GetChildContainerIterator();
                BorderPanelOverlayElement frame            = (BorderPanelOverlayElement)xx.ElementAt(0);

                modThumbs[i].SetDimensions(128.0f * scale, 96.0f * scale);
                frame.SetDimensions(modThumbs[i].Width + 16.0f, modThumbs[i].Height + 16.0f);
                modThumbs[i].SetPosition((left - 80.0f - (modThumbs[i].Width / 2.0f)),
                                         (top - 5.0f - (modThumbs[i].Height / 2.0f)));

                if (i == modChooserMenu.getSelectionIndex())
                {
                    frame.BorderMaterialName = "SdkTrays/Frame/Over";
                }
                else
                {
                    frame.BorderMaterialName = "SdkTrays/Frame";
                }
            }

            GameManager.Instance.trayMgr.frameRenderingQueued(evt);

            return(true);
        }
Пример #2
0
        public override void itemSelected(SelectMenu menu)
        {
            switch (menu.getSelectionIndex())
            {
            case 0:
                m_pCamera.PolygonMode = (PolygonMode.PM_SOLID); break;

            case 1:
                m_pCamera.PolygonMode = (PolygonMode.PM_WIREFRAME); break;

            case 2:
                m_pCamera.PolygonMode = (PolygonMode.PM_POINTS); break;
            }
        }
Пример #3
0
        public virtual bool keyPressed(KeyEvent keyEventRef)
        {
            if (m_bSettingsMode == true)
            {
                if (AdvancedMogreFramework.Singleton.m_pKeyboard.IsKeyDown(KeyCode.KC_S))
                {
                    SelectMenu pMenu = (SelectMenu)AdvancedMogreFramework.Singleton.m_pTrayMgr.getWidget("ChatModeSelMenu");
                    if (pMenu.getSelectionIndex() + 1 < (int)pMenu.getNumItems())
                    {
                        pMenu.selectItem((uint)pMenu.getSelectionIndex() + 1);
                    }
                }

                if (AdvancedMogreFramework.Singleton.m_pKeyboard.IsKeyDown(KeyCode.KC_W))
                {
                    SelectMenu pMenu = (SelectMenu)AdvancedMogreFramework.Singleton.m_pTrayMgr.getWidget("ChatModeSelMenu");
                    if (pMenu.getSelectionIndex() - 1 >= 0)
                    {
                        pMenu.selectItem((uint)pMenu.getSelectionIndex() - 1);
                    }
                }
            }

            if (AdvancedMogreFramework.Singleton.m_pKeyboard.IsKeyDown(KeyCode.KC_ESCAPE))
            {
                pushAppState(findByName("PauseState"));
                return(true);
            }

            if (AdvancedMogreFramework.Singleton.m_pKeyboard.IsKeyDown(KeyCode.KC_I))
            {
                if (m_pDetailsPanel.getTrayLocation() == TrayLocation.TL_NONE)
                {
                    AdvancedMogreFramework.Singleton.m_pTrayMgr.moveWidgetToTray(m_pDetailsPanel, TrayLocation.TL_TOPLEFT, 0);
                    m_pDetailsPanel.show();
                }
                else
                {
                    AdvancedMogreFramework.Singleton.m_pTrayMgr.removeWidgetFromTray(m_pDetailsPanel);
                    m_pDetailsPanel.hide();
                }
            }

            if (AdvancedMogreFramework.Singleton.m_pKeyboard.IsKeyDown(KeyCode.KC_TAB))
            {
                m_bSettingsMode = !m_bSettingsMode;
                return(true);
            }

            if (m_bSettingsMode && AdvancedMogreFramework.Singleton.m_pKeyboard.IsKeyDown(KeyCode.KC_RETURN) ||
                AdvancedMogreFramework.Singleton.m_pKeyboard.IsKeyDown(KeyCode.KC_NUMPADENTER))
            {
            }

            if (!m_bSettingsMode || (m_bSettingsMode && !AdvancedMogreFramework.Singleton.m_pKeyboard.IsKeyDown(KeyCode.KC_O)))
            {
                AdvancedMogreFramework.Singleton.keyPressed(keyEventRef);
            }

            return(true);
        }