package u;

import com.ld57.game.ddd;

public class Uinput3 {
	// set defaults
	private static int p3left = 29;
	private static int p3right = 32;
	private static int p3up = 51;
	private static int p3down = 47;
	private static int p3aimleft = 21;// left key
	private static int p3aimright = 22;// right key
	private static int p3aimup = 19;// up key
	private static int p3aimdown = 20;// down key
	private static int p3fire = 0;
	private static int p3jump = 62;
	private static int p3inventory = 46;// this is actually reload for this game.
	private static int p3crouch = 59;
	private static int p3sprint = 129;
	private static int p3select = 1;
	private static int p3start = 111;// esc key
	private static String p3JoyLSRight = "cRd3";// button!
	private static String p3JoyLSLeft = "cLd3";// button!
	private static String p3JoyLSUp = "cUd3";// button!
	private static String p3JoyLSDown = "cDd3";// button!
	private static String p3JoyRSRight = "cRd3";// button!
	private static String p3JoyRSLeft = "cLd3";// button!
	private static String p3JoyRSUp = "cUd3";// button!
	private static String p3JoyRSDown = "cDd3";// button!
	private static String p3JoyFire = "bDd3";
	private static String p3JoyJump = "bLd3";
	private static String p3JoyInventory = "bRd3";
	private static String p3JoyCrouch = "bRTd3";
	private static String p3JoySprint = "bLTd3";
	private static String p3JoySelect = "bSeld3";
	private static String p3JoyStart = "bStd3";

	private static String p3masterright = "Right_IsKeyboard_PlayerThree";
	private static String p3masterleft = "Left_IsKeyboard_PlayerThree";
	private static String p3masterup = "Up_IsKeyboard_PlayerThree";
	private static String p3masterdown = "Down_IsKeyboard_PlayerThree";
	private static String p3masteraimright = "Aim_Right_IsKeyboard_PlayerThree";
	private static String p3masteraimleft = "Aim_Left_IsKeyboard_PlayerThree";
	private static String p3masteraimup = "Aim_Up_IsKeyboard_PlayerThree";
	private static String p3masteraimdown = "Aim_Down_IsKeyboard_PlayerThree";
	private static String p3masterfire = "Fire_IsMouse_PlayerThree";
	private static String p3masterjump = "Jump_IsKeyboard_PlayerThree";
	private static String p3masterinventory = "Inventory_IsKeyboard_PlayerThree";
	private static String p3mastercrouch = "Crouch_IsKeyboard_PlayerThree";
	private static String p3mastersprint = "Sprint_IsKeyboard_PlayerThree";
	private static String p3masterselect = "Select_IsKeyboard_PlayerThree";
	private static String p3masterstart = "Start_IsKeyboard_PlayerThree";

	public Uinput3() {

	}
	/*
	 * 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("IsFirstTimeRunningGame3");// 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("IsFirstTimeRunningGame3", true);// remember this has to be backwards to work.^^
			ddd.GameSettings.putInteger("p3_left_key", 29);// a = 29
			ddd.GameSettings.putInteger("p3_right_key", 32);// d = 32
			ddd.GameSettings.putInteger("p3_up_key", 51);// w = 51
			ddd.GameSettings.putInteger("p3_down_key", 47);// s = 47
			ddd.GameSettings.putInteger("p3_aim_left_key", 21);// left = 21
			ddd.GameSettings.putInteger("p3_aim_right_key", 22);// right = 22
			ddd.GameSettings.putInteger("p3_aim_up_key", 19);// up = 19
			ddd.GameSettings.putInteger("p3_aim_down_key", 20);// down = 20
			ddd.GameSettings.putInteger("p3_fire_key", 0);// left_mouse_button = 0
			ddd.GameSettings.putInteger("p3_cancel_key", 1);// right_mouse_button = 1
			ddd.GameSettings.putInteger("p3_jump_key", 62);// space = 62
			ddd.GameSettings.putInteger("p3_inventory_key", 46);// i = 37 (46 is R for reload in this game)
			ddd.GameSettings.putInteger("p3_crouch_key", 59);// = left_shift = 59
			ddd.GameSettings.putInteger("p3_sprint_key", 129);// = left_control = 129
			ddd.GameSettings.putInteger("p3_start_key", 111);// = esc = 111
			ddd.GameSettings.putString("p3masterright", "Right_IsKeyboard_PlayerThree");// pause player master map (direction, controllerType, player)
			ddd.GameSettings.putString("p3masterleft", "Left_IsKeyboard_PlayerThree");// default everything to keyboard...? lolz
			ddd.GameSettings.putString("p3masterup", "Up_IsKeyboard_PlayerThree");
			ddd.GameSettings.putString("p3masterdown", "Down_IsKeyboard_PlayerThree");
			ddd.GameSettings.putString("p3masteraimright", "Aim_Right_IsKeyboard_PlayerThree");// aim keys...
			ddd.GameSettings.putString("p3masteraimleft", "Aim_Left_IsKeyboard_PlayerThree");
			ddd.GameSettings.putString("p3masteraimup", "Aim_Up_IsKeyboard_PlayerThree");
			ddd.GameSettings.putString("p3masteraimdown", "Aim_Down_IsKeyboard_PlayerThree");
			ddd.GameSettings.putString("p3masterfire", "Fire_IsMouse_PlayerThree");
			ddd.GameSettings.putString("p3masterjump", "Jump_IsKeyboard_PlayerThree");
			ddd.GameSettings.putString("p3masterinventory", "Inventory_IsKeyboard_PlayerThree");
			ddd.GameSettings.putString("p3mastercrouch", "Crouch_IsKeyboard_PlayerThree");
			ddd.GameSettings.putString("p3mastersprint", "Sprint_IsKeyboard_PlayerThree");
			ddd.GameSettings.putString("p3masterselect", "Select_IsKeyboard_PlayerThree");
			ddd.GameSettings.putString("p3masterstart", "Start_IsKeyboard_PlayerThree");
			ddd.GameSettings.putString("p3_aim_right_button", "RScRd3");// buttons!
			ddd.GameSettings.putString("p3_aim_left_button", "RScLd3");// buttons!
			ddd.GameSettings.putString("p3_aim_up_button", "RScUd3");// buttons!
			ddd.GameSettings.putString("p3_aim_down_button", "RScDd3");// buttons!
			ddd.GameSettings.putString("p3_right_button", "bRd3");// buttons!
			ddd.GameSettings.putString("p3_left_button", "bLd3");// buttons!
			ddd.GameSettings.putString("p3_up_button", "bUd3");// buttons!
			ddd.GameSettings.putString("p3_down_button", "bsDd3");// buttons!
			ddd.GameSettings.putString("p3_fire_button", "bDd3");// buttons!
			ddd.GameSettings.putString("p3_jump_button", "bLd3");// buttons!
			ddd.GameSettings.putString("p3_inventory_button", "bRd3");// buttons!
			ddd.GameSettings.putString("p3_crouch_button", "bRTd3");// buttons!
			ddd.GameSettings.putString("p3_sprint_button", "bLTd3");// buttons!
			ddd.GameSettings.putString("p3_select_button", "bSeld3");// buttons!
			ddd.GameSettings.putString("p3_start_button", "bStd3");// buttons!
			ddd.GameSettings.flush();
		} else {// if not, load the defaults?... uhhhh it works. "PASSED" lol
			p3left = ddd.GameSettings.getInteger("p3_left_key");
			p3right = ddd.GameSettings.getInteger("p3_right_key");// d = 32
			p3up = ddd.GameSettings.getInteger("p3_up_key");// w = 51
			p3down = ddd.GameSettings.getInteger("p3_down_key");// s = 47
			p3aimleft = ddd.GameSettings.getInteger("p3_aim_left_key");
			p3aimright = ddd.GameSettings.getInteger("p3_aim_right_key");// d = 32
			p3aimup = ddd.GameSettings.getInteger("p3_aim_up_key");// w = 51
			p3aimdown = ddd.GameSettings.getInteger("p3_aim_down_key");// s = 47
			p3fire = ddd.GameSettings.getInteger("p3_fire_key");// left_mouse_button = 0
			p3select = ddd.GameSettings.getInteger("p3_select_key");// right_mouse_button = 1
			p3jump = ddd.GameSettings.getInteger("p3_jump_key");// space = 62
			p3inventory = ddd.GameSettings.getInteger("p3_inventory_key");// i = 37 I switched this to R for reload for this game.
			p3crouch = ddd.GameSettings.getInteger("p3_crouch_key");// = left_shift = 59
			p3sprint = ddd.GameSettings.getInteger("p3_sprint_key");// = left_control = 129
			p3start = ddd.GameSettings.getInteger("p3_start_key");// = esc = 111
			p3JoyLSRight = ddd.GameSettings.getString("p3_right_button");
			p3JoyLSLeft = ddd.GameSettings.getString("p3_left_button");
			p3JoyLSUp = ddd.GameSettings.getString("p3_up_button");
			p3JoyLSDown = ddd.GameSettings.getString("p3_down_button");
			p3JoyRSRight = ddd.GameSettings.getString("p3_aim_right_button");
			p3JoyRSLeft = ddd.GameSettings.getString("p3_aim_left_button");
			p3JoyRSUp = ddd.GameSettings.getString("p3_aim_up_button");
			p3JoyRSDown = ddd.GameSettings.getString("p3_aim_down_button");
			p3JoyFire = ddd.GameSettings.getString("p3_fire_button");
			p3JoySelect = ddd.GameSettings.getString("p3_select_button");
			p3JoyJump = ddd.GameSettings.getString("p3_jump_button");
			p3JoyInventory = ddd.GameSettings.getString("p3_inventory_button");
			p3JoyCrouch = ddd.GameSettings.getString("p3_crouch_button");
			p3JoySprint = ddd.GameSettings.getString("p3_sprint_button");
			p3JoyStart = ddd.GameSettings.getString("p3_start_button");
			p3masterright = ddd.GameSettings.getString("p3masterright");
			p3masterleft = ddd.GameSettings.getString("p3masterleft");
			p3masterup = ddd.GameSettings.getString("p3masterup");
			p3masterdown = ddd.GameSettings.getString("p3masterdown");
			p3masteraimright = ddd.GameSettings.getString("p3masteraimright");
			p3masteraimleft = ddd.GameSettings.getString("p3masteraimleft");
			p3masteraimup = ddd.GameSettings.getString("p3masteraimup");
			p3masteraimdown = ddd.GameSettings.getString("p3masteraimdown");
			p3masterfire = ddd.GameSettings.getString("p3masterfire");
			p3masterjump = ddd.GameSettings.getString("p3masterjump");
			p3masterinventory = ddd.GameSettings.getString("p3masterinventory");
			p3mastercrouch = ddd.GameSettings.getString("p3mastercrouch");
			p3mastersprint = ddd.GameSettings.getString("p3mastersprint");
			p3masterselect = ddd.GameSettings.getString("p3masterselect");
			p3masterstart = ddd.GameSettings.getString("p3masterstart");
		}

	}

	public static int P3AimLeft() {
		return p3aimleft;
	}

	public static int P3AimRight() {
		return p3aimright;
	}

	public static int P3AimUp() {
		return p3aimup;
	}

	public static int P3AimDown() {
		return p3aimdown;
	}

	public static int P3Left() {
		return p3left;
	}

	public static int P3Right() {
		return p3right;
	}

	public static int P3Up() {
		return p3up;
	}

	public static int P3Down() {
		return p3down;
	}

	public static int P3Fire() {
		return p3fire;
	}

	public static int P3Select() {
		return p3select;
	}

	public static int P3Jump() {
		return p3jump;
	}

	public static int P3Inventory() {
		return p3inventory;
	}

	public static int P3Crouch() {
		return p3crouch;
	}

	public static int P3Sprint() {
		return p3sprint;
	}

	public static int P3Start() {
		return p3start;
	}

	public static String P3MasterRight() {
		return p3masterright;
	}

	public static String P3MasterLeft() {
		return p3masterleft;
	}

	public static String P3MasterUp() {
		return p3masterup;
	}

	public static String P3MasterDown() {
		return p3masterdown;
	}

	public static String P3MasterAimRight() {
		return p3masteraimright;
	}

	public static String P3MasterAimLeft() {
		return p3masteraimleft;
	}

	public static String P3MasterAimUp() {
		return p3masteraimup;
	}

	public static String P3MasterAimDown() {
		return p3masteraimdown;
	}

	public static String P3MasterFire() {
		return p3masterfire;
	}

	public static String P3MasterJump() {
		return p3masterjump;
	}

	public static String P3MasterInventory() {
		return p3masterinventory;
	}

	public static String P3MasterSprint() {
		return p3mastersprint;
	}

	public static String P3MasterCrouch() {
		return p3mastercrouch;
	}

	public static String P3MasterSelect() {
		return p3masterselect;
	}

	public static String P3MasterStart() {
		return p3masterstart;
	}

	public static String P3JoyLSRight() {
		return p3JoyLSRight;
	}

	public static String P3JoyLSLeft() {
		return p3JoyLSLeft;
	}

	public static String P3JoyLSUp() {
		return p3JoyLSUp;
	}

	public static String P3JoyLSDown() {
		return p3JoyLSDown;
	}

	public static String P3JoyRSRight() {
		return p3JoyRSRight;
	}

	public static String P3JoyRSLeft() {
		return p3JoyRSLeft;
	}

	public static String P3JoyRSUp() {
		return p3JoyRSUp;
	}

	public static String P3JoyRSDown() {
		return p3JoyRSDown;
	}

	public static String P3JoyFire() {
		return p3JoyFire;
	}

	public static String P3JoyJump() {
		return p3JoyJump;
	}

	public static String P3JoyInventory() {
		return p3JoyInventory;
	}

	public static String P3JoyCrouch() {
		return p3JoyCrouch;
	}

	public static String P3JoySprint() {
		return p3JoySprint;
	}

	public static String P3JoySelect() {
		return p3JoySelect;
	}

	public static String P3JoyStart() {
		return p3JoyStart;
	}
}
