package u;

import com.ld57.game.ddd;

public class Uinput2 {
	// set defaults
	private static int p2left = 29;
	private static int p2right = 32;
	private static int p2up = 51;
	private static int p2down = 47;
	private static int p2aimleft = 21;// left key
	private static int p2aimright = 22;// right key
	private static int p2aimup = 19;// up key
	private static int p2aimdown = 20;// down key
	private static int p2fire = 0;
	private static int p2jump = 62;
	private static int p2inventory = 46;// this is actually reload for this game.
	private static int p2crouch = 59;
	private static int p2sprint = 129;
	private static int p2select = 1;
	private static int p2start = 111;// esc key
	private static String p2JoyLSRight = "cRd2";// button!
	private static String p2JoyLSLeft = "cLd2";// button!
	private static String p2JoyLSUp = "cUd2";// button!
	private static String p2JoyLSDown = "cDd2";// button!
	private static String p2JoyRSRight = "cRd2";// button!
	private static String p2JoyRSLeft = "cLd2";// button!
	private static String p2JoyRSUp = "cUd2";// button!
	private static String p2JoyRSDown = "cDd2";// button!
	private static String p2JoyFire = "bDd2";
	private static String p2JoyJump = "bLd2";
	private static String p2JoyInventory = "bRd2";
	private static String p2JoyCrouch = "bRTd2";
	private static String p2JoySprint = "bLTd2";
	private static String p2JoySelect = "bSeld2";
	private static String p2JoyStart = "bStd2";

	private static String p2masterright = "Right_IsKeyboard_PlayerTwo";
	private static String p2masterleft = "Left_IsKeyboard_PlayerTwo";
	private static String p2masterup = "Up_IsKeyboard_PlayerTwo";
	private static String p2masterdown = "Down_IsKeyboard_PlayerTwo";
	private static String p2masteraimright = "Aim_Right_IsKeyboard_PlayerTwo";
	private static String p2masteraimleft = "Aim_Left_IsKeyboard_PlayerTwo";
	private static String p2masteraimup = "Aim_Up_IsKeyboard_PlayerTwo";
	private static String p2masteraimdown = "Aim_Down_IsKeyboard_PlayerTwo";
	private static String p2masterfire = "Fire_IsMouse_PlayerTwo";
	private static String p2masterjump = "Jump_IsKeyboard_PlayerTwo";
	private static String p2masterinventory = "Inventory_IsKeyboard_PlayerTwo";
	private static String p2mastercrouch = "Crouch_IsKeyboard_PlayerTwo";
	private static String p2mastersprint = "Sprint_IsKeyboard_PlayerTwo";
	private static String p2masterselect = "Select_IsKeyboard_PlayerTwo";
	private static String p2masterstart = "Start_IsKeyboard_PlayerTwo";

	public Uinput2() {

	}
	/*
	 * 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("IsFirstTimeRunningGame2");// 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("IsFirstTimeRunningGame2", true);// remember this has to be backwards to work.^^
			ddd.GameSettings.putInteger("p2_left_key", 29);// a = 29
			ddd.GameSettings.putInteger("p2_right_key", 32);// d = 32
			ddd.GameSettings.putInteger("p2_up_key", 51);// w = 51
			ddd.GameSettings.putInteger("p2_down_key", 47);// s = 47
			ddd.GameSettings.putInteger("p2_aim_left_key", 21);// left = 21
			ddd.GameSettings.putInteger("p2_aim_right_key", 22);// right = 22
			ddd.GameSettings.putInteger("p2_aim_up_key", 19);// up = 19
			ddd.GameSettings.putInteger("p2_aim_down_key", 20);// down = 20
			ddd.GameSettings.putInteger("p2_fire_key", 0);// left_mouse_button = 0
			ddd.GameSettings.putInteger("p2_cancel_key", 1);// right_mouse_button = 1
			ddd.GameSettings.putInteger("p2_jump_key", 62);// space = 62
			ddd.GameSettings.putInteger("p2_inventory_key", 46);// i = 37 (46 is R for reload in this game)
			ddd.GameSettings.putInteger("p2_crouch_key", 59);// = left_shift = 59
			ddd.GameSettings.putInteger("p2_sprint_key", 129);// = left_control = 129
			ddd.GameSettings.putInteger("p2_start_key", 111);// = esc = 111
			ddd.GameSettings.putString("p2masterright", "Right_IsKeyboard_PlayerTwo");// pause player master map (direction, controllerType, player)
			ddd.GameSettings.putString("p2masterleft", "Left_IsKeyboard_PlayerTwo");// default everything to keyboard...? lolz
			ddd.GameSettings.putString("p2masterup", "Up_IsKeyboard_PlayerTwo");
			ddd.GameSettings.putString("p2masterdown", "Down_IsKeyboard_PlayerTwo");
			ddd.GameSettings.putString("p2masteraimright", "Aim_Right_IsKeyboard_PlayerTwo");// aim keys...
			ddd.GameSettings.putString("p2masteraimleft", "Aim_Left_IsKeyboard_PlayerTwo");
			ddd.GameSettings.putString("p2masteraimup", "Aim_Up_IsKeyboard_PlayerTwo");
			ddd.GameSettings.putString("p2masteraimdown", "Aim_Down_IsKeyboard_PlayerTwo");
			ddd.GameSettings.putString("p2masterfire", "Fire_IsMouse_PlayerTwo");
			ddd.GameSettings.putString("p2masterjump", "Jump_IsKeyboard_PlayerTwo");
			ddd.GameSettings.putString("p2masterinventory", "Inventory_IsKeyboard_PlayerTwo");
			ddd.GameSettings.putString("p2mastercrouch", "Crouch_IsKeyboard_PlayerTwo");
			ddd.GameSettings.putString("p2mastersprint", "Sprint_IsKeyboard_PlayerTwo");
			ddd.GameSettings.putString("p2masterselect", "Select_IsKeyboard_PlayerTwo");
			ddd.GameSettings.putString("p2masterstart", "Start_IsKeyboard_PlayerTwo");
			ddd.GameSettings.putString("p2_aim_right_button", "RScRd2");// buttons!
			ddd.GameSettings.putString("p2_aim_left_button", "RScLd2");// buttons!
			ddd.GameSettings.putString("p2_aim_up_button", "RScUd2");// buttons!
			ddd.GameSettings.putString("p2_aim_down_button", "RScDd2");// buttons!
			ddd.GameSettings.putString("p2_right_button", "bRd2");// buttons!
			ddd.GameSettings.putString("p2_left_button", "bLd2");// buttons!
			ddd.GameSettings.putString("p2_up_button", "bUd2");// buttons!
			ddd.GameSettings.putString("p2_down_button", "bsDd2");// buttons!
			ddd.GameSettings.putString("p2_fire_button", "bDd2");// buttons!
			ddd.GameSettings.putString("p2_jump_button", "bLd2");// buttons!
			ddd.GameSettings.putString("p2_inventory_button", "bRd2");// buttons!
			ddd.GameSettings.putString("p2_crouch_button", "bRTd2");// buttons!
			ddd.GameSettings.putString("p2_sprint_button", "bLTd2");// buttons!
			ddd.GameSettings.putString("p2_select_button", "bSeld2");// buttons!
			ddd.GameSettings.putString("p2_start_button", "bStd2");// buttons!
			ddd.GameSettings.flush();
		} else {// if not, load the defaults?... uhhhh it works. "PASSED" lol
			p2left = ddd.GameSettings.getInteger("p2_left_key");
			p2right = ddd.GameSettings.getInteger("p2_right_key");// d = 32
			p2up = ddd.GameSettings.getInteger("p2_up_key");// w = 51
			p2down = ddd.GameSettings.getInteger("p2_down_key");// s = 47
			p2aimleft = ddd.GameSettings.getInteger("p2_aim_left_key");
			p2aimright = ddd.GameSettings.getInteger("p2_aim_right_key");// d = 32
			p2aimup = ddd.GameSettings.getInteger("p2_aim_up_key");// w = 51
			p2aimdown = ddd.GameSettings.getInteger("p2_aim_down_key");// s = 47
			p2fire = ddd.GameSettings.getInteger("p2_fire_key");// left_mouse_button = 0
			p2select = ddd.GameSettings.getInteger("p2_select_key");// right_mouse_button = 1
			p2jump = ddd.GameSettings.getInteger("p2_jump_key");// space = 62
			p2inventory = ddd.GameSettings.getInteger("p2_inventory_key");// i = 37 I switched this to R for reload for this game.
			p2crouch = ddd.GameSettings.getInteger("p2_crouch_key");// = left_shift = 59
			p2sprint = ddd.GameSettings.getInteger("p2_sprint_key");// = left_control = 129
			p2start = ddd.GameSettings.getInteger("p2_start_key");// = esc = 111
			p2JoyLSRight = ddd.GameSettings.getString("p2_right_button");
			p2JoyLSLeft = ddd.GameSettings.getString("p2_left_button");
			p2JoyLSUp = ddd.GameSettings.getString("p2_up_button");
			p2JoyLSDown = ddd.GameSettings.getString("p2_down_button");
			p2JoyRSRight = ddd.GameSettings.getString("p2_aim_right_button");
			p2JoyRSLeft = ddd.GameSettings.getString("p2_aim_left_button");
			p2JoyRSUp = ddd.GameSettings.getString("p2_aim_up_button");
			p2JoyRSDown = ddd.GameSettings.getString("p2_aim_down_button");
			p2JoyFire = ddd.GameSettings.getString("p2_fire_button");
			p2JoySelect = ddd.GameSettings.getString("p2_select_button");
			p2JoyJump = ddd.GameSettings.getString("p2_jump_button");
			p2JoyInventory = ddd.GameSettings.getString("p2_inventory_button");
			p2JoyCrouch = ddd.GameSettings.getString("p2_crouch_button");
			p2JoySprint = ddd.GameSettings.getString("p2_sprint_button");
			p2JoyStart = ddd.GameSettings.getString("p2_start_button");
			p2masterright = ddd.GameSettings.getString("p2masterright");
			p2masterleft = ddd.GameSettings.getString("p2masterleft");
			p2masterup = ddd.GameSettings.getString("p2masterup");
			p2masterdown = ddd.GameSettings.getString("p2masterdown");
			p2masteraimright = ddd.GameSettings.getString("p2masteraimright");
			p2masteraimleft = ddd.GameSettings.getString("p2masteraimleft");
			p2masteraimup = ddd.GameSettings.getString("p2masteraimup");
			p2masteraimdown = ddd.GameSettings.getString("p2masteraimdown");
			p2masterfire = ddd.GameSettings.getString("p2masterfire");
			p2masterjump = ddd.GameSettings.getString("p2masterjump");
			p2masterinventory = ddd.GameSettings.getString("p2masterinventory");
			p2mastercrouch = ddd.GameSettings.getString("p2mastercrouch");
			p2mastersprint = ddd.GameSettings.getString("p2mastersprint");
			p2masterselect = ddd.GameSettings.getString("p2masterselect");
			p2masterstart = ddd.GameSettings.getString("p2masterstart");
		}

	}

	public static int P2AimLeft() {
		return p2aimleft;
	}

	public static int P2AimRight() {
		return p2aimright;
	}

	public static int P2AimUp() {
		return p2aimup;
	}

	public static int P2AimDown() {
		return p2aimdown;
	}

	public static int P2Left() {
		return p2left;
	}

	public static int P2Right() {
		return p2right;
	}

	public static int P2Up() {
		return p2up;
	}

	public static int P2Down() {
		return p2down;
	}

	public static int P2Fire() {
		return p2fire;
	}

	public static int P2Select() {
		return p2select;
	}

	public static int P2Jump() {
		return p2jump;
	}

	public static int P2Inventory() {
		return p2inventory;
	}

	public static int P2Crouch() {
		return p2crouch;
	}

	public static int P2Sprint() {
		return p2sprint;
	}

	public static int P2Start() {
		return p2start;
	}

	public static String P2MasterRight() {
		return p2masterright;
	}

	public static String P2MasterLeft() {
		return p2masterleft;
	}

	public static String P2MasterUp() {
		return p2masterup;
	}

	public static String P2MasterDown() {
		return p2masterdown;
	}

	public static String P2MasterAimRight() {
		return p2masteraimright;
	}

	public static String P2MasterAimLeft() {
		return p2masteraimleft;
	}

	public static String P2MasterAimUp() {
		return p2masteraimup;
	}

	public static String P2MasterAimDown() {
		return p2masteraimdown;
	}

	public static String P2MasterFire() {
		return p2masterfire;
	}

	public static String P2MasterJump() {
		return p2masterjump;
	}

	public static String P2MasterInventory() {
		return p2masterinventory;
	}

	public static String P2MasterSprint() {
		return p2mastersprint;
	}

	public static String P2MasterCrouch() {
		return p2mastercrouch;
	}

	public static String P2MasterSelect() {
		return p2masterselect;
	}

	public static String P2MasterStart() {
		return p2masterstart;
	}

	public static String P2JoyLSRight() {
		return p2JoyLSRight;
	}

	public static String P2JoyLSLeft() {
		return p2JoyLSLeft;
	}

	public static String P2JoyLSUp() {
		return p2JoyLSUp;
	}

	public static String P2JoyLSDown() {
		return p2JoyLSDown;
	}

	public static String P2JoyRSRight() {
		return p2JoyRSRight;
	}

	public static String P2JoyRSLeft() {
		return p2JoyRSLeft;
	}

	public static String P2JoyRSUp() {
		return p2JoyRSUp;
	}

	public static String P2JoyRSDown() {
		return p2JoyRSDown;
	}

	public static String P2JoyFire() {
		return p2JoyFire;
	}

	public static String P2JoyJump() {
		return p2JoyJump;
	}

	public static String P2JoyInventory() {
		return p2JoyInventory;
	}

	public static String P2JoyCrouch() {
		return p2JoyCrouch;
	}

	public static String P2JoySprint() {
		return p2JoySprint;
	}

	public static String P2JoySelect() {
		return p2JoySelect;
	}

	public static String P2JoyStart() {
		return p2JoyStart;
	}
}
