package u;

import com.ld57.game.ddd;

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