package u;

import com.ld58.game.rcr;

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