コード例 #1
0
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            topEffect.Update((float)os.lastGameTime.ElapsedGameTime.TotalSeconds);
            botEffect.Update((float)os.lastGameTime.ElapsedGameTime.TotalSeconds);
            var height     = 30;
            var rectangle1 = new Rectangle(bounds.X + 30, bounds.Y + bounds.Height / 2 - height / 2, bounds.Width - 60,
                                           height);
            var bounds1 = rectangle1;

            bounds1.Height = 60;
            bounds1.Y     -= bounds1.Height;
            topEffect.Draw(sb, bounds1, 1f, 3f, 1f, os.highlightColor);
            if (Button.doButton(73518921, rectangle1.X, rectangle1.Y, rectangle1.Width, rectangle1.Height,
                                "Shuffle Music", os.highlightColor))
            {
                var maxValue = 12;
                MissionFunctions.runCommand(Utils.random.Next(maxValue) + 1, "changeSong");
            }
            bounds1.Y += bounds1.Height + height;
            botEffect.Draw(sb, bounds1, 1f, 3f, 1f, os.highlightColor);
            var rectangle2 = new Rectangle(bounds.X + 4, bounds.Y + bounds.Height - 4 - 20, (int)(bounds.Width * 0.5), 20);

            if (
                !Button.doButton(73518924, rectangle2.X, rectangle2.Y, rectangle2.Width, rectangle2.Height, "Exit",
                                 os.lockedColor))
            {
                return;
            }
            os.display.command = "connect";
        }
コード例 #2
0
ファイル: SequencerExe.cs プロジェクト: strangea/OpenHacknet
        public override void Update(float t)
        {
            base.Update(t);
            if (HasBeenKilled)
            {
                return;
            }
            bars.Update(t);
            UpdateRamCost(t);
            stateTimer += t;
            switch (state)
            {
            case SequencerExeState.Unavaliable:
                if (os.Flags.HasFlag(flagForProgressionName) || Settings.debugCommandsEnabled)
                {
                    state = SequencerExeState.AwaitingActivation;
                    break;
                }
                bars.MinLineChangeTime = 1f;
                bars.MaxLineChangeTime = 3f;
                break;

            case SequencerExeState.SpinningUp:
                if (MediaPlayer.State == MediaState.Playing)
                {
                    if (MediaPlayer.PlayPosition.TotalSeconds < beatDropTime || stateTimer <= 10.0)
                    {
                        break;
                    }
                    MoveToActiveState();
                    break;
                }
                if (stateTimer <= (double)SPIN_UP_TIME)
                {
                    break;
                }
                MoveToActiveState();
                break;

            case SequencerExeState.Active:
                var num = 2.5f;
                if (stateTimer < (double)num)
                {
                    if (Utils.randm(1f) < 0.300000011920929 + stateTimer / (double)num * 0.699999988079071)
                    {
                        ThemeManager.switchThemeColors(os, targetTheme);
                        ThemeManager.loadThemeBackground(os, targetTheme);
                        ThemeManager.currentTheme = targetTheme;
                    }
                    else
                    {
                        ThemeManager.switchThemeColors(os, originalTheme);
                        ThemeManager.loadThemeBackground(os, originalTheme);
                        ThemeManager.currentTheme = originalTheme;
                    }
                    if ((MediaPlayer.PlayPosition.TotalSeconds - beatDropTime) % beatHits < 0.00999999977648258)
                    {
                        os.warningFlash();
                    }
                }
                ActiveStateUpdate(t);
                break;
            }
        }