package u;

import com.ld58.game.rcr;

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