/// <summary> /// Обработка состояния элементов интерфейса /// </summary> private void ProcessUiElementsList() { //добавить фон _currentMenuElements = new List <RenderingData.RenderingData?>(); _currentMenuElements.Add(new RenderingData.RenderingData( new RenderingSprite(ActualSubassetsDataLibrary.GetSprite(JUKEBOX_MENU_BG), 0, 0, 0, Color.White, 0))); //добавить передний план _currentMenuElements.Add(new RenderingData.RenderingData( new RenderingSprite(ActualSubassetsDataLibrary.GetSprite(JUKEBOX_MENU_FG), 0, 0, 0, Color.White, 0))); //добавить кнопки void ProcessButton(UiElementButton parButton, int parX, int parY, string parCaption) { string chosenFontKey = parButton.IsHovered ? ViewBehaviourConsts.DEFAULT_APP_FONT : ViewBehaviourConsts .MENU_DARK_INACTIVE_APP_FONT; _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, parX, parY, parCaption, ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Middle, EVerticalAlign.Middle))); } ProcessButton(_modelProviderComponent.MusicPlayerControlButton, BUTTONS_MIDDLE_X, BUTTON_MUSIC_MIDDLE_Y, AppAudioLibraryConsts.JukeboxMusicSmdLibrary[_modelProviderComponent.CurrentSelectedTrack]); ProcessButton(_modelProviderComponent.ReturnBackButton, BUTTONS_MIDDLE_X, BUTTON_BACK_MIDDLE_Y, "Back"); }
/// <summary> /// Обработка состояния элементов интерфейса /// </summary> private void ProcessUiElementsList() { //добавить фон _currentMenuElements = new List <RenderingData.RenderingData?>(); _currentMenuElements.Add(new RenderingData.RenderingData( new RenderingSprite(ActualSubassetsDataLibrary.GetSprite(LOBBY_MENU_BG), 0, 0, 0, Color.White, 0))); //добавить кнопки void ProcessButton(UiElementButton parButton, int parX, int parY, string parCaption) { string chosenFontKey = parButton.IsHovered ? ViewBehaviourConsts.DEFAULT_APP_FONT : ViewBehaviourConsts .MENU_DARK_INACTIVE_APP_FONT; _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, parX, parY, parCaption, ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Middle, EVerticalAlign.Middle))); } ProcessButton(_modelProviderComponent.SelectStartLevelButton, BUTTONS_MIDDLE_X, BUTTON_LEVEL_SELECT_MIDDLE_Y, _modelProviderComponent.CurrentSelectedLevel.LevelName); ProcessButton(_modelProviderComponent.ReturnBackButton, BUTTONS_MIDDLE_X, BUTTON_RETURN_BACK_MIDDLE_Y, "Back"); }
/// <summary> /// Обработка состояния элементов интерфейса /// </summary> private void ProcessUiElementsList() { //добавить фон _currentMenuElements = new List <RenderingData.RenderingData?>(); _currentMenuElements.Add(new RenderingData.RenderingData( new RenderingSprite(ActualSubassetsDataLibrary.GetSprite(MAIN_MENU_BG), 0, 0, 0, Color.White, 1))); //добавить кнопки int currentMenuY = Y_OFFSET_MENU_START; if (_modelProviderComponent.MenuUiElements != null) { if (_modelProviderComponent.MenuUiElements.Count > 0) { void ProcessButton(UiElementButton parButton, int parY, string parCaption) { string chosenFontKey = parButton.IsHovered ? ViewBehaviourConsts.DEFAULT_APP_FONT : ViewBehaviourConsts .MENU_DARK_INACTIVE_APP_FONT; _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, X_CENTERED_OFFSET_MENU, parY, parCaption, ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Middle, EVerticalAlign.Top))); } ProcessButton(_modelProviderComponent.NewGame1PPocketButton, currentMenuY, "1P Pocket Game"); currentMenuY += Y_OFFSET_MENU_ELEMENTS; ProcessButton(_modelProviderComponent.OptionsButton, currentMenuY, "Options"); currentMenuY += Y_OFFSET_MENU_ELEMENTS; ProcessButton(_modelProviderComponent.RecordsButton, currentMenuY, "Records"); currentMenuY += Y_OFFSET_MENU_ELEMENTS; ProcessButton(_modelProviderComponent.JukeboxButton, currentMenuY, "Jukebox"); currentMenuY += Y_OFFSET_MENU_ELEMENTS; ProcessButton(_modelProviderComponent.ExitButton, currentMenuY, "Exit"); currentMenuY += Y_OFFSET_MENU_ELEMENTS; } } }
/// <summary> /// Обновить данные для рендеринга /// </summary> public override void UpdateRenderingData() { if (_modelProviderComponent != null) { if (_modelProviderComponent.GameReady) { //всегда есть задний фон, шары, очки и счетчик жизней if (_currentRenderingBg == null) { _currentRenderingBg = new RenderingData.RenderingData( new RenderingSprite(ActualSubassetsDataLibrary.GetSprite(NORMAL_GAMEFIELD_BG_SPRITE), 0, 0, 0, Color.White, 5)); } if (_ballsRenderingData == null) { _ballsRenderingData = new LinkedList <RenderingData.RenderingData?>(); } _ballsRenderingData.Clear(); foreach (var modelBall in _modelProviderComponent.BallsInGame) { BallGraphicsBind graphicsBind = GameFieldViewConsts.BallGraphicsBinds[modelBall.BallType]; _ballsRenderingData.AddLast(new RenderingData.RenderingData(new RenderingSprite( ActualSubassetsDataLibrary.GetSprite(graphicsBind.StillSpriteKey), GameFieldViewConsts.FIELD_MODEL_RENDER_LEFT_TOP_OFFSET_X + modelBall.Center.X, GameFieldViewConsts.FIELD_MODEL_RENDER_LEFT_TOP_OFFSET_Y + (GameFieldViewConsts.FIELD_HEIGHT - modelBall.Center.Y), 0, graphicsBind.BlendColor, 1, 1, 1, EHorizontalAlign.Middle, EVerticalAlign.Middle))); } if (_playerScoreAndLifeCounter == null) { _playerScoreAndLifeCounter = new LinkedList <RenderingData.RenderingData?>(); } _playerScoreAndLifeCounter.Clear(); //очки _playerScoreAndLifeCounter.AddLast(new RenderingData.RenderingData(new RenderingString(1, SCORE_RIGHT_X_OFFSET, SCORE_TOP_Y_OFFSET, _modelProviderComponent.ActualPlayer.Score.ToString(), ActualSubassetsDataLibrary.GetFont(ViewBehaviourConsts.RED_SHADOW_APP_FONT), Color.White, 1, 1, EHorizontalAlign.Right, EVerticalAlign.Top))); //счетчик жизней int line1Lifes = 0; int line2Lifes = 0; int actualPlayerLifesNumber = _modelProviderComponent.ActualPlayer.LifeCount / 2 + _modelProviderComponent.ActualPlayer.LifeCount % 2; bool isLastLifeHalfed = _modelProviderComponent.ActualPlayer.LifeCount % 2 == 1; if (actualPlayerLifesNumber > 2 * LIFES_ON_ONE_LINE) { line1Lifes = LIFES_ON_ONE_LINE; line2Lifes = LIFES_ON_ONE_LINE; } else { if (actualPlayerLifesNumber >= LIFES_ON_ONE_LINE) { line1Lifes = LIFES_ON_ONE_LINE; line2Lifes = actualPlayerLifesNumber - LIFES_ON_ONE_LINE; } else { line1Lifes = actualPlayerLifesNumber; line2Lifes = 0; } } int currentY = LIFECOUNTER_LINE1_START_MIDDLE_Y; int currentX = LIFECOUNTER_LINE1_START_MIDDLE_X; for (int i = 0; i < line1Lifes; i++) { string chosenSpriteKey = LIFE_INDICATOR; if (i == line1Lifes - 1) { if (line2Lifes == 0) { if (isLastLifeHalfed) { chosenSpriteKey = LIFE_INDICATOR_HALF; } } } _playerScoreAndLifeCounter.AddLast(new RenderingData.RenderingData(new RenderingSprite( ActualSubassetsDataLibrary.GetSprite(chosenSpriteKey), currentX, currentY, 0, Color.White, 0, 1, 1, EHorizontalAlign.Middle, EVerticalAlign.Middle))); currentX += LIFECOUNTER_X_ELEM_OFFSET; } currentY += LIFECOUNTER_Y_ELEM_OFFSET; currentX = LIFECOUNTER_LINE1_START_MIDDLE_X; for (int i = 0; i < line2Lifes; i++) { string chosenSpriteKey = LIFE_INDICATOR; if (i == line2Lifes - 1) { if (isLastLifeHalfed) { chosenSpriteKey = LIFE_INDICATOR_HALF; } } _playerScoreAndLifeCounter.AddLast(new RenderingData.RenderingData(new RenderingSprite( ActualSubassetsDataLibrary.GetSprite(chosenSpriteKey), currentX, currentY, 0, Color.White, 0, 1, 1, EHorizontalAlign.Middle, EVerticalAlign.Middle))); currentX += LIFECOUNTER_X_ELEM_OFFSET; } //дальнейший рендеринг зависит от текущего состояния игры if (_playerCueRenderingData == null) { _playerCueRenderingData = new LinkedList <RenderingData.RenderingData?>(); } _playerCueRenderingData.Clear(); if (_modelProviderComponent.CurrentGameState == EPocketGameState.Aiming) { _upperShotChoosePanelOverlay = null; //прицел SpVector3 whiteBallPosOrigin = _modelProviderComponent.PlayerWhiteBall.Center; whiteBallPosOrigin.X += GameFieldViewConsts.FIELD_MODEL_RENDER_LEFT_TOP_OFFSET_X; whiteBallPosOrigin.Y = GameFieldViewConsts.FIELD_MODEL_RENDER_LEFT_TOP_OFFSET_Y + (GameFieldViewConsts.FIELD_HEIGHT - whiteBallPosOrigin.Y); double additionalRotOffset = 0; if (_modelProviderComponent.PlayerCurrentAimingAngle > 10 && _modelProviderComponent.PlayerCurrentAimingAngle < 80) { additionalRotOffset = ANGLE_ADJUST_TOLERANCE; } else if (_modelProviderComponent.PlayerCurrentAimingAngle <= 10 && _modelProviderComponent.PlayerCurrentAimingAngle > 0) { additionalRotOffset = CustomLerp.GetInterpolatedValue(_modelProviderComponent.PlayerCurrentAimingAngle, 0, 10, 0, ANGLE_ADJUST_TOLERANCE); } else if (_modelProviderComponent.PlayerCurrentAimingAngle >= 80 && _modelProviderComponent.PlayerCurrentAimingAngle < 90) { additionalRotOffset = CustomLerp.GetInterpolatedValue(_modelProviderComponent.PlayerCurrentAimingAngle, 80, 90, ANGLE_ADJUST_TOLERANCE, 0); } else if (_modelProviderComponent.PlayerCurrentAimingAngle > 100 && _modelProviderComponent.PlayerCurrentAimingAngle < 170) { additionalRotOffset = -ANGLE_ADJUST_TOLERANCE; } else if (_modelProviderComponent.PlayerCurrentAimingAngle > 90 && _modelProviderComponent.PlayerCurrentAimingAngle <= 100) { additionalRotOffset = - CustomLerp.GetInterpolatedValue(_modelProviderComponent.PlayerCurrentAimingAngle, 90, 100, 0, ANGLE_ADJUST_TOLERANCE); } else if (_modelProviderComponent.PlayerCurrentAimingAngle >= 170 && _modelProviderComponent.PlayerCurrentAimingAngle < 180) { additionalRotOffset = - CustomLerp.GetInterpolatedValue(_modelProviderComponent.PlayerCurrentAimingAngle, 170, 180, ANGLE_ADJUST_TOLERANCE, 0); } else if (_modelProviderComponent.PlayerCurrentAimingAngle > 190 && _modelProviderComponent.PlayerCurrentAimingAngle < 260) { additionalRotOffset = ANGLE_ADJUST_TOLERANCE; } else if (_modelProviderComponent.PlayerCurrentAimingAngle > 180 && _modelProviderComponent.PlayerCurrentAimingAngle <= 190) { additionalRotOffset = CustomLerp.GetInterpolatedValue(_modelProviderComponent.PlayerCurrentAimingAngle, 180, 190, 0, ANGLE_ADJUST_TOLERANCE); } else if (_modelProviderComponent.PlayerCurrentAimingAngle >= 260 && _modelProviderComponent.PlayerCurrentAimingAngle < 270) { additionalRotOffset = CustomLerp.GetInterpolatedValue(_modelProviderComponent.PlayerCurrentAimingAngle, 260, 270, ANGLE_ADJUST_TOLERANCE, 0); } else if (_modelProviderComponent.PlayerCurrentAimingAngle > 280 && _modelProviderComponent.PlayerCurrentAimingAngle < 350) { additionalRotOffset = -ANGLE_ADJUST_TOLERANCE; } else if (_modelProviderComponent.PlayerCurrentAimingAngle > 270 && _modelProviderComponent.PlayerCurrentAimingAngle <= 280) { additionalRotOffset = - CustomLerp.GetInterpolatedValue(_modelProviderComponent.PlayerCurrentAimingAngle, 270, 280, 0, ANGLE_ADJUST_TOLERANCE); } else if (_modelProviderComponent.PlayerCurrentAimingAngle >= 350 && _modelProviderComponent.PlayerCurrentAimingAngle < 360) { additionalRotOffset = - CustomLerp.GetInterpolatedValue(_modelProviderComponent.PlayerCurrentAimingAngle, 350, 360, ANGLE_ADJUST_TOLERANCE, 0); } _playerCueRenderingData.AddLast(new RenderingData.RenderingData(whiteBallPosOrigin.X + 8, whiteBallPosOrigin.Y, 100, 1, Color.Bisque, -1, _modelProviderComponent.GetAngleApproximated() + additionalRotOffset, whiteBallPosOrigin.X, whiteBallPosOrigin.Y)); } else if (_modelProviderComponent.CurrentGameState == EPocketGameState.ChooseShotPower) { _choosingShotAnimationInfobar.CurrentFrame = _modelProviderComponent.GetShotForcePercent() * ANIM_INFOBAR_MAX_FRAME; _choosingShotPlayerCueAnimation.CurrentFrame = _modelProviderComponent.GetShotForcePercent() * ANIM_HANDSHOT_CUE_MAX_FRAME; //панель с информацией о силе удара _upperShotChoosePanelOverlay = new RenderingData.RenderingData(new RenderingSprite( _choosingShotAnimationInfobar.GetCurrentAnimSpriteFrame(), 145, 1, 0, Color.White, -5, 1, 1)); //анимация кия SpVector3 whiteBallPosOrigin = _modelProviderComponent.PlayerWhiteBall.Center; whiteBallPosOrigin.X += GameFieldViewConsts.FIELD_MODEL_RENDER_LEFT_TOP_OFFSET_X; whiteBallPosOrigin.Y = GameFieldViewConsts.FIELD_MODEL_RENDER_LEFT_TOP_OFFSET_Y + (GameFieldViewConsts.FIELD_HEIGHT - whiteBallPosOrigin.Y); _playerCueRenderingData.AddLast(new RenderingData.RenderingData(new RenderingSprite( _choosingShotPlayerCueAnimation.GetCurrentAnimSpriteFrame(), whiteBallPosOrigin.X + 8, whiteBallPosOrigin.Y + 4, _modelProviderComponent.PlayerCurrentAimingAngle - 180, Color.White, -6, 1, 1, EHorizontalAlign.Left, EVerticalAlign.Middle, whiteBallPosOrigin.X, whiteBallPosOrigin.Y))); } } } }
/// <summary> /// Обновить данные для рендеринга /// </summary> public override void UpdateRenderingData() { if (_modelSideComponent.IsAlive) { if (_backgroundRenderingData == null) { _backgroundRenderingData = new RenderingData.RenderingData(new RenderingSprite(ActualSubassetsDataLibrary.GetSprite(RESULTS_BG_PATH), 0, 0, 0, Color.White, -30)); } if (_textsRenderingData == null) { _textsRenderingData = new List <RenderingData.RenderingData?>(); } _textsRenderingData.Clear(); _textsRenderingData.Add(new RenderingData.RenderingData(new RenderingString(-35, TEXT_MIDDLE_X, 120, $"YOUR CURRENT SCORE: {_modelSideComponent.PlayerActualData.Score}", ActualSubassetsDataLibrary.GetFont(ViewBehaviourConsts.DEFAULT_APP_FONT), Color.White, 1, 1, EHorizontalAlign.Middle, EVerticalAlign.Middle))); void ProcessButton(bool parIsActiveButton, int parX, int parY, string parCaption) { string chosenFontKey = parIsActiveButton ? ViewBehaviourConsts.DEFAULT_APP_FONT : ViewBehaviourConsts .MENU_DARK_INACTIVE_APP_FONT; _textsRenderingData.Add(new RenderingData.RenderingData(new RenderingString(-35, parX, parY, parCaption, ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Middle, EVerticalAlign.Middle))); } switch (_modelSideComponent.CurrentStage) { case EResultsScreenStage.ChooseNextAction: { ProcessButton(!_modelSideComponent.IsBankAndExitActionSelected, TEXT_MIDDLE_X, 160, "CONTINUE"); ProcessButton(_modelSideComponent.IsBankAndExitActionSelected, TEXT_MIDDLE_X, 180, "BANK AND EXIT"); break; } case EResultsScreenStage.ChooseNameForTheRecords: { ProcessButton(true, TEXT_MIDDLE_X, 140, $"{ViewBehaviourConsts.ESCAPE_CHARACTER_SEQUENCE_START}KING_1{ViewBehaviourConsts.ESCAPE_CHARACTER_SEQUENCE_END} ENTER NAME FOR RECORDS LIST {ViewBehaviourConsts.ESCAPE_CHARACTER_SEQUENCE_START}KING_1{ViewBehaviourConsts.ESCAPE_CHARACTER_SEQUENCE_END}"); ProcessButton(true, TEXT_MIDDLE_X, 160, "8 CHARACTERS MAX, THEN PRESS ENTER"); string playerName = _modelSideComponent.CurrentPlayerName; if (playerName.Length < RecordPlayerInfo.MAX_CHARS_IN_NAME) { playerName = playerName + "-"; } ProcessButton(true, TEXT_MIDDLE_X, 180, playerName); break; } default: throw new ArgumentOutOfRangeException(); } } }
/// <summary> /// Обработка состояния элементов интерфейса /// </summary> private void ProcessUiElementsList() { //добавить фон _currentMenuElements = new List <RenderingData.RenderingData?>(); _currentMenuElements.Add(new RenderingData.RenderingData( new RenderingSprite( ActualSubassetsDataLibrary.GetSprite(MainMenuControlComponentViewRenderableComponent.MAIN_MENU_BG), 0, 0, 0, Color.White, 1))); //добавить псевдо-кнопки рекордов с текущими значениями int currentMenuY = MainMenuControlComponentViewRenderableComponent.Y_OFFSET_MENU_START; if (_modelProviderComponent.MenuUiElements != null) { void ProcessButton(UiElementButton parButton, int parY, string parCaptionPrimary, string parCaptionSecondary) { string chosenFontKey = parButton.IsHovered ? ViewBehaviourConsts.DEFAULT_APP_FONT : ViewBehaviourConsts .MENU_DARK_INACTIVE_APP_FONT; bool isCentered = parCaptionSecondary == null; if (isCentered) { _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, MainMenuControlComponentViewRenderableComponent.X_CENTERED_OFFSET_MENU, parY, parCaptionPrimary, ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Middle, EVerticalAlign.Top))); } else { _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, OptionsMenuControlComponentViewRenderableComponent.MENU_LEFT_SIDE_X_OFFSET, parY, parCaptionPrimary, ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Left, EVerticalAlign.Top))); _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, OptionsMenuControlComponentViewRenderableComponent.MENU_RIGHT_SIDE_X_OFFSET, parY, parCaptionSecondary, ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Right, EVerticalAlign.Top))); } } RecordsData recordsData = _modelProviderComponent.ParentGameObject.LinkedAppModel.GetRecordsData(); int currentRecordId = 0; ProcessButton(_modelProviderComponent.RecordOne, currentMenuY, $"{recordsData.PlayerRecordsInfo[currentRecordId].PlayerName}", recordsData.PlayerRecordsInfo[currentRecordId].PointsEarned.ToString()); currentRecordId++; currentMenuY += MainMenuControlComponentViewRenderableComponent.Y_OFFSET_MENU_ELEMENTS; ProcessButton(_modelProviderComponent.RecordTwo, currentMenuY, $"{recordsData.PlayerRecordsInfo[currentRecordId].PlayerName}", recordsData.PlayerRecordsInfo[currentRecordId].PointsEarned.ToString()); currentRecordId++; currentMenuY += MainMenuControlComponentViewRenderableComponent.Y_OFFSET_MENU_ELEMENTS; ProcessButton(_modelProviderComponent.RecordThree, currentMenuY, $"{recordsData.PlayerRecordsInfo[currentRecordId].PlayerName}", recordsData.PlayerRecordsInfo[currentRecordId].PointsEarned.ToString()); currentRecordId++; currentMenuY += MainMenuControlComponentViewRenderableComponent.Y_OFFSET_MENU_ELEMENTS; ProcessButton(_modelProviderComponent.RecordsClearButton, currentMenuY, "Clear", null); currentMenuY += MainMenuControlComponentViewRenderableComponent.Y_OFFSET_MENU_ELEMENTS; ProcessButton(_modelProviderComponent.ReturnBackButton, currentMenuY, "Back", null); } }
/// <summary> /// Обработка состояния элементов интерфейса /// </summary> private void ProcessUiElementsList() { //добавить фон _currentMenuElements = new List <RenderingData.RenderingData?>(); _currentMenuElements.Add(new RenderingData.RenderingData( new RenderingSprite( ActualSubassetsDataLibrary.GetSprite(MainMenuControlComponentViewRenderableComponent.MAIN_MENU_BG), 0, 0, 0, Color.White, 1))); //добавить кнопки опций с текущими значениями int currentMenuY = MainMenuControlComponentViewRenderableComponent.Y_OFFSET_MENU_START; if (_modelProviderComponent.MenuUiElements != null) { string ChooseFontKey(UiElementButton parButton) { return(parButton.IsHovered ? ViewBehaviourConsts.DEFAULT_APP_FONT : ViewBehaviourConsts .MENU_DARK_INACTIVE_APP_FONT); } //опция режима отображения UiElementButton targetButton = _modelProviderComponent.ScreenModeButton; string chosenFontKey = ChooseFontKey(targetButton); _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, MENU_LEFT_SIDE_X_OFFSET, currentMenuY, "Windowed", ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Left, EVerticalAlign.Top))); var graphicsSettings = (GraphicsSettingsDataOpenTk)LinkedViewEventsHandler.LinkedView.CurrentGraphicsSettings; bool isFullscreenEnabled = graphicsSettings.IsFullscreen; string valueCaption = !isFullscreenEnabled ? "Yes" : "No"; _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, MENU_RIGHT_SIDE_X_OFFSET, currentMenuY, valueCaption, ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Right, EVerticalAlign.Top))); currentMenuY += MainMenuControlComponentViewRenderableComponent.Y_OFFSET_MENU_ELEMENTS; //опция режима музыки targetButton = _modelProviderComponent.MusicModeButton; chosenFontKey = ChooseFontKey(targetButton); _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, MENU_LEFT_SIDE_X_OFFSET, currentMenuY, "Music", ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Left, EVerticalAlign.Top))); var gameSettings = _modelProviderComponent.ParentGameObject.LinkedAppModel.GetGameplaySettingsData(); bool isMusicEnabled = gameSettings.IsMusicEnabled; valueCaption = isMusicEnabled ? "Yes" : "No"; _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, MENU_RIGHT_SIDE_X_OFFSET, currentMenuY, valueCaption, ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Right, EVerticalAlign.Top))); currentMenuY += MainMenuControlComponentViewRenderableComponent.Y_OFFSET_MENU_ELEMENTS; //опция режима звуковых эффектов targetButton = _modelProviderComponent.SfxModeButton; chosenFontKey = ChooseFontKey(targetButton); _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, MENU_LEFT_SIDE_X_OFFSET, currentMenuY, "Sound", ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Left, EVerticalAlign.Top))); bool isSfxEnabled = gameSettings.IsSfxEnabled; valueCaption = isSfxEnabled ? "Yes" : "No"; _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, MENU_RIGHT_SIDE_X_OFFSET, currentMenuY, valueCaption, ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Right, EVerticalAlign.Top))); currentMenuY += MainMenuControlComponentViewRenderableComponent.Y_OFFSET_MENU_ELEMENTS; //опция режима стартовой заставки targetButton = _modelProviderComponent.IntroCutsceneModeButton; chosenFontKey = ChooseFontKey(targetButton); _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, MENU_LEFT_SIDE_X_OFFSET, currentMenuY, "Intro", ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Left, EVerticalAlign.Top))); bool isIntroEnabled = !gameSettings.IsIntroDisabled; valueCaption = isIntroEnabled ? "Yes" : "No"; _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, MENU_RIGHT_SIDE_X_OFFSET, currentMenuY, valueCaption, ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Right, EVerticalAlign.Top))); currentMenuY += MainMenuControlComponentViewRenderableComponent.Y_OFFSET_MENU_ELEMENTS; //кнопка возврата targetButton = _modelProviderComponent.ReturnBackButton; chosenFontKey = ChooseFontKey(targetButton); _currentMenuElements.Add(new RenderingData.RenderingData(new RenderingString(-1, MainMenuControlComponentViewRenderableComponent.X_CENTERED_OFFSET_MENU, currentMenuY, "Back", ActualSubassetsDataLibrary.GetFont(chosenFontKey), Color.White, 1, 1, EHorizontalAlign.Middle, EVerticalAlign.Top))); currentMenuY += MainMenuControlComponentViewRenderableComponent.Y_OFFSET_MENU_ELEMENTS; } }