package u;

import com.ld57.game.ddd;

public class Uinput {
	// set defaults
	private static int left = 29;
	private static int right = 32;
	private static int up = 51;
	private static int down = 47;
	private static int fire = 0;
	private static int jump = 62;
	private static int inventory = 46;// this is actually reload for this game.
	private static int crouch = 59;
	private static int sprint = 129;
	private static int select = 1;
	private static int start = 111;// esc
	private static int ppleft = 29;
	private static int ppright = 32;
	private static int ppup = 51;
	private static int ppdown = 47;
	private static int ppaimleft = 21;// left key
	private static int ppaimright = 22;// right key
	private static int ppaimup = 19;// up key
	private static int ppaimdown = 20;// down key
	private static int ppfire = 0;
	private static int ppjump = 62;
	private static int ppinventory = 46;// this is actually reload for this game.
	private static int ppcrouch = 59;
	private static int ppsprint = 129;
	private static int ppselect = 1;
	private static int ppstart = 111;// esc key
	private static String ppJoyLSRight = "cRd2";// button!
	private static String ppJoyLSLeft = "cLd2";// button!
	private static String ppJoyLSUp = "cUd2";// button!
	private static String ppJoyLSDown = "cDd2";// button!
	private static String ppJoyRSRight = "cRd2";// button!
	private static String ppJoyRSLeft = "cLd2";// button!
	private static String ppJoyRSUp = "cUd2";// button!
	private static String ppJoyRSDown = "cDd2";// button!
	private static String ppJoyFire = "bDd2";
	private static String ppJoyJump = "bLd2";
	private static String ppJoyInventory = "bRd2";
	private static String ppJoyCrouch = "bRTd2";
	private static String ppJoySprint = "bLTd2";
	private static String ppJoySelect = "bSeld2";
	private static String ppJoyStart = "bStd2";

	private static String ppmasterright = "Right_IsKeyboard_PausePlayer";
	private static String ppmasterleft = "Left_IsKeyboard_PausePlayer";
	private static String ppmasterup = "Up_IsKeyboard_PausePlayer";
	private static String ppmasterdown = "Down_IsKeyboard_PausePlayer";
	private static String ppmasteraimright = "Aim_Right_IsKeyboard_PausePlayer";
	private static String ppmasteraimleft = "Aim_Left_IsKeyboard_PausePlayer";
	private static String ppmasteraimup = "Aim_Up_IsKeyboard_PausePlayer";
	private static String ppmasteraimdown = "Aim_Down_IsKeyboard_PausePlayer";
	private static String ppmasterfire = "Fire_IsMouse_PausePlayer";
	private static String ppmasterjump = "Jump_IsKeyboard_PausePlayer";
	private static String ppmasterinventory = "Inventory_IsKeyboard_PausePlayer";
	private static String ppmastercrouch = "Crouch_IsKeyboard_PausePlayer";
	private static String ppmastersprint = "Sprint_IsKeyboard_PausePlayer";
	private static String ppmasterselect = "Select_IsKeyboard_PausePlayer";
	private static String ppmasterstart = "Start_IsKeyboard_PausePlayer";

	public Uinput() {

	}
	/*
	 * does this class need to be changed to add in controller support? I'd think so. hmmm. It just needs to be able to remember the last
	 * controller used, the buttons that were mapped, etc. Each one, i hope, can hold settings. That's all this should do.
	 */

	public static void LoadDefaultInputs() {
		boolean first = ddd.GameSettings.getBoolean("IsFirstTimeRunningGame");// this is going to be backwards because it defaults to false.
		// System.out.println("first: " + first);
		if (!first) {// if the first time the game is running, set all the defaults
			ddd.GameSettings.putBoolean("IsFirstTimeRunningGame", true);// remember this has to be backwards to work.^^
			ddd.GameSettings.putInteger("pp_left_key", 29);// a = 29
			ddd.GameSettings.putInteger("pp_right_key", 32);// d = 32
			ddd.GameSettings.putInteger("pp_up_key", 51);// w = 51
			ddd.GameSettings.putInteger("pp_down_key", 47);// s = 47
			ddd.GameSettings.putInteger("pp_aim_left_key", 21);// left = 21
			ddd.GameSettings.putInteger("pp_aim_right_key", 22);// right = 22
			ddd.GameSettings.putInteger("pp_aim_up_key", 19);// up = 19
			ddd.GameSettings.putInteger("pp_aim_down_key", 20);// down = 20
			ddd.GameSettings.putInteger("pp_fire_key", 0);// left_mouse_button = 0
			ddd.GameSettings.putInteger("pp_cancel_key", 1);// right_mouse_button = 1
			ddd.GameSettings.putInteger("pp_jump_key", 62);// space = 62
			ddd.GameSettings.putInteger("pp_inventory_key", 46);// i = 37 (46 is R for reload in this game)
			ddd.GameSettings.putInteger("pp_crouch_key", 59);// = left_shift = 59
			ddd.GameSettings.putInteger("pp_sprint_key", 129);// = left_control = 129
			ddd.GameSettings.putInteger("pp_start_key", 111);// = esc = 111
			ddd.GameSettings.putInteger("playerOneController", 0);// for now player one is 0. I probably wont use this. :/
			ddd.GameSettings.putString("ppmasterright", "Right_IsKeyboard_PausePlayer");// pause player master map (direction, controllerType, player)
			ddd.GameSettings.putString("ppmasterleft", "Left_IsKeyboard_PausePlayer");// default everything to keyboard...? lolz
			ddd.GameSettings.putString("ppmasterup", "Up_IsKeyboard_PausePlayer");
			ddd.GameSettings.putString("ppmasterdown", "Down_IsKeyboard_PausePlayer");
			ddd.GameSettings.putString("ppmasteraimright", "Aim_Right_IsKeyboard_PausePlayer");// aim keys...
			ddd.GameSettings.putString("ppmasteraimleft", "Aim_Left_IsKeyboard_PausePlayer");
			ddd.GameSettings.putString("ppmasteraimup", "Aim_Up_IsKeyboard_PausePlayer");
			ddd.GameSettings.putString("ppmasteraimdown", "Aim_Down_IsKeyboard_PausePlayer");
			ddd.GameSettings.putString("ppmasterfire", "Fire_IsMouse_PausePlayer");
			ddd.GameSettings.putString("ppmasterjump", "Jump_IsKeyboard_PausePlayer");
			ddd.GameSettings.putString("ppmasterinventory", "Inventory_IsKeyboard_PausePlayer");
			ddd.GameSettings.putString("ppmastercrouch", "Crouch_IsKeyboard_PausePlayer");
			ddd.GameSettings.putString("ppmastersprint", "Sprint_IsKeyboard_PausePlayer");
			ddd.GameSettings.putString("ppmasterselect", "Select_IsKeyboard_PausePlayer");
			ddd.GameSettings.putString("ppmasterstart", "Start_IsKeyboard_PausePlayer");
			ddd.GameSettings.putString("pp_aim_right_button", "RScRd");// buttons!
			ddd.GameSettings.putString("pp_aim_left_button", "RScLd");// buttons!
			ddd.GameSettings.putString("pp_aim_up_button", "RScUd");// buttons!
			ddd.GameSettings.putString("pp_aim_down_button", "RScDd");// buttons!
			ddd.GameSettings.putString("pp_right_button", "bRd");// buttons!
			ddd.GameSettings.putString("pp_left_button", "bLd");// buttons!
			ddd.GameSettings.putString("pp_up_button", "bUd");// buttons!
			ddd.GameSettings.putString("pp_down_button", "bsDd");// buttons!
			ddd.GameSettings.putString("pp_fire_button", "bDd");// buttons!
			ddd.GameSettings.putString("pp_jump_button", "bLd");// buttons!
			ddd.GameSettings.putString("pp_inventory_button", "bRd");// buttons!
			ddd.GameSettings.putString("pp_crouch_button", "bRTd");// buttons!
			ddd.GameSettings.putString("pp_sprint_button", "bLTd");// buttons!
			ddd.GameSettings.putString("pp_select_button", "bSeld");// buttons!
			ddd.GameSettings.putString("pp_start_button", "bStd");// buttons!
			ddd.GameSettings.flush();
		} else {// if not, load the defaults?... uhhhh it works. "PASSED" lol
			left = ddd.GameSettings.getInteger("pp_left_key");
			right = ddd.GameSettings.getInteger("pp_right_key");// d = 32
			up = ddd.GameSettings.getInteger("pp_up_key");// w = 51
			down = ddd.GameSettings.getInteger("pp_down_key");// s = 47
			fire = ddd.GameSettings.getInteger("pp_fire_key");// left_mouse_button = 0
			select = ddd.GameSettings.getInteger("pp_select_key");// right_mouse_button = 1
			jump = ddd.GameSettings.getInteger("pp_jump_key");// space = 62
			inventory = ddd.GameSettings.getInteger("pp_inventory_key");// i = 37 I switched this to R for reload for this game.
			crouch = ddd.GameSettings.getInteger("pp_crouch_key");// = left_shift = 59
			sprint = ddd.GameSettings.getInteger("pp_sprint_key");// = left_control = 129
			start = ddd.GameSettings.getInteger("pp_start_key");// = esc = 111
			ppleft = ddd.GameSettings.getInteger("pp_left_key");
			ppright = ddd.GameSettings.getInteger("pp_right_key");// d = 32
			ppup = ddd.GameSettings.getInteger("pp_up_key");// w = 51
			ppdown = ddd.GameSettings.getInteger("pp_down_key");// s = 47
			ppaimleft = ddd.GameSettings.getInteger("pp_aim_left_key");
			ppaimright = ddd.GameSettings.getInteger("pp_aim_right_key");// d = 32
			ppaimup = ddd.GameSettings.getInteger("pp_aim_up_key");// w = 51
			ppaimdown = ddd.GameSettings.getInteger("pp_aim_down_key");// s = 47
			ppfire = ddd.GameSettings.getInteger("pp_fire_key");// left_mouse_button = 0
			ppselect = ddd.GameSettings.getInteger("pp_select_key");// right_mouse_button = 1
			ppjump = ddd.GameSettings.getInteger("pp_jump_key");// space = 62
			ppinventory = ddd.GameSettings.getInteger("pp_inventory_key");// i = 37 I switched this to R for reload for this game.
			ppcrouch = ddd.GameSettings.getInteger("pp_crouch_key");// = left_shift = 59
			ppsprint = ddd.GameSettings.getInteger("pp_sprint_key");// = left_control = 129
			ppstart = ddd.GameSettings.getInteger("pp_start_key");// = esc = 111
			ppJoyLSRight = ddd.GameSettings.getString("pp_right_button");
			ppJoyLSLeft = ddd.GameSettings.getString("pp_left_button");
			ppJoyLSUp = ddd.GameSettings.getString("pp_up_button");
			ppJoyLSDown = ddd.GameSettings.getString("pp_down_button");
			ppJoyRSRight = ddd.GameSettings.getString("pp_aim_right_button");
			ppJoyRSLeft = ddd.GameSettings.getString("pp_aim_left_button");
			ppJoyRSUp = ddd.GameSettings.getString("pp_aim_up_button");
			ppJoyRSDown = ddd.GameSettings.getString("pp_aim_down_button");
			ppJoyFire = ddd.GameSettings.getString("pp_fire_button");
			ppJoySelect = ddd.GameSettings.getString("pp_select_button");
			ppJoyJump = ddd.GameSettings.getString("pp_jump_button");
			ppJoyInventory = ddd.GameSettings.getString("pp_inventory_button");
			ppJoyCrouch = ddd.GameSettings.getString("pp_crouch_button");
			ppJoySprint = ddd.GameSettings.getString("pp_sprint_button");
			ppJoyStart = ddd.GameSettings.getString("pp_start_button");
			ppmasterright = ddd.GameSettings.getString("ppmasterright");
			ppmasterleft = ddd.GameSettings.getString("ppmasterleft");
			ppmasterup = ddd.GameSettings.getString("ppmasterup");
			ppmasterdown = ddd.GameSettings.getString("ppmasterdown");
			ppmasteraimright = ddd.GameSettings.getString("ppmasteraimright");
			ppmasteraimleft = ddd.GameSettings.getString("ppmasteraimleft");
			ppmasteraimup = ddd.GameSettings.getString("ppmasteraimup");
			ppmasteraimdown = ddd.GameSettings.getString("ppmasteraimdown");
			ppmasterfire = ddd.GameSettings.getString("ppmasterfire");
			ppmasterjump = ddd.GameSettings.getString("ppmasterjump");
			ppmasterinventory = ddd.GameSettings.getString("ppmasterinventory");
			ppmastercrouch = ddd.GameSettings.getString("ppmastercrouch");
			ppmastersprint = ddd.GameSettings.getString("ppmastersprint");
			ppmasterselect = ddd.GameSettings.getString("ppmasterselect");
			ppmasterstart = ddd.GameSettings.getString("ppmasterstart");
		}

	}

	public static int Left() {
		return left;
	}

	public static int Right() {
		return right;
	}

	public static int Up() {
		return up;
	}

	public static int Down() {
		return down;
	}

	public static int Fire() {
		return fire;
	}

	public static int Select() {
		return select;
	}

	public static int Jump() {
		return jump;
	}

	public static int Inventory() {
		return inventory;
	}

	public static int Crouch() {
		return crouch;
	}

	public static int Sprint() {
		return sprint;
	}

	public static int Start() {
		return start;
	}

	public static int PPAimLeft() {
		return ppaimleft;
	}

	public static int PPAimRight() {
		return ppaimright;
	}

	public static int PPAimUp() {
		return ppaimup;
	}

	public static int PPAimDown() {
		return ppaimdown;
	}

	public static int PPLeft() {
		return ppleft;
	}

	public static int PPRight() {
		return ppright;
	}

	public static int PPUp() {
		return ppup;
	}

	public static int PPDown() {
		return ppdown;
	}

	public static int PPFire() {
		return ppfire;
	}

	public static int PPSelect() {
		return ppselect;
	}

	public static int PPJump() {
		return ppjump;
	}

	public static int PPInventory() {
		return ppinventory;
	}

	public static int PPCrouch() {
		return ppcrouch;
	}

	public static int PPSprint() {
		return ppsprint;
	}

	public static int PPStart() {
		return ppstart;
	}

	public static String PPMasterRight() {
		return ppmasterright;
	}

	public static String PPMasterLeft() {
		return ppmasterleft;
	}

	public static String PPMasterUp() {
		return ppmasterup;
	}

	public static String PPMasterDown() {
		return ppmasterdown;
	}

	public static String PPMasterAimRight() {
		return ppmasteraimright;
	}

	public static String PPMasterAimLeft() {
		return ppmasteraimleft;
	}

	public static String PPMasterAimUp() {
		return ppmasteraimup;
	}

	public static String PPMasterAimDown() {
		return ppmasteraimdown;
	}

	public static String PPMasterFire() {
		return ppmasterfire;
	}

	public static String PPMasterJump() {
		return ppmasterjump;
	}

	public static String PPMasterInventory() {
		return ppmasterinventory;
	}

	public static String PPMasterSprint() {
		return ppmastersprint;
	}

	public static String PPMasterCrouch() {
		return ppmastercrouch;
	}

	public static String PPMasterSelect() {
		return ppmasterselect;
	}

	public static String PPMasterStart() {
		return ppmasterstart;
	}

	public static String PPJoyLSRight() {
		return ppJoyLSRight;
	}

	public static String PPJoyLSLeft() {
		return ppJoyLSLeft;
	}

	public static String PPJoyLSUp() {
		return ppJoyLSUp;
	}

	public static String PPJoyLSDown() {
		return ppJoyLSDown;
	}

	public static String PPJoyRSRight() {
		return ppJoyRSRight;
	}

	public static String PPJoyRSLeft() {
		return ppJoyRSLeft;
	}

	public static String PPJoyRSUp() {
		return ppJoyRSUp;
	}

	public static String PPJoyRSDown() {
		return ppJoyRSDown;
	}

	public static String PPJoyFire() {
		return ppJoyFire;
	}

	public static String PPJoyJump() {
		return ppJoyJump;
	}

	public static String PPJoyInventory() {
		return ppJoyInventory;
	}

	public static String PPJoyCrouch() {
		return ppJoyCrouch;
	}

	public static String PPJoySprint() {
		return ppJoySprint;
	}

	public static String PPJoySelect() {
		return ppJoySelect;
	}

	public static String PPJoyStart() {
		return ppJoyStart;
	}
}
