package u;

import com.ld58.game.rcr;

public class Uinput5 {
	// set defaults
	private static int p5left = 29;
	private static int p5right = 32;
	private static int p5up = 51;
	private static int p5down = 47;
	private static int p5aimleft = 21;// left key
	private static int p5aimright = 22;// right key
	private static int p5aimup = 19;// up key
	private static int p5aimdown = 20;// down key
	private static int p5fire = 0;
	private static int p5jump = 62;
	private static int p5inventory = 46;// this is actually reload for this game.
	private static int p5crouch = 59;
	private static int p5sprint = 129;
	private static int p5select = 1;
	private static int p5start = 111;// esc key
	private static String p5JoyLSRight = "cRd5";// button!
	private static String p5JoyLSLeft = "cLd5";// button!
	private static String p5JoyLSUp = "cUd5";// button!
	private static String p5JoyLSDown = "cDd5";// button!
	private static String p5JoyRSRight = "cRd5";// button!
	private static String p5JoyRSLeft = "cLd5";// button!
	private static String p5JoyRSUp = "cUd5";// button!
	private static String p5JoyRSDown = "cDd5";// button!
	private static String p5JoyFire = "bDd5";
	private static String p5JoyJump = "bLd5";
	private static String p5JoyInventory = "bRd5";
	private static String p5JoyCrouch = "bRTd5";
	private static String p5JoySprint = "bLTd5";
	private static String p5JoySelect = "bSeld5";
	private static String p5JoyStart = "bStd5";

	private static String p5masterright = "Right_IsKeyboard_PlayerFive";
	private static String p5masterleft = "Left_IsKeyboard_PlayerFive";
	private static String p5masterup = "Up_IsKeyboard_PlayerFive";
	private static String p5masterdown = "Down_IsKeyboard_PlayerFive";
	private static String p5masteraimright = "Aim_Right_IsKeyboard_PlayerFive";
	private static String p5masteraimleft = "Aim_Left_IsKeyboard_PlayerFive";
	private static String p5masteraimup = "Aim_Up_IsKeyboard_PlayerFive";
	private static String p5masteraimdown = "Aim_Down_IsKeyboard_PlayerFive";
	private static String p5masterfire = "Fire_IsMouse_PlayerFive";
	private static String p5masterjump = "Jump_IsKeyboard_PlayerFive";
	private static String p5masterinventory = "Inventory_IsKeyboard_PlayerFive";
	private static String p5mastercrouch = "Crouch_IsKeyboard_PlayerFive";
	private static String p5mastersprint = "Sprint_IsKeyboard_PlayerFive";
	private static String p5masterselect = "Select_IsKeyboard_PlayerFive";
	private static String p5masterstart = "Start_IsKeyboard_PlayerFive";

	public Uinput5() {

	}
	/*
	 * 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("IsFirstTimeRunningGame5");// 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("IsFirstTimeRunningGame5", true);// remember this has to be backwards to work.^^
			rcr.GameSettings.putInteger("p5_left_key", 29);// a = 29
			rcr.GameSettings.putInteger("p5_right_key", 32);// d = 32
			rcr.GameSettings.putInteger("p5_up_key", 51);// w = 51
			rcr.GameSettings.putInteger("p5_down_key", 47);// s = 47
			rcr.GameSettings.putInteger("p5_aim_left_key", 21);// left = 21
			rcr.GameSettings.putInteger("p5_aim_right_key", 22);// right = 22
			rcr.GameSettings.putInteger("p5_aim_up_key", 19);// up = 19
			rcr.GameSettings.putInteger("p5_aim_down_key", 20);// down = 20
			rcr.GameSettings.putInteger("p5_fire_key", 0);// left_mouse_button = 0
			rcr.GameSettings.putInteger("p5_cancel_key", 1);// right_mouse_button = 1
			rcr.GameSettings.putInteger("p5_jump_key", 62);// space = 62
			rcr.GameSettings.putInteger("p5_inventory_key", 46);// i = 37 (46 is R for reload in this game)
			rcr.GameSettings.putInteger("p5_crouch_key", 59);// = left_shift = 59
			rcr.GameSettings.putInteger("p5_sprint_key", 129);// = left_control = 129
			rcr.GameSettings.putInteger("p5_start_key", 111);// = esc = 111
			rcr.GameSettings.putString("p5masterright", "Right_IsKeyboard_PlayerFive");// pause player master map (direction, controllerType, player)
			rcr.GameSettings.putString("p5masterleft", "Left_IsKeyboard_PlayerFive");// default everything to keyboard...? lolz
			rcr.GameSettings.putString("p5masterup", "Up_IsKeyboard_PlayerFive");
			rcr.GameSettings.putString("p5masterdown", "Down_IsKeyboard_PlayerFive");
			rcr.GameSettings.putString("p5masteraimright", "Aim_Right_IsKeyboard_PlayerFive");// aim keys...
			rcr.GameSettings.putString("p5masteraimleft", "Aim_Left_IsKeyboard_PlayerFive");
			rcr.GameSettings.putString("p5masteraimup", "Aim_Up_IsKeyboard_PlayerFive");
			rcr.GameSettings.putString("p5masteraimdown", "Aim_Down_IsKeyboard_PlayerFive");
			rcr.GameSettings.putString("p5masterfire", "Fire_IsMouse_PlayerFive");
			rcr.GameSettings.putString("p5masterjump", "Jump_IsKeyboard_PlayerFive");
			rcr.GameSettings.putString("p5masterinventory", "Inventory_IsKeyboard_PlayerFive");
			rcr.GameSettings.putString("p5mastercrouch", "Crouch_IsKeyboard_PlayerFive");
			rcr.GameSettings.putString("p5mastersprint", "Sprint_IsKeyboard_PlayerFive");
			rcr.GameSettings.putString("p5masterselect", "Select_IsKeyboard_PlayerFive");
			rcr.GameSettings.putString("p5masterstart", "Start_IsKeyboard_PlayerFive");
			rcr.GameSettings.putString("p5_aim_right_button", "RScRd5");// buttons!
			rcr.GameSettings.putString("p5_aim_left_button", "RScLd5");// buttons!
			rcr.GameSettings.putString("p5_aim_up_button", "RScUd5");// buttons!
			rcr.GameSettings.putString("p5_aim_down_button", "RScDd5");// buttons!
			rcr.GameSettings.putString("p5_right_button", "bRd5");// buttons!
			rcr.GameSettings.putString("p5_left_button", "bLd5");// buttons!
			rcr.GameSettings.putString("p5_up_button", "bUd5");// buttons!
			rcr.GameSettings.putString("p5_down_button", "bsDd5");// buttons!
			rcr.GameSettings.putString("p5_fire_button", "bDd5");// buttons!
			rcr.GameSettings.putString("p5_jump_button", "bLd5");// buttons!
			rcr.GameSettings.putString("p5_inventory_button", "bRd5");// buttons!
			rcr.GameSettings.putString("p5_crouch_button", "bRTd5");// buttons!
			rcr.GameSettings.putString("p5_sprint_button", "bLTd5");// buttons!
			rcr.GameSettings.putString("p5_select_button", "bSeld5");// buttons!
			rcr.GameSettings.putString("p5_start_button", "bStd5");// buttons!
			rcr.GameSettings.flush();
		} else {// if not, load the defaults?... uhhhh it works. "PASSED" lol
			p5left = rcr.GameSettings.getInteger("p5_left_key");
			p5right = rcr.GameSettings.getInteger("p5_right_key");// d = 32
			p5up = rcr.GameSettings.getInteger("p5_up_key");// w = 51
			p5down = rcr.GameSettings.getInteger("p5_down_key");// s = 47
			p5aimleft = rcr.GameSettings.getInteger("p5_aim_left_key");
			p5aimright = rcr.GameSettings.getInteger("p5_aim_right_key");// d = 32
			p5aimup = rcr.GameSettings.getInteger("p5_aim_up_key");// w = 51
			p5aimdown = rcr.GameSettings.getInteger("p5_aim_down_key");// s = 47
			p5fire = rcr.GameSettings.getInteger("p5_fire_key");// left_mouse_button = 0
			p5select = rcr.GameSettings.getInteger("p5_select_key");// right_mouse_button = 1
			p5jump = rcr.GameSettings.getInteger("p5_jump_key");// space = 62
			p5inventory = rcr.GameSettings.getInteger("p5_inventory_key");// i = 37 I switched this to R for reload for this game.
			p5crouch = rcr.GameSettings.getInteger("p5_crouch_key");// = left_shift = 59
			p5sprint = rcr.GameSettings.getInteger("p5_sprint_key");// = left_control = 129
			p5start = rcr.GameSettings.getInteger("p5_start_key");// = esc = 111
			p5JoyLSRight = rcr.GameSettings.getString("p5_right_button");
			p5JoyLSLeft = rcr.GameSettings.getString("p5_left_button");
			p5JoyLSUp = rcr.GameSettings.getString("p5_up_button");
			p5JoyLSDown = rcr.GameSettings.getString("p5_down_button");
			p5JoyRSRight = rcr.GameSettings.getString("p5_aim_right_button");
			p5JoyRSLeft = rcr.GameSettings.getString("p5_aim_left_button");
			p5JoyRSUp = rcr.GameSettings.getString("p5_aim_up_button");
			p5JoyRSDown = rcr.GameSettings.getString("p5_aim_down_button");
			p5JoyFire = rcr.GameSettings.getString("p5_fire_button");
			p5JoySelect = rcr.GameSettings.getString("p5_select_button");
			p5JoyJump = rcr.GameSettings.getString("p5_jump_button");
			p5JoyInventory = rcr.GameSettings.getString("p5_inventory_button");
			p5JoyCrouch = rcr.GameSettings.getString("p5_crouch_button");
			p5JoySprint = rcr.GameSettings.getString("p5_sprint_button");
			p5JoyStart = rcr.GameSettings.getString("p5_start_button");
			p5masterright = rcr.GameSettings.getString("p5masterright");
			p5masterleft = rcr.GameSettings.getString("p5masterleft");
			p5masterup = rcr.GameSettings.getString("p5masterup");
			p5masterdown = rcr.GameSettings.getString("p5masterdown");
			p5masteraimright = rcr.GameSettings.getString("p5masteraimright");
			p5masteraimleft = rcr.GameSettings.getString("p5masteraimleft");
			p5masteraimup = rcr.GameSettings.getString("p5masteraimup");
			p5masteraimdown = rcr.GameSettings.getString("p5masteraimdown");
			p5masterfire = rcr.GameSettings.getString("p5masterfire");
			p5masterjump = rcr.GameSettings.getString("p5masterjump");
			p5masterinventory = rcr.GameSettings.getString("p5masterinventory");
			p5mastercrouch = rcr.GameSettings.getString("p5mastercrouch");
			p5mastersprint = rcr.GameSettings.getString("p5mastersprint");
			p5masterselect = rcr.GameSettings.getString("p5masterselect");
			p5masterstart = rcr.GameSettings.getString("p5masterstart");
		}

	}

	public static int P5AimLeft() {
		return p5aimleft;
	}

	public static int P5AimRight() {
		return p5aimright;
	}

	public static int P5AimUp() {
		return p5aimup;
	}

	public static int P5AimDown() {
		return p5aimdown;
	}

	public static int P5Left() {
		return p5left;
	}

	public static int P5Right() {
		return p5right;
	}

	public static int P5Up() {
		return p5up;
	}

	public static int P5Down() {
		return p5down;
	}

	public static int P5Fire() {
		return p5fire;
	}

	public static int P5Select() {
		return p5select;
	}

	public static int P5Jump() {
		return p5jump;
	}

	public static int P5Inventory() {
		return p5inventory;
	}

	public static int P5Crouch() {
		return p5crouch;
	}

	public static int P5Sprint() {
		return p5sprint;
	}

	public static int P5Start() {
		return p5start;
	}

	public static String P5MasterRight() {
		return p5masterright;
	}

	public static String P5MasterLeft() {
		return p5masterleft;
	}

	public static String P5MasterUp() {
		return p5masterup;
	}

	public static String P5MasterDown() {
		return p5masterdown;
	}

	public static String P5MasterAimRight() {
		return p5masteraimright;
	}

	public static String P5MasterAimLeft() {
		return p5masteraimleft;
	}

	public static String P5MasterAimUp() {
		return p5masteraimup;
	}

	public static String P5MasterAimDown() {
		return p5masteraimdown;
	}

	public static String P5MasterFire() {
		return p5masterfire;
	}

	public static String P5MasterJump() {
		return p5masterjump;
	}

	public static String P5MasterInventory() {
		return p5masterinventory;
	}

	public static String P5MasterSprint() {
		return p5mastersprint;
	}

	public static String P5MasterCrouch() {
		return p5mastercrouch;
	}

	public static String P5MasterSelect() {
		return p5masterselect;
	}

	public static String P5MasterStart() {
		return p5masterstart;
	}

	public static String P5JoyLSRight() {
		return p5JoyLSRight;
	}

	public static String P5JoyLSLeft() {
		return p5JoyLSLeft;
	}

	public static String P5JoyLSUp() {
		return p5JoyLSUp;
	}

	public static String P5JoyLSDown() {
		return p5JoyLSDown;
	}

	public static String P5JoyRSRight() {
		return p5JoyRSRight;
	}

	public static String P5JoyRSLeft() {
		return p5JoyRSLeft;
	}

	public static String P5JoyRSUp() {
		return p5JoyRSUp;
	}

	public static String P5JoyRSDown() {
		return p5JoyRSDown;
	}

	public static String P5JoyFire() {
		return p5JoyFire;
	}

	public static String P5JoyJump() {
		return p5JoyJump;
	}

	public static String P5JoyInventory() {
		return p5JoyInventory;
	}

	public static String P5JoyCrouch() {
		return p5JoyCrouch;
	}

	public static String P5JoySprint() {
		return p5JoySprint;
	}

	public static String P5JoySelect() {
		return p5JoySelect;
	}

	public static String P5JoyStart() {
		return p5JoyStart;
	}
}
