package u;

import com.ld57.game.ddd;

public class Uinput4 {
	// set defaults
	private static int p4left = 29;
	private static int p4right = 32;
	private static int p4up = 51;
	private static int p4down = 47;
	private static int p4aimleft = 21;// left key
	private static int p4aimright = 22;// right key
	private static int p4aimup = 19;// up key
	private static int p4aimdown = 20;// down key
	private static int p4fire = 0;
	private static int p4jump = 62;
	private static int p4inventory = 46;// this is actually reload for this game.
	private static int p4crouch = 59;
	private static int p4sprint = 129;
	private static int p4select = 1;
	private static int p4start = 111;// esc key
	private static String p4JoyLSRight = "cRd4";// button!
	private static String p4JoyLSLeft = "cLd4";// button!
	private static String p4JoyLSUp = "cUd4";// button!
	private static String p4JoyLSDown = "cDd4";// button!
	private static String p4JoyRSRight = "cRd4";// button!
	private static String p4JoyRSLeft = "cLd4";// button!
	private static String p4JoyRSUp = "cUd4";// button!
	private static String p4JoyRSDown = "cDd4";// button!
	private static String p4JoyFire = "bDd4";
	private static String p4JoyJump = "bLd4";
	private static String p4JoyInventory = "bRd4";
	private static String p4JoyCrouch = "bRTd4";
	private static String p4JoySprint = "bLTd4";
	private static String p4JoySelect = "bSeld4";
	private static String p4JoyStart = "bStd4";

	private static String p4masterright = "Right_IsKeyboard_PlayerFour";
	private static String p4masterleft = "Left_IsKeyboard_PlayerFour";
	private static String p4masterup = "Up_IsKeyboard_PlayerFour";
	private static String p4masterdown = "Down_IsKeyboard_PlayerFour";
	private static String p4masteraimright = "Aim_Right_IsKeyboard_PlayerFour";
	private static String p4masteraimleft = "Aim_Left_IsKeyboard_PlayerFour";
	private static String p4masteraimup = "Aim_Up_IsKeyboard_PlayerFour";
	private static String p4masteraimdown = "Aim_Down_IsKeyboard_PlayerFour";
	private static String p4masterfire = "Fire_IsMouse_PlayerFour";
	private static String p4masterjump = "Jump_IsKeyboard_PlayerFour";
	private static String p4masterinventory = "Inventory_IsKeyboard_PlayerFour";
	private static String p4mastercrouch = "Crouch_IsKeyboard_PlayerFour";
	private static String p4mastersprint = "Sprint_IsKeyboard_PlayerFour";
	private static String p4masterselect = "Select_IsKeyboard_PlayerFour";
	private static String p4masterstart = "Start_IsKeyboard_PlayerFour";

	public Uinput4() {

	}
	/*
	 * 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("IsFirstTimeRunningGame4");// 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("IsFirstTimeRunningGame4", true);// remember this has to be backwards to work.^^
			ddd.GameSettings.putInteger("p4_left_key", 29);// a = 29
			ddd.GameSettings.putInteger("p4_right_key", 32);// d = 32
			ddd.GameSettings.putInteger("p4_up_key", 51);// w = 51
			ddd.GameSettings.putInteger("p4_down_key", 47);// s = 47
			ddd.GameSettings.putInteger("p4_aim_left_key", 21);// left = 21
			ddd.GameSettings.putInteger("p4_aim_right_key", 22);// right = 22
			ddd.GameSettings.putInteger("p4_aim_up_key", 19);// up = 19
			ddd.GameSettings.putInteger("p4_aim_down_key", 20);// down = 20
			ddd.GameSettings.putInteger("p4_fire_key", 0);// left_mouse_button = 0
			ddd.GameSettings.putInteger("p4_cancel_key", 1);// right_mouse_button = 1
			ddd.GameSettings.putInteger("p4_jump_key", 62);// space = 62
			ddd.GameSettings.putInteger("p4_inventory_key", 46);// i = 37 (46 is R for reload in this game)
			ddd.GameSettings.putInteger("p4_crouch_key", 59);// = left_shift = 59
			ddd.GameSettings.putInteger("p4_sprint_key", 129);// = left_control = 129
			ddd.GameSettings.putInteger("p4_start_key", 111);// = esc = 111
			ddd.GameSettings.putString("p4masterright", "Right_IsKeyboard_PlayerFour");// pause player master map (direction, controllerType, player)
			ddd.GameSettings.putString("p4masterleft", "Left_IsKeyboard_PlayerFour");// default everything to keyboard...? lolz
			ddd.GameSettings.putString("p4masterup", "Up_IsKeyboard_PlayerFour");
			ddd.GameSettings.putString("p4masterdown", "Down_IsKeyboard_PlayerFour");
			ddd.GameSettings.putString("p4masteraimright", "Aim_Right_IsKeyboard_PlayerFour");// aim keys...
			ddd.GameSettings.putString("p4masteraimleft", "Aim_Left_IsKeyboard_PlayerFour");
			ddd.GameSettings.putString("p4masteraimup", "Aim_Up_IsKeyboard_PlayerFour");
			ddd.GameSettings.putString("p4masteraimdown", "Aim_Down_IsKeyboard_PlayerFour");
			ddd.GameSettings.putString("p4masterfire", "Fire_IsMouse_PlayerFour");
			ddd.GameSettings.putString("p4masterjump", "Jump_IsKeyboard_PlayerFour");
			ddd.GameSettings.putString("p4masterinventory", "Inventory_IsKeyboard_PlayerFour");
			ddd.GameSettings.putString("p4mastercrouch", "Crouch_IsKeyboard_PlayerFour");
			ddd.GameSettings.putString("p4mastersprint", "Sprint_IsKeyboard_PlayerFour");
			ddd.GameSettings.putString("p4masterselect", "Select_IsKeyboard_PlayerFour");
			ddd.GameSettings.putString("p4masterstart", "Start_IsKeyboard_PlayerFour");
			ddd.GameSettings.putString("p4_aim_right_button", "RScRd4");// buttons!
			ddd.GameSettings.putString("p4_aim_left_button", "RScLd4");// buttons!
			ddd.GameSettings.putString("p4_aim_up_button", "RScUd4");// buttons!
			ddd.GameSettings.putString("p4_aim_down_button", "RScDd4");// buttons!
			ddd.GameSettings.putString("p4_right_button", "bRd4");// buttons!
			ddd.GameSettings.putString("p4_left_button", "bLd4");// buttons!
			ddd.GameSettings.putString("p4_up_button", "bUd4");// buttons!
			ddd.GameSettings.putString("p4_down_button", "bsDd4");// buttons!
			ddd.GameSettings.putString("p4_fire_button", "bDd4");// buttons!
			ddd.GameSettings.putString("p4_jump_button", "bLd4");// buttons!
			ddd.GameSettings.putString("p4_inventory_button", "bRd4");// buttons!
			ddd.GameSettings.putString("p4_crouch_button", "bRTd4");// buttons!
			ddd.GameSettings.putString("p4_sprint_button", "bLTd4");// buttons!
			ddd.GameSettings.putString("p4_select_button", "bSeld4");// buttons!
			ddd.GameSettings.putString("p4_start_button", "bStd4");// buttons!
			ddd.GameSettings.flush();
		} else {// if not, load the defaults?... uhhhh it works. "PASSED" lol
			p4left = ddd.GameSettings.getInteger("p4_left_key");
			p4right = ddd.GameSettings.getInteger("p4_right_key");// d = 32
			p4up = ddd.GameSettings.getInteger("p4_up_key");// w = 51
			p4down = ddd.GameSettings.getInteger("p4_down_key");// s = 47
			p4aimleft = ddd.GameSettings.getInteger("p4_aim_left_key");
			p4aimright = ddd.GameSettings.getInteger("p4_aim_right_key");// d = 32
			p4aimup = ddd.GameSettings.getInteger("p4_aim_up_key");// w = 51
			p4aimdown = ddd.GameSettings.getInteger("p4_aim_down_key");// s = 47
			p4fire = ddd.GameSettings.getInteger("p4_fire_key");// left_mouse_button = 0
			p4select = ddd.GameSettings.getInteger("p4_select_key");// right_mouse_button = 1
			p4jump = ddd.GameSettings.getInteger("p4_jump_key");// space = 62
			p4inventory = ddd.GameSettings.getInteger("p4_inventory_key");// i = 37 I switched this to R for reload for this game.
			p4crouch = ddd.GameSettings.getInteger("p4_crouch_key");// = left_shift = 59
			p4sprint = ddd.GameSettings.getInteger("p4_sprint_key");// = left_control = 129
			p4start = ddd.GameSettings.getInteger("p4_start_key");// = esc = 111
			p4JoyLSRight = ddd.GameSettings.getString("p4_right_button");
			p4JoyLSLeft = ddd.GameSettings.getString("p4_left_button");
			p4JoyLSUp = ddd.GameSettings.getString("p4_up_button");
			p4JoyLSDown = ddd.GameSettings.getString("p4_down_button");
			p4JoyRSRight = ddd.GameSettings.getString("p4_aim_right_button");
			p4JoyRSLeft = ddd.GameSettings.getString("p4_aim_left_button");
			p4JoyRSUp = ddd.GameSettings.getString("p4_aim_up_button");
			p4JoyRSDown = ddd.GameSettings.getString("p4_aim_down_button");
			p4JoyFire = ddd.GameSettings.getString("p4_fire_button");
			p4JoySelect = ddd.GameSettings.getString("p4_select_button");
			p4JoyJump = ddd.GameSettings.getString("p4_jump_button");
			p4JoyInventory = ddd.GameSettings.getString("p4_inventory_button");
			p4JoyCrouch = ddd.GameSettings.getString("p4_crouch_button");
			p4JoySprint = ddd.GameSettings.getString("p4_sprint_button");
			p4JoyStart = ddd.GameSettings.getString("p4_start_button");
			p4masterright = ddd.GameSettings.getString("p4masterright");
			p4masterleft = ddd.GameSettings.getString("p4masterleft");
			p4masterup = ddd.GameSettings.getString("p4masterup");
			p4masterdown = ddd.GameSettings.getString("p4masterdown");
			p4masteraimright = ddd.GameSettings.getString("p4masteraimright");
			p4masteraimleft = ddd.GameSettings.getString("p4masteraimleft");
			p4masteraimup = ddd.GameSettings.getString("p4masteraimup");
			p4masteraimdown = ddd.GameSettings.getString("p4masteraimdown");
			p4masterfire = ddd.GameSettings.getString("p4masterfire");
			p4masterjump = ddd.GameSettings.getString("p4masterjump");
			p4masterinventory = ddd.GameSettings.getString("p4masterinventory");
			p4mastercrouch = ddd.GameSettings.getString("p4mastercrouch");
			p4mastersprint = ddd.GameSettings.getString("p4mastersprint");
			p4masterselect = ddd.GameSettings.getString("p4masterselect");
			p4masterstart = ddd.GameSettings.getString("p4masterstart");
		}

	}

	public static int P4AimLeft() {
		return p4aimleft;
	}

	public static int P4AimRight() {
		return p4aimright;
	}

	public static int P4AimUp() {
		return p4aimup;
	}

	public static int P4AimDown() {
		return p4aimdown;
	}

	public static int P4Left() {
		return p4left;
	}

	public static int P4Right() {
		return p4right;
	}

	public static int P4Up() {
		return p4up;
	}

	public static int P4Down() {
		return p4down;
	}

	public static int P4Fire() {
		return p4fire;
	}

	public static int P4Select() {
		return p4select;
	}

	public static int P4Jump() {
		return p4jump;
	}

	public static int P4Inventory() {
		return p4inventory;
	}

	public static int P4Crouch() {
		return p4crouch;
	}

	public static int P4Sprint() {
		return p4sprint;
	}

	public static int P4Start() {
		return p4start;
	}

	public static String P4MasterRight() {
		return p4masterright;
	}

	public static String P4MasterLeft() {
		return p4masterleft;
	}

	public static String P4MasterUp() {
		return p4masterup;
	}

	public static String P4MasterDown() {
		return p4masterdown;
	}

	public static String P4MasterAimRight() {
		return p4masteraimright;
	}

	public static String P4MasterAimLeft() {
		return p4masteraimleft;
	}

	public static String P4MasterAimUp() {
		return p4masteraimup;
	}

	public static String P4MasterAimDown() {
		return p4masteraimdown;
	}

	public static String P4MasterFire() {
		return p4masterfire;
	}

	public static String P4MasterJump() {
		return p4masterjump;
	}

	public static String P4MasterInventory() {
		return p4masterinventory;
	}

	public static String P4MasterSprint() {
		return p4mastersprint;
	}

	public static String P4MasterCrouch() {
		return p4mastercrouch;
	}

	public static String P4MasterSelect() {
		return p4masterselect;
	}

	public static String P4MasterStart() {
		return p4masterstart;
	}

	public static String P4JoyLSRight() {
		return p4JoyLSRight;
	}

	public static String P4JoyLSLeft() {
		return p4JoyLSLeft;
	}

	public static String P4JoyLSUp() {
		return p4JoyLSUp;
	}

	public static String P4JoyLSDown() {
		return p4JoyLSDown;
	}

	public static String P4JoyRSRight() {
		return p4JoyRSRight;
	}

	public static String P4JoyRSLeft() {
		return p4JoyRSLeft;
	}

	public static String P4JoyRSUp() {
		return p4JoyRSUp;
	}

	public static String P4JoyRSDown() {
		return p4JoyRSDown;
	}

	public static String P4JoyFire() {
		return p4JoyFire;
	}

	public static String P4JoyJump() {
		return p4JoyJump;
	}

	public static String P4JoyInventory() {
		return p4JoyInventory;
	}

	public static String P4JoyCrouch() {
		return p4JoyCrouch;
	}

	public static String P4JoySprint() {
		return p4JoySprint;
	}

	public static String P4JoySelect() {
		return p4JoySelect;
	}

	public static String P4JoyStart() {
		return p4JoyStart;
	}
}
