package u;

import com.ld58.game.rcr;

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