Exemplo n.º 1
0
        private void OnClickFinishPrev(HUDTextButton sender, HUDButtonEventArgs args)
        {
            if (UnlockManager.IsUnlocked(Levels.WORLD_001, false) != WorldUnlockState.OpenAndUnlocked)
            {
                MainGame.Inst.SetTutorialLevelScreen();
                return;
            }

            if (UnlockManager.IsUnlocked(Levels.WORLD_002, false) != WorldUnlockState.OpenAndUnlocked)
            {
                MainGame.Inst.SetWorldMapScreenZoomedOut(Levels.WORLD_001);
                return;
            }

            if (UnlockManager.IsUnlocked(Levels.WORLD_003, false) != WorldUnlockState.OpenAndUnlocked)
            {
                MainGame.Inst.SetWorldMapScreenZoomedOut(Levels.WORLD_002);
                return;
            }

            if (UnlockManager.IsUnlocked(Levels.WORLD_004, false) != WorldUnlockState.OpenAndUnlocked)
            {
                MainGame.Inst.SetWorldMapScreenZoomedOut(Levels.WORLD_003);
                return;
            }

            MainGame.Inst.SetWorldMapScreenZoomedOut(Levels.WORLD_004);
        }
Exemplo n.º 2
0
        public WorldPreviewPanel(LevelBlueprint[] bps, Guid unlockID, string iab, int worldnumber)
        {
            _blueprints  = bps;
            _id          = unlockID;
            _iabCode     = iab;
            _worldNumber = worldnumber;

            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.Asbestos;

            _unlockWorldNumber = 1;

            if (UnlockManager.IsUnlocked(Levels.WORLD_001, false) != WorldUnlockState.Unlocked)
            {
                _unlockWorldNumber = 0;
            }
            else
            {
                if (_worldNumber > 2 && UnlockManager.IsUnlocked(Levels.WORLD_002, false) == WorldUnlockState.Unlocked)
                {
                    _unlockWorldNumber = 2;
                }
                if (_worldNumber > 3 && UnlockManager.IsUnlocked(Levels.WORLD_003, false) == WorldUnlockState.Unlocked)
                {
                    _unlockWorldNumber = 3;
                }
                if (_worldNumber > 4 && UnlockManager.IsUnlocked(Levels.WORLD_004, false) == WorldUnlockState.Unlocked)
                {
                    _unlockWorldNumber = 4;
                }
            }
        }
Exemplo n.º 3
0
        protected override void OnClick(GameEntityMouseArea area, SAMTime gameTime, InputState istate)
        {
#if DEBUG
            if (DebugSettings.Get("UnlockNode"))
            {
                OnClickUnlocked(); return;
            }

            if (DebugSettings.Get("WorldPreview"))
            {
                MainGame.Inst.Profile.PurchasedWorlds.Clear(); ShowPreview(); return;
            }
#endif

            _ustate = UnlockManager.IsUnlocked(Blueprint, true);

            if (_ustate == WorldUnlockState.Unlocked)
            {
                OnClickUnlocked();
            }
            else if (_ustate == WorldUnlockState.NeedsAction)
            {
                OnClickNeedsAction();
            }
            else if (_ustate == WorldUnlockState.FullyLocked)
            {
                OnClickFullyLocked();
            }
        }
Exemplo n.º 4
0
        public MultiplayerMainPanel()
        {
            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;

            _ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_MULTIPLAYER, true);
        }
Exemplo n.º 5
0
        public MultiplayerMainPanel()
        {
            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;

            _ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_MULTIPLAYER, true);

            //MainGame.Inst.GDBridge.IAB.SynchronizePurchases(GDConstants.IABList);
        }
Exemplo n.º 6
0
        public OverworldNode_SCCM(GDOverworldScreen scrn, FPoint pos) : base(scrn, pos, L10NImpl.STR_WORLD_ONLINE, Levels.WORLD_ID_ONLINE)
        {
            AddOperationDelayed(new TetrisInitialOperation(0.50f), 0.75f);
            AddOperation(new CyclicSequenceOperation <OverworldNode_SCCM>(
                             new SleepOperation <OverworldNode_SCCM>(1.50f),
                             new TetrisFillOperation(5.50f),
                             new SleepOperation <OverworldNode_SCCM>(0.75f),
                             new TetrisBlendOperation(0.75f),
                             new SleepOperation <OverworldNode_SCCM>(0.25f),
                             new TetrisShrinkOperation(2.50f)));

            _ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_ONLINE, false);
        }
Exemplo n.º 7
0
        protected OverworldNode_Graph(GDOverworldScreen scrn, FPoint pos, GraphBlueprint world, string iab)
            : base(scrn, pos, Levels.WORLD_NAMES[world.ID], world.ID)
        {
            Blueprint = world;
            IABCode   = iab;

            solvedPerc[FractionDifficulty.DIFF_0] = GetSolvePercentage(FractionDifficulty.DIFF_0);
            solvedPerc[FractionDifficulty.DIFF_1] = GetSolvePercentage(FractionDifficulty.DIFF_1);
            solvedPerc[FractionDifficulty.DIFF_2] = GetSolvePercentage(FractionDifficulty.DIFF_2);
            solvedPerc[FractionDifficulty.DIFF_3] = GetSolvePercentage(FractionDifficulty.DIFF_3);

            _swingPeriode *= FloatMath.GetRangedRandom(0.85f, 1.15f);

            _ustate = UnlockManager.IsUnlocked(world, false);
        }
Exemplo n.º 8
0
        protected override void OnClick(GameEntityMouseArea area, SAMTime gameTime, InputState istate)
        {
            var ownr = ((GDOverworldScreen)Owner);

            if (ownr.IsTransitioning)
            {
                return;
            }

            if (MainGame.Inst.Profile.AccountType == AccountType.Local)
            {
                MainGame.Inst.ShowToast(null, L10N.T(L10NImpl.STR_MP_CONNECTING), 40, FlatColors.Emerald, FlatColors.Foreground, 2f);
                MainGame.Inst.Backend.CreateUser(MainGame.Inst.Profile).RunAsync();
                return;
            }

            //MainGame.Inst.GDBridge.IAB.SynchronizePurchases(GDConstants.IABList);

            var ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_ONLINE, true);

            switch (ustate)
            {
            case WorldUnlockState.OpenAndUnlocked:
                Owner.HUD.AddModal(new SCCMMainPanel(), true, 0.5f, 1f);
                break;

            case WorldUnlockState.ReachableButMustBePreviewed:
            case WorldUnlockState.UnreachableButCanBePreviewed:
                Owner.HUD.AddModal(new SCCMPreviewPanel(), true, 0.5f, 1f);
                break;

            case WorldUnlockState.UnreachableAndFullyLocked:
                Owner.HUD.ShowToast("ONSCCM::LOCKED(MULTI)", L10N.T(L10NImpl.STR_GLOB_WORLDLOCK), 40, FlatColors.Pomegranate, FlatColors.Foreground, 1.5f);
                MainGame.Inst.GDSound.PlayEffectError();

                AddOperation(new ShakeNodeOperation());
                break;

            default:
                SAMLog.Error("ONSCCM::EnumSwitch_OC", "ustate: " + ustate);
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo 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;
            }

            if (UnlockManager.IsUnlocked(Blueprint.TargetWorld, true) == WorldUnlockState.OpenAndUnlocked)
            {
                Owner.AddAgent(new LeaveTransitionWorldMapAgent(GDOwner, GDOwner.ZoomState == BistateProgress.Expanded, this, Target));
                MainGame.Inst.GDSound.PlayEffectZoomOut();
            }
            else
            {
                Owner.AddAgent(new LeaveTransitionOverworldAgent(GDOwner, GDOwner.ZoomState == BistateProgress.Expanded));
                MainGame.Inst.GDSound.PlayEffectZoomOut();
            }
        }
Exemplo n.º 10
0
        protected override void DoUpdate(SAMTime gameTime, InputState istate)
        {
            base.DoUpdate(gameTime, istate);

            if (!Alive)
            {
                return;
            }

            if (_ustate != WorldUnlockState.OpenAndUnlocked)
            {
                _ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_MULTIPLAYER, false);

                if (_ustate == WorldUnlockState.OpenAndUnlocked)
                {
                    Remove();
                    Owner.HUD.AddModal(new MultiplayerMainPanel(), true, 0.5f);
                }
            }
        }
Exemplo n.º 11
0
        protected override void OnClick(GameEntityMouseArea area, SAMTime gameTime, InputState istate)
        {
#if DEBUG
            if (DebugSettings.Get("UnlockNode"))
            {
                OnClick_OpenAndUnlocked(); return;
            }

            if (DebugSettings.Get("WorldPreview"))
            {
                MainGame.Inst.Profile.PurchasedWorlds.Clear(); ShowPreview(); return;
            }
#endif

            _ustate = UnlockManager.IsUnlocked(Blueprint, true);

            //MainGame.Inst.GDBridge.IAB.SynchronizePurchases(GDConstants.IABList);

            switch (_ustate)
            {
            case WorldUnlockState.OpenAndUnlocked:
                OnClick_OpenAndUnlocked();
                break;

            case WorldUnlockState.ReachableButMustBePreviewed:
                OnClick_ReachableButMustBeBought();
                break;

            case WorldUnlockState.UnreachableButCanBePreviewed:
                OnClick_UnreachableButCanBeBought();
                break;

            case WorldUnlockState.UnreachableAndFullyLocked:
                OnClick_UnreachableAndFullyLocked();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 12
0
        public OverworldNode_MP(GDOverworldScreen scrn, FPoint pos) : base(scrn, pos, L10NImpl.STR_WORLD_MULTIPLAYER, Levels.WORLD_ID_MULTIPLAYER)
        {
            AddEntityOperationDelayed(new NetworkAnimationTriggerOperation(), NetworkAnimationTriggerOperation.INITIAL_DELAY);

            _ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_MULTIPLAYER, false);
        }