Esempio n. 1
0
        protected override void OnClick_UnreachableButCanBeBought()
        {
            if (ForceClickCounter == 0)
            {
                Owner.HUD.ShowToast("ONW1::UNLOCK(MULTI)", L10N.T(L10NImpl.STR_GLOB_UNLOCKTOAST1), 40, FlatColors.Silver, FlatColors.Foreground, 2f);
                ForceClickCounter++;

                MainGame.Inst.GDSound.PlayEffectError();
                AddOperation(new ShakeNodeOperation());
            }
            else if (ForceClickCounter == 1)
            {
                Owner.HUD.ShowToast("ONW1::UNLOCK(MULTI)", L10N.T(L10NImpl.STR_GLOB_UNLOCKTOAST2), 40, FlatColors.Silver, FlatColors.Foreground, 2f);
                ForceClickCounter++;

                MainGame.Inst.GDSound.PlayEffectError();

                AddOperation(new ShakeNodeOperation());
            }
            else if (ForceClickCounter == 2)
            {
                Owner.HUD.ShowToast("ONW1::UNLOCK(MULTI)", L10N.T(L10NImpl.STR_GLOB_UNLOCKTOAST3), 40, FlatColors.Silver, FlatColors.Foreground, 2f);

                MainGame.Inst.Profile.SkipTutorial = true;
                MainGame.Inst.SaveProfile();
                _ustate = WorldUnlockState.OpenAndUnlocked;
                return;
            }
        }
        private async Task StartMetaUpdateLevel()
        {
            try
            {
                var meta = await MainGame.Inst.Backend.QueryUserLevelMeta(MainGame.Inst.Profile, _blueprint.CustomMeta_LevelID);

                if (meta == null)
                {
                    MonoSAMGame.CurrentInst.DispatchBeginInvoke(() =>
                    {
                        HUD.ShowToast("SCCMLPD::CUF(MULTI)", L10N.T(L10NImpl.STR_SCCM_DOWNLOADFAILED), 40, FlatColors.Flamingo, FlatColors.Foreground, 3f);
                        MonoSAMGame.CurrentInst.DispatchBeginInvoke(OnDownloadFailed);
                    });
                    return;
                }

                _meta = meta;
                MonoSAMGame.CurrentInst.DispatchBeginInvoke(OnCacheUpdateSuccess);
            }
            catch (Exception e)
            {
                MonoSAMGame.CurrentInst.DispatchBeginInvoke(() =>
                {
                    HUD.ShowToast("SCCMLPD::CUF(MULTI)", L10N.T(L10NImpl.STR_SCCM_DOWNLOADFAILED), 40, FlatColors.Flamingo, FlatColors.Foreground, 3f);
                });

                MonoSAMGame.CurrentInst.DispatchBeginInvoke(OnDownloadFailed);

                SAMLog.Error("SCCMLPD:CacheUpdateException", e);
            }
        }
Esempio n. 3
0
        private void CreateNewUserLevel(HUDTextButton sender, HUDButtonEventArgs e)
        {
            if (MainGame.Inst.Profile.AccountType == AccountType.Local)
            {
                CreateUserAndShowAnonPanel().EnsureNoError();
                return;
            }
            else if (MainGame.Inst.Profile.AccountType == AccountType.Anonymous)
            {
                ShowAnonPanel();
                HUD.ShowToast(null, L10N.T(L10NImpl.STR_SCCM_NEEDS_ACC), 40, FlatColors.Orange, FlatColors.Foreground, 2f);
                return;
            }

            var waitDialog = new HUDIconMessageBox
            {
                L10NText   = L10NImpl.STR_GENERIC_SERVER_QUERY,
                TextColor  = FlatColors.TextHUD,
                Background = HUDBackgroundDefinition.CreateRounded(FlatColors.BelizeHole, 16),

                IconColor     = FlatColors.Clouds,
                Icon          = Textures.CannonCogBig,
                RotationSpeed = 1f,

                CloseOnClick = false,
            };

            HUD.AddModal(waitDialog, false, 0.7f);

            CreateNewUserLevelInternal(waitDialog).RunAsync();
        }
Esempio n. 4
0
        protected void DefaultAction_UnreachableAndFullyLocked()
        {
            Owner.HUD.ShowToast("OWNG::LOCKED(MULTI)", L10N.T(L10NImpl.STR_GLOB_WORLDLOCK), 40, FlatColors.Pomegranate, FlatColors.Foreground, 1.5f);
            MainGame.Inst.GDSound.PlayEffectError();

            AddOperation(new ShakeNodeOperation());
        }
Esempio n. 5
0
        private async Task DoUpload()
        {
            var result = await MainGame.Inst.Backend.SetCustomLevelCompleted(MainGame.Inst.Profile, _level.CustomMeta_LevelID, _difficulty, _time);

            if (result.IsError)
            {
                MonoSAMGame.CurrentInst.DispatchBeginInvoke(() =>
                {
                    _btnReupload.IsVisible   = true;
                    _cannonCog.Color         = FlatColors.Alizarin;
                    _cannonCog.RotationSpeed = 0f;
                    _centerLabel.IsVisible   = false;
                });
            }
            else
            {
                MonoSAMGame.CurrentInst.DispatchBeginInvoke(() =>
                {
                    Remove();

                    HUD.AddModal(new HUDSCCMScorePanel_Won(_level, result.Metadata, _difficulty, result.ScoreGain, _time), false);

                    if (result.IsFirstClear)
                    {
                        AchievementPopup.Show(L10N.T(L10NImpl.STR_ACH_FIRSTCLEAR));
                    }
                    else if (result.IsWorldRecord)
                    {
                        AchievementPopup.Show(L10N.T(L10NImpl.STR_ACH_WORLDRECORD));
                    }
                });
            }
        }
Esempio n. 6
0
        private void Initialize()
        {
#if DEBUG
            DebugUtils.CreateShortcuts(this);
            DebugDisp = DebugUtils.CreateDisplay(this);
#endif

            _banner1.TargetRect          = new FRectangle(0, 2.5f, 16, 2).AsDeflated(0.25f).InReferenceRaster(1f / GDConstants.TILE_WIDTH);
            _banner1.Text                = L10N.T(L10NImpl.STR_ENDGAME_1);
            _banner1.UseCPUParticles     = false;
            _banner1.AnimationTime       = 4f;
            _banner1.AnimationStartDelay = 5f;
            _banner1.CreateEntities(ParticlePresets.GetConfigLetterFlickerFire());

            _banner2.TargetRect          = new FRectangle(0, 5.5f, 16, 2).AsDeflated(0.25f).InReferenceRaster(1f / GDConstants.TILE_WIDTH);
            _banner2.Text                = L10N.T(L10NImpl.STR_ENDGAME_2);
            _banner2.UseCPUParticles     = false;
            _banner2.AnimationTime       = 4f;
            _banner2.AnimationStartDelay = 9f;
            _banner2.CreateEntities(ParticlePresets.GetConfigLetterFlickerFire());

            Entities.AddEntity(new MouseAreaEntity(this, new FPoint(VIEW_WIDTH / 2f, VIEW_HEIGHT / 2f), new FSize(VIEW_WIDTH * 2, VIEW_HEIGHT * 2), 0)
            {
                Click = LeaveScreen
            });
        }
Esempio n. 7
0
 private void ShowErrorConnection()
 {
     MonoSAMGame.CurrentInst.DispatchBeginInvoke(() =>
     {
         MainGame.Inst.ShowToast("SAPI::CONERR", L10N.T(L10NImpl.STR_API_CONERR), 40, FlatColors.Flamingo, FlatColors.Foreground, 3f);
     });
 }
Esempio n. 8
0
        protected override void OnUpdate(GameScreen screen, SAMTime gameTime, InputState istate)
        {
            bool trigger = false;

            if (istate.IsKeyExclusiveJustDown(SKeys.AndroidBack))
            {
                istate.SwallowKey(SKeys.AndroidBack, InputConsumer.ScreenAgent);
                trigger = true;
            }
            else if (istate.IsKeyExclusiveJustDown(SKeys.Backspace))
            {
                istate.SwallowKey(SKeys.Backspace, InputConsumer.ScreenAgent);
                trigger = true;
            }

            if (trigger)
            {
                var delta = gameTime.TotalElapsedSeconds - _lastBackClick;

                if (delta < 2f)
                {
                    MainGame.Inst.CleanExit();
                    return;
                }
                else
                {
                    screen.HUD.ShowToast(null, L10N.T(L10NImpl.STR_GLOB_EXITTOAST), 40, FlatColors.Silver, FlatColors.Foreground, 2f);
                }

                _lastBackClick = gameTime.TotalElapsedSeconds;
            }
        }
Esempio n. 9
0
        private void OnClick(GameEntityMouseArea sender, SAMTime gameTime, InputState istate)
        {
            if (GDOwner.ZoomState != BistateProgress.Normal && GDOwner.ZoomState != BistateProgress.Expanded)
            {
                return;
            }

#if DEBUG
            if (!NodeEnabled && DebugSettings.Get("UnlockNode"))
            {
                NodeEnabled = true;
            }
#endif
            if (!NodeEnabled)
            {
                MainGame.Inst.GDSound.PlayEffectError();

                if (GDOwner.ZoomState == BistateProgress.Expanded)
                {
                    AddEntityOperation(new ScreenShakeOperation2(this, GDOwner));
                }
                else
                {
                    AddEntityOperation(new ScreenShakeAndCenterOperation2(this, GDOwner));
                }

                Owner.HUD.ShowToast("WN::LOCKED", L10N.T(L10NImpl.STR_GLOB_WORLDLOCK), 40, FlatColors.Pomegranate, FlatColors.Foreground, 1.5f);

                return;
            }

            Owner.AddAgent(new LeaveTransitionGameEndAgent(GDOwner, GDOwner.ZoomState == BistateProgress.Expanded, this));
            MainGame.Inst.GDSound.PlayEffectZoomOut();
        }
Esempio n. 10
0
        private void RefreshControls()
        {
            _ctrlID.Text    = $"{_id:000000000000}";
            _ctrlName.Text  = _name;
            _ctrlSize.Text  = _size.Width + "x" + _size.Height;
            _ctrlView.Text  = FlatAlign9Helper.LETTERS[_view];
            _ctrlMusic.Text = _music < 0 ? L10N.T(L10NImpl.STR_MUSIC_NONE) : L10N.TF(L10NImpl.STR_MUSIC_INT, _music + 1);
            switch (_geometry)
            {
            case GameWrapMode.Death:
                _ctrlGeometry.L10NText = L10NImpl.STR_LVLED_CFG_WRAP_INFINITY;
                break;

            case GameWrapMode.Donut:
                _ctrlGeometry.L10NText = L10NImpl.STR_LVLED_CFG_WRAP_DONUT;
                break;

            case GameWrapMode.Reflect:
                _ctrlGeometry.L10NText = L10NImpl.STR_LVLED_CFG_WRAP_REFLECT;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 11
0
        private void OnClickUnlock(HUDTextButton sender, HUDButtonEventArgs e)
        {
            try
            {
                var r = MainGame.Inst.GDBridge.IAB.StartPurchase(GDConstants.IAB_MULTIPLAYER);
                switch (r)
                {
                case PurchaseResult.ProductNotFound:
                    SAMLog.Error("MMP::IAB-PNF", "Product not found", "_iabCode -> " + GDConstants.IAB_MULTIPLAYER);
                    Owner.HUD.ShowToast("MMP:ERR1", L10N.T(L10NImpl.STR_IAB_BUYERR), 40, FlatColors.Pomegranate, FlatColors.Foreground, 2.5f);
                    break;

                case PurchaseResult.NotConnected:
                    Owner.HUD.ShowToast("MMP:ERR2", L10N.T(L10NImpl.STR_IAB_BUYNOCONN), 40, FlatColors.Orange, FlatColors.Foreground, 2.5f);
                    break;

                case PurchaseResult.CurrentlyInitializing:
                    Owner.HUD.ShowToast("MMP:ERR3", L10N.T(L10NImpl.STR_IAB_BUYNOTREADY), 40, FlatColors.Orange, FlatColors.Foreground, 2.5f);
                    break;

                case PurchaseResult.PurchaseStarted:
                    SAMLog.Info("MMP::IAB-BUY", "PurchaseStarted");
                    break;

                default:
                    SAMLog.Error("MMP::EnumSwitch_OCU", "OnClickBuy()", "r -> " + r);
                    break;
                }
            }
            catch (Exception ex)
            {
                SAMLog.Error("MMP::IAB_CALL", ex);
            }
        }
Esempio n. 12
0
        protected void DefaultAction_UnreachableButCanBeBought()
        {
            Owner.HUD.ShowToast("OWNG::LOCKED(MULTI)", L10N.T(L10NImpl.STR_GLOB_WORLDLOCK), 40, FlatColors.Pomegranate, FlatColors.Foreground, 1.5f);
            MainGame.Inst.GDSound.PlayEffectError();

            AddOperation(new ShakeNodeOperation());
            AddOperation(new LambdaOperation <OverworldNode_Graph>("ShowPreviewDelayed", 0.25f, (n, p) => { }, n => { }, n => n.ShowPreview()));
        }
Esempio n. 13
0
        private void Transition_2_ShootingFirstNeutral()
        {
            _state = TutorialState.ShootingFirstNeutral;

            _infobox.Remove();
            SetInfoBox(L10N.T(L10NImpl.STR_TUT_INFO2));

            _anim?.Remove();
        }
Esempio n. 14
0
        private void Transition_1_ShootFirstNeutral()
        {
            _state = TutorialState.TargetFirstNeutral;

            _controller5.RechargeBarrel = false;

            SetInfoBox(L10N.T(L10NImpl.STR_TUT_INFO1));

            AddTouchAnimation(_cannon1, _cannon2);
        }
Esempio n. 15
0
        private void Transition_4_BoostWhileShootingCenter()
        {
            _state = TutorialState.BoostWhileShootingCenter;

            _controller5.RechargeBarrel = true;

            SetInfoBox(L10N.T(L10NImpl.STR_TUT_INFO4));

            _anim?.Remove();
        }
Esempio n. 16
0
        protected override void OnSongError()
        {
            IsMusicMuted = true;
            MainGame.Inst.Profile.MusicEnabled = false;
            SAMLog.Warning("SSP::DISABLE_2", "Disable Sounds due to error");

            MainGame.Inst.DispatchBeginInvoke(() =>
            {
                MainGame.Inst.ShowToast("SSP::ERR_SONG", L10N.T(L10NImpl.STR_ERR_MUSICPLAYBACK), 32, FlatColors.Flamingo, FlatColors.Foreground, 8f);
            });
        }
Esempio n. 17
0
        protected override void OnEffectError()
        {
            IsEffectsMuted = true;
            MainGame.Inst.Profile.SoundsEnabled = false;
            SAMLog.Warning("SSP::DISABLE_1", "Disable Music due to error");

            MainGame.Inst.DispatchBeginInvoke(() =>
            {
                MainGame.Inst.ShowToast("SSP::ERR_EFFECTS", L10N.T(L10NImpl.STR_ERR_SOUNDPLAYBACK), 32, FlatColors.Flamingo, FlatColors.Foreground, 8f);
            });
        }
Esempio n. 18
0
        private void Transition_6_ChangeGameSpeed()
        {
            _state = TutorialState.ChangeGameSpeed;

            _screen.GameSpeedMode = GameSpeedModes.SUPERSLOW;

            SetInfoBox(L10N.T(L10NImpl.STR_TUT_INFO6));

            _anim?.Remove();

            _hud.AddElement(_anim2 = new HUDArrowAnimation(_hud.BtnSpeed.Center + new Vector2(60, -40), 150 * FloatMath.DegreesToRadians));
        }
Esempio n. 19
0
        private async Task DoReuploadProfile(PlayerProfile p)
        {
            try
            {
                // ======== STEP 1 -- UPLOAD ========

                bool sucess = await MainGame.Inst.Backend.Reupload(p);

                if (!sucess)
                {
                    MonoSAMGame.CurrentInst.DispatchBeginInvoke(() =>
                    {
                        btnReload.RotationSpeed = 0f;
                        btnReload.ImageColor    = FlatColors.Carrot;

                        MainGame.Inst.ShowToast(null, L10N.T(L10NImpl.STR_PROFILESYNC_ERROR), 40, FlatColors.Orange, FlatColors.Foreground, 2f);
                    });

                    return;
                }

                // ======== STEP 2 -- DOWNLOAD ========

                sucess = await MainGame.Inst.Backend.DownloadData(p);

                if (!sucess)
                {
                    MonoSAMGame.CurrentInst.DispatchBeginInvoke(() =>
                    {
                        btnReload.RotationSpeed = 0f;
                        btnReload.ImageColor    = FlatColors.Carrot;

                        MainGame.Inst.ShowToast(null, L10N.T(L10NImpl.STR_PROFILESYNC_ERROR), 40, FlatColors.Orange, FlatColors.Foreground, 2f);
                    });

                    return;
                }

                // ======== FINISHED ========

                MonoSAMGame.CurrentInst.DispatchBeginInvoke(() =>
                {
                    btnReload.RotationSpeed = 0f;
                    btnReload.ImageColor    = FlatColors.Clouds;

                    MainGame.Inst.ShowToast(null, L10N.T(L10NImpl.STR_PROFILESYNC_SUCCESS), 40, FlatColors.Emerald, FlatColors.Foreground, 2f);
                });
            }
            finally
            {
                isUploading = false;
            }
        }
Esempio n. 20
0
        private void Transition_8_WinGame()
        {
            _state = TutorialState.WinGame;

            _cannon1.RotateTo(_cannon2);
            _cannon2.RotateTo(_cannon3);
            _cannon3.RotateTo(_cannon4);

            _controller5.RechargeBarrel = true;

            SetInfoBox(L10N.T(L10NImpl.STR_TUT_INFO8));
        }
Esempio n. 21
0
        private void Transition_7_CaptureEnemy()
        {
            _state = TutorialState.CaptureEnemy;

            _screen.GameSpeedMode = GameSpeedModes.NORMAL;

            _cannon3.RotateTo(_cannon4);
            _controller5.RechargeBarrel = false;

            SetInfoBox(L10N.T(L10NImpl.STR_TUT_INFO7));

            _anim2.Remove();
        }
Esempio n. 22
0
        private void OnReuploadProfile(HUDImageButton sender, HUDButtonEventArgs e)
        {
            if (isUploading)
            {
                return;
            }
            isUploading = true;

            btnReload.RotationSpeed = 0.5f;
            MainGame.Inst.ShowToast(null, L10N.T(L10NImpl.STR_PROFILESYNC_START), 40, FlatColors.Silver, FlatColors.Foreground, 2f);
            MainGame.Inst.Profile.NeedsReupload = true;

            DoReuploadProfile(MainGame.Inst.Profile).RunAsync();
        }
Esempio n. 23
0
        private void OpenNode()
        {
            AbortAllOperations(p => p.Name == "LevelNode::Center");
            AbortAllOperations(p => p.Name == "LevelNode::CenterShake");

#if DEBUG
            if (!NodeEnabled && DebugSettings.Get("UnlockNode"))
            {
                NodeEnabled = true;
            }
#endif
            if (!NodeEnabled)
            {
                MainGame.Inst.GDSound.PlayEffectError();

                AddEntityOperation(new ScreenShakeAndCenterOperation(this, GDOwner));

                Owner.HUD.ShowToast("LN::LOCKED", L10N.T(L10NImpl.STR_GLOB_LEVELLOCK), 40, FlatColors.Pomegranate, FlatColors.Foreground, 1.5f);

                return;
            }

            ((GDWorldHUD)Owner.HUD).SelectNode(this);

            var progress = FindFirstOperationProgress(p => p.Name == "LevelNode::Close::root");
            AbortAllOperations(p => p.Name == "LevelNode::Close::root");
            var o = AddEntityOperation(new SimpleGameEntityOperation <LevelNode>("LevelNode::Open::root", TOTAL_EXPANSION_TIME, (n, p) => RootExpansionProgress = p));
            if (progress != null)
            {
                o.ForceSetProgress(1 - progress.Value);
            }

            if (Blueprint.UniqueID == Levels.LEVELID_1_1 && !LevelData.HasCompletedOrBetter(FractionDifficulty.DIFF_0))
            {
                OpenExtender(FractionDifficulty.DIFF_0);
            }
            else
            {
                OpenExtender(FractionDifficulty.DIFF_0);
                OpenExtender(FractionDifficulty.DIFF_1);
                OpenExtender(FractionDifficulty.DIFF_2);
                OpenExtender(FractionDifficulty.DIFF_3);
            }


            AddEntityOperation(new CenterNodeOperation(GDOwner));

            MainGame.Inst.GDSound.PlayEffectOpen();
        }
Esempio n. 24
0
        private void OnLogout(HUDTextButton sender, HUDButtonEventArgs e)
        {
            var delta = MonoSAMGame.CurrentTime.TotalElapsedSeconds - _lastClickLogout;

            if (delta > 5f)
            {
                _logOutCounter = 0;
            }

            if (_logOutCounter == 0)
            {
                HUD.ShowToast(null, L10N.T(L10NImpl.STR_FAP_WARN1), 40, FlatColors.Flamingo, FlatColors.Foreground, 3f);
                _lastClickLogout = MonoSAMGame.CurrentTime.TotalElapsedSeconds;
                _logOutCounter++;
                return;
            }
            else if (_logOutCounter == 1)
            {
                if (delta < 0.5f)
                {
                    return;
                }

                HUD.ShowToast(null, L10N.T(L10NImpl.STR_FAP_WARN2), 40, FlatColors.Flamingo, FlatColors.Foreground, 3f);
                _lastClickLogout = MonoSAMGame.CurrentTime.TotalElapsedSeconds;
                _logOutCounter++;
                return;
            }
            else if (_logOutCounter == 2)
            {
                MainGame.Inst.Profile.LevelData.Clear();
                MainGame.Inst.Profile.CustomLevelData.Clear();
                MainGame.Inst.Profile.ScoreSCCM         = 0;
                MainGame.Inst.Profile.ScoreStars        = 0;
                MainGame.Inst.Profile.MultiplayerPoints = 0;

                MainGame.Inst.Profile.AccountType        = AccountType.Local;
                MainGame.Inst.Profile.OnlineUserID       = -1;
                MainGame.Inst.Profile.OnlineUsername     = "******";
                MainGame.Inst.Profile.OnlinePasswordHash = string.Empty;
                MainGame.Inst.Profile.OnlineRevisionID   = -1;
                MainGame.Inst.Profile.NeedsReupload      = false;

                MainGame.Inst.Backend.CreateUser(MainGame.Inst.Profile).ContinueWith(t => MainGame.Inst.Backend.DownloadHighscores(MainGame.Inst.Profile)).EnsureNoError();

                HUD.ShowToast(null, L10N.T(L10NImpl.STR_FAP_LOGOUT_SUCESS), 40, FlatColors.Emerald, FlatColors.Foreground, 1.5f);
                MainGame.Inst.SetOverworldScreenCopy(HUD.Screen as GDOverworldScreen);
            }
        }
Esempio n. 25
0
        protected override void OnDraw(IBatchRenderer sbatch)
        {
            SimpleRenderHelper.DrawSimpleRect(sbatch, FRectangle.CreateByCenter(Position, DIAMETER, DIAMETER), clickAreaThis.IsMouseDown() ? FlatColors.WetAsphalt : FlatColors.Asbestos);
            SimpleRenderHelper.DrawSimpleRectOutline(sbatch, FRectangle.CreateByCenter(Position, DIAMETER, DIAMETER), 2, FlatColors.MidnightBlue);

            SimpleRenderHelper.DrawRoundedRect(sbatch, FRectangle.CreateByCenter(Position, INNER_DIAMETER, INNER_DIAMETER), Color.Black);

            FontRenderHelper.DrawTextCenteredWithBackground(
                sbatch,
                Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH,
                L10N.T(L10NImpl.STR_GLOB_OVERWORLD),
                FlatColors.TextHUD,
                Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH),
                FlatColors.BackgroundHUD2 * 0.5f);
        }
Esempio n. 26
0
        private void Transition_3_TargetCenter()
        {
            _state = TutorialState.TargetCenter;

            _cannon5.RotateTo(_cannon4);

            if (FloatMath.DiffRadiansAbs(_cannon2.Rotation.ActualValue, FloatMath.RAD_POS_090) < FloatMath.RAD_POS_060)
            {
                _cannon2.Rotation.Set(FloatMath.RAD_POS_180);
            }

            SetInfoBox(L10N.T(L10NImpl.STR_TUT_INFO3));

            AddTouchAnimation(_cannon2, _cannon3);
        }
Esempio n. 27
0
        protected override void OnShow()
        {
            if (Blueprint.CustomMusic != -1)
            {
                MainGame.Inst.GDSound.PlayMusicLevel(Blueprint.CustomMusic);
            }
            else
            {
                MainGame.Inst.GDSound.StopSong();
            }

            if (_toast)
            {
                HUD.ShowToast("SCCMUpload:Notif", L10N.T(L10NImpl.STR_SCCM_UPLOADINFO), 40, FlatColors.Silver, FlatColors.Foreground, 4f);
            }
        }
        public override void OnInitialize()
        {
            AddElement(new HUDLambdaLabel
            {
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(222, Height),
                Alignment        = HUDAlignment.CENTER,
                TextAlignment    = HUDAlignment.CENTERLEFT,

                FontSize  = Height - 10,
                Font      = Textures.HUDFontBold,
                TextColor = Color.White,

                Lambda = () => L10N.T(L10NImpl.STR_SCCM_LOADING) + new string('.', ((int)(MonoSAMGame.CurrentTime.TotalElapsedSeconds * 2)) % 4),
            });
        }
Esempio n. 29
0
        private void Close(HUDTextButton sender, HUDButtonEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(_name))
            {
                HUD.ShowToast("LECP::NONAME", L10N.T(L10NImpl.STR_LVLED_ERR_NONAME), 40, FlatColors.Flamingo, FlatColors.Foreground, 3f);
                return;
            }

            _data.Name     = _name;
            _data.Size     = _size;
            _data.View     = _view;
            _data.Geometry = _geometry;
            _data.Music    = _music;

            this.Remove();
        }
Esempio n. 30
0
        public BackgroundText(GDGameScreen scrn, BackgroundTextBlueprint blueprint) : base(scrn, GDConstants.ORDER_GAME_BACKGROUNDTEXT)
        {
            var pos = new FPoint(blueprint.X, blueprint.Y);

            Blueprint = blueprint;

            _rotation = FloatMath.ToRadians(blueprint.Rotation);
            _bounds   = new FRotatedRectangle(pos, blueprint.Width, blueprint.Height, _rotation);

            Position = pos;

            DrawingBoundingBox = _bounds.OuterSize;

            _text  = FontRenderHelper.MakeTextSafe(Textures.LevelBackgroundFont, L10N.T(blueprint.L10NText), '_');
            _scale = FontRenderHelper.GetFontScale(Textures.LevelBackgroundFont, _text, _bounds.Size);

            if ((Blueprint.Config & BackgroundTextBlueprint.CONFIG_SHAKE) == BackgroundTextBlueprint.CONFIG_SHAKE)
            {
                AddOperation(new ShakeTextOperation());
            }

            if ((Blueprint.Config & BackgroundTextBlueprint.CONFIG_ONLYD1) == BackgroundTextBlueprint.CONFIG_ONLYD1)
            {
                if (scrn.Difficulty != FractionDifficulty.DIFF_0)
                {
                    Alive = false;
                }
            }

            if ((Blueprint.Config & BackgroundTextBlueprint.CONFIG_ONLY_UNCLEARED) == BackgroundTextBlueprint.CONFIG_ONLY_UNCLEARED)
            {
                if (MainGame.Inst.Profile.GetLevelData(scrn.Blueprint).HasCompletedOrBetter(scrn.Difficulty))
                {
                    Alive = false;
                }
            }

            if ((Blueprint.Config & BackgroundTextBlueprint.CONFIG_REDFLASH) == BackgroundTextBlueprint.CONFIG_REDFLASH)
            {
                AddOperation(new RedFlashTextOperation());
            }

            if (scrn.IsPreview)
            {
                Alive = false;
            }
        }