Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of SakeysEquipmentSlots v1.0.8
BepInEx/plugins/Sakey's Equipment Slots/SakeysEquipmentSlots.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SakeysEquipmentSlots")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SakeysEquipmentSlots")] [assembly: AssemblyTitle("SakeysEquipmentSlots")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SakeysEquipmentSlots { [BepInPlugin("com.sakey.equipmentslots.appearance-light-config", "Sakey's Equipment Slot -Light 見た目", "1.0.8")] public sealed class SakeysEquipmentSlotAppearanceLightConfig : BaseUnityPlugin { public const string PluginGUID = "com.sakey.equipmentslots.appearance-light-config"; public const string PluginName = "Sakey's Equipment Slot -Light 見た目"; public const string PluginVersion = "1.0.8"; internal static ConfigEntry<float> BrightnessPercent; internal static ConfigEntry<float> RangePercent; internal static ConfigEntry<float> ShadowStrengthPercent; private void Awake() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown BrightnessPercent = ((BaseUnityPlugin)this).Config.Bind<float>("見た目ライト", "BrightnessPercent", 66f, new ConfigDescription("見た目ライトの明るさ(元の値に対する割合)。", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 200f), new object[1] { new ConfigurationManagerAttributes { Category = "見た目ライト", DispName = "明るさ (%)", DefaultValue = 66f } })); RangePercent = ((BaseUnityPlugin)this).Config.Bind<float>("見た目ライト", "RangePercent", 77.6f, new ConfigDescription("見た目ライトの照射範囲(元の値に対する割合)。", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 200f), new object[1] { new ConfigurationManagerAttributes { Category = "見た目ライト", DispName = "照射範囲 (%)", DefaultValue = 77.6f } })); ShadowStrengthPercent = ((BaseUnityPlugin)this).Config.Bind<float>("見た目ライト", "ShadowStrengthPercent", 75f, new ConfigDescription("見た目ライトの影の強さ。", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1] { new ConfigurationManagerAttributes { Category = "見た目ライト", DispName = "影の強さ (%)", DefaultValue = 75f } })); } internal static void Apply(GameObject instance) { if ((Object)(object)instance == (Object)null) { return; } Light[] componentsInChildren = instance.GetComponentsInChildren<Light>(true); foreach (Light val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { AppearanceLightOriginalValues appearanceLightOriginalValues = ((Component)val).GetComponent<AppearanceLightOriginalValues>(); if ((Object)(object)appearanceLightOriginalValues == (Object)null) { appearanceLightOriginalValues = ((Component)val).gameObject.AddComponent<AppearanceLightOriginalValues>(); } appearanceLightOriginalValues.Capture(val); val.intensity = appearanceLightOriginalValues.Intensity * ((BrightnessPercent != null) ? BrightnessPercent.Value : 66f) / 100f; val.range = appearanceLightOriginalValues.Range * ((RangePercent != null) ? RangePercent.Value : 77.6f) / 100f; val.shadowStrength = appearanceLightOriginalValues.ShadowStrength * ((ShadowStrengthPercent != null) ? ShadowStrengthPercent.Value : 75f) / 100f; } } } } internal sealed class AppearanceLightOriginalValues : MonoBehaviour { internal float Intensity; internal float Range; internal float ShadowStrength; private bool captured; internal void Capture(Light light) { if (!captured && !((Object)(object)light == (Object)null)) { Intensity = light.intensity; Range = light.range; ShadowStrength = light.shadowStrength; captured = true; } } } internal sealed class ConfigurationManagerAttributes { public bool? Browsable; public string Category; public object DefaultValue; public bool? HideDefaultButton; public bool? HideSettingName; public string Description; public string DispName; public int? Order; public bool? ReadOnly; public bool? IsAdvanced; public bool? ShowRangeAsPercent; public Func<object, string> ObjToStr; public Func<string, object> StrToObj; public Action<ConfigEntryBase> CustomDrawer; } [BepInPlugin("com.sakey.equipmentslots.waistappearance", "Sakey's Equipment Slots - Waist Appearance", "1.0.8")] public sealed class SakeysWaistAppearanceConfigPlugin : BaseUnityPlugin { public const string PluginGUID = "com.sakey.equipmentslots.waistappearance"; public const string PluginName = "Sakey's Equipment Slots - Waist Appearance"; public const string PluginVersion = "1.0.8"; internal static SakeysWaistAppearanceConfigPlugin Instance; private static ConfigEntry<string> WaistPreset1; private static ConfigEntry<string> WaistPreset2; private static ConfigEntry<string> WaistPreset3; private static ConfigEntry<string> WaistPresetControls; private static ConfigEntry<int> WaistActivePreset; private static bool StartupPresetPending = true; internal static readonly Dictionary<string, string[]> BuiltInWaistWeaponCoordinates = new Dictionary<string, string[]>(StringComparer.Ordinal) { { "AxeBlackMetal", new string[7] { "0.6647059", "-0.1", "0.02", "0", "-6.05042", "-7.814723", "22.52101" } }, { "AxeBronze", new string[7] { "0.7285714", "-0.1", "0.02", "9.500713E-08", "-6.05042", "-7.814723", "22.52101" } }, { "AxeFlint", new string[7] { "0.6327731", "-0.1", "0.02", "9.500713E-08", "-6.05042", "-16.89035", "22.52101" } }, { "AxeGold", new string[7] { "0.712605", "-0.1", "0.02", "9.500713E-08", "-6.05042", "-16.89035", "22.52101" } }, { "AxeGold_BloodLightning", new string[7] { "0.7205883", "-0.1", "0.02", "9.500713E-08", "-6.05042", "-16.89035", "22.52101" } }, { "AxeGold_FrostFire", new string[7] { "0.7365546", "-0.1", "0.02", "9.500713E-08", "-6.05042", "-16.89035", "22.52101" } }, { "AxeJotunBane", new string[7] { "0.6647059", "-0.1", "0.02", "9.500713E-08", "-6.05042", "-16.89035", "22.52101" } }, { "AxeStone", new string[7] { "0.5369748", "-0.1", "0.02", "9.500713E-08", "-6.05042", "-16.89035", "22.52101" } }, { "AxeWood", new string[7] { "0.6487395", "-0.1", "0.02", "9.500713E-08", "-6.05042", "6.89035", "22.52101" } }, { "Club", new string[7] { "0.4331933", "-0.085", "1.739735E-07", "1.739735E-07", "-1.512604", "1.260502", "16.47059" } }, { "CrossbowArbalest", new string[7] { "0.3802521", "-0.06", "-0.4", "0.6", "45", "-0.6621847", "0.8504202" } }, { "CrossbowGold", new string[7] { "0.3802521", "-0.06", "-0.4", "0.6", "45", "-0.6621847", "0.8504202" } }, { "CrossbowGold_BloodLightning", new string[7] { "0.3802521", "-0.06", "-0.4", "0.6", "45", "-0.6621847", "0.8504202" } }, { "CrossbowGold_FrostFire", new string[7] { "0.3802521", "-0.06", "-0.4", "0.6", "45", "-0.6621847", "0.8504202" } }, { "CrossbowRipperBlood", new string[7] { "0.3802521", "-0.06", "-0.4", "0.6", "45", "-0.6621847", "0.8504202" } }, { "CrossbowRipperLightning", new string[7] { "0.3802521", "-0.06", "-0.4", "0.6", "45", "-0.6621847", "0.8504202" } }, { "CrossbowRipperNature", new string[7] { "0.3802521", "-0.06", "-0.4", "0.6", "45", "-0.6621847", "0.8504202" } }, { "FW_SwordBlackmetal", new string[7] { "0.6806723", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "KnifeBlackMetal", new string[7] { "1", "0", "0", "-0.2", "0", "35", "0" } }, { "KnifeButcher", new string[7] { "1", "0", "0", "-0.2", "0", "35", "0" } }, { "KnifeChitin", new string[7] { "1", "0", "0", "-0.2", "0", "35", "0" } }, { "KnifeFlint", new string[7] { "1", "0", "0", "-0.2", "0", "35", "0" } }, { "KnifeGold", new string[7] { "1", "0", "0", "-0.2", "0", "35", "0" } }, { "KnifeGold_BloodLightning", new string[7] { "1", "0", "0", "-0.2", "0", "35", "0" } }, { "KnifeGold_FrostFire", new string[7] { "1", "0", "0", "-0.2", "0", "35", "0" } }, { "KnifeSilver", new string[7] { "1", "0", "0", "-0.2", "0", "35", "0" } }, { "KnifeWood", new string[7] { "1", "0", "0", "-0.2", "0", "35", "0" } }, { "MaceBronze", new string[7] { "0.6483193", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "MaceEldner", new string[7] { "0.6323529", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "MaceEldnerBlood", new string[7] { "0.6403361", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "MaceEldnerLightning", new string[7] { "0.62479", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "MaceEldnerNature", new string[7] { "0.6407564", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "MaceGold", new string[7] { "0.6567227", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "MaceGold_BloodLightning", new string[7] { "0.6407562", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "MaceGold_FrostFire", new string[7] { "0.6886554", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "MaceIron", new string[7] { "0.6907563", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "MaceNeedle", new string[7] { "0.7205882", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "MaceSilver", new string[7] { "0.7285714", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "MaceWood", new string[7] { "0.7844538", "0", "1.739735E-07", "0.02016804", "-13.61344", "-1.008405", "102.6891" } }, { "SakeysLight", new string[7] { "1.1", "0.001", "0.21", "-0.15", "-25.58824", "10.5", "42.17647" } }, { "SledgeCheat", new string[7] { "0.5071428", "-0.04", "-0.4", "0.4", "37", "15.12603", "15.88234" } }, { "SledgeDemolisher", new string[7] { "0.5071428", "-0.04", "-0.4", "0.4", "37", "15.12603", "15.88234" } }, { "SledgeGold", new string[7] { "0.5071428", "-0.04", "-0.4", "0.4", "37", "15.12603", "15.88234" } }, { "SledgeGold_BloodLightning", new string[7] { "0.5071428", "-0.04", "-0.4", "0.4", "37", "15.12603", "15.88234" } }, { "SledgeGold_FrostFire", new string[7] { "0.5071428", "-0.04", "-0.4", "0.4", "37", "15.12603", "15.88234" } }, { "SledgeIron", new string[7] { "0.5071428", "-0.04", "-0.4", "0.4", "37", "15.12603", "15.88234" } }, { "SledgeStagbreaker", new string[7] { "0.5071428", "-0.04", "-0.4", "0.4", "37", "15.12603", "15.88234" } }, { "SledgeWood", new string[7] { "0.5071428", "-0.04", "-0.4", "0.4", "37", "4.36975", "15.88234" } }, { "SwordBronze", new string[7] { "0.8882353", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordCheat", new string[7] { "0.6567227", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordDyrnwyn", new string[7] { "0.5689076", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordGold", new string[7] { "0.6109244", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordGold_BloodLightning", new string[7] { "0.6247898", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordGold_FrostFire", new string[7] { "0.6487395", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordIron", new string[7] { "0.6567227", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordIronFire", new string[7] { "0.6647059", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordMistwalker", new string[7] { "0.6806723", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordNiedhogg", new string[7] { "0.6487395", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordNiedhoggBlood", new string[7] { "0.6806722", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordNiedhoggLightning", new string[7] { "0.6886554", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordNiedhoggNature", new string[7] { "0.7445378", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordSilver", new string[7] { "0.5096638", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "SwordWood", new string[7] { "0.920168", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" } }, { "Torch", new string[7] { "0.6806723", "-0.085", "-0.503359", "-0.5320168", "-22.68907", "185.042", "15.12605" } } }; internal static IEnumerable<KeyValuePair<string, string[]>> BuiltInHipWeaponCoordinates() { return BuiltInWaistWeaponCoordinates; } internal static float ParseBuiltInCoordinate(string value, float fallback) { if (!float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { return fallback; } return result; } private void Awake() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Expected O, but got Unknown Instance = this; WaistPreset1 = ((BaseUnityPlugin)this).Config.Bind<string>("見た目腰プリセット", "Preset 1 Data", BuildDefaultWaistPreset(vrm: false), new ConfigDescription("プリセット1(バニラプレイヤー向け)の腰武器設定。", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); WaistPreset2 = ((BaseUnityPlugin)this).Config.Bind<string>("見た目腰プリセット", "Preset 2 Data", BuildDefaultWaistPreset(vrm: true), new ConfigDescription("プリセット2(VRM向け)の腰武器設定。", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); WaistActivePreset = ((BaseUnityPlugin)this).Config.Bind<int>("見た目腰プリセット", "起動時プリセット", 3, new ConfigDescription("起動時に適用する腰武器プリセット。1=バニラ、2=VRM、3=ヴァルキリー。", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 3), new object[1] { new ConfigurationManagerAttributes { Category = "見た目腰プリセット", DispName = "起動時プリセット", DefaultValue = 3 } })); if (string.IsNullOrEmpty(WaistPreset1.Value)) { WaistPreset1.Value = BuildDefaultWaistPreset(vrm: false); } WaistPreset2.Value = NormalizeVrmSwordPreset(WaistPreset2.Value); WaistPreset3 = ((BaseUnityPlugin)this).Config.Bind<string>("見た目腰プリセット", "Preset 3 Data", BuildDefaultValkyrWaistPreset(), new ConfigDescription("プリセット3(ヴァルキリー向け)の腰武器設定。", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); WaistPreset3.Value = NormalizeValkyrWaistPreset(WaistPreset3.Value); WaistPresetControls = ((BaseUnityPlugin)this).Config.Bind<string>("見た目腰プリセット", "Preset Controls", string.Empty, new ConfigDescription("プリセット1はバニラ向け、2はVRM向け、3はヴァルキリー向けです。選択中の起動時プリセットは次回起動時にも適用されます。", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Category = "見た目腰プリセット", DispName = "プリセット登録 / 呼び出し", HideDefaultButton = true, CustomDrawer = DrawWaistPresetControls } })); ApplyWaistConfigLocalization(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Sakey's Equipment Slots - Waist Appearance configuration page registered."); } private static string BuildDefaultWaistPreset(bool vrm) { List<string> list = new List<string>(); if (!BuiltInWaistWeaponCoordinates.ContainsKey("SwordSilver")) { _ = new string[7] { "1", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" }; } else { _ = (string[])BuiltInWaistWeaponCoordinates["SwordSilver"].Clone(); } Dictionary<string, string[]> dictionary = new Dictionary<string, string[]>(StringComparer.Ordinal); foreach (KeyValuePair<string, string[]> builtInWaistWeaponCoordinate in BuiltInWaistWeaponCoordinates) { if (builtInWaistWeaponCoordinate.Value != null && builtInWaistWeaponCoordinate.Value.Length >= 7) { dictionary[builtInWaistWeaponCoordinate.Key] = (string[])builtInWaistWeaponCoordinate.Value.Clone(); } } if (vrm) { SetPresetTransform(dictionary, "SwordSilver", "0.5096638", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975"); SetPresetTransform(dictionary, "Club", "0.3189076", "-0.112782", "1.98546658E-07", "-0.03", "-23.16674", "-27.16055", "51.26051"); SetPresetTransform(dictionary, "AxeWood", "0.4630252", "-0.095", "0.011", "0.105", "-13.6126022", "-20.64578", "51.26051"); SetPresetTransform(dictionary, "SakeysLight", "0.7836133", "0.280751884", "0.1892585", "0.07037595", "5.79237366", "-62.7333031", "-147.518829"); SetPresetTransform(dictionary, "KnifeSkollAndHati", "1", "0", "0", "-0.2", "0", "35", "0"); string[] array = (string[])dictionary["SwordSilver"].Clone(); string[] array2 = dictionary.Keys.Where(IsSwordFamilyPrefab).ToArray(); foreach (string key in array2) { dictionary[key] = (string[])array.Clone(); } } foreach (KeyValuePair<string, string[]> item in dictionary.OrderBy<KeyValuePair<string, string[]>, string>((KeyValuePair<string, string[]> p) => p.Key, StringComparer.Ordinal)) { list.Add(Uri.EscapeDataString(item.Key) + "|" + string.Join("|", item.Value)); } return string.Join(";", list); } private static string BuildDefaultValkyrWaistPreset() { Dictionary<string, string[]> dictionary = new Dictionary<string, string[]>(StringComparer.Ordinal); foreach (KeyValuePair<string, string[]> builtInWaistWeaponCoordinate in BuiltInWaistWeaponCoordinates) { if (builtInWaistWeaponCoordinate.Value != null && builtInWaistWeaponCoordinate.Value.Length >= 7) { dictionary[builtInWaistWeaponCoordinate.Key] = (string[])builtInWaistWeaponCoordinate.Value.Clone(); } } SetPresetTransform(dictionary, "Club", "0.4331933", "-0.160187975", "1.739735E-07", "0.0375938974", "-15.0464392", "6.76691341", "16.47059"); SetPresetTransform(dictionary, "Torch", "0.6806723", "-0.085", "-0.428171039", "-0.7575807", "-22.68907", "185.042", "15.12605"); SetPresetTransform(dictionary, "SakeysLight", "1.04285717", "-0.14937596", "0.075188145", "-0.0751877949", "-25.58824", "10.5", "42.17647"); SetPresetTransform(dictionary, "SwordSilver", "0.752521", "-0.06", "-0.0751879662", "0.140375942", "-12.7377262", "-6.02388954", "12.4900513"); SetPresetTransform(dictionary, "KnifeFlint", "0.8857143", "-0.199999988", "-0.07518795", "0.224812046", "-8.120298", "339.699219", "36.5413475"); SetPresetTransform(dictionary, "MaceBronze", "0.6483193", "-0.07518797", "0.075188145", "0.170543984", "-13.61344", "-1.008405", "102.6891"); SetPresetTransform(dictionary, "AxeFlint", "0.6327731", "-0.15", "-0.087", "0.185", "-14.1707211", "-8.77005", "22.52101"); SetPresetTransform(dictionary, "CrossbowArbalest", "0.3802521", "-0.06", "-0.26", "0.755188", "45", "-0.6621847", "-4.56311369"); SetPresetTransform(dictionary, "SledgeStagbreaker", "0.5071428", "-0.2655639", "-0.224812031", "0.475187957", "31.5864639", "19.18618", "53.7770844"); NormalizeFamily(dictionary, IsSwordFamilyPrefab, "SwordSilver"); NormalizeFamily(dictionary, (string p) => p.StartsWith("Knife", StringComparison.Ordinal) || p.StartsWith("FW_Knife", StringComparison.Ordinal), "KnifeFlint"); NormalizeFamily(dictionary, (string p) => p.StartsWith("Mace", StringComparison.Ordinal), "MaceBronze"); NormalizeFamily(dictionary, (string p) => p.StartsWith("Axe", StringComparison.Ordinal), "AxeFlint"); NormalizeFamily(dictionary, (string p) => p.StartsWith("Crossbow", StringComparison.Ordinal), "CrossbowArbalest"); NormalizeFamily(dictionary, (string p) => p.StartsWith("Sledge", StringComparison.Ordinal), "SledgeStagbreaker"); return SerializePreset(dictionary); } private static string NormalizeValkyrWaistPreset(string existing) { Dictionary<string, string[]> dictionary = ParseWaistPreset(existing); if (dictionary.Count == 0) { dictionary = ParseWaistPreset(BuildDefaultValkyrWaistPreset()); } NormalizeFamily(dictionary, IsSwordFamilyPrefab, "SwordSilver"); NormalizeFamily(dictionary, (string p) => p.StartsWith("Knife", StringComparison.Ordinal) || p.StartsWith("FW_Knife", StringComparison.Ordinal), "KnifeFlint"); NormalizeFamily(dictionary, (string p) => p.StartsWith("Mace", StringComparison.Ordinal), "MaceBronze"); NormalizeFamily(dictionary, (string p) => p.StartsWith("Axe", StringComparison.Ordinal), "AxeFlint"); NormalizeFamily(dictionary, (string p) => p.StartsWith("Crossbow", StringComparison.Ordinal), "CrossbowArbalest"); NormalizeFamily(dictionary, (string p) => p.StartsWith("Sledge", StringComparison.Ordinal), "SledgeStagbreaker"); Dictionary<string, string[]> dictionary2 = ParseWaistPreset(BuildDefaultValkyrWaistPreset()); string[] array = new string[3] { "Club", "Torch", "SakeysLight" }; foreach (string key in array) { if (!dictionary.ContainsKey(key) && dictionary2.ContainsKey(key)) { dictionary[key] = (string[])dictionary2[key].Clone(); } } foreach (KeyValuePair<string, string[]> item in dictionary2) { if (!dictionary.ContainsKey(item.Key)) { dictionary[item.Key] = (string[])item.Value.Clone(); } } return SerializePreset(dictionary); } private static void SetPresetTransform(Dictionary<string, string[]> values, string key, params string[] transform) { if (values != null && transform != null && transform.Length == 7) { values[key] = (string[])transform.Clone(); } } private static void NormalizeFamily(Dictionary<string, string[]> values, Func<string, bool> predicate, string referenceKey) { if (values != null && predicate != null && values.TryGetValue(referenceKey, out var value) && value != null && value.Length >= 7) { string[] array = values.Keys.Where(predicate).ToArray(); foreach (string key in array) { values[key] = (string[])value.Clone(); } } } private static Dictionary<string, string[]> ParseWaistPreset(string data) { Dictionary<string, string[]> dictionary = new Dictionary<string, string[]>(StringComparer.Ordinal); if (string.IsNullOrEmpty(data)) { return dictionary; } string[] array = data.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split('|'); if (array2.Length == 8) { try { string key = Uri.UnescapeDataString(array2[0]); dictionary[key] = array2.Skip(1).Take(7).ToArray(); } catch { } } } return dictionary; } private static string SerializePreset(Dictionary<string, string[]> values) { return string.Join(";", from p in values.OrderBy<KeyValuePair<string, string[]>, string>((KeyValuePair<string, string[]> p) => p.Key, StringComparer.Ordinal) where p.Value != null && p.Value.Length >= 7 select Uri.EscapeDataString(p.Key) + "|" + string.Join("|", p.Value)); } private static string NormalizeVrmSwordPreset(string existing) { Dictionary<string, string[]> dictionary = new Dictionary<string, string[]>(StringComparer.Ordinal); if (!string.IsNullOrEmpty(existing)) { string[] array = existing.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split('|'); if (array2.Length == 8) { try { string key = Uri.UnescapeDataString(array2[0]); string[] array3 = new string[7]; Array.Copy(array2, 1, array3, 0, 7); dictionary[key] = array3; } catch { } } } } string[] array4 = ((dictionary.TryGetValue("SwordSilver", out array4) && array4 != null && array4.Length >= 7) ? ((string[])array4.Clone()) : (BuiltInWaistWeaponCoordinates.ContainsKey("SwordSilver") ? ((string[])BuiltInWaistWeaponCoordinates["SwordSilver"].Clone()) : new string[7] { "1", "-0.06", "0", "-0.01", "-18.15126", "-10.08404", "4.36975" })); foreach (KeyValuePair<string, string[]> builtInWaistWeaponCoordinate in BuiltInWaistWeaponCoordinates) { if (IsSwordFamilyPrefab(builtInWaistWeaponCoordinate.Key)) { dictionary[builtInWaistWeaponCoordinate.Key] = (string[])array4.Clone(); } else if (!dictionary.ContainsKey(builtInWaistWeaponCoordinate.Key)) { dictionary[builtInWaistWeaponCoordinate.Key] = (string[])builtInWaistWeaponCoordinate.Value.Clone(); } } List<string> list = new List<string>(); foreach (KeyValuePair<string, string[]> item in dictionary.OrderBy<KeyValuePair<string, string[]>, string>((KeyValuePair<string, string[]> p) => p.Key, StringComparer.Ordinal)) { if (item.Value != null && item.Value.Length >= 7) { list.Add(Uri.EscapeDataString(item.Key) + "|" + string.Join("|", item.Value)); } } return string.Join(";", list); } private static bool IsSwordFamilyPrefab(string prefab) { if (string.IsNullOrEmpty(prefab)) { return false; } if (!prefab.StartsWith("Sword", StringComparison.Ordinal)) { return prefab.StartsWith("FW_Sword", StringComparison.Ordinal); } return true; } internal static void ApplyStartupPresetIfReady() { if (!StartupPresetPending || (Object)(object)Instance == (Object)null || (Object)(object)SakeysEquipmentSlotsPlugin.Instance == (Object)null) { return; } string text = ((WaistActivePreset == null || WaistActivePreset.Value != 2) ? ((WaistActivePreset != null && WaistActivePreset.Value == 3) ? ((WaistPreset3 != null) ? WaistPreset3.Value : string.Empty) : ((WaistPreset1 != null) ? WaistPreset1.Value : string.Empty)) : ((WaistPreset2 != null) ? WaistPreset2.Value : string.Empty)); if (!string.IsNullOrEmpty(text) && SakeysOtherUtilityVisuals.RestoreWaistAppearancePreset(text)) { StartupPresetPending = false; if ((Object)(object)Instance != (Object)null) { ((BaseUnityPlugin)Instance).Config.Save(); } } } internal static void ApplyWaistConfigLocalization() { LocalizeWaistEntry((ConfigEntryBase)(object)WaistActivePreset, "見た目腰プリセット", "起動時プリセット", "起動時に適用する腰武器プリセット。1=バニラ、2=VRM、3=ヴァルキリー。"); LocalizeWaistEntry((ConfigEntryBase)(object)WaistPresetControls, "見た目腰プリセット", "プリセット登録 / 呼び出し", "プリセット1はバニラ向け、2はVRM向け、3はヴァルキリー向けです。選択中の起動時プリセットは次回起動時にも適用されます。"); } private static void LocalizeWaistEntry(ConfigEntryBase entry, string category, string name, string description) { if (entry == null || entry.Description == null || entry.Description.Tags == null) { return; } object[] tags = entry.Description.Tags; for (int i = 0; i < tags.Length; i++) { if (tags[i] is ConfigurationManagerAttributes configurationManagerAttributes) { configurationManagerAttributes.Category = SakeysEquipmentSlotsPlugin.ConfigText(category, "Hip Weapon Appearance Presets"); configurationManagerAttributes.DispName = SakeysEquipmentSlotsPlugin.ConfigText(name, (name == "起動時プリセット") ? "Startup Preset" : "Save / Load Presets"); configurationManagerAttributes.Description = SakeysEquipmentSlotsPlugin.ConfigText(description, (description == "起動時に適用する腰武器プリセット。1=バニラ、2=VRM、3=ヴァルキリー。") ? "Hip-weapon preset applied at startup: 1=Vanilla, 2=VRM, 3=Valkyrie." : "Preset 1 is for Vanilla, 2 for VRM, and 3 for Valkyrie. The selected startup preset is applied again next time."); break; } } } private static void DrawWaistPresetControls(ConfigEntryBase setting) { GUILayout.BeginVertical(GUI.skin.box, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(310f) }); GUILayout.Label(SakeysEquipmentSlotsPlugin.ConfigText("現在の腰見た目を登録し、あとから呼び出せます。", "Save the current hip-weapon appearance and load it later."), Array.Empty<GUILayoutOption>()); DrawWaistPresetRow(1); DrawWaistPresetRow(2); DrawWaistPresetRow(3); GUILayout.EndVertical(); } private static void DrawWaistPresetRow(int index) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label(((WaistActivePreset != null && WaistActivePreset.Value == index) ? "✓ " : " ") + SakeysEquipmentSlotsPlugin.ConfigText("プリセット" + index, "Preset " + index), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(105f) }); if (GUILayout.Button(SakeysEquipmentSlotsPlugin.ConfigText("登録 / 上書き", "Save / Overwrite"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(105f) })) { SaveWaistPreset(index); } if (GUILayout.Button(SakeysEquipmentSlotsPlugin.ConfigText("呼び出し", "Load"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) })) { LoadWaistPreset(index); } GUILayout.EndHorizontal(); } private static void SaveWaistPreset(int index) { string value = SakeysOtherUtilityVisuals.CaptureWaistAppearancePreset(); switch (index) { case 1: WaistPreset1.Value = value; break; case 2: WaistPreset2.Value = value; break; case 3: WaistPreset3.Value = value; break; } if ((Object)(object)Instance != (Object)null) { ((BaseUnityPlugin)Instance).Config.Save(); } } private static void LoadWaistPreset(int index) { string text = index switch { 3 => WaistPreset3.Value, 2 => WaistPreset2.Value, 1 => WaistPreset1.Value, _ => string.Empty, }; if (!string.IsNullOrEmpty(text)) { if (index >= 1 && index <= 3) { WaistActivePreset.Value = index; } if (SakeysOtherUtilityVisuals.RestoreWaistAppearancePreset(text) && (Object)(object)Instance != (Object)null) { ((BaseUnityPlugin)Instance).Config.Save(); } } } } [BepInPlugin("com.sakey.equipmentslots", "Sakey's Equipment Slots", "1.0.8")] public sealed class SakeysEquipmentSlotsPlugin : BaseUnityPlugin { public const string PluginGUID = "com.sakey.equipmentslots"; public const string PluginName = "Sakey's Equipment Slots"; public const string PluginVersion = "1.0.8"; internal static SakeysEquipmentSlotsPlugin Instance; internal static Harmony Harmony; internal static ConfigEntry<float> EquipmentX; internal static ConfigEntry<float> EquipmentY; internal static ConfigEntry<float> EquipmentScale; internal static ConfigEntry<bool> EquipmentMouseMove; internal static ConfigEntry<float> UtilityX; internal static ConfigEntry<float> UtilityY; internal static ConfigEntry<float> UtilityScale; internal static ConfigEntry<bool> UtilityMouseMove; internal static ConfigEntry<float> CapeX; internal static ConfigEntry<float> CapeY; internal static ConfigEntry<float> CapeScale; internal static ConfigEntry<bool> CapeMouseMove; internal static ConfigEntry<bool> FoodMouseMove; internal static ConfigEntry<bool> MeadMouseMove; internal static ConfigEntry<bool> AmmoMouseMove; internal static ConfigEntry<bool> MiscMouseMove; internal static ConfigEntry<bool> SpecialMouseMove; internal static ConfigEntry<bool> CoinMouseMove; internal static ConfigEntry<bool> ShowAppearancePanel; internal static ConfigEntry<bool> ShowUtilityItemGraphics; internal static ConfigEntry<bool> AppearanceWithoutEquipment; internal static ConfigEntry<float> AppearanceX; internal static ConfigEntry<float> AppearanceY; internal static ConfigEntry<float> AppearanceScale; internal static ConfigEntry<float> AppearancePreviewZoom; internal static ConfigEntry<string> AppearancePreviewModel; internal static ConfigEntry<bool> AppearanceMouseMove; internal static ConfigEntry<bool> ShowRecyclePanel; internal static ConfigEntry<float> RecycleX; internal static ConfigEntry<float> RecycleY; internal static ConfigEntry<float> RecycleScale; internal static ConfigEntry<bool> RecycleMouseMove; internal static ConfigEntry<int> RecycleReturnRate; internal static ConfigEntry<bool> RecycleRequireConfirmation; internal static ConfigEntry<float> TooltipX; internal static ConfigEntry<float> TooltipY; internal static ConfigEntry<float> TooltipScale; internal static ConfigEntry<float> FoodX; internal static ConfigEntry<float> FoodY; internal static ConfigEntry<float> FoodScale; internal static ConfigEntry<float> MeadX; internal static ConfigEntry<float> MeadY; internal static ConfigEntry<float> MeadScale; internal static ConfigEntry<float> MiscX; internal static ConfigEntry<float> MiscY; internal static ConfigEntry<float> MiscScale; internal static ConfigEntry<float> AmmoX; internal static ConfigEntry<float> AmmoY; internal static ConfigEntry<float> AmmoScale; internal static ConfigEntry<float> SpecialX; internal static ConfigEntry<float> SpecialY; internal static ConfigEntry<float> SpecialScale; internal static ConfigEntry<float> CoinX; internal static ConfigEntry<float> CoinY; internal static ConfigEntry<float> CoinScale; internal static ConfigEntry<KeyboardShortcut> CapeHotkey1; internal static ConfigEntry<KeyboardShortcut> CapeHotkey2; internal static ConfigEntry<KeyboardShortcut> FoodHotkey1; internal static ConfigEntry<KeyboardShortcut> FoodHotkey2; internal static ConfigEntry<KeyboardShortcut> FoodHotkey3; internal static ConfigEntry<KeyboardShortcut> FoodHotkey4; internal static ConfigEntry<KeyboardShortcut> FoodHotkey5; internal static ConfigEntry<KeyboardShortcut> MeadHotkey1; internal static ConfigEntry<KeyboardShortcut> MeadHotkey2; internal static ConfigEntry<KeyboardShortcut> MeadHotkey3; internal static ConfigEntry<KeyboardShortcut> MeadHotkey4; internal static ConfigEntry<KeyboardShortcut> MeadHotkey5; internal static ConfigEntry<KeyboardShortcut> AmmoHotkey1; internal static ConfigEntry<KeyboardShortcut> AmmoHotkey2; internal static ConfigEntry<KeyboardShortcut> AmmoHotkey3; internal static ConfigEntry<bool> ShowDebugLog; internal static ConfigEntry<bool> PanelBackground; internal static ConfigEntry<bool> InfiniteCarryWeight; internal static ConfigEntry<bool> RestoreVanillaRowsOnce; internal static ConfigEntry<float> ContainerX; internal static ConfigEntry<float> ContainerY; internal static ConfigEntry<bool> ContainerMouseMove; internal static ConfigEntry<float> ContainerScale; internal static ConfigEntry<bool> ContainerPositionInitialized; internal static ConfigEntry<int> CoordinateFormatVersion; internal static ConfigEntry<int> NativeWindowCoordinateFormatVersion; internal static ConfigEntry<int> TooltipCoordinateFormatVersion; internal static ConfigEntry<int> ContainerCoordinateFormatVersion; internal static ConfigEntry<float> InventoryX; internal static ConfigEntry<float> InventoryY; internal static ConfigEntry<float> InventoryScale; internal static ConfigEntry<bool> InventoryMouseMove; internal static ConfigEntry<bool> InventoryPositionInitialized; internal static ConfigEntry<float> InfoPanelX; internal static ConfigEntry<float> InfoPanelY; internal static ConfigEntry<float> InfoPanelScale; internal static ConfigEntry<bool> InfoPanelMouseMove; internal static ConfigEntry<bool> InfoPanelPositionInitialized; internal static ConfigEntry<float> SkillsX; internal static ConfigEntry<float> SkillsY; internal static ConfigEntry<float> SkillsScale; internal static ConfigEntry<bool> SkillsMouseMove; internal static ConfigEntry<bool> SkillsPositionInitialized; internal static ConfigEntry<float> TrophiesX; internal static ConfigEntry<float> TrophiesY; internal static ConfigEntry<float> TrophiesScale; internal static ConfigEntry<bool> TrophiesMouseMove; internal static ConfigEntry<bool> TrophiesPositionInitialized; internal static ConfigEntry<float> StatsX; internal static ConfigEntry<float> StatsY; internal static ConfigEntry<float> StatsScale; internal static ConfigEntry<bool> StatsMouseMove; internal static ConfigEntry<bool> StatsPositionInitialized; internal static ConfigEntry<float> AchievementsX; internal static ConfigEntry<float> AchievementsY; internal static ConfigEntry<float> AchievementsScale; internal static ConfigEntry<bool> AchievementsMouseMove; internal static ConfigEntry<bool> AchievementsPositionInitialized; internal static ConfigEntry<float> CraftingWindowX; internal static ConfigEntry<float> CraftingWindowY; internal static ConfigEntry<float> CraftingWindowScale; internal static ConfigEntry<bool> CraftingWindowMouseMove; internal static ConfigEntry<bool> CraftingWindowPositionInitialized; internal static bool ContainerResetRequested; internal static bool WritingContainerPosition; internal static ConfigEntry<string> DisplayLanguage; private static readonly List<ConfigEntryBase> LocalizedConfigEntries = new List<ConfigEntryBase>(); private static readonly Dictionary<ConfigEntryBase, Tuple<string, string, string>> LocalizedConfigMetadata = new Dictionary<ConfigEntryBase, Tuple<string, string, string>>(); internal static ConfigEntry<string> LayoutPresetControls; private static ConfigEntry<string> LayoutPreset1; private static ConfigEntry<string> LayoutPreset2; private static ConfigEntry<string> LayoutPreset3; private static ConfigEntry<int> LayoutPresetFormat; private static ConfigEntry<int> LayoutPresetSelected; internal static ConfigEntry<float> FoodHotbarX; internal static ConfigEntry<float> FoodHotbarY; internal static ConfigEntry<float> FoodHotbarScale; internal static ConfigEntry<float> MeadHotbarX; internal static ConfigEntry<float> MeadHotbarY; internal static ConfigEntry<float> MeadHotbarScale; internal static ConfigEntry<float> AmmoHotbarX; internal static ConfigEntry<float> AmmoHotbarY; internal static ConfigEntry<float> AmmoHotbarScale; internal static ConfigEntry<float> CapeHotbarX; internal static ConfigEntry<float> CapeHotbarY; internal static ConfigEntry<float> CapeHotbarScale; private static readonly string[] LayoutFieldSuffixes = new string[3] { "X", "Y", "Scale" }; private const string BuiltInPreset1PanelData = "AchievementsScale=1;AchievementsX=-2.823547;AchievementsY=2.823471;AmmoHotbarScale=0.75;AmmoHotbarX=150;AmmoHotbarY=120;AmmoScale=0.75;AmmoX=-181;AmmoY=-778;AppearanceScale=0.85;AppearanceX=-144;AppearanceY=-8.47057;CapeHotbarScale=0.75;CapeHotbarX=45;CapeHotbarY=120;CapeScale=0.82;CapeX=644;CapeY=-309;CoinScale=0.8;CoinX=-139;CoinY=-654;ContainerScale=0.7042017;ContainerX=-932.1702;ContainerY=-144.9385;CraftingWindowScale=1;CraftingWindowX=-36.70575;CraftingWindowY=-186.3531;EquipmentScale=1;EquipmentX=352;EquipmentY=-688;FoodHotbarScale=0.8;FoodHotbarX=240;FoodHotbarY=950;FoodScale=0.82;FoodX=263;FoodY=-209;InfoPanelScale=0.9941176;InfoPanelX=-35.17603;InfoPanelY=-37.11768;InventoryScale=1;InventoryX=24;InventoryY=-19.76471;MeadHotbarScale=0.75;MeadHotbarX=240;MeadHotbarY=890;MeadScale=0.82;MeadX=-134;MeadY=-129;MiscScale=0.8;MiscX=151;MiscY=-779;RecycleScale=0.9;RecycleX=120;RecycleY=-220;SkillsScale=1;SkillsX=-32.88247;SkillsY=-11.1765;SpecialScale=0.75;SpecialX=256;SpecialY=-568;StatsScale=1;StatsX=-28.47052;StatsY=28.23533;TooltipScale=1;TooltipX=0;TooltipY=62;TrophiesScale=1;TrophiesX=-43.05888;TrophiesY=39.29412;UtilityScale=1;UtilityX=503;UtilityY=-456"; private const string BuiltInPreset2PanelData = "AchievementsScale=1;AchievementsX=-2.823547;AchievementsY=2.823471;AmmoHotbarScale=0.75;AmmoHotbarX=150;AmmoHotbarY=120;AmmoScale=0.75;AmmoX=-457;AmmoY=-536;AppearanceScale=0.9271429;AppearanceX=168;AppearanceY=-12.70587;CapeHotbarScale=0.75;CapeHotbarX=45;CapeHotbarY=120;CapeScale=0.82;CapeX=366;CapeY=-70;CoinScale=0.8;CoinX=-124;CoinY=-568;ContainerScale=0.7042017;ContainerX=-932.1702;ContainerY=-144.9385;CraftingWindowScale=1;CraftingWindowX=-36.70575;CraftingWindowY=-186.3531;EquipmentScale=1;EquipmentX=354;EquipmentY=-772;FoodHotbarScale=0.8;FoodHotbarX=240;FoodHotbarY=950;FoodScale=0.82;FoodX=269;FoodY=-130;InfoPanelScale=0.9941176;InfoPanelX=-35.17603;InfoPanelY=-37.11768;InventoryScale=1;InventoryX=24;InventoryY=-19.76471;MeadHotbarScale=0.75;MeadHotbarX=240;MeadHotbarY=890;MeadScale=0.82;MeadX=-130;MeadY=-209;MiscScale=0.8;MiscX=457;MiscY=-700;RecycleScale=0.9;RecycleX=120;RecycleY=-220;SkillsScale=1;SkillsX=-32.88247;SkillsY=-11.1765;SpecialScale=0.75;SpecialX=258;SpecialY=-646;StatsScale=1;StatsX=-28.47052;StatsY=28.23533;TooltipScale=1;TooltipX=-250;TooltipY=62;TrophiesScale=1;TrophiesX=-43.05888;TrophiesY=39.29412;UtilityScale=1;UtilityX=505;UtilityY=-539"; private const string BuiltInPreset3PanelData = "AchievementsScale=1;AchievementsX=-2.823547;AchievementsY=2.823471;AmmoHotbarScale=0.65;AmmoHotbarX=698;AmmoHotbarY=45;AmmoScale=0.65;AmmoX=-120;AmmoY=-698;AppearanceScale=1.079832;AppearanceX=-97.41195;AppearanceY=69.17667;CapeHotbarScale=0.65;CapeHotbarX=605;CapeHotbarY=45;CapeScale=0.7;CapeX=976;CapeY=-231;CoinScale=0.8;CoinX=46;CoinY=-626;ContainerScale=0.7042017;ContainerX=-932.1702;ContainerY=-144.9385;CraftingWindowScale=0.847479;CraftingWindowX=-26.8233;CraftingWindowY=-169.4119;EquipmentScale=0.75;EquipmentX=319;EquipmentY=-768;FoodHotbarScale=0.65;FoodHotbarX=1043;FoodHotbarY=45;FoodScale=0.7;FoodX=152;FoodY=-298;InfoPanelScale=0.6382353;InfoPanelX=-39.4112;InfoPanelY=-62.52948;InventoryScale=1;InventoryX=24;InventoryY=-19.76471;MeadHotbarScale=0.65;MeadHotbarX=828;MeadHotbarY=45;MeadScale=0.7;MeadX=-245;MeadY=-235;MiscScale=0.7;MiscX=350;MiscY=-774;RecycleScale=0.9;RecycleX=120;RecycleY=-220;SkillsScale=1;SkillsX=-32.88247;SkillsY=-11.1765;SpecialScale=0.7;SpecialX=400;SpecialY=-637;StatsScale=1;StatsX=-28.47052;StatsY=28.23533;TooltipScale=1;TooltipX=30;TooltipY=62;TrophiesScale=1;TrophiesX=-43.05888;TrophiesY=39.29412;UtilityScale=0.75;UtilityX=433;UtilityY=-536"; private static string CachedLanguage = "ja"; private static bool LanguageCacheInitialized; private const string ConfigurationManagerGUID = "aedenthorn.configurationmanager"; private const string ConfigurationManagerUpdaterTypeName = "ConfigurationManager.Updater"; private static bool ConfigurationManagerOpenLatch; private static bool ConfigurationManagerWasOpen; private static Type ConfigurationManagerUpdaterType; private static Object ConfigurationManagerUpdaterInstance; private void Awake() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_0800: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_0870: Unknown result type (might be due to invalid IL or missing references) //IL_08a8: Unknown result type (might be due to invalid IL or missing references) //IL_08e0: Unknown result type (might be due to invalid IL or missing references) //IL_0918: Unknown result type (might be due to invalid IL or missing references) //IL_0950: Unknown result type (might be due to invalid IL or missing references) //IL_0988: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_09f8: Unknown result type (might be due to invalid IL or missing references) //IL_0a30: Unknown result type (might be due to invalid IL or missing references) //IL_0a68: Unknown result type (might be due to invalid IL or missing references) //IL_0aa0: Unknown result type (might be due to invalid IL or missing references) //IL_0ad8: Unknown result type (might be due to invalid IL or missing references) //IL_0b10: Unknown result type (might be due to invalid IL or missing references) //IL_0b43: Unknown result type (might be due to invalid IL or missing references) //IL_0b58: Unknown result type (might be due to invalid IL or missing references) //IL_0b7a: Unknown result type (might be due to invalid IL or missing references) //IL_0b8f: Unknown result type (might be due to invalid IL or missing references) //IL_0bae: Unknown result type (might be due to invalid IL or missing references) //IL_0bc3: Unknown result type (might be due to invalid IL or missing references) //IL_0be5: Unknown result type (might be due to invalid IL or missing references) //IL_0bfa: Unknown result type (might be due to invalid IL or missing references) //IL_0c19: Unknown result type (might be due to invalid IL or missing references) //IL_0c2e: Unknown result type (might be due to invalid IL or missing references) //IL_0c50: Unknown result type (might be due to invalid IL or missing references) //IL_0c65: Unknown result type (might be due to invalid IL or missing references) //IL_0c84: Unknown result type (might be due to invalid IL or missing references) //IL_0c99: Unknown result type (might be due to invalid IL or missing references) //IL_0cbb: Unknown result type (might be due to invalid IL or missing references) //IL_0cd0: Unknown result type (might be due to invalid IL or missing references) //IL_0cef: Unknown result type (might be due to invalid IL or missing references) //IL_0d04: Unknown result type (might be due to invalid IL or missing references) //IL_0d26: Unknown result type (might be due to invalid IL or missing references) //IL_0d3b: Unknown result type (might be due to invalid IL or missing references) //IL_0d5a: Unknown result type (might be due to invalid IL or missing references) //IL_0d6f: Unknown result type (might be due to invalid IL or missing references) //IL_0d8e: Unknown result type (might be due to invalid IL or missing references) //IL_0da3: Unknown result type (might be due to invalid IL or missing references) //IL_0dc2: Unknown result type (might be due to invalid IL or missing references) //IL_0dd7: Unknown result type (might be due to invalid IL or missing references) //IL_0df6: Unknown result type (might be due to invalid IL or missing references) //IL_0e0b: Unknown result type (might be due to invalid IL or missing references) //IL_0e2a: Unknown result type (might be due to invalid IL or missing references) //IL_0e3f: Unknown result type (might be due to invalid IL or missing references) //IL_0e5e: Unknown result type (might be due to invalid IL or missing references) //IL_0e73: Unknown result type (might be due to invalid IL or missing references) //IL_0e92: Unknown result type (might be due to invalid IL or missing references) //IL_0ea7: Unknown result type (might be due to invalid IL or missing references) //IL_0ec6: Unknown result type (might be due to invalid IL or missing references) //IL_0edb: Unknown result type (might be due to invalid IL or missing references) //IL_0efa: Unknown result type (might be due to invalid IL or missing references) //IL_0f0f: Unknown result type (might be due to invalid IL or missing references) //IL_0f2e: Unknown result type (might be due to invalid IL or missing references) //IL_0f43: Unknown result type (might be due to invalid IL or missing references) //IL_0f62: Unknown result type (might be due to invalid IL or missing references) //IL_0f77: Unknown result type (might be due to invalid IL or missing references) //IL_0f96: Unknown result type (might be due to invalid IL or missing references) //IL_0fab: Unknown result type (might be due to invalid IL or missing references) //IL_0fca: Unknown result type (might be due to invalid IL or missing references) //IL_0fdf: Unknown result type (might be due to invalid IL or missing references) //IL_0ffe: Unknown result type (might be due to invalid IL or missing references) //IL_1013: Unknown result type (might be due to invalid IL or missing references) //IL_1032: Unknown result type (might be due to invalid IL or missing references) //IL_1047: Unknown result type (might be due to invalid IL or missing references) //IL_1066: Unknown result type (might be due to invalid IL or missing references) //IL_107b: Unknown result type (might be due to invalid IL or missing references) //IL_109a: Unknown result type (might be due to invalid IL or missing references) //IL_10af: Unknown result type (might be due to invalid IL or missing references) //IL_10ce: Unknown result type (might be due to invalid IL or missing references) //IL_10e3: Unknown result type (might be due to invalid IL or missing references) //IL_1102: Unknown result type (might be due to invalid IL or missing references) //IL_1117: Unknown result type (might be due to invalid IL or missing references) //IL_1801: Unknown result type (might be due to invalid IL or missing references) //IL_180b: Expected O, but got Unknown //IL_18d3: Unknown result type (might be due to invalid IL or missing references) //IL_18dd: Expected O, but got Unknown //IL_191b: Unknown result type (might be due to invalid IL or missing references) //IL_1925: Expected O, but got Unknown //IL_1963: Unknown result type (might be due to invalid IL or missing references) //IL_196d: Expected O, but got Unknown //IL_19a7: Unknown result type (might be due to invalid IL or missing references) //IL_19b1: Expected O, but got Unknown //IL_19eb: Unknown result type (might be due to invalid IL or missing references) //IL_19f5: Expected O, but got Unknown //IL_1a8f: Unknown result type (might be due to invalid IL or missing references) //IL_1a99: Expected O, but got Unknown //IL_1f04: Unknown result type (might be due to invalid IL or missing references) //IL_1f0e: Expected O, but got Unknown //IL_1fd4: Unknown result type (might be due to invalid IL or missing references) //IL_1fde: Expected O, but got Unknown //IL_201c: Unknown result type (might be due to invalid IL or missing references) //IL_2026: Expected O, but got Unknown //IL_2064: Unknown result type (might be due to invalid IL or missing references) //IL_206e: Expected O, but got Unknown //IL_20ac: Unknown result type (might be due to invalid IL or missing references) //IL_20b6: Expected O, but got Unknown //IL_20f0: Unknown result type (might be due to invalid IL or missing references) //IL_20fa: Expected O, but got Unknown //IL_2153: Unknown result type (might be due to invalid IL or missing references) //IL_215d: Expected O, but got Unknown //IL_21c9: Unknown result type (might be due to invalid IL or missing references) //IL_21d3: Expected O, but got Unknown //IL_27d5: Unknown result type (might be due to invalid IL or missing references) //IL_27df: Expected O, but got Unknown Instance = this; DisplayLanguage = ((BaseUnityPlugin)Instance).Config.Bind<string>("UI", "Display Language", "自動", new ConfigDescription("表示言語を選択します。自動ではValheimの言語に合わせます。", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[6] { "自動", "日本語", "English", "Deutsch", "Français", "한국어" }), new object[1] { new ConfigurationManagerAttributes { Category = "UI", DispName = "表示言語", DefaultValue = "自動" } })); DisplayLanguage.SettingChanged += delegate { RefreshLanguageCache(); ApplyConfigManagerLocalization(); }; EquipmentX = BindFloat("Equipment Panel", "Position X", 0f, "装備", "位置 X", "装備パネルのX位置。"); EquipmentY = BindFloat("Equipment Panel", "Position Y", 0f, "装備", "位置 Y", "装備パネルのY位置。"); EquipmentScale = BindFloat("Equipment Panel", "Scale", 1f, "装備", "サイズ", "装備パネルのサイズ。", 0.4f, 1.5f); EquipmentMouseMove = BindBool("Equipment Panel", "Mouse Move", value: true, "装備", "マウスで移動", "装備パネルをマウスでドラッグして移動できるようにします。"); UtilityX = BindFloat("Utility Panel", "Position X", 0f, "ユーティリティ", "位置 X", "ユーティリティパネルのX位置。"); UtilityY = BindFloat("Utility Panel", "Position Y", 0f, "ユーティリティ", "位置 Y", "ユーティリティパネルのY位置。"); UtilityScale = BindFloat("Utility Panel", "Scale", 1f, "ユーティリティ", "サイズ", "ユーティリティパネルのサイズ。", 0.4f, 1.5f); UtilityMouseMove = BindBool("Utility Panel", "Mouse Move", value: true, "ユーティリティ", "マウスで移動", "ユーティリティパネルをマウスでドラッグして移動できるようにします。"); CapeX = BindFloat("Cape Panel", "Position X", 0f, "マント", "位置 X", "マントパネルのX位置。"); CapeY = BindFloat("Cape Panel", "Position Y", 0f, "マント", "位置 Y", "マントパネルのY位置。"); CapeScale = BindFloat("Cape Panel", "Scale", 0.82f, "マント", "サイズ", "マントパネルのサイズ。", 0.4f, 1.5f); CapeMouseMove = BindBool("Cape Panel", "Mouse Move", value: true, "マント", "マウスで移動", "マントパネルをマウスでドラッグして移動できるようにします。"); TooltipX = BindFloat("Inventory Tooltip", "Position X", 0f, "アイテム説明", "位置 X", "アイテム説明のX位置。"); TooltipY = BindFloat("Inventory Tooltip", "Position Y", 62f, "アイテム説明", "位置 Y", "アイテム説明のY位置。"); TooltipScale = BindFloat("Inventory Tooltip", "Scale", 1f, "アイテム説明", "サイズ", "アイテム説明の大きさ。1.0がバニラサイズです。", 0.4f, 1.5f); FoodX = BindFloat("Food Panel", "Position X", 0f, "食べ物", "位置 X", "食べ物パネルのX位置。"); FoodY = BindFloat("Food Panel", "Position Y", 20f, "食べ物", "位置 Y", "食べ物パネルのY位置。"); FoodScale = BindFloat("Food Panel", "Scale", 0.82f, "食べ物", "サイズ", "食べ物パネルのサイズ。", 0.4f, 1.5f); FoodMouseMove = BindBool("Food Panel", "Mouse Move", value: true, "食べ物", "マウスで移動", "食べ物パネルをマウスでドラッグして移動できるようにします。"); MeadX = BindFloat("Mead Panel", "Position X", 190f, "蜂蜜酒", "位置 X", "蜂蜜酒パネルのX位置。"); MeadY = BindFloat("Mead Panel", "Position Y", 0f, "蜂蜜酒", "位置 Y", "蜂蜜酒パネルのY位置。"); MeadScale = BindFloat("Mead Panel", "Scale", 0.82f, "蜂蜜酒", "サイズ", "蜂蜜酒パネルのサイズ。", 0.4f, 1.5f); MeadMouseMove = BindBool("Mead Panel", "Mouse Move", value: true, "蜂蜜酒", "マウスで移動", "蜂蜜酒パネルをマウスでドラッグして移動できるようにします。"); MiscX = BindFloat("Misc Panel", "Position X", 260f, "その他", "位置 X", "その他パネルのX位置。"); MiscY = BindFloat("Misc Panel", "Position Y", 20f, "その他", "位置 Y", "その他パネルのY位置。"); MiscScale = BindFloat("Misc Panel", "Scale", 0.75f, "その他", "サイズ", "その他パネルのサイズ。", 0.4f, 1.5f); MiscMouseMove = BindBool("Misc Panel", "Mouse Move", value: true, "その他", "マウスで移動", "その他パネルをマウスでドラッグして移動できるようにします。"); AmmoX = BindFloat("Ammo Panel", "Position X", 150f, "矢弾", "位置 X", "矢弾パネルのX位置。"); AmmoY = BindFloat("Ammo Panel", "Position Y", 20f, "矢弾", "位置 Y", "矢弾パネルのY位置。"); AmmoScale = BindFloat("Ammo Panel", "Scale", 0.75f, "矢弾", "サイズ", "矢弾パネルのサイズ。", 0.4f, 1.5f); AmmoMouseMove = BindBool("Ammo Panel", "Mouse Move", value: true, "矢弾", "マウスで移動", "矢弾パネルをマウスでドラッグして移動できるようにします。"); SpecialX = BindFloat("Special Panel", "Position X", 0f, "特殊", "位置 X", "鍵やライトなどの特殊アイテムパネルのX位置。"); SpecialY = BindFloat("Special Panel", "Position Y", 20f, "特殊", "位置 Y", "鍵やライトなどの特殊アイテムパネルのY位置。"); SpecialScale = BindFloat("Special Panel", "Scale", 0.72f, "特殊", "サイズ", "特殊アイテムパネルのサイズ。", 0.4f, 1.5f); SpecialMouseMove = BindBool("Special Panel", "Mouse Move", value: true, "特殊", "マウスで移動", "特殊アイテムパネルをマウスでドラッグして移動できるようにします。"); CoinX = BindFloat("Coin Panel", "Position X", 430f, "コイン", "位置 X", "コインパネルのX位置。"); CoinY = BindFloat("Coin Panel", "Position Y", 20f, "コイン", "位置 Y", "コインパネルのY位置。"); CoinScale = BindFloat("Coin Panel", "Scale", 0.72f, "コイン", "サイズ", "コインパネルのサイズ。", 0.4f, 1.5f); CoinMouseMove = BindBool("Coin Panel", "Mouse Move", value: true, "コイン", "マウスで移動", "コインパネルをマウスでドラッグして移動できるようにします。"); CapeHotkey1 = BindHotkey("Hotkeys - Cape", "Cape 1", new KeyboardShortcut((KeyCode)98, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "ケープキー", "ケープ 1", "ケープスロット1を使用。"); CapeHotkey2 = BindHotkey("Hotkeys - Cape", "Cape 2", new KeyboardShortcut((KeyCode)110, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "ケープキー", "ケープ 2", "ケープスロット2を使用。"); FoodHotkey1 = BindHotkey("Hotkeys - Food", "Food 1", new KeyboardShortcut((KeyCode)104, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "食べ物キー", "食べ物 1", "食べ物スロット1を使用。"); FoodHotkey2 = BindHotkey("Hotkeys - Food", "Food 2", new KeyboardShortcut((KeyCode)106, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "食べ物キー", "食べ物 2", "食べ物スロット2を使用。"); FoodHotkey3 = BindHotkey("Hotkeys - Food", "Food 3", new KeyboardShortcut((KeyCode)107, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "食べ物キー", "食べ物 3", "食べ物スロット3を使用。"); FoodHotkey4 = BindHotkey("Hotkeys - Food", "Food 4", new KeyboardShortcut((KeyCode)108, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "食べ物キー", "食べ物 4", "食べ物スロット4を使用。"); FoodHotkey5 = BindHotkey("Hotkeys - Food", "Food 5", new KeyboardShortcut((KeyCode)59, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "食べ物キー", "食べ物 5", "食べ物スロット5を使用。"); MeadHotkey1 = BindHotkey("Hotkeys - Mead", "Mead 1", new KeyboardShortcut((KeyCode)121, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "ポーションキー", "ポーション 1", "ポーションスロット1を使用。"); MeadHotkey2 = BindHotkey("Hotkeys - Mead", "Mead 2", new KeyboardShortcut((KeyCode)117, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "ポーションキー", "ポーション 2", "ポーションスロット2を使用。"); MeadHotkey3 = BindHotkey("Hotkeys - Mead", "Mead 3", new KeyboardShortcut((KeyCode)105, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "ポーションキー", "ポーション 3", "ポーションスロット3を使用。"); MeadHotkey4 = BindHotkey("Hotkeys - Mead", "Mead 4", new KeyboardShortcut((KeyCode)111, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "ポーションキー", "ポーション 4", "ポーションスロット4を使用。"); MeadHotkey5 = BindHotkey("Hotkeys - Mead", "Mead 5", new KeyboardShortcut((KeyCode)112, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "ポーションキー", "ポーション 5", "ポーションスロット5を使用。"); AmmoHotkey1 = BindHotkey("Hotkeys - Ammo", "Ammo 1", new KeyboardShortcut((KeyCode)91, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "矢弾キー", "矢弾 1", "矢弾スロット1を使用。"); AmmoHotkey2 = BindHotkey("Hotkeys - Ammo", "Ammo 2", new KeyboardShortcut((KeyCode)93, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "矢弾キー", "矢弾 2", "矢弾スロット2を使用。"); AmmoHotkey3 = BindHotkey("Hotkeys - Ammo", "Ammo 3", new KeyboardShortcut((KeyCode)92, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "矢弾キー", "矢弾 3", "矢弾スロット3を使用。"); MigrateLegacyHotkey(CapeHotkey1, new KeyboardShortcut((KeyCode)113, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)98, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(CapeHotkey1, new KeyboardShortcut((KeyCode)287, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)98, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(CapeHotkey2, new KeyboardShortcut((KeyCode)119, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)110, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(CapeHotkey2, new KeyboardShortcut((KeyCode)288, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)110, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(FoodHotkey1, new KeyboardShortcut((KeyCode)122, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)104, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(FoodHotkey1, new KeyboardShortcut((KeyCode)289, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)104, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(FoodHotkey2, new KeyboardShortcut((KeyCode)120, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)106, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(FoodHotkey2, new KeyboardShortcut((KeyCode)291, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)106, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(FoodHotkey3, new KeyboardShortcut((KeyCode)99, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)107, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(FoodHotkey3, new KeyboardShortcut((KeyCode)277, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)107, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(FoodHotkey4, new KeyboardShortcut((KeyCode)118, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)108, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(FoodHotkey4, new KeyboardShortcut((KeyCode)127, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)108, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(FoodHotkey5, new KeyboardShortcut((KeyCode)98, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)59, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(FoodHotkey5, new KeyboardShortcut((KeyCode)96, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)59, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(MeadHotkey1, new KeyboardShortcut((KeyCode)97, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)121, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(MeadHotkey1, new KeyboardShortcut((KeyCode)45, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)121, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(MeadHotkey2, new KeyboardShortcut((KeyCode)115, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)117, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(MeadHotkey2, new KeyboardShortcut((KeyCode)61, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)117, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(MeadHotkey3, new KeyboardShortcut((KeyCode)100, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)105, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(MeadHotkey3, new KeyboardShortcut((KeyCode)91, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)105, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(MeadHotkey4, new KeyboardShortcut((KeyCode)102, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)111, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(MeadHotkey4, new KeyboardShortcut((KeyCode)93, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)111, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(MeadHotkey5, new KeyboardShortcut((KeyCode)103, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)112, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(MeadHotkey5, new KeyboardShortcut((KeyCode)59, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)112, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(AmmoHotkey1, new KeyboardShortcut((KeyCode)49, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)91, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(AmmoHotkey1, new KeyboardShortcut((KeyCode)39, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)91, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(AmmoHotkey2, new KeyboardShortcut((KeyCode)50, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)93, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(AmmoHotkey2, new KeyboardShortcut((KeyCode)47, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)93, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); MigrateLegacyHotkey(AmmoHotkey3, new KeyboardShortcut((KeyCode)51, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), new KeyboardShortcut((KeyCode)92, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 })); PanelBackground = BindBool("UI", "Panel Background", value: true, "UI", "MOD追加パネル背景", "MODが追加する装備スロットの背面・見出し背景・見た目/リサイクルパネルの背面を表示します。OFFではこれらのMOD追加背景を非表示にします。バニラのインベントリ/情報/クラフトウィンドウ自体の背景は対象外です。"); InfiniteCarryWeight = BindBool("Gameplay", "Infinite Carry Weight", value: false, "所持重量", "重量制限解除", "所持重量の上限を解除します。ONにすると大量のアイテムを持っても重量超過になりません。OFFではValheim本来の重量計算を使用します。"); ContainerX = BindFloat("Storage Panel", "Position X", 0f, "収納パネル", "位置 X", "収納パネルのX位置。自動設定後はこの座標を基準に固定します。"); ContainerY = BindFloat("Storage Panel", "Position Y", 0f, "収納パネル", "位置 Y", "収納パネルのY位置。自動設定後はこの座標を基準に固定します。"); ContainerMouseMove = BindBool("Storage Panel", "Mouse Move", value: true, "収納パネル", "マウスで移動", "収納パネルをマウスでドラッグして移動できるようにします。"); ContainerScale = BindFloat("Storage Panel", "Scale", 1f, "収納パネル", "サイズ", "収納パネルの大きさ。1.0がバニラサイズです。", 0.4f, 1.5f); InventoryX = BindFloat("Inventory", "Position X", 0f, "インベントリ", "位置 X", "インベントリのX位置。"); InventoryY = BindFloat("Inventory", "Position Y", 0f, "インベントリ", "位置 Y", "インベントリのY位置。"); InventoryScale = BindFloat("Inventory", "Scale", 1f, "インベントリ", "サイズ", "インベントリの大きさ。1.0がバニラサイズです。", 0.4f, 1.5f); InventoryMouseMove = BindBool("Inventory", "Mouse Move", value: true, "インベントリ", "マウスで移動", "インベントリを上部からマウスでドラッグして移動できるようにします。"); InventoryPositionInitialized = BindHiddenBool("Inventory", "Position Initialized", value: false); InfoPanelX = BindFloat("Info Panel", "Position X", 0f, "情報パネル", "位置 X", "情報パネルのX位置。"); InfoPanelY = BindFloat("Info Panel", "Position Y", 0f, "情報パネル", "位置 Y", "情報パネルのY位置。"); InfoPanelScale = BindFloat("Info Panel", "Scale", 0.8f, "情報パネル", "サイズ", "情報パネルの大きさ。1.0がバニラサイズです。", 0.4f, 1.5f); InfoPanelMouseMove = BindBool("Info Panel", "Mouse Move", value: true, "情報パネル", "マウスで移動", "情報パネルを名前部分からマウスでドラッグして移動できるようにします。"); InfoPanelPositionInitialized = BindHiddenBool("Info Panel", "Position Initialized", value: false); SkillsX = BindFloat("Info Menu - Skills", "Position X", 0f, "情報メニュー - スキル", "位置 X", "スキルメニューのX位置。"); SkillsY = BindFloat("Info Menu - Skills", "Position Y", 0f, "情報メニュー - スキル", "位置 Y", "スキルメニューのY位置。"); SkillsScale = BindFloat("Info Menu - Skills", "Scale", 1f, "情報メニュー - スキル", "サイズ", "スキルメニューの大きさ。", 0.4f, 1.5f); SkillsMouseMove = BindBool("Info Menu - Skills", "Mouse Move", value: true, "情報メニュー - スキル", "マウスで移動", "スキルウインドウ中央の領域をマウスでドラッグして移動できるようにします。"); SkillsPositionInitialized = BindHiddenBool("Info Menu - Skills", "Position Initialized", value: false); TrophiesX = BindFloat("Info Menu - Trophies", "Position X", 0f, "情報メニュー - トロフィー", "位置 X", "トロフィーメニューのX位置。"); TrophiesY = BindFloat("Info Menu - Trophies", "Position Y", 0f, "情報メニュー - トロフィー", "位置 Y", "トロフィーメニューのY位置。"); TrophiesScale = BindFloat("Info Menu - Trophies", "Scale", 1f, "情報メニュー - トロフィー", "サイズ", "トロフィーメニューの大きさ。", 0.4f, 1.5f); TrophiesMouseMove = BindBool("Info Menu - Trophies", "Mouse Move", value: true, "情報メニュー - トロフィー", "マウスで移動", "トロフィーウインドウ中央の領域をマウスでドラッグして移動できるようにします。"); TrophiesPositionInitialized = BindHiddenBool("Info Menu - Trophies", "Position Initialized", value: false); StatsX = BindFloat("Info Menu - Stats", "Position X", 0f, "情報メニュー - カラス / 情報", "位置 X", "カラスの情報(Texts)メニューのX位置。"); StatsY = BindFloat("Info Menu - Stats", "Position Y", 0f, "情報メニュー - カラス / 情報", "位置 Y", "カラスの情報(Texts)メニューのY位置。"); StatsScale = BindFloat("Info Menu - Stats", "Scale", 1f, "情報メニュー - カラス / 情報", "サイズ", "カラスの情報(Texts)メニューの大きさ。", 0.4f, 1.5f); StatsMouseMove = BindBool("Info Menu - Stats", "Mouse Move", value: true, "情報メニュー - カラス / 情報", "マウスで移動", "統計・カラスの情報ウインドウ中央の領域をマウスでドラッグして移動できるようにします。"); StatsPositionInitialized = BindHiddenBool("Info Menu - Stats", "Position Initialized", value: false); AchievementsX = BindFloat("Info Menu - Achievements", "Position X", 0f, "情報メニュー - 実績", "位置 X", "実績メニューのX位置。"); AchievementsY = BindFloat("Info Menu - Achievements", "Position Y", 0f, "情報メニュー - 実績", "位置 Y", "実績メニューのY位置。"); AchievementsScale = BindFloat("Info Menu - Achievements", "Scale", 1f, "情報メニュー - 実績", "サイズ", "実績メニューの大きさ。", 0.4f, 1.5f); AchievementsMouseMove = BindBool("Info Menu - Achievements", "Mouse Move", value: true, "情報メニュー - 実績", "マウスで移動", "実績ウインドウ中央の領域をマウスでドラッグして移動できるようにします。"); AchievementsPositionInitialized = BindHiddenBool("Info Menu - Achievements", "Position Initialized", value: false); CraftingWindowX = BindFloat("Crafting Window", "Position X", 0f, "クラフトウインドウ", "位置 X", "クラフトウインドウのX位置。"); CraftingWindowY = BindFloat("Crafting Window", "Position Y", 0f, "クラフトウインドウ", "位置 Y", "クラフトウインドウのY位置。"); CraftingWindowScale = BindFloat("Crafting Window", "Scale", 1f, "クラフトウインドウ", "サイズ", "クラフトウインドウの大きさ。1.0がバニラサイズです。", 0.4f, 1.5f); CraftingWindowMouseMove = BindBool("Crafting Window", "Mouse Move", value: true, "クラフトウインドウ", "マウスで移動", "クラフトウインドウを上部からマウスでドラッグして移動できるようにします。"); CraftingWindowPositionInitialized = BindHiddenBool("Crafting Window", "Position Initialized", value: false); ContainerPositionInitialized = ((BaseUnityPlugin)Instance).Config.Bind<bool>("Storage Panel", "Position Initialized", false, new ConfigDescription("収納パネルの初期位置が保存済みかどうか。", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); LocalizedConfigEntries.Add((ConfigEntryBase)(object)ContainerPositionInitialized); LocalizedConfigMetadata[(ConfigEntryBase)(object)ContainerPositionInitialized] = Tuple.Create("収納パネル", "位置初期化済み", "収納パネルの初期位置が保存済みかどうか。"); CoordinateFormatVersion = BindHiddenInt("UI Coordinates", "Coordinate Format", 0, 3); NativeWindowCoordinateFormatVersion = BindHiddenInt("UI Coordinates", "Native Window Coordinate Format", 0, 2); TooltipCoordinateFormatVersion = BindHiddenInt("UI Coordinates", "Tooltip Coordinate Format", 0, 3); ContainerCoordinateFormatVersion = BindHiddenInt("UI Coordinates", "Container Coordinate Format", 0, 3); LayoutPreset1 = ((BaseUnityPlugin)Instance).Config.Bind<string>("Layout Presets", "Preset 1 Data", string.Empty, new ConfigDescription("レイアウトプリセット1の保存データ。", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); LayoutPreset2 = ((BaseUnityPlugin)Instance).Config.Bind<string>("Layout Presets", "Preset 2 Data", string.Empty, new ConfigDescription("レイアウトプリセット2の保存データ。", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); LayoutPreset3 = ((BaseUnityPlugin)Instance).Config.Bind<string>("Layout Presets", "Preset 3 Data", string.Empty, new ConfigDescription("レイアウトプリセット3の保存データ。", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); LayoutPresetFormat = ((BaseUnityPlugin)Instance).Config.Bind<int>("Layout Presets", "Preset Format", 0, new ConfigDescription("レイアウトプリセットの内部形式番号。", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); LayoutPresetSelected = ((BaseUnityPlugin)Instance).Config.Bind<int>("Layout Presets", "Selected Preset", 1, new ConfigDescription("現在選択中のレイアウトプリセット番号。", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); if (LayoutPresetSelected.Value < 1 || LayoutPresetSelected.Value > 3) { LayoutPresetSelected.Value = 1; } LayoutPresetControls = ((BaseUnityPlugin)Instance).Config.Bind<string>("Layout Presets", "Preset Controls", string.Empty, new ConfigDescription("現在の配置を保存したり、保存済みの配置へ切り替えます。", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Category = "レイアウトプリセット", DispName = "プリセット", HideDefaultButton = true, CustomDrawer = DrawPresetControls } })); FoodHotbarX = BindFloat("Hotbar - Food", "Position X", 40f, "食べ物クイックバー", "位置 X", "食べ物クイックバーの左上からのX位置。"); FoodHotbarY = BindFloat("Hotbar - Food", "Position Y", 145f, "食べ物クイックバー", "位置 Y", "食べ物クイックバーの左上からのY位置。"); FoodHotbarScale = BindFloat("Hotbar - Food", "Scale", 1f, "食べ物クイックバー", "サイズ", "食べ物クイックバーのサイズ。"); MeadHotbarX = BindFloat("Hotbar - Mead", "Position X", 40f, "ミードクイックバー", "位置 X", "ミードクイックバーの左上からのX位置。"); MeadHotbarY = BindFloat("Hotbar - Mead", "Position Y", 205f, "ミードクイックバー", "位置 Y", "ミードクイックバーの上端からのY位置。"); MeadHotbarScale = BindFloat("Hotbar - Mead", "Scale", 1f, "ミードクイックバー", "サイズ", "ミードクイックバーのサイズ。"); AmmoHotbarX = BindFloat("Hotbar - Ammo", "Position X", 180f, "矢弾クイックバー", "位置 X", "矢弾クイックバーの左上からのX位置。"); AmmoHotbarY = BindFloat("Hotbar - Ammo", "Position Y", 85f, "矢弾クイックバー", "位置 Y", "矢弾クイックバーの左上からのY位置。"); AmmoHotbarScale = BindFloat("Hotbar - Ammo", "Scale", 1f, "矢弾クイックバー", "サイズ", "矢弾クイックバーのサイズ。"); CapeHotbarX = BindFloat("Hotbar - Cape", "Position X", 40f, "ケープクイックバー", "位置 X", "ケープクイックバーの左上からのX位置。"); CapeHotbarY = BindFloat("Hotbar - Cape", "Position Y", 85f, "ケープクイックバー", "位置 Y", "ケープクイックバーの左上からのY位置。"); CapeHotbarScale = BindFloat("Hotbar - Cape", "Scale", 1f, "ケープクイックバー", "サイズ", "ケープクイックバーのサイズ。"); ShowDebugLog = BindBool("Debug", "Debug Log", value: false, "デバッグ", "デバッグログ", "診断ログを有効にします。"); ShowAppearancePanel = BindBool("Appearance Panel", "Show", value: true, "見た目装備", "表示", "見た目装備パネルを表示します。"); ShowUtilityItemGraphics = BindBool("Utility Items", "Show Utility Item Graphics", value: true, "ユーティリティアイテム", "グラフィック表示を1つだけにする", "ONにすると、独自ユーティリティスロット内で最後に装着したアイテムのグラフィックだけを表示します。OFFでは従来どおり複数のグラフィックを表示します。装備状態や効果は変わりません。"); ShowUtilityItemGraphics.SettingChanged += delegate { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } try { SakeysOtherUtilityVisuals.RefreshLiveNow(localPlayer); } catch (Exception ex) { Log("Utility graphics setting refresh failed: " + ex.GetType().Name + ": " + ex.Message); } }; AppearanceWithoutEquipment = BindBool("Appearance Panel", "Show Without Equipment", value: true, "見た目装備", "未装備部位にも表示", "実際の頭・胴・脚・ケープを装備していなくても、選択した見た目だけを表示します。"); AppearanceX = BindFloat("Appearance Panel", "Position X", -120f, "見た目装備", "位置 X", "画面中央を基準にした見た目装備パネルのX位置。"); AppearanceY = BindFloat("Appearance Panel", "Position Y", -220f, "見た目装備", "位置 Y", "画面中央を基準にした見た目装備パネルのY位置。"); AppearanceScale = BindFloat("Appearance Panel", "Scale", 1f, "見た目装備", "サイズ", "見た目装備パネルのサイズ。正方形の基準サイズに対する倍率。", 0.5f, 2f); AppearancePreviewZoom = BindFloat("Appearance Panel", "Preview Zoom", 1.2f, "見た目装備", "プレビュー初期ズーム", "外観プレビューを開いたときの初期ズーム倍率。ゲーム中は右スティック/マウスホイールで変更できます。", 0.5f, 3f); AppearancePreviewModel = ((BaseUnityPlugin)Instance).Config.Bind<string>("Appearance Panel", "Preview Model", "バニラ", new ConfigDescription("見た目装備プレビューに表示するモデルを切り替えます。腰装備の座標プリセットとは独立しています。", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[2] { "バニラ", "VRM" }), new object[1] { new ConfigurationManagerAttributes { Category = "見た目装備", DispName = "プレビュー方式", DefaultValue = "バニラ", ObjToStr = delegate(object value) { string obj = ((value != null) ? value.ToString() : ""); return ConfigText(obj, obj); } } })); if (string.Equals(AppearancePreviewModel.Value, "ヴァルキリー", StringComparison.Ordinal)) { AppearancePreviewModel.Value = "バニラ"; } RegisterDynamicLocalizedConfig((ConfigEntryBase)(object)AppearancePreviewModel, "見た目装備", "プレビュー方式", "見た目装備プレビューに表示するモデルを切り替えます。腰装備の座標プリセットとは独立しています。"); AppearancePreviewModel.SettingChanged += delegate { SakeysAppearancePreview.Clear(); }; AppearanceMouseMove = BindBool("Appearance Panel", "Mouse Move", value: true, "見た目装備", "マウスで移動", "見た目装備パネルをマウスでドラッグして移動できるようにします。"); ShowRecyclePanel = ((BaseUnityPlugin)Instance).Config.Bind<bool>("Internal", "Recycle Panel Enabled", false, new ConfigDescription("Internal", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); RecycleX = ((BaseUnityPlugin)Instance).Config.Bind<float>("Internal", "Recycle X", 120f, new ConfigDescription("Internal", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); RecycleY = ((BaseUnityPlugin)Instance).Config.Bind<float>("Internal", "Recycle Y", -220f, new ConfigDescription("Internal", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); RecycleScale = ((BaseUnityPlugin)Instance).Config.Bind<float>("Internal", "Recycle Scale", 0.9f, new ConfigDescription("Internal", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); RecycleMouseMove = ((BaseUnityPlugin)Instance).Config.Bind<bool>("Internal", "Recycle Mouse Move", false, new ConfigDescription("Internal", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); RecycleReturnRate = ((BaseUnityPlugin)Instance).Config.Bind<int>("Recycle", "Return Rate", 100, new ConfigDescription("リサイクル時にレシピ素材の何%を返すか。", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), new object[1] { new ConfigurationManagerAttributes { Category = "リサイクル", DispName = "返還率", DefaultValue = 100 } })); LocalizedConfigEntries.Add((ConfigEntryBase)(object)RecycleReturnRate); LocalizedConfigMetadata[(ConfigEntryBase)(object)RecycleReturnRate] = Tuple.Create("リサイクル", "返還率", "リサイクル時にレシピ素材の何%を返すか。"); RecycleRequireConfirmation = ((BaseUnityPlugin)Instance).Config.Bind<bool>("Internal", "Recycle Require Confirmation", false, new ConfigDescription("Internal", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } })); if (!EquipmentMouseMove.Value) { EquipmentMouseMove.Value = true; } if (!UtilityMouseMove.Value) { UtilityMouseMove.Value = true; } if (!CapeMouseMove.Value) { CapeMouseMove.Value = true; } if (Mathf.Approximately(CapeScale.Value, 1f)) { CapeScale.Value = 0.82f; } if (Mathf.Approximately(FoodHotbarScale.Value, 0.72f)) { FoodHotbarScale.Value = 1f; } if (Mathf.Approximately(MeadHotbarScale.Value, 0.72f)) { MeadHotbarScale.Value = 1f; } if (Mathf.Approximately(AmmoHotbarScale.Value, 0.72f)) { AmmoHotbarScale.Value = 1f; } if (Mathf.Approximately(CapeHotbarScale.Value, 0.72f)) { CapeHotbarScale.Value = 1f; } if (LayoutPresetFormat.Value < 9) { LayoutPreset1.Value = BuildPreset1Layout(); LayoutPreset2.Value = BuildPreset2Layout(); LayoutPreset3.Value = BuildPreset3Layout(LayoutPreset3.Value); LayoutPresetFormat.Value = 9; ((BaseUnityPlugin)Instance).Config.Save(); } if (LayoutPresetFormat.Value < 11) { LayoutPreset1.Value = ApplyPresetOverrides(LayoutPreset1.Value, new Dictionary<string, float> { { "AmmoHotbarScale", 0.75f }, { "AmmoHotbarX", 150f }, { "AmmoHotbarY", 120f } }); LayoutPreset2.Value = ApplyPresetOverrides(LayoutPreset2.Value, new Dictionary<string, float> { { "CapeHotbarScale", 0.75f }, { "CapeHotbarX", 230f }, { "CapeHotbarY", 870f }, { "FoodHotbarScale", 0.8f }, { "FoodHotbarX", 500f }, { "FoodHotbarY", 1000f }, { "AmmoHotbarScale", 0.9f }, { "AmmoHotbarX", 230f }, { "AmmoHotbarY", 930f }, { "MeadHotbarScale", 0.8f }, { "MeadHotbarX", 230f }, { "MeadHotbarY", 1000f } }); LayoutPresetFormat.Value = 11; ((BaseUnityPlugin)Instance).Config.Save(); } if (LayoutPresetFormat.Value < 13) { LayoutPreset1.Value = ApplyPresetOverrides(LayoutPreset1.Value, new Dictionary<string, float> { { "CapeScale", 0.82f }, { "CapeX", 260f }, { "CapeY", -379f }, { "AmmoScale", 0.75f }, { "AmmoX", 703f }, { "AmmoY", -473f }, { "UtilityScale", 1f }, { "UtilityX", 154f }, { "UtilityY", -109f }, { "MeadHotbarScale", 0.75f }, { "MeadHotbarX", 240f }, { "MeadHotbarY", 890f } }); LayoutPresetFormat.Value = 13; ((BaseUnityPlugin)Instance).Config.Save(); } if (LayoutPresetFormat.Value < 15) { LayoutPreset1.Value = BuildPreset1Layout(); LayoutPreset2.Value = BuildPreset2Layout(); LayoutPreset3.Value = BuildPreset3Layout(LayoutPreset3.Value); LayoutPresetFormat.Value = 15; RestoreLayout(LayoutPreset1.Value); ((BaseUnityPlugin)Instance).Config.Save(); } if (LayoutPresetFormat.Value < 16) { Dictionary<string, float> defaults = new Dictionary<string, float> { { "AppearanceX", 0f }, { "AppearanceY", -260f }, { "AppearanceScale", 1.2f }, { "RecycleX", 260f }, { "RecycleY", -260f }, { "RecycleScale", 0.9f } }; LayoutPreset1.Value = ApplyPresetDefaultsIfMissing(LayoutPreset1.Value, defaults); LayoutPreset2.Value = ApplyPresetDefaultsIfMissing(LayoutPreset2.Value, defaults); LayoutPreset3.Value = ApplyPresetDefaultsIfMissing(LayoutPreset3.Value, defaults); LayoutPresetFormat.Value = 16; ((BaseUnityPlugin)Instance).Config.Save(); } if (Mathf.Approximately(AppearanceX.Value, 0f) && Mathf.Approximately(AppearanceY.Value, -260f)) { AppearanceX.Value = -120f; AppearanceY.Value = -220f; } if (Mathf.Approximately(RecycleX.Value, 260f) && Mathf.Approximately(RecycleY.Value, -260f)) { RecycleX.Value = 120f; RecycleY.Value = -220f; } if (Mathf.Approximately(AppearanceX.Value, -120f) && Mathf.Approximately(AppearanceY.Value, -220f)) { AppearanceX.Value = -205f; AppearanceY.Value = -220f; } MigrateV40CoordinatesBackToCanonical(); SyncConfigManagerDefaultsToPreset1(); Harmony = new Harmony("com.sakey.equipmentslots"); Harmony.PatchAll(); ((MonoBehaviour)this).StartCoroutine(SakeysOtherUtilityVisuals.InstallValkyrApplyPostfixWhenAvailable(Harmony)); RefreshLanguageCache(); ApplyConfigManagerLocalization(); ((MonoBehaviour)this).StartCoroutine(RefreshLanguageAfterStartup()); Log("Sakey's Equipment Slots started (build394)."); } private static FieldInfo[] GetLayoutFields() { return (from f in typeof(SakeysEquipmentSlotsPlugin).GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) where f.FieldType == typeof(ConfigEntry<float>) && LayoutFieldSuffixes.Any((string s) => f.Name.EndsWith(s, StringComparison.Ordinal)) orderby f.Name select f).ToArray(); } private static string BuildPreset1Layout() { return BuildBuiltInPresetLayout("AchievementsScale=1;AchievementsX=-2.823547;AchievementsY=2.823471;AmmoHotbarScale=0.75;AmmoHotbarX=150;AmmoHotbarY=120;AmmoScale=0.75;AmmoX=-181;AmmoY=-778;AppearanceScale=0.85;AppearanceX=-144;AppearanceY=-8.47057;CapeHotbarScale=0.75;CapeHotbarX=45;CapeHotbarY=120;CapeScale=0.82;CapeX=644;CapeY=-309;CoinScale=0.8;CoinX=-139;CoinY=-654;ContainerScale=0.7042017;ContainerX=-932.1702;ContainerY=-144.9385;CraftingWindowScale=1;CraftingWindowX=-36.70575;CraftingWindowY=-186.3531;EquipmentScale=1;EquipmentX=352;EquipmentY=-688;FoodHotbarScale=0.8;FoodHotbarX=240;FoodHotbarY=950;FoodScale=0.82;FoodX=263;FoodY=-209;InfoPanelScale=0.9941176;InfoPanelX=-35.17603;InfoPanelY=-37.11768;InventoryScale=1;InventoryX=24;InventoryY=-19.76471;MeadHotbarScale=0.75;MeadHotbarX=240;MeadHotbarY=890;MeadScale=0.82;MeadX=-134;MeadY=-129;MiscScale=0.8;MiscX=151;MiscY=-779;RecycleScale=0.9;RecycleX=120;RecycleY=-220;SkillsScale=1;SkillsX=-32.88247;SkillsY=-11.1765;SpecialScale=0.75;SpecialX=256;SpecialY=-568;StatsScale=1;StatsX=-28.47052;StatsY=28.23533;TooltipScale=1;TooltipX=0;TooltipY=62;TrophiesScale=1;TrophiesX=-43.05888;TrophiesY=39.29412;UtilityScale=1;UtilityX=503;UtilityY=-456"); } private static string BuildPreset2Layout() { return BuildBuiltInPresetLayout("AchievementsScale=1;AchievementsX=-2.823547;AchievementsY=2.823471;AmmoHotbarScale=0.75;AmmoHotbarX=150;AmmoHotbarY=120;AmmoScale=0.75;AmmoX=-457;AmmoY=-536;AppearanceScale=0.9271429;AppearanceX=168;AppearanceY=-12.70587;CapeHotbarScale=0.75;CapeHotbarX=45;CapeHotbarY=120;CapeScale=0.82;CapeX=366;CapeY=-70;CoinScale=0.8;CoinX=-124;CoinY=-568;ContainerScale=0.7042017;ContainerX=-932.1702;ContainerY=-144.9385;CraftingWindowScale=1;CraftingWindowX=-36.70575;CraftingWindowY=-186.3531;EquipmentScale=1;EquipmentX=354;EquipmentY=-772;FoodHotbarScale=0.8;FoodHotbarX=240;FoodHotbarY=950;FoodScale=0.82;FoodX=269;FoodY=-130;InfoPanelScale=0.9941176;InfoPanelX=-35.17603;InfoPanelY=-37.11768;InventoryScale=1;InventoryX=24;InventoryY=-19.76471;MeadHotbarScale=0.75;MeadHotbarX=240;MeadHotbarY=890;MeadScale=0.82;MeadX=-130;MeadY=-209;MiscScale=0.8;MiscX=457;MiscY=-700;RecycleScale=0.9;RecycleX=120;RecycleY=-220;SkillsScale=1;SkillsX=-32.88247;SkillsY=-11.1765;SpecialScale=0.75;SpecialX=258;SpecialY=-646;StatsScale=1;StatsX=-28.47052;StatsY=28.23533;TooltipScale=1;TooltipX=-250;TooltipY=62;TrophiesScale=1;TrophiesX=-43.05888;TrophiesY=39.29412;UtilityScale=1;UtilityX=505;UtilityY=-539"); } private static string BuildPreset3Layout(string existing) { return BuildBuiltInPresetLayout("AchievementsScale=1;AchievementsX=-2.823547;AchievementsY=2.823471;AmmoHotbarScale=0.65;AmmoHotbarX=698;AmmoHotbarY=45;AmmoScale=0.65;AmmoX=-120;AmmoY=-698;AppearanceScale=1.079832;AppearanceX=-97.41195;AppearanceY=69.17667;CapeHotbarScale=0.65;CapeHotbarX=605;CapeHotbarY=45;CapeScale=0.7;CapeX=976;CapeY=-231;CoinScale=0.8;CoinX=46;CoinY=-626;ContainerScale=0.7042017;ContainerX=-932.1702;ContainerY=-144.9385;CraftingWindowScale=0.847479;CraftingWindowX=-26.8233;CraftingWindowY=-169.4119;EquipmentScale=0.75;EquipmentX=319;EquipmentY=-768;FoodHotbarScale=0.65;FoodHotbarX=1043;FoodHotbarY=45;FoodScale=0.7;FoodX=152;FoodY=-298;InfoPanelScale=0.6382353;InfoPanelX=-39.4112;InfoPanelY=-62.52948;InventoryScale=1;InventoryX=24;InventoryY=-19.76471;MeadHotbarScale=0.65;MeadHotbarX=828;MeadHotbarY=45;MeadScale=0.7;MeadX=-245;MeadY=-235;MiscScale=0.7;MiscX=350;MiscY=-774;RecycleScale=0.9;RecycleX=120;RecycleY=-220;SkillsScale=1;SkillsX=-32.88247;SkillsY=-11.1765;SpecialScale=0.7;SpecialX=400;SpecialY=-637;StatsScale=1;StatsX=-28.47052;StatsY=28.23533;TooltipScale=1;TooltipX=30;TooltipY=62;TrophiesScale=1;TrophiesX=-43.05888;TrophiesY=39.29412;UtilityScale=0.75;UtilityX=433;UtilityY=-536"); } private static string BuildBuiltInPresetLayout(string panelData) { Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.Ordinal); if (!string.IsNullOrEmpty(panelData)) { string[] array = panelData.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (string text in array) { int num = text.IndexOf('='); if (num > 0 && num < text.Length - 1) { dictionary[text.Substring(0, num)] = text.Substring(num + 1); } } } foreach (KeyValuePair<string, string[]> item in DefaultHipWeaponCoordinates()) { if (item.Value != null && item.Value.Length >= 7) { string text2 = "HIP_" + Uri.EscapeDataString(item.Key) + "_"; dictionary[text2 + "Scale"] = item.Value[0]; dictionary[text2 + "X"] = item.Value[1]; dictionary[text2 + "Y"] = item.Value[2]; dictionary[text2 + "Z"] = item.Value[3]; dictionary[text2 + "RX"] = item.Value[4]; dictionary[text2 + "RY"] = item.Value[5]; dictionary[text2 + "RZ"] = item.Value[6]; } } return string.Join(";", from k in dictionary.OrderBy<KeyValuePair<string, string>, string>((KeyValuePair<string, string> k) => k.Key, StringComparer.Ordinal) select k.Key + "=" + k.Value); } private static IEnumerable<KeyValuePair<string, string[]>> DefaultHipWeaponCoordinates() { return SakeysWaistAppearanceConfigPlugin.BuiltInHipWeaponCoordinates(); } private static string ApplyPresetOverrides(string data, Dictionary<string, float> overrides) { Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.Ordinal); if (!string.IsNullOrEmpty(data)) { string[] array = data.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { int num = array[i].IndexOf('='); if (num > 0 && num < array[i].Length - 1) { dictionary[array[i].Substring(0, num)] = array[i].Substring(num + 1); } } } foreach (KeyValuePair<string, float> @override in overrides) { dictionary[@override.Key] = @override.Value.ToString(CultureInfo.InvariantCulture); } return string.Join(";", from k in dictionary orderby k.Key select k.Key + "=" + k.Value); } private static string ApplyPresetDefaultsIfMissing(string data, Dictionary<string, float> defaults) { Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.Ordinal); if (!string.IsNullOrEmpty(data)) { string[] array = data.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (string text in array) { int num = text.IndexOf('='); if (num > 0 && num < text.Length - 1) { dictionary[text.Substring(0, num)] = text.Substring(num + 1); } } } foreach (KeyValuePair<string, float> @default in defaults) { if (!dictionary.ContainsKey(@default.Key)) { dictionary[@default.Key] = @default.Value.ToString(CultureInfo.InvariantCulture); } } return string.Join(";", from k in dictionary.OrderBy<KeyValuePair<string, string>, string>((KeyValuePair<string, string> k) => k.Key, StringComparer.Ordinal) select k.Key + "=" + k.Value); } private static string CaptureLayout() { List<string> list = new List<string>(); FieldInfo[] layoutFields = GetLayoutFields(); foreach (FieldInfo fieldInfo in layoutFields) { if (fieldInfo.GetValue(null) is ConfigEntry<float> val) { list.Add(fieldInfo.Name + "=" + val.Value.ToString(CultureInfo.InvariantCulture)); } } foreach (KeyValuePair<string, SakeysOtherUtilityVisuals.HipWeaponVisualConfig> item in SakeysOtherUtilityVisuals.HipWeaponConfigsForPreset()) { SakeysOtherUtilityVisuals.HipWeaponVisualConfig value = item.Value; if (value != null) { string text = "HIP_" + Uri.EscapeDataString(item.Key) + "_"; list.Add(text + "Scale=" + value.Scale.Value.ToString(CultureInfo.InvariantCulture)); list.Add(text + "X=" + value.OffsetX.Value.ToString(CultureInfo.InvariantCulture)); list.Add(text + "Y=" + value.OffsetY.Value.ToString(CultureInfo.InvariantCulture)); list.Add(text + "Z=" + value.OffsetZ.Value.ToString(CultureInfo.InvariantCulture)); list.Add(text + "RX=" + value.RotationX.Value.ToString(CultureInfo.InvariantCulture)); list.Add(text + "RY=" + value.RotationY.Value.ToString(CultureInfo.InvariantCulture)); list.Add(text + "RZ=" + value.RotationZ.Value.ToString(CultureInfo.InvariantCulture)); } } return string.Join(";", list); } private static bool RestoreLayout(string data) { if (string.IsNullOrEmpty(data)) { return false; } Dictionary<string, float> dictionary = new Dictionary<string, float>(StringComparer.Ordinal); string[] array = data.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { int num = array[i].IndexOf('='); if (num > 0 && num <