Пример #1
0
 private void Unload()
 {
     SaberTailorPatches.RemoveHarmonyPatches();
     ScoreUtility.Cleanup();
     Configuration.Save();
     RemoveEvents();
 }
Пример #2
0
        /**
         * Constructor
         */
        public GameView(GameBoxForm parent, GameLogic logic, GameData data, CreditSystem credit)
        {
            InitializeComponent();

            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            //performance buff
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            _parent = parent;

            bullets      = new List <Bullet>();
            alienbullets = new List <Bullet>();
            this.credit  = credit;

            this.logic = logic;

            this.data = data;
            this.logic.SetGameView(this);


            scoreUtil = new ScoreUtility();

            logic.SetScoreUtil(scoreUtil);

            lblHighScore.Text = scoreUtil.getTopScore().ToString();
            InitializeStartScreen();
            InitializeGameObjects();
            this.logic.SetupCollisionHandler();
            fpsTimer.Start();
        }
Пример #3
0
        public void OnGameSceneLoaded()
        {
            CustomNote activeNote = NoteAssetLoader.CustomNoteObjects[NoteAssetLoader.SelectedNote];

            if (activeNote.FileName != "DefaultNotes")
            {
                MaterialSwapper.GetMaterials();
                MaterialSwapper.ReplaceMaterialsForGameObject(activeNote.NoteLeft);
                MaterialSwapper.ReplaceMaterialsForGameObject(activeNote.NoteRight);

                if (activeNote.NoteDotLeft != null)
                {
                    MaterialSwapper.ReplaceMaterialsForGameObject(activeNote.NoteDotLeft);
                }

                if (activeNote.NoteDotRight != null)
                {
                    MaterialSwapper.ReplaceMaterialsForGameObject(activeNote.NoteDotRight);
                }

                if (activeNote.NoteBomb != null)
                {
                    MaterialSwapper.ReplaceMaterialsForGameObject(activeNote.NoteBomb);
                }

                CheckCustomNotesScoreDisable();
            }
            else if (ScoreUtility.ScoreIsBlocked)
            {
                ScoreUtility.EnableScoreSubmission("ModifiersEnabled");
            }
        }
Пример #4
0
 private void Unload()
 {
     RemoveEvents();
     CustomNotesPatches.RemoveHarmonyPatches();
     ScoreUtility.Cleanup();
     Configuration.Save();
     NoteAssetLoader.Clear();
     SettingsUI.RemoveMenu();
 }
Пример #5
0
#pragma warning restore IDE0051 // Used by MonoBehaviour

        private void Load()
        {
            // Allow the user to run in any mode, but don't allow ScoreSubmission
            if (IsPreventingScoreSubmission)
            {
                ScoreUtility.DisableScoreSubmission(Name);
            }
            else if (ScoreUtility.ScoreIsBlocked)
            {
                ScoreUtility.EnableScoreSubmission(Name);
            }

            StartCoroutine(ApplyGameCoreModifications());
        }
Пример #6
0
 internal static void CheckCustomNotesScoreDisable()
 {
     if (SceneManager.GetActiveScene().name == "GameCore")
     {
         string fileName = NoteAssetLoader.CustomNoteObjects[NoteAssetLoader.SelectedNote].FileName;
         if (fileName != "DefaultNotes")
         {
             if (BS_Utils.Plugin.LevelData.GameplayCoreSceneSetupData.gameplayModifiers.ghostNotes == true ||
                 BS_Utils.Plugin.LevelData.GameplayCoreSceneSetupData.gameplayModifiers.disappearingArrows == true)
             {
                 ScoreUtility.DisableScoreSubmission("ModifiersEnabled");
             }
             else
             {
                 ScoreUtility.EnableScoreSubmission("ModifiersEnabled");
             }
         }
     }
 }
Пример #7
0
        public void OnActiveSceneChanged(Scene prevScene, Scene nextScene)
        {
            if (nextScene.name == "GameCore")
            {
                if (Configuration.Trail.TweakEnabled)
                {
                    new GameObject(PluginName).AddComponent <SaberTrail>();
                }

                if (Configuration.Scale.TweakEnabled)
                {
                    new GameObject(PluginName).AddComponent <SaberLength>();
                }
                else if (ScoreUtility.ScoreIsBlocked)
                {
                    ScoreUtility.EnableScoreSubmission(SaberLength.Name);
                }
            }
            else if (nextScene.name == "MenuViewControllers" && prevScene.name == "EmptyTransition")
            {
                BSMLSettings.instance.AddSettingsMenu("SaberTailor", "SaberTailor.Settings.UI.Views.mainsettings.bsml", MainSettings.instance);
            }
        }
Пример #8
0
 private void AddScoreUtility(ScoreUtility score)
 {
     this.score = score;
 }
Пример #9
0
 public void SetScoreUtil(ScoreUtility util)
 {
     this.score = util;
 }
Пример #10
0
 public void SetScoreUtil(ScoreUtility util)
 {
     this.scoreUtil = util;
     highScore.SetScoreUtil(util);
 }