/*
 ** 2014 August 01
 **
 ** The author disclaims copyright to this source code.  In place of
 ** a legal notice, here is a blessing:
 **    May you do good and not evil.
 **    May you find forgiveness for yourself and forgive others.
 **    May you share freely, never taking more than you give.
 */
package info.ata4.minecraft.minema.client.modules;

import info.ata4.minecraft.minema.client.config.MinemaConfig;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;

/**
 *
 * @author Nico Bergemann <barracuda415 at yahoo.de>
 */
public class GameSettingsModifier extends ACaptureModule {

	private static final Minecraft MC = Minecraft.getMinecraft();

	private int limitFramerate;
	private boolean pauseOnLostFocus;

	public GameSettingsModifier(final MinemaConfig cfg) {
		super(cfg);
	}

	@Override
	protected void doEnable() throws Exception {
		final GameSettings gs = MC.gameSettings;

		// disable build-in framerate limit
		this.limitFramerate = gs.limitFramerate;
		gs.limitFramerate = Integer.MAX_VALUE;

		// don't pause when losing focus
		this.pauseOnLostFocus = gs.pauseOnLostFocus;
		gs.pauseOnLostFocus = false;

	}

	@Override
	protected void doDisable() throws Exception {
		// restore game settings
		final GameSettings gs = MC.gameSettings;
		gs.limitFramerate = this.limitFramerate;
		gs.pauseOnLostFocus = this.pauseOnLostFocus;
	}

}

@@ -702,30 +702,25 @@
 ate int 
-limitF
+f
 ramerate
 ;%0A%09priva
@@ -711,16 +711,45 @@
 ramerate
+Limit;%0A%09private boolean vSync
 ;%0A%09priva
@@ -997,30 +997,25 @@
 %0A%09%09this.
-limitF
+f
 ramerate
  = gs.li
@@ -1006,16 +1006,21 @@
 ramerate
+Limit
  = gs.li
@@ -1075,16 +1075,93 @@
 VALUE;%0A%0A
+%09%09// disable vSync%0A%09%09this.vSync = gs.enableVsync;%0A%09%09gs.enableVsync = false;%0A%0A
 %09%09// don
@@ -1345,21 +1345,18 @@
 ore 
-game sett
+everyth
 ing
-s
 %0A%09%09f
@@ -1422,30 +1422,25 @@
  = this.
-limitF
+f
 ramerate
 ;%0A%09%09gs.p
@@ -1427,24 +1427,29 @@
 is.framerate
+Limit
 ;%0A%09%09gs.pause
@@ -1485,14 +1485,45 @@
 tFocus;%0A
+%09%09gs.enableVsync = this.vSync;%0A
 %09%7D%0A%0A%7D%0A

Disable new vSync setting while recording