package u;

import com.ld57.game.ddd;

public class Uinput1 {
	// set defaults
	private static int p1left = 29;
	private static int p1right = 32;
	private static int p1up = 51;
	private static int p1down = 47;
	private static int p1aimleft = 21;// left key
	private static int p1aimright = 22;// right key
	private static int p1aimup = 19;// up key
	private static int p1aimdown = 20;// down key
	private static int p1fire = 0;
	private static int p1jump = 62;
	private static int p1inventory = 46;// this is actually reload for this game.
	private static int p1crouch = 59;
	private static int p1sprint = 129;
	private static int p1select = 1;
	private static int p1start = 111;// esc key
	private static String p1JoyLSRight = "cRd2";// button!
	private static String p1JoyLSLeft = "cLd2";// button!
	private static String p1JoyLSUp = "cUd2";// button!
	private static String p1JoyLSDown = "cDd2";// button!
	private static String p1JoyRSRight = "cRd2";// button!
	private static String p1JoyRSLeft = "cLd2";// button!
	private static String p1JoyRSUp = "cUd2";// button!
	private static String p1JoyRSDown = "cDd2";// button!
	private static String p1JoyFire = "bDd2";
	private static String p1JoyJump = "bLd2";
	private static String p1JoyInventory = "bRd2";
	private static String p1JoyCrouch = "bRTd2";
	private static String p1JoySprint = "bLTd2";
	private static String p1JoySelect = "bSeld2";
	private static String p1JoyStart = "bStd2";

	private static String p1masterright = "Right_IsKeyboard_PlayerOne";
	private static String p1masterleft = "Left_IsKeyboard_PlayerOne";
	private static String p1masterup = "Up_IsKeyboard_PlayerOne";
	private static String p1masterdown = "Down_IsKeyboard_PlayerOne";
	private static String p1masteraimright = "Aim_Right_IsKeyboard_PlayerOne";
	private static String p1masteraimleft = "Aim_Left_IsKeyboard_PlayerOne";
	private static String p1masteraimup = "Aim_Up_IsKeyboard_PlayerOne";
	private static String p1masteraimdown = "Aim_Down_IsKeyboard_PlayerOne";
	private static String p1masterfire = "Fire_IsMouse_PlayerOne";
	private static String p1masterjump = "Jump_IsKeyboard_PlayerOne";
	private static String p1masterinventory = "Inventory_IsKeyboard_PlayerOne";
	private static String p1mastercrouch = "Crouch_IsKeyboard_PlayerOne";
	private static String p1mastersprint = "Sprint_IsKeyboard_PlayerOne";
	private static String p1masterselect = "Select_IsKeyboard_PlayerOne";
	private static String p1masterstart = "Start_IsKeyboard_PlayerOne";

	public Uinput1() {

	}
	/*
	 * 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("IsFirstTimeRunningGame1");// 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("IsFirstTimeRunningGame1", true);// remember this has to be backwards to work.^^
			ddd.GameSettings.putInteger("p1_left_key", 29);// a = 29
			ddd.GameSettings.putInteger("p1_right_key", 32);// d = 32
			ddd.GameSettings.putInteger("p1_up_key", 51);// w = 51
			ddd.GameSettings.putInteger("p1_down_key", 47);// s = 47
			ddd.GameSettings.putInteger("p1_aim_left_key", 21);// left = 21
			ddd.GameSettings.putInteger("p1_aim_right_key", 22);// right = 22
			ddd.GameSettings.putInteger("p1_aim_up_key", 19);// up = 19
			ddd.GameSettings.putInteger("p1_aim_down_key", 20);// down = 20
			ddd.GameSettings.putInteger("p1_fire_key", 0);// left_mouse_button = 0
			ddd.GameSettings.putInteger("p1_cancel_key", 1);// right_mouse_button = 1
			ddd.GameSettings.putInteger("p1_jump_key", 62);// space = 62
			ddd.GameSettings.putInteger("p1_inventory_key", 46);// i = 37 (46 is R for reload in this game)
			ddd.GameSettings.putInteger("p1_crouch_key", 59);// = left_shift = 59
			ddd.GameSettings.putInteger("p1_sprint_key", 129);// = left_control = 129
			ddd.GameSettings.putInteger("p1_start_key", 111);// = esc = 111
			ddd.GameSettings.putInteger("playerOneController", 0);// for now player one is 0. I probably wont use this. :/
			ddd.GameSettings.putString("p1masterright", "Right_IsKeyboard_PlayerOne");// pause player master map (direction, controllerType, player)
			ddd.GameSettings.putString("p1masterleft", "Left_IsKeyboard_PlayerOne");// default everything to keyboard...? lolz
			ddd.GameSettings.putString("p1masterup", "Up_IsKeyboard_PlayerOne");
			ddd.GameSettings.putString("p1masterdown", "Down_IsKeyboard_PlayerOne");
			ddd.GameSettings.putString("p1masteraimright", "Aim_Right_IsKeyboard_PlayerOne");// aim keys...
			ddd.GameSettings.putString("p1masteraimleft", "Aim_Left_IsKeyboard_PlayerOne");
			ddd.GameSettings.putString("p1masteraimup", "Aim_Up_IsKeyboard_PlayerOne");
			ddd.GameSettings.putString("p1masteraimdown", "Aim_Down_IsKeyboard_PlayerOne");
			ddd.GameSettings.putString("p1masterfire", "Fire_IsMouse_PlayerOne");
			ddd.GameSettings.putString("p1masterjump", "Jump_IsKeyboard_PlayerOne");
			ddd.GameSettings.putString("p1masterinventory", "Inventory_IsKeyboard_PlayerOne");
			ddd.GameSettings.putString("p1mastercrouch", "Crouch_IsKeyboard_PlayerOne");
			ddd.GameSettings.putString("p1mastersprint", "Sprint_IsKeyboard_PlayerOne");
			ddd.GameSettings.putString("p1masterselect", "Select_IsKeyboard_PlayerOne");
			ddd.GameSettings.putString("p1masterstart", "Start_IsKeyboard_PlayerOne");
			ddd.GameSettings.putString("p1_aim_right_button", "RScRd");// buttons!
			ddd.GameSettings.putString("p1_aim_left_button", "RScLd");// buttons!
			ddd.GameSettings.putString("p1_aim_up_button", "RScUd");// buttons!
			ddd.GameSettings.putString("p1_aim_down_button", "RScDd");// buttons!
			ddd.GameSettings.putString("p1_right_button", "bRd");// buttons!
			ddd.GameSettings.putString("p1_left_button", "bLd");// buttons!
			ddd.GameSettings.putString("p1_up_button", "bUd");// buttons!
			ddd.GameSettings.putString("p1_down_button", "bsDd");// buttons!
			ddd.GameSettings.putString("p1_fire_button", "bDd");// buttons!
			ddd.GameSettings.putString("p1_jump_button", "bLd");// buttons!
			ddd.GameSettings.putString("p1_inventory_button", "bRd");// buttons!
			ddd.GameSettings.putString("p1_crouch_button", "bRTd");// buttons!
			ddd.GameSettings.putString("p1_sprint_button", "bLTd");// buttons!
			ddd.GameSettings.putString("p1_select_button", "bSeld");// buttons!
			ddd.GameSettings.putString("p1_start_button", "bStd");// buttons!
			ddd.GameSettings.flush();
		} else {// if not, load the defaults?... uhhhh it works. "PASSED" lol
			p1left = ddd.GameSettings.getInteger("p1_left_key");
			p1right = ddd.GameSettings.getInteger("p1_right_key");// d = 32
			p1up = ddd.GameSettings.getInteger("p1_up_key");// w = 51
			p1down = ddd.GameSettings.getInteger("p1_down_key");// s = 47
			p1aimleft = ddd.GameSettings.getInteger("p1_aim_left_key");
			p1aimright = ddd.GameSettings.getInteger("p1_aim_right_key");// d = 32
			p1aimup = ddd.GameSettings.getInteger("p1_aim_up_key");// w = 51
			p1aimdown = ddd.GameSettings.getInteger("p1_aim_down_key");// s = 47
			p1fire = ddd.GameSettings.getInteger("p1_fire_key");// left_mouse_button = 0
			p1select = ddd.GameSettings.getInteger("p1_select_key");// right_mouse_button = 1
			p1jump = ddd.GameSettings.getInteger("p1_jump_key");// space = 62
			p1inventory = ddd.GameSettings.getInteger("p1_inventory_key");// i = 37 I switched this to R for reload for this game.
			p1crouch = ddd.GameSettings.getInteger("p1_crouch_key");// = left_shift = 59
			p1sprint = ddd.GameSettings.getInteger("p1_sprint_key");// = left_control = 129
			p1start = ddd.GameSettings.getInteger("p1_start_key");// = esc = 111
			p1JoyLSRight = ddd.GameSettings.getString("p1_right_button");
			p1JoyLSLeft = ddd.GameSettings.getString("p1_left_button");
			p1JoyLSUp = ddd.GameSettings.getString("p1_up_button");
			p1JoyLSDown = ddd.GameSettings.getString("p1_down_button");
			p1JoyRSRight = ddd.GameSettings.getString("p1_aim_right_button");
			p1JoyRSLeft = ddd.GameSettings.getString("p1_aim_left_button");
			p1JoyRSUp = ddd.GameSettings.getString("p1_aim_up_button");
			p1JoyRSDown = ddd.GameSettings.getString("p1_aim_down_button");
			p1JoyFire = ddd.GameSettings.getString("p1_fire_button");
			p1JoySelect = ddd.GameSettings.getString("p1_select_button");
			p1JoyJump = ddd.GameSettings.getString("p1_jump_button");
			p1JoyInventory = ddd.GameSettings.getString("p1_inventory_button");
			p1JoyCrouch = ddd.GameSettings.getString("p1_crouch_button");
			p1JoySprint = ddd.GameSettings.getString("p1_sprint_button");
			p1JoyStart = ddd.GameSettings.getString("p1_start_button");
			p1masterright = ddd.GameSettings.getString("p1masterright");
			p1masterleft = ddd.GameSettings.getString("p1masterleft");
			p1masterup = ddd.GameSettings.getString("p1masterup");
			p1masterdown = ddd.GameSettings.getString("p1masterdown");
			p1masteraimright = ddd.GameSettings.getString("p1masteraimright");
			p1masteraimleft = ddd.GameSettings.getString("p1masteraimleft");
			p1masteraimup = ddd.GameSettings.getString("p1masteraimup");
			p1masteraimdown = ddd.GameSettings.getString("p1masteraimdown");
			p1masterfire = ddd.GameSettings.getString("p1masterfire");
			p1masterjump = ddd.GameSettings.getString("p1masterjump");
			p1masterinventory = ddd.GameSettings.getString("p1masterinventory");
			p1mastercrouch = ddd.GameSettings.getString("p1mastercrouch");
			p1mastersprint = ddd.GameSettings.getString("p1mastersprint");
			p1masterselect = ddd.GameSettings.getString("p1masterselect");
			p1masterstart = ddd.GameSettings.getString("p1masterstart");
		}

	}

	public static int P1AimLeft() {
		return p1aimleft;
	}

	public static int P1AimRight() {
		return p1aimright;
	}

	public static int P1AimUp() {
		return p1aimup;
	}

	public static int P1AimDown() {
		return p1aimdown;
	}

	public static int P1Left() {
		return p1left;
	}

	public static int P1Right() {
		return p1right;
	}

	public static int P1Up() {
		return p1up;
	}

	public static int P1Down() {
		return p1down;
	}

	public static int P1Fire() {
		return p1fire;
	}

	public static int P1Select() {
		return p1select;
	}

	public static int P1Jump() {
		return p1jump;
	}

	public static int P1Inventory() {
		return p1inventory;
	}

	public static int P1Crouch() {
		return p1crouch;
	}

	public static int P1Sprint() {
		return p1sprint;
	}

	public static int P1Start() {
		return p1start;
	}

	public static String P1MasterRight() {
		return p1masterright;
	}

	public static String P1MasterLeft() {
		return p1masterleft;
	}

	public static String P1MasterUp() {
		return p1masterup;
	}

	public static String P1MasterDown() {
		return p1masterdown;
	}

	public static String P1MasterAimRight() {
		return p1masteraimright;
	}

	public static String P1MasterAimLeft() {
		return p1masteraimleft;
	}

	public static String P1MasterAimUp() {
		return p1masteraimup;
	}

	public static String P1MasterAimDown() {
		return p1masteraimdown;
	}

	public static String P1MasterFire() {
		return p1masterfire;
	}

	public static String P1MasterJump() {
		return p1masterjump;
	}

	public static String P1MasterInventory() {
		return p1masterinventory;
	}

	public static String P1MasterSprint() {
		return p1mastersprint;
	}

	public static String P1MasterCrouch() {
		return p1mastercrouch;
	}

	public static String P1MasterSelect() {
		return p1masterselect;
	}

	public static String P1MasterStart() {
		return p1masterstart;
	}

	public static String P1JoyLSRight() {
		return p1JoyLSRight;
	}

	public static String P1JoyLSLeft() {
		return p1JoyLSLeft;
	}

	public static String P1JoyLSUp() {
		return p1JoyLSUp;
	}

	public static String P1JoyLSDown() {
		return p1JoyLSDown;
	}

	public static String P1JoyRSRight() {
		return p1JoyRSRight;
	}

	public static String P1JoyRSLeft() {
		return p1JoyRSLeft;
	}

	public static String P1JoyRSUp() {
		return p1JoyRSUp;
	}

	public static String P1JoyRSDown() {
		return p1JoyRSDown;
	}

	public static String P1JoyFire() {
		return p1JoyFire;
	}

	public static String P1JoyJump() {
		return p1JoyJump;
	}

	public static String P1JoyInventory() {
		return p1JoyInventory;
	}

	public static String P1JoyCrouch() {
		return p1JoyCrouch;
	}

	public static String P1JoySprint() {
		return p1JoySprint;
	}

	public static String P1JoySelect() {
		return p1JoySelect;
	}

	public static String P1JoyStart() {
		return p1JoyStart;
	}
}
