public static void Patch() { try { HarmonyHelper.Patch(); Logger.Log("Patched successfully!"); PFC_Config.Enable = PlayerPrefsExtra.GetBool("pfcEnable", true); Logger.Log("Obtained values from config"); OptionsPanelHandler.RegisterModOptions(new Options("Pickup Full Carry-alls")); Logger.Log("Registered mod options"); ItemActionHelper.RegisterAction(MouseButton.Middle, TechType.LuggageBag, InventoryOpener.OnMiddleClick, "open storage", InventoryOpener.Condition); ItemActionHelper.RegisterAction(MouseButton.Middle, TechType.SmallStorage, InventoryOpener.OnMiddleClick, "open storage", InventoryOpener.Condition); /* * ItemActionHandler.RegisterMiddleClickAction(TechType.LuggageBag, InventoryOpener.OnMiddleClick, "open storage"); * ItemActionHandler.RegisterMiddleClickAction(TechType.SmallStorage, InventoryOpener.OnMiddleClick, "open storage"); * * Logger.Log("Registered middle click actions"); */ } catch (Exception e) { Logger.Exception(e, LoggedWhen.Initializing); } }
public static void Load() { ChoiceIndex = PlayerPrefs.GetInt("SMLHelperExampleModChoice", 0); KeybindKey = PlayerPrefsExtra.GetKeyCode("SMLHelperExampleModKeybind", KeyCode.X); SliderValue = PlayerPrefs.GetFloat("SMLHelperExampleModSlider", 50f); ToggleValue = PlayerPrefsExtra.GetBool("SMLHelperExampleModToggle", true); }
public static void Load() { ShowCellCapacityValue = PlayerPrefsExtra.GetBool("ShowCellCapacityToggle", false); // keep as a switch MarchThroughHealthValue = PlayerPrefs.GetFloat("MarchThroughHealthValueSlider", 3f); // keep as a switch MarchThroughPowerValue = PlayerPrefs.GetFloat("MarchThroughPowerValueSlider", 3f); // keep as a switch SeamothGearValue = PlayerPrefs.GetFloat("SeamothGearValueSlider", 1f); // keep as a switch // User changeable values VehicleFontSizeSliderValue = PlayerPrefs.GetFloat("VehicleFontSizeSlider", 30f); ShowKeyPromptToggleValue = PlayerPrefsExtra.GetBool("ShowKeyPromptToggle", true); ShowSpeedKmhToggleValue = PlayerPrefsExtra.GetBool("ShowSpeedKmhToggle", true); LightsLoHiKeybindValue = PlayerPrefsExtra.GetKeyCode("LightsLoHiKeybindPress", KeyCode.L); CruiseKeybindValue = PlayerPrefsExtra.GetKeyCode("CruiseKeybindPress", KeyCode.Y); ModeKeybindValue = PlayerPrefsExtra.GetKeyCode("ModeKeybindPress", KeyCode.T); GearUpKeybindValue = PlayerPrefsExtra.GetKeyCode("GearUpKeybindPress", KeyCode.F); GearDownKeybindValue = PlayerPrefsExtra.GetKeyCode("GearDownKeybindPress", KeyCode.V); HealthKeybindValue = PlayerPrefsExtra.GetKeyCode("HealthKeybindPress", KeyCode.H); PowerKeybindValue = PlayerPrefsExtra.GetKeyCode("PowerKeybindPress", KeyCode.J); PowerLowerLimitSliderValue = PlayerPrefs.GetFloat("PowerLowerLimitSlider", 33f); PowerUpperLimitSliderValue = PlayerPrefs.GetFloat("PowerUpperLimitSlider", 66f); HealthLowerLimitSliderValue = PlayerPrefs.GetFloat("HealthLowerLimitSlider", 33f); HealthUpperLimitSliderValue = PlayerPrefs.GetFloat("HealthUpperLimitSlider", 66f); TempMothLowerLimitSliderValue = PlayerPrefs.GetFloat("TempMothLowerLimitSlider", 30f); TempMothUpperLimitSliderValue = PlayerPrefs.GetFloat("TempMothUpperLimitSlider", 45f); } // end public static void Load()
public static void Load() { EnableSnapTurning = PlayerPrefsExtra.GetBool(OptionsMenu.PLAYER_PREF_KEY_TOGGLE_SNAP_TURNING, true); SnapAngleChoiceIndex = GetSnapAngleChoiceIndex(SnapType.Default); KeybindKeyLeft = PlayerPrefsExtra.GetKeyCode("SMLHelperExampleModKeybindLeft", KeyCode.LeftArrow); KeybindKeyRight = PlayerPrefsExtra.GetKeyCode("SMLHelperExampleModKeybindRight", KeyCode.RightArrow); }
// Token: 0x06000006 RID: 6 RVA: 0x000021F4 File Offset: 0x000003F4 public void Options_ToggleChanged(object sender, ToggleChangedEventArgs e) { string id = e.Id; string text = id; if (text != null) { if (!(text == "SnapTurningId")) { if (!(text == "SeamothId")) { if (text == "PrawnId") { Config.EnablePrawn = e.Value; PlayerPrefsExtra.SetBool("SnapTurningTogglePrawn", e.Value); } } else { Config.EnableSeamoth = e.Value; PlayerPrefsExtra.SetBool("SnapTurningToggleSeamoth", e.Value); } } else { Config.EnableSnapTurning = e.Value; PlayerPrefsExtra.SetBool("SnapTurningTogglePlayerPrefKey", e.Value); } } }
public static object GetSelectionEnum(string key, System.Type enumType) { string t_key = enumType.ToString() + key; int modeId = PlayerPrefsExtra.GetInt(t_key); return((Enum.GetValues(enumType)).GetValue(modeId)); }
void Start() { if (PlayerPrefsExtra.HasKey("connect_IP")) { connectToIP = PlayerPrefsExtra.GetString("connect_IP"); } if (PlayerPrefsExtra.HasKey("connect_Port")) { connectPort = PlayerPrefsExtra.GetInt("connect_Port"); autoConnect = (PlayerPrefsExtra.GetInt("connect_autoConnect") == 1); } if (PlayerPrefsExtra.HasKey("connect_sendRate")) { sendRate = PlayerPrefsExtra.GetInt("connect_sendRate"); Network.sendRate = sendRate; } if (autoConnect) { isServer = (PlayerPrefsExtra.GetInt("connect_isServer") == 1) ? true : false; if (isServer) { connectAsServer(); } else { connectAsClient(); } } }
// SelectionEnum public static void SetSelectionEnum(string key, object v, System.Type enumType) { int id = (int)v; string t_key = enumType.ToString() + key; PlayerPrefsExtra.SetInt(t_key, id); }
// Color public static void SetColor(string name, Color color) { PlayerPrefsExtra.SetFloat(name + "_r", color.r); PlayerPrefsExtra.SetFloat(name + "_g", color.g); PlayerPrefsExtra.SetFloat(name + "_b", color.b); PlayerPrefsExtra.SetFloat(name + "_a", color.a); }
// Rect public static void SetRect(string name, Rect rect) { PlayerPrefsExtra.SetFloat(name + "_x", rect.x); PlayerPrefsExtra.SetFloat(name + "_y", rect.y); PlayerPrefsExtra.SetFloat(name + "_width", rect.width); PlayerPrefsExtra.SetFloat(name + "_height", rect.height); }
void Update( ) { //Update data only on mouse click if (Input.GetMouseButtonUp(0)) { //Update pos & save data: pos = new Vector2(pos.x + 1f, pos.y + 5f); PlayerPrefsExtra.SetVector2("Pos", pos); //Update col & save col = new Color( Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), 1f ); PlayerPrefsExtra.SetColor("Col", col); //Update & save rot rot = new Quaternion( rot.x + 1f, rot.y + 5f, rot.z + 10f, rot.w + 15f ); PlayerPrefsExtra.SetQuaternion("Rot", rot); } }
void Start( ) { //Load data pos = PlayerPrefsExtra.GetVector2("Pos", Vector2.zero); col = PlayerPrefsExtra.GetColor("Col", Color.white); rot = PlayerPrefsExtra.GetQuaternion("Rot", Quaternion.identity); }
public void Options_ToggleChanged(object sender, ToggleChangedEventArgs e) { if (e.Id == "fabricatorcolor") { Config.fabricatorColor = e.Value; PlayerPrefsExtra.SetBool("fabricatorColor", e.Value); } }
public void Options_ToggleChanged(object sender, ToggleChangedEventArgs e) { if (e.Id == "seaglidecolor") { ConfigWhiteLights.SeaGlideColor = e.Value; PlayerPrefsExtra.SetBool("SeaGlideColor", e.Value); } }
public void Options_ToggleAirVentsKeybindValueChanged(object sender, KeybindChangedEventArgs e) { if (e.Id != "toggleAirVentsKeybindPress") { return; } Config.ToggleAirVentsKeybindValue = e.Key; PlayerPrefsExtra.SetKeyCode("ToggleAirVentsKeybindPress", e.Key); }
public static void Load() { rValue = PlayerPrefs.GetFloat("R", 0.996f); gValue = PlayerPrefs.GetFloat("G", 0.942f); bValue = PlayerPrefs.GetFloat("B", 0.819f); Intensity = PlayerPrefs.GetFloat("Intensity", 1.000f); Range = PlayerPrefs.GetFloat("Range", 50.000f); ToggleColor = PlayerPrefsExtra.GetBool("ToggleColor", false); }
public void Options_ShowPlayerPromptsToggleChanged(object sender, ToggleChangedEventArgs e) { if (e.Id != "showPlayerPromptsToggle") { return; } Config.ShowPlayerPromptsToggleValue = e.Value; PlayerPrefsExtra.SetBool("ShowPlayerPromptsToggle", e.Value); }
public void Options_AirVentsAutoToggleChanged(object sender, ToggleChangedEventArgs e) { if (e.Id != "airVentsAutoToggle") { return; } Config.AirVentsAutoToggleValue = e.Value; PlayerPrefsExtra.SetBool("AirVentsAutoToggle", e.Value); }
public void Options_LightsLoHiKeybindValueChanged(object sender, KeybindChangedEventArgs e) { if (e.Id != "lightsLoHiKeybindPress") { return; } Config.LightsLoHiKeybindValue = e.Key; PlayerPrefsExtra.SetKeyCode("LightsLoHiKeybindPress", e.Key); }
public static Vector3 GetVector2(string name) { Vector2 vec = new Vector2(); vec.x = PlayerPrefsExtra.GetFloat(name + "_x"); vec.y = PlayerPrefsExtra.GetFloat(name + "_y"); return(vec); }
public void Options_GearUpKeybindValueChanged(object sender, KeybindChangedEventArgs e) { if (e.Id != "gearUpKeybindPress") { return; } Config.GearUpKeybindValue = e.Key; PlayerPrefsExtra.SetKeyCode("GearUpKeybindPress", e.Key); }
public void Options_KeybindChanged(object sender, KeybindChangedEventArgs e) { if (e.Id != "exampleKeybind") { return; } Config.KeybindKey = e.Key; PlayerPrefsExtra.SetKeyCode("SMLHelperExampleModKeybind", e.Key); }
public void Options_ToggleChanged(object sender, ToggleChangedEventArgs e) { if (e.Id != "exampleToggle") { return; } Config.ToggleValue = e.Value; PlayerPrefsExtra.SetBool("SMLHelperExampleModToggle", e.Value); }
public void Options_EasyEnergyToggleChanged(object sender, ToggleChangedEventArgs e) { if (e.Id != "useEasyEnergyToggle") { return; } Config.UseEasyEnergyToggleValue = e.Value; PlayerPrefsExtra.SetBool("UseEasyEnergyToggle", e.Value); }
void Update( ) { //Update & save data if (Input.GetMouseButtonUp(0)) { listInt.Add(Random.Range(0, 100)); PlayerPrefsExtra.SetList("listInt", listInt); } }
public void Options_ToggleChanged(object sender, ToggleChangedEventArgs e) { if (e.Id != TOGGLE_CHANGED_ID_SNAP_TURNING) { return; } Config.EnableSnapTurning = e.Value; PlayerPrefsExtra.SetBool(PLAYER_PREF_KEY_TOGGLE_SNAP_TURNING, e.Value); }
public static void Load() { SliderValue = PlayerPrefs.GetFloat("ResourceMultiplier", 1f); RegenSpawns = false; ToggleValue = PlayerPrefsExtra.GetBool("ResourceMultiplierEnabled", true); ShowConfig = false; Randomization = PlayerPrefsExtra.GetBool("ResourceRandomizerEnabled", true); resetDefaults = false; }
public void Options_ToggleChanged(object sender, ToggleChangedEventArgs e) { switch (e.Id) { case TOGGLE_CHANGED_ID_SNAP_TURNING: Config.EnableSnapTurning = e.Value; PlayerPrefsExtra.SetBool(PLAYER_PREF_KEY_TOGGLE_SNAP_TURNING, e.Value); break; } }
public static void Load() { seagliderValue = PlayerPrefs.GetFloat("SeaglideR", 0.016f); seaglidegValue = PlayerPrefs.GetFloat("SeaglideG", 1.000f); seaglidebValue = PlayerPrefs.GetFloat("SeaglideB", 1.000f); Intensity = PlayerPrefs.GetFloat("Intensity", 0.9f); Range = PlayerPrefs.GetFloat("Range", 40f); spotAngle = PlayerPrefs.GetFloat("Size", 70f); SeaGlideColor = PlayerPrefsExtra.GetBool("SeaGlideColor", false); }
private void saveSetting() { PlayerPrefsExtra.SetInt("connect_isServer", isServer ? 1 : 0); PlayerPrefsExtra.SetInt("connect_autoConnect", autoConnect ? 1 : 0); PlayerPrefsExtra.SetString("connect_IP", connectToIP); PlayerPrefsExtra.SetInt("connect_Port", connectPort); PlayerPrefsExtra.SetInt("connect_sendRate", sendRate); //PlayerPrefsExtra.Save(); }