package u;

import com.ld58.game.rcr;

public class Uinput {
	// set defaults
	private static int left = 29;
	private static int right = 32;
	private static int up = 51;
	private static int down = 47;
	private static int fire = 0;
	private static int jump = 62;
	private static int inventory = 46;// this is actually reload for this game.
	private static int crouch = 59;
	private static int sprint = 129;
	private static int select = 1;
	private static int start = 111;// esc
	private static int ppleft = 29;
	private static int ppright = 32;
	private static int ppup = 51;
	private static int ppdown = 47;
	private static int ppaimleft = 21;// left key
	private static int ppaimright = 22;// right key
	private static int ppaimup = 19;// up key
	private static int ppaimdown = 20;// down key
	private static int ppfire = 0;
	private static int ppjump = 62;
	private static int ppinventory = 46;// this is actually reload for this game.
	private static int ppcrouch = 59;
	private static int ppsprint = 129;
	private static int ppselect = 1;
	private static int ppstart = 111;// esc key
	private static String ppJoyLSRight = "cRd2";// button!
	private static String ppJoyLSLeft = "cLd2";// button!
	private static String ppJoyLSUp = "cUd2";// button!
	private static String ppJoyLSDown = "cDd2";// button!
	private static String ppJoyRSRight = "cRd2";// button!
	private static String ppJoyRSLeft = "cLd2";// button!
	private static String ppJoyRSUp = "cUd2";// button!
	private static String ppJoyRSDown = "cDd2";// button!
	private static String ppJoyFire = "bDd2";
	private static String ppJoyJump = "bLd2";
	private static String ppJoyInventory = "bRd2";
	private static String ppJoyCrouch = "bRTd2";
	private static String ppJoySprint = "bLTd2";
	private static String ppJoySelect = "bSeld2";
	private static String ppJoyStart = "bStd2";

	private static String ppmasterright = "Right_IsKeyboard_PausePlayer";
	private static String ppmasterleft = "Left_IsKeyboard_PausePlayer";
	private static String ppmasterup = "Up_IsKeyboard_PausePlayer";
	private static String ppmasterdown = "Down_IsKeyboard_PausePlayer";
	private static String ppmasteraimright = "Aim_Right_IsKeyboard_PausePlayer";
	private static String ppmasteraimleft = "Aim_Left_IsKeyboard_PausePlayer";
	private static String ppmasteraimup = "Aim_Up_IsKeyboard_PausePlayer";
	private static String ppmasteraimdown = "Aim_Down_IsKeyboard_PausePlayer";
	private static String ppmasterfire = "Fire_IsMouse_PausePlayer";
	private static String ppmasterjump = "Jump_IsKeyboard_PausePlayer";
	private static String ppmasterinventory = "Inventory_IsKeyboard_PausePlayer";
	private static String ppmastercrouch = "Crouch_IsKeyboard_PausePlayer";
	private static String ppmastersprint = "Sprint_IsKeyboard_PausePlayer";
	private static String ppmasterselect = "Select_IsKeyboard_PausePlayer";
	private static String ppmasterstart = "Start_IsKeyboard_PausePlayer";

	public Uinput() {

	}
	/*
	 * 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("IsFirstTimeRunningGame");// 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("IsFirstTimeRunningGame", true);// remember this has to be backwards to work.^^
			rcr.GameSettings.putInteger("pp_left_key", 29);// a = 29
			rcr.GameSettings.putInteger("pp_right_key", 32);// d = 32
			rcr.GameSettings.putInteger("pp_up_key", 51);// w = 51
			rcr.GameSettings.putInteger("pp_down_key", 47);// s = 47
			rcr.GameSettings.putInteger("pp_aim_left_key", 21);// left = 21
			rcr.GameSettings.putInteger("pp_aim_right_key", 22);// right = 22
			rcr.GameSettings.putInteger("pp_aim_up_key", 19);// up = 19
			rcr.GameSettings.putInteger("pp_aim_down_key", 20);// down = 20
			rcr.GameSettings.putInteger("pp_fire_key", 0);// left_mouse_button = 0
			rcr.GameSettings.putInteger("pp_cancel_key", 1);// right_mouse_button = 1
			rcr.GameSettings.putInteger("pp_jump_key", 62);// space = 62
			rcr.GameSettings.putInteger("pp_inventory_key", 46);// i = 37 (46 is R for reload in this game)
			rcr.GameSettings.putInteger("pp_crouch_key", 59);// = left_shift = 59
			rcr.GameSettings.putInteger("pp_sprint_key", 129);// = left_control = 129
			rcr.GameSettings.putInteger("pp_start_key", 111);// = esc = 111
			rcr.GameSettings.putInteger("playerOneController", 0);// for now player one is 0. I probably wont use this. :/
			rcr.GameSettings.putString("ppmasterright", "Right_IsKeyboard_PausePlayer");// pause player master map (direction, controllerType, player)
			rcr.GameSettings.putString("ppmasterleft", "Left_IsKeyboard_PausePlayer");// default everything to keyboard...? lolz
			rcr.GameSettings.putString("ppmasterup", "Up_IsKeyboard_PausePlayer");
			rcr.GameSettings.putString("ppmasterdown", "Down_IsKeyboard_PausePlayer");
			rcr.GameSettings.putString("ppmasteraimright", "Aim_Right_IsKeyboard_PausePlayer");// aim keys...
			rcr.GameSettings.putString("ppmasteraimleft", "Aim_Left_IsKeyboard_PausePlayer");
			rcr.GameSettings.putString("ppmasteraimup", "Aim_Up_IsKeyboard_PausePlayer");
			rcr.GameSettings.putString("ppmasteraimdown", "Aim_Down_IsKeyboard_PausePlayer");
			rcr.GameSettings.putString("ppmasterfire", "Fire_IsMouse_PausePlayer");
			rcr.GameSettings.putString("ppmasterjump", "Jump_IsKeyboard_PausePlayer");
			rcr.GameSettings.putString("ppmasterinventory", "Inventory_IsKeyboard_PausePlayer");
			rcr.GameSettings.putString("ppmastercrouch", "Crouch_IsKeyboard_PausePlayer");
			rcr.GameSettings.putString("ppmastersprint", "Sprint_IsKeyboard_PausePlayer");
			rcr.GameSettings.putString("ppmasterselect", "Select_IsKeyboard_PausePlayer");
			rcr.GameSettings.putString("ppmasterstart", "Start_IsKeyboard_PausePlayer");
			rcr.GameSettings.putString("pp_aim_right_button", "RScRd");// buttons!
			rcr.GameSettings.putString("pp_aim_left_button", "RScLd");// buttons!
			rcr.GameSettings.putString("pp_aim_up_button", "RScUd");// buttons!
			rcr.GameSettings.putString("pp_aim_down_button", "RScDd");// buttons!
			rcr.GameSettings.putString("pp_right_button", "bRd");// buttons!
			rcr.GameSettings.putString("pp_left_button", "bLd");// buttons!
			rcr.GameSettings.putString("pp_up_button", "bUd");// buttons!
			rcr.GameSettings.putString("pp_down_button", "bsDd");// buttons!
			rcr.GameSettings.putString("pp_fire_button", "bDd");// buttons!
			rcr.GameSettings.putString("pp_jump_button", "bLd");// buttons!
			rcr.GameSettings.putString("pp_inventory_button", "bRd");// buttons!
			rcr.GameSettings.putString("pp_crouch_button", "bRTd");// buttons!
			rcr.GameSettings.putString("pp_sprint_button", "bLTd");// buttons!
			rcr.GameSettings.putString("pp_select_button", "bSeld");// buttons!
			rcr.GameSettings.putString("pp_start_button", "bStd");// buttons!
			rcr.GameSettings.flush();
		} else {// if not, load the defaults?... uhhhh it works. "PASSED" lol
			left = rcr.GameSettings.getInteger("pp_left_key");
			right = rcr.GameSettings.getInteger("pp_right_key");// d = 32
			up = rcr.GameSettings.getInteger("pp_up_key");// w = 51
			down = rcr.GameSettings.getInteger("pp_down_key");// s = 47
			fire = rcr.GameSettings.getInteger("pp_fire_key");// left_mouse_button = 0
			select = rcr.GameSettings.getInteger("pp_select_key");// right_mouse_button = 1
			jump = rcr.GameSettings.getInteger("pp_jump_key");// space = 62
			inventory = rcr.GameSettings.getInteger("pp_inventory_key");// i = 37 I switched this to R for reload for this game.
			crouch = rcr.GameSettings.getInteger("pp_crouch_key");// = left_shift = 59
			sprint = rcr.GameSettings.getInteger("pp_sprint_key");// = left_control = 129
			start = rcr.GameSettings.getInteger("pp_start_key");// = esc = 111
			ppleft = rcr.GameSettings.getInteger("pp_left_key");
			ppright = rcr.GameSettings.getInteger("pp_right_key");// d = 32
			ppup = rcr.GameSettings.getInteger("pp_up_key");// w = 51
			ppdown = rcr.GameSettings.getInteger("pp_down_key");// s = 47
			ppaimleft = rcr.GameSettings.getInteger("pp_aim_left_key");
			ppaimright = rcr.GameSettings.getInteger("pp_aim_right_key");// d = 32
			ppaimup = rcr.GameSettings.getInteger("pp_aim_up_key");// w = 51
			ppaimdown = rcr.GameSettings.getInteger("pp_aim_down_key");// s = 47
			ppfire = rcr.GameSettings.getInteger("pp_fire_key");// left_mouse_button = 0
			ppselect = rcr.GameSettings.getInteger("pp_select_key");// right_mouse_button = 1
			ppjump = rcr.GameSettings.getInteger("pp_jump_key");// space = 62
			ppinventory = rcr.GameSettings.getInteger("pp_inventory_key");// i = 37 I switched this to R for reload for this game.
			ppcrouch = rcr.GameSettings.getInteger("pp_crouch_key");// = left_shift = 59
			ppsprint = rcr.GameSettings.getInteger("pp_sprint_key");// = left_control = 129
			ppstart = rcr.GameSettings.getInteger("pp_start_key");// = esc = 111
			ppJoyLSRight = rcr.GameSettings.getString("pp_right_button");
			ppJoyLSLeft = rcr.GameSettings.getString("pp_left_button");
			ppJoyLSUp = rcr.GameSettings.getString("pp_up_button");
			ppJoyLSDown = rcr.GameSettings.getString("pp_down_button");
			ppJoyRSRight = rcr.GameSettings.getString("pp_aim_right_button");
			ppJoyRSLeft = rcr.GameSettings.getString("pp_aim_left_button");
			ppJoyRSUp = rcr.GameSettings.getString("pp_aim_up_button");
			ppJoyRSDown = rcr.GameSettings.getString("pp_aim_down_button");
			ppJoyFire = rcr.GameSettings.getString("pp_fire_button");
			ppJoySelect = rcr.GameSettings.getString("pp_select_button");
			ppJoyJump = rcr.GameSettings.getString("pp_jump_button");
			ppJoyInventory = rcr.GameSettings.getString("pp_inventory_button");
			ppJoyCrouch = rcr.GameSettings.getString("pp_crouch_button");
			ppJoySprint = rcr.GameSettings.getString("pp_sprint_button");
			ppJoyStart = rcr.GameSettings.getString("pp_start_button");
			ppmasterright = rcr.GameSettings.getString("ppmasterright");
			ppmasterleft = rcr.GameSettings.getString("ppmasterleft");
			ppmasterup = rcr.GameSettings.getString("ppmasterup");
			ppmasterdown = rcr.GameSettings.getString("ppmasterdown");
			ppmasteraimright = rcr.GameSettings.getString("ppmasteraimright");
			ppmasteraimleft = rcr.GameSettings.getString("ppmasteraimleft");
			ppmasteraimup = rcr.GameSettings.getString("ppmasteraimup");
			ppmasteraimdown = rcr.GameSettings.getString("ppmasteraimdown");
			ppmasterfire = rcr.GameSettings.getString("ppmasterfire");
			ppmasterjump = rcr.GameSettings.getString("ppmasterjump");
			ppmasterinventory = rcr.GameSettings.getString("ppmasterinventory");
			ppmastercrouch = rcr.GameSettings.getString("ppmastercrouch");
			ppmastersprint = rcr.GameSettings.getString("ppmastersprint");
			ppmasterselect = rcr.GameSettings.getString("ppmasterselect");
			ppmasterstart = rcr.GameSettings.getString("ppmasterstart");
		}

	}

	public static int Left() {
		return left;
	}

	public static int Right() {
		return right;
	}

	public static int Up() {
		return up;
	}

	public static int Down() {
		return down;
	}

	public static int Fire() {
		return fire;
	}

	public static int Select() {
		return select;
	}

	public static int Jump() {
		return jump;
	}

	public static int Inventory() {
		return inventory;
	}

	public static int Crouch() {
		return crouch;
	}

	public static int Sprint() {
		return sprint;
	}

	public static int Start() {
		return start;
	}

	public static int PPAimLeft() {
		return ppaimleft;
	}

	public static int PPAimRight() {
		return ppaimright;
	}

	public static int PPAimUp() {
		return ppaimup;
	}

	public static int PPAimDown() {
		return ppaimdown;
	}

	public static int PPLeft() {
		return ppleft;
	}

	public static int PPRight() {
		return ppright;
	}

	public static int PPUp() {
		return ppup;
	}

	public static int PPDown() {
		return ppdown;
	}

	public static int PPFire() {
		return ppfire;
	}

	public static int PPSelect() {
		return ppselect;
	}

	public static int PPJump() {
		return ppjump;
	}

	public static int PPInventory() {
		return ppinventory;
	}

	public static int PPCrouch() {
		return ppcrouch;
	}

	public static int PPSprint() {
		return ppsprint;
	}

	public static int PPStart() {
		return ppstart;
	}

	public static String PPMasterRight() {
		return ppmasterright;
	}

	public static String PPMasterLeft() {
		return ppmasterleft;
	}

	public static String PPMasterUp() {
		return ppmasterup;
	}

	public static String PPMasterDown() {
		return ppmasterdown;
	}

	public static String PPMasterAimRight() {
		return ppmasteraimright;
	}

	public static String PPMasterAimLeft() {
		return ppmasteraimleft;
	}

	public static String PPMasterAimUp() {
		return ppmasteraimup;
	}

	public static String PPMasterAimDown() {
		return ppmasteraimdown;
	}

	public static String PPMasterFire() {
		return ppmasterfire;
	}

	public static String PPMasterJump() {
		return ppmasterjump;
	}

	public static String PPMasterInventory() {
		return ppmasterinventory;
	}

	public static String PPMasterSprint() {
		return ppmastersprint;
	}

	public static String PPMasterCrouch() {
		return ppmastercrouch;
	}

	public static String PPMasterSelect() {
		return ppmasterselect;
	}

	public static String PPMasterStart() {
		return ppmasterstart;
	}

	public static String PPJoyLSRight() {
		return ppJoyLSRight;
	}

	public static String PPJoyLSLeft() {
		return ppJoyLSLeft;
	}

	public static String PPJoyLSUp() {
		return ppJoyLSUp;
	}

	public static String PPJoyLSDown() {
		return ppJoyLSDown;
	}

	public static String PPJoyRSRight() {
		return ppJoyRSRight;
	}

	public static String PPJoyRSLeft() {
		return ppJoyRSLeft;
	}

	public static String PPJoyRSUp() {
		return ppJoyRSUp;
	}

	public static String PPJoyRSDown() {
		return ppJoyRSDown;
	}

	public static String PPJoyFire() {
		return ppJoyFire;
	}

	public static String PPJoyJump() {
		return ppJoyJump;
	}

	public static String PPJoyInventory() {
		return ppJoyInventory;
	}

	public static String PPJoyCrouch() {
		return ppJoyCrouch;
	}

	public static String PPJoySprint() {
		return ppJoySprint;
	}

	public static String PPJoySelect() {
		return ppJoySelect;
	}

	public static String PPJoyStart() {
		return ppJoyStart;
	}
}
