package u;

import com.ld58.game.rcr;

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