Exemplo n.º 1
0
        /// <summary>
        /// Loads the data.
        /// </summary>
        private void LoadData()
        {
            int block1 = -1;

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartProfilingBlock("MyMinerGame::LoadData", ref block1);
            MyMwcLog.WriteLine("MyMinerGame.LoadData() - START");
            MyMwcLog.IncreaseIndent();

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartProfilingBlock("MyPerformanceTimer.LoadData");
            MyPerformanceTimer.LoadData();

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartNextBlock("MyVoxelFiles.LoadData");
            MyVoxelFiles.LoadData();
            // Not using now
            //MyClientServer.LoadData();
            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartNextBlock("MyAudio.LoadData");
            MyAudio.LoadData();

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartNextBlock("MyGuiManager.LoadData");
            MyGuiManager.LoadData();

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartNextBlock("MyGameplayCheats.LoadData");
            MyGameplayCheats.LoadData();

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().EndProfilingBlock();

            MyMwcLog.DecreaseIndent();
            MyMwcLog.WriteLine("MyMinerGame.LoadData() - END");
            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().EndProfilingBlock(block1);
        }
Exemplo n.º 2
0
 private void DisableCheats()
 {
     foreach (var c in MyGameplayCheats.AllCheats)
     {
         MyGameplayCheats.EnableCheat(c.CheatEnum, false);
     }
 }
Exemplo n.º 3
0
        void AddCheat(MyGameplayCheat cheat)
        {
            bool             enabled = MyGuiScreenGamePlay.Static.CheatsEnabled() && cheat.IsImplemented;
            MyGuiControlBase control;

            if (cheat.IsButton)
            {
                if (!m_lastWasButton)
                {
                    m_currentPosition.Y += 0.005f * m_scale;
                }
                m_lastWasButton = true;
                control         = AddButton(MyTextsWrapper.Get(cheat.CheatName), onCheatButtonClick, textColor: Vector4.One, size: new Vector2(0.20f, 0.04f));
            }
            else
            {
                if (m_lastWasButton)
                {
                    m_currentPosition.Y += 0.005f * m_scale;
                }
                m_lastWasButton = false;
                control         = AddCheckBox(cheat.CheatName, MyGameplayCheats.IsCheatEnabled(cheat.CheatEnum), OnCheatCheckedChanged, enabled, color: Vector4.One);
            }

            control.UserData = cheat;

            control.Enabled = enabled;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Unloads the data.
        /// </summary>
        private void UnloadData()
        {
            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartProfilingBlock("MyMinerGame::UnloadData");
            MyMwcLog.WriteLine("MyMinerGame.UnloadData() - START");
            MyMwcLog.IncreaseIndent();

            // TODO: Unload data probably not necessery because all data are loaded at start and dies at the end. No partial unload.

            //  We must unload XACT sounds here, not in the background thread, because on Windows XP every XACT sound loaded in
            //  not-main thread is then not player (I can't hear it).
            MyAudio.UnloadData();

            MyGameplayCheats.UnloadData();

            // Not using now
            //MyClientServer.UnloadData();
            MyPerformanceTimer.UnloadData();

            MyMwcLog.DecreaseIndent();
            MyMwcLog.WriteLine("MyMinerGame.UnloadData() - END");
            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().EndProfilingBlock();
        }
Exemplo n.º 5
0
        void onCheatButtonClick(MyGuiControlButton sender)
        {
            MyGameplayCheat cheat = (MyGameplayCheat)sender.UserData;

            MyGameplayCheats.EnableCheat(cheat.CheatEnum, true);
        }
Exemplo n.º 6
0
        void OnCheatCheckedChanged(MyGuiControlCheckbox sender)
        {
            MyGameplayCheat cheat = (MyGameplayCheat)sender.UserData;

            MyGameplayCheats.EnableCheat(cheat.CheatEnum, sender.Checked);
        }