Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // GSGE.Debug
- static Debug()
- {
- Debug.debugKeys = new Dictionary<Debug.KeyModifier, Dictionary<Keys, Debug.DebugKeyCallback>>(Debug.KeyModifierEqualityComparer.Default);
- Debug.s_framesSinceLastStep = 0;
- Debug.m_drawWeaponOrganization = false;
- Debug.m_logMessages = new Dictionary<Debug.DebugText, List<string>>();
- Debug.m_messageTypeDisplayIndex = 0;
- Debug.m_debugText = null;
- Debug.registerDebugKey(Debug.KeyModifier.Control, Keys.T, delegate
- {
- GameplayScreen.getInGameUI().UserVisible = false;
- ConfigOptions.ShroudMinTransparency = 0f;
- ConfigOptions.ShroudMaxTransparency = 0f;
- ConfigOptions.DebugMessages = false;
- ConfigOptions.DebugDraw = true;
- AnimationManager.hideTextAnimations();
- ConfigOptions.ShowUIAnimations = false;
- ConfigOptions.UseOcclusion = false;
- ConfigOptions.DropLoot = false;
- ConfigOptions.Invincibility = true;
- PlayerManager.getFirstPlayerUnit().healFraction(1f);
- ProgressHelper.depositMoney(872);
- ConfigOptions.EasyDebugKeys = true;
- });
- Debug.registerDebugKey(Debug.KeyModifier.None, Keys.P, new Debug.DebugKeyCallback(World.togglePause));
- Debug.registerDebugKey(Debug.KeyModifier.None, Keys.OemCloseBrackets, new Debug.DebugKeyCallback(World.stepFrame));
- Debug.registerDebugKey(Debug.KeyModifier.Control, Keys.Delete, delegate
- {
- Debug.m_messageTypeDisplayIndex = 0;
- });
- Debug.registerDebugKey(Debug.KeyModifier.Control, Keys.L, delegate
- {
- Debug.HotLoad();
- });
- Debug.registerDebugKey(Debug.KeyModifier.ControlShift, Keys.P, delegate
- {
- PerfTimerScreen screen = new PerfTimerScreen(App.getScreenManager());
- App.getScreenManager().AddScreen(screen);
- });
- }
- // GSGE.Debug
- public static void handleInput(InputHandler input)
- {
- if (!ConfigOptions.DebugKeysEnabled)
- {
- return;
- }
- if (Debug.handleInputForMod(Debug.KeyModifier.ControlShift, input))
- {
- return;
- }
- if (Debug.handleInputForMod(Debug.KeyModifier.Control, input))
- {
- return;
- }
- if (Debug.handleInputForMod(Debug.KeyModifier.Shift, input))
- {
- return;
- }
- if (Debug.handleInputForMod(Debug.KeyModifier.None, input))
- {
- return;
- }
- Player player = PlayerManager.getPlayer();
- PlayerUnit unit = player.getUnit();
- if (input.isCtrlDown() && input.wasKeyPressed(Keys.D))
- {
- Debug.m_messageTypeDisplayIndex++;
- Debug.m_messageTypeDisplayIndex = Functions.wrap(Debug.m_messageTypeDisplayIndex, 0, Enum.GetValues(typeof(Debug.DebugText)).Length);
- }
- else if (input.isShiftDown() && input.wasKeyPressed(Keys.D))
- {
- ConfigOptions.DebugMessages = !ConfigOptions.DebugMessages;
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.A))
- {
- ConfigOptions.Music = !ConfigOptions.Music;
- if (ConfigOptions.Music)
- {
- AudioManager.unmute();
- }
- else
- {
- AudioManager.mute();
- }
- if (!input.isShiftDown())
- {
- ConfigOptions.SoundFX = ConfigOptions.Music;
- }
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.M))
- {
- ProgressHelper.depositMoney(9999);
- ConfigOptions.FlashUnspentMoney = false;
- ProgressHelper.pickUpGoalPiece();
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.N))
- {
- World.getMap().debugEndWave();
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.W))
- {
- World.getMap().debugWin();
- }
- else if (input.isShiftDown() && input.wasKeyPressed(Keys.W))
- {
- Debug.m_drawWeaponOrganization = !Debug.m_drawWeaponOrganization;
- }
- else if (!input.isCtrlDown() || !input.wasKeyPressed(Keys.R))
- {
- if (input.isShiftDown() && input.wasKeyPressed(Keys.R))
- {
- unit.refillAllWeaponAmmo();
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.OemPlus))
- {
- BookAnimation.cycleNumAnglesForwards();
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.OemMinus))
- {
- BookAnimation.cycleNumAnglesBackwards();
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.G))
- {
- ConfigOptions.GodMode = !ConfigOptions.GodMode;
- if (ConfigOptions.GodMode)
- {
- PlayerManager.getFirstPlayerUnit().healFraction(1f);
- ConfigOptions.DamageMultiplier = 100f;
- }
- else
- {
- ConfigOptions.DamageMultiplier = 1f;
- }
- ConfigOptions.Invincibility = ConfigOptions.GodMode;
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.K))
- {
- ConfigOptions.GuranteeCrit = !ConfigOptions.GuranteeCrit;
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.O))
- {
- ConfigOptions.TutorialsOn = !ConfigOptions.TutorialsOn;
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.A))
- {
- ConfigOptions.UseAnimations = !ConfigOptions.UseAnimations;
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.E))
- {
- ConfigOptions.DrawExtents = !ConfigOptions.DrawExtents;
- }
- else if (!input.isCtrlDown() || !input.wasKeyPressed(Keys.X))
- {
- if (input.isShiftDown() && input.isKeyDown(Keys.E))
- {
- player.grantExperience(200, unit.getLocation());
- }
- else if (input.isShiftDown() && input.wasKeyPressed(Keys.N))
- {
- GeneratorManager.buildTick();
- GeneratorManager.UpgradeAvailable = true;
- }
- else if (unit != null && input.isCtrlDown() && input.wasKeyPressed(Keys.U))
- {
- Debug.equipRandomLoadout();
- }
- else if (unit != null && input.isShiftDown() && input.wasKeyPressed(Keys.U))
- {
- unit.pickupWeapon("Hammer");
- unit.pickupWeapon("Roll");
- unit.pickupWeapon("Repeater");
- unit.pickupWeapon("HealthPotion");
- unit.pickupWeapon("ShieldBash");
- unit.pickupWeapon("Longbow");
- IAssetManager instance = AssetManager.Instance;
- instance.loadPackage("Hammer", CMID.WEAPON_LOADOUT);
- instance.loadPackage("Roll", CMID.WEAPON_LOADOUT);
- instance.loadPackage("Repeater", CMID.WEAPON_LOADOUT);
- instance.loadPackage("HealthPotion", CMID.WEAPON_LOADOUT);
- instance.loadPackage("ShieldBash", CMID.WEAPON_LOADOUT);
- instance.loadPackage("Longbow", CMID.WEAPON_LOADOUT);
- PlayerTechManager.unlockWeapon("Hammer_Whirlwind");
- PlayerTechManager.unlockWeapon("Longbow_BouncingShot");
- unit.pickupWeapon("Repeater_TwirlShot");
- PlayerTechManager.pickupSchematic("Hammer_Seed");
- PlayerTechManager.pickupSchematic("Repeater_Seed");
- PlayerTechManager.pickupSchematic("Longbow_Seed");
- PlayerTechManager.pickupSchematic("City_Plant01");
- ProgressHelper.depositMoney(400);
- player.grantExperience(99999999, unit.getLocation());
- player.grantExperience(99999999, unit.getLocation());
- ProgressHelper.pickUpGoalPiece();
- ProgressManager.setFlag(ProgressManager.FlagSet.UPGRADES_UNLOCKED, "LifeSteal");
- ProgressManager.setFlag(ProgressManager.FlagSet.UPGRADES_UNLOCKED, "PlusHealth");
- ProgressManager.setFlag(ProgressManager.FlagSet.UPGRADES_UNLOCKED, "PlusAllCritMinusHealth");
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.H))
- {
- unit.debugToggleMaxHealth(0.5f);
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.Q))
- {
- Debug.resetMap(World.BeginRequest.NOLOAD);
- }
- else if (input.isCtrlDown() && input.wasKeyPressed(Keys.J))
- {
- ConfigOptions.FishEye = !ConfigOptions.FishEye;
- }
- }
- }
- if (input.isShiftDown() && input.isKeyDown(Keys.OemPlus))
- {
- App.getLightComponent().adjustBrightness(0.002f);
- }
- else if (input.isShiftDown() && input.isKeyDown(Keys.OemMinus))
- {
- App.getLightComponent().adjustBrightness(-0.002f);
- }
- if (input.isCtrlDown())
- {
- int scrollWheelChange = input.getScrollWheelChange();
- if (scrollWheelChange < 0)
- {
- Camera.zoom(0.9f);
- }
- else if (scrollWheelChange > 0)
- {
- Camera.zoom(1.1f);
- }
- else if (input.wasMouseButtonPressed(Controls.MouseButtons.Middle))
- {
- Camera.resetZoom();
- }
- }
- if (input.isShiftDown())
- {
- if (input.isKeyDown(Keys.Left))
- {
- Camera.move(new Vector2(-1f, 0f));
- }
- else if (input.isKeyDown(Keys.Right))
- {
- Camera.move(new Vector2(1f, 0f));
- }
- else if (input.isKeyDown(Keys.Up))
- {
- Camera.move(new Vector2(0f, -1f));
- }
- else if (input.isKeyDown(Keys.Down))
- {
- Camera.move(new Vector2(0f, 1f));
- }
- }
- if (input.wasKeyPressed(Keys.F1))
- {
- Debug.debugOpenArsenal();
- }
- else if (input.wasKeyPressed(Keys.F2))
- {
- Debug.debugOpenDistillery();
- }
- else if (input.wasKeyPressed(Keys.F3))
- {
- Debug.debugOpenForge();
- }
- else if (input.wasKeyPressed(Keys.F4))
- {
- Debug.debugOpenShrine();
- }
- else if (input.wasKeyPressed(Keys.F5))
- {
- Debug.debugOpenMemorial();
- }
- else if (input.wasKeyPressed(Keys.F6))
- {
- Debug.debugOpenLostAndFound();
- }
- if (input.isButtonDown(ConfigOptions.DebugKey))
- {
- if (input.wasButtonPressed(Buttons.DPadDown))
- {
- Debug.debugOpenShrine();
- }
- else if (input.wasButtonPressed(Buttons.DPadLeft))
- {
- Debug.debugOpenArsenal();
- }
- else if (input.wasButtonPressed(Buttons.DPadRight))
- {
- Debug.debugOpenDistillery();
- }
- else if (input.wasButtonPressed(Buttons.DPadUp))
- {
- Debug.debugOpenForge();
- }
- }
- if (ConfigOptions.EasyDebugKeys)
- {
- if (input.wasButtonPressed(Buttons.RightShoulder))
- {
- World.togglePause();
- }
- Debug.s_framesSinceLastStep++;
- if (input.wasButtonPressed(Buttons.LeftShoulder) || (input.isButtonDown(Buttons.LeftShoulder) && Debug.s_framesSinceLastStep > 4))
- {
- World.stepFrame();
- Debug.s_framesSinceLastStep = 0;
- }
- if (input.wasButtonPressed(Buttons.LeftStick))
- {
- Camera.toggleTrackPlayers();
- }
- if (input.wasButtonPressed(Buttons.RightStick))
- {
- App.TakeScreenshot();
- }
- if (input.isButtonDown(Buttons.DPadLeft))
- {
- Camera.move(new Vector2(-1f, 0f));
- return;
- }
- if (input.isButtonDown(Buttons.DPadRight))
- {
- Camera.move(new Vector2(1f, 0f));
- return;
- }
- if (input.isButtonDown(Buttons.DPadUp))
- {
- Camera.move(new Vector2(0f, -1f));
- return;
- }
- if (input.isButtonDown(Buttons.DPadDown))
- {
- Camera.move(new Vector2(0f, 1f));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement